const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-CBf9aYgb.js","./index-Bd1MzT5k.js","./ListApiDocs-D97szj_n.js","./FieldsQueryParam-DQVKTiQb.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-wlifUl4N.js","./CreateApiDocs-JPvR8N_9.js","./UpdateApiDocs-DL1jPaKQ.js","./AuthMethodsDocs-kTmmvbiv.js","./AuthWithPasswordDocs-DDzkR56i.js","./AuthWithOAuth2Docs-DR-QIR8o.js","./AuthWithOtpDocs-Bf-89h5e.js","./AuthRefreshDocs-CN-JUWQG.js","./CodeEditor-CHQR53XK.js","./Leaflet-Dlp_i0kf.js","./Leaflet-DCQr6yJv.css"])))=>i.map(i=>d[i]); var By=Object.defineProperty;var Wy=(n,e,t)=>e in n?By(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>Wy(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function te(){}const lo=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function Yy(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Xb(n){return n()}function mf(){return Object.create(null)}function Ee(n){n.forEach(Xb)}function Lt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let wo;function Sn(n,e){return n===e?!0:(wo||(wo=document.createElement("a")),wo.href=e,n===wo.href)}function Ky(n){return Object.keys(n).length===0}function pu(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Qb(n){let e;return pu(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(pu(e,t))}function Nt(n,e,t,i){if(n){const s=xb(n,e,t,i);return n[0](s)}}function xb(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function Rt(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),mu=e0?n=>requestAnimationFrame(n):te;const Zl=new Set;function t0(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&mu(t0)}function wr(n){let e;return Zl.size===0&&mu(t0),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function y(n,e){n.appendChild(e)}function n0(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Jy(n){const e=b("style");return e.textContent="/* empty */",Zy(n0(n),e),e.sheet}function Zy(n,e){return y(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function it(n){return function(e){return e.preventDefault(),n.call(this,e)}}function en(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const Gy=["width","height"];function ii(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&Gy.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function Xy(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function mt(n){return n===""?null:+n}function Qy(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function me(n,e){n.value=e??""}function i0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function l0(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Ht(n,e){return new n(e)}const sr=new Map;let or=0;function xy(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function ev(n,e){const t={stylesheet:Jy(e),rules:{}};return sr.set(n,t),t}function Us(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ `;for(let _=0;_<=1;_+=a){const k=e+(t-e)*l(_);u+=_*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} }`,c=`__svelte_${xy(f)}_${r}`,d=n0(n),{stylesheet:m,rules:h}=sr.get(d)||ev(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,or+=1,c}function Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),or-=s,or||tv())}function tv(){mu(()=>{or||(sr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),sr.clear())})}function nv(n,e,t,i){if(!e)return te;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return te;const{delay:l=0,duration:o=300,easing:r=lo,start:a=vr()+l,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function g(){c&&(h=Us(n,0,1,o,l,r,c)),l||(m=!0)}function _(){c&&Vs(n,h),d=!1}return wr(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),g(),f(0,1),_}function iv(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,s0(n,s)}}function s0(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function qi(n){Bs=n}function so(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function an(n){so().$$.on_mount.push(n)}function lv(n){so().$$.after_update.push(n)}function oo(n){so().$$.on_destroy.push(n)}function wt(){const n=so();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=l0(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Le(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Kl=[],ne=[];let Gl=[];const La=[],o0=Promise.resolve();let Aa=!1;function r0(){Aa||(Aa=!0,o0.then(hu))}function _n(){return r0(),o0}function tt(n){Gl.push(n)}function $e(n){La.push(n)}const Wr=new Set;let zl=0;function hu(){if(zl!==0)return;const n=Bs;do{try{for(;zln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let bs;function _u(){return bs||(bs=Promise.resolve(),bs.then(()=>{bs=null})),bs}function Cl(n,e,t){n.dispatchEvent(l0(`${e?"intro":"outro"}${t}`))}const Zo=new Set;let Ti;function oe(){Ti={r:0,c:[],p:Ti}}function re(){Ti.r||Ee(Ti.c),Ti=Ti.p}function M(n,e){n&&n.i&&(Zo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Zo.has(n))return;Zo.add(n),Ti.c.push(()=>{Zo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const gu={duration:0};function a0(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=lo,tick:g=te,css:_}=s||gu;_&&(o=Us(n,0,1,m,d,h,_,a++)),g(0,1);const k=vr()+d,S=k+m;r&&r.abort(),l=!0,tt(()=>Cl(n,!0,"start")),r=wr($=>{if(l){if($>=S)return g(1,0),Cl(n,!0,"end"),u(),l=!1;if($>=k){const T=h(($-k)/m);g(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,Vs(n),Lt(s)?(s=s(i),_u().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function bu(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Ti;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=lo,tick:m=te,css:h}=s||gu;h&&(o=Us(n,1,0,c,f,d,h));const g=vr()+f,_=g+c;tt(()=>Cl(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),wr(k=>{if(l){if(k>=_)return m(0,1),Cl(n,!1,"end"),--r.r||Ee(r.c),!1;if(k>=g){const S=d((k-g)/c);m(1-S,S)}}return l})}return Lt(s)?_u().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&Vs(n,o),l=!1)}}}function qe(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Vs(n,u)}function d(h,g){const _=h.b-o;return g*=Math.abs(_),{a:o,b:h.b,d:_,duration:g,start:h.start,end:h.start+g,group:h.group}}function m(h){const{delay:g=0,duration:_=300,easing:k=lo,tick:S=te,css:$}=l||gu,T={start:vr()+g,b:h};h||(T.group=Ti,Ti.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=Us(n,o,h,_,g,k,$)),h&&S(0,1),r=d(T,_),tt(()=>Cl(n,h,"start")),wr(O=>{if(a&&O>a.start&&(r=d(a,_),a=null,Cl(n,r.b,"start"),$&&(c(),u=Us(n,o,r.b,r.duration,0,k,l.css))),r){if(O>=r.end)S(o=r.b,1-o),Cl(n,r.b,"end"),a||(r.b?c():--r.group.r||Ee(r.group.c)),r=null;else if(O>=r.start){const E=O-r.start;o=r.a+r.d*k(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Lt(l)?_u().then(()=>{l=l({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function _f(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(oe(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),re())}):e.block.d(1),u.c(),M(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&hu()}if(Yy(n)){const s=so();if(n.then(l=>{qi(s),i(e.then,1,e.value,l),qi(null)},l=>{if(qi(s),i(e.catch,2,e.error,l),qi(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function rv(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function ce(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function si(n,e){n.d(1),e.delete(n.key)}function Yt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function av(n,e){n.f(),Yt(n,e)}function kt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,m=l.length,h=d;const g={};for(;h--;)g[n[h].key]=h;const _=[],k=new Map,S=new Map,$=[];for(h=m;h--;){const L=c(s,l,h),I=t(L);let A=o.get(I);A?$.push(()=>A.p(L,e)):(A=u(I,L),A.c()),k.set(I,_[h]=A),I in g&&S.set(I,Math.abs(h-g[I]))}const T=new Set,O=new Set;function E(L){M(L,1),L.m(r,f),o.set(L.key,L),f=L.first,m--}for(;d&&m;){const L=_[m-1],I=n[d-1],A=L.key,P=I.key;L===I?(f=L.first,d--,m--):k.has(P)?!o.has(A)||T.has(A)?E(L):O.has(P)?d--:S.get(A)>S.get(P)?(O.add(A),E(L)):(T.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];k.has(L.key)||a(L,o)}for(;m;)E(_[m-1]);return Ee($),_}function vt(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function At(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function H(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),tt(()=>{const l=n.$$.on_mount.map(Xb).filter(Lt);n.$$.on_destroy?n.$$.on_destroy.push(...l):Ee(l),n.$$.on_mount=[]}),s.forEach(tt)}function j(n,e){const t=n.$$;t.fragment!==null&&(ov(t.after_update),Ee(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function uv(n,e){n.$$.dirty[0]===-1&&(Kl.push(n),r0(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&uv(n,c)),d}):[],u.update(),f=!0,Ee(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Qy(e.target);u.fragment&&u.fragment.l(c),c.forEach(v)}else u.fragment&&u.fragment.c();e.intro&&M(n.$$.fragment),q(n,e.target,e.anchor),hu()}qi(a)}class we{constructor(){pt(this,"$$");pt(this,"$$set")}$destroy(){j(this,1),this.$destroy=te}$on(e,t){if(!Lt(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!Ky(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const fv="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(fv);class Al extends Error{}class cv extends Al{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class dv extends Al{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class pv extends Al{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Al{}class u0 extends Al{constructor(e){super(`Invalid unit ${e}`)}}class bn extends Al{}class Yi extends Al{constructor(){super("Zone is an abstract class")}}const ze="numeric",mi="short",Wn="long",rr={year:ze,month:ze,day:ze},f0={year:ze,month:mi,day:ze},mv={year:ze,month:mi,day:ze,weekday:mi},c0={year:ze,month:Wn,day:ze},d0={year:ze,month:Wn,day:ze,weekday:Wn},p0={hour:ze,minute:ze},m0={hour:ze,minute:ze,second:ze},h0={hour:ze,minute:ze,second:ze,timeZoneName:mi},_0={hour:ze,minute:ze,second:ze,timeZoneName:Wn},g0={hour:ze,minute:ze,hourCycle:"h23"},b0={hour:ze,minute:ze,second:ze,hourCycle:"h23"},k0={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:mi},y0={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:Wn},v0={year:ze,month:ze,day:ze,hour:ze,minute:ze},w0={year:ze,month:ze,day:ze,hour:ze,minute:ze,second:ze},S0={year:ze,month:mi,day:ze,hour:ze,minute:ze},T0={year:ze,month:mi,day:ze,hour:ze,minute:ze,second:ze},hv={year:ze,month:mi,day:ze,weekday:mi,hour:ze,minute:ze},$0={year:ze,month:Wn,day:ze,hour:ze,minute:ze,timeZoneName:mi},C0={year:ze,month:Wn,day:ze,hour:ze,minute:ze,second:ze,timeZoneName:mi},O0={year:ze,month:Wn,day:ze,weekday:Wn,hour:ze,minute:ze,timeZoneName:Wn},M0={year:ze,month:Wn,day:ze,weekday:Wn,hour:ze,minute:ze,second:ze,timeZoneName:Wn};class ro{get type(){throw new Yi}get name(){throw new Yi}get ianaName(){return this.name}get isUniversal(){throw new Yi}offsetName(e,t){throw new Yi}formatOffset(e,t){throw new Yi}offset(e){throw new Yi}equals(e){throw new Yi}get isValid(){throw new Yi}}let Yr=null;class Sr extends ro{static get instance(){return Yr===null&&(Yr=new Sr),Yr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return j0(e,t,i)}formatOffset(e,t){return Is(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Pa=new Map;function _v(n){let e=Pa.get(n);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Pa.set(n,e)),e}const gv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function bv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function kv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let gf={};function yv(n,e={}){const t=JSON.stringify([n,e]);let i=gf[t];return i||(i=new Intl.ListFormat(n,e),gf[t]=i),i}const Na=new Map;function Ra(n,e={}){const t=JSON.stringify([n,e]);let i=Na.get(t);return i===void 0&&(i=new Intl.DateTimeFormat(n,e),Na.set(t,i)),i}const Fa=new Map;function vv(n,e={}){const t=JSON.stringify([n,e]);let i=Fa.get(t);return i===void 0&&(i=new Intl.NumberFormat(n,e),Fa.set(t,i)),i}const qa=new Map;function wv(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=qa.get(s);return l===void 0&&(l=new Intl.RelativeTimeFormat(n,e),qa.set(s,l)),l}let $s=null;function Sv(){return $s||($s=new Intl.DateTimeFormat().resolvedOptions().locale,$s)}const ja=new Map;function E0(n){let e=ja.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),ja.set(n,e)),e}const Ha=new Map;function Tv(n){let e=Ha.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...D0,...e}),Ha.set(n,e)}return e}function $v(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,s;try{i=Ra(n).resolvedOptions(),s=n}catch{const a=n.substring(0,t);i=Ra(a).resolvedOptions(),s=a}const{numberingSystem:l,calendar:o}=i;return[s,l,o]}}function Cv(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Ov(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function Mv(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function So(n,e,t,i){const s=n.listingMode();return s==="error"?null:s==="en"?t(e):i(e)}function Ev(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||E0(n.locale).numberingSystem==="latn"}class Dv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=vv(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Su(e,3);return ln(t,this.padTo)}}}class Iv{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ji.create(r).valid?(s=r,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const l={...this.opts};l.timeZone=l.timeZone||s,this.dtf=Ra(t,l)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Lv{constructor(e,t,i){this.opts={style:"long",...i},!t&&F0()&&(this.rtf=wv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):e2(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const D0={firstDay:1,minimalDays:4,weekend:[6,7]};class Dt{static fromOpts(e){return Dt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,s,l=!1){const o=e||xt.defaultLocale,r=o||(l?"en-US":Sv()),a=t||xt.defaultNumberingSystem,u=i||xt.defaultOutputCalendar,f=Ua(s)||xt.defaultWeekSettings;return new Dt(r,a,u,f,o)}static resetCache(){$s=null,Na.clear(),Fa.clear(),qa.clear(),ja.clear(),Ha.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:s}={}){return Dt.create(e,t,i,s)}constructor(e,t,i,s,l){const[o,r,a]=$v(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=s,this.intl=Cv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=l,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ev(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Dt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Ua(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return So(this,e,U0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=Ov(l=>this.extract(l,i,"month"))),this.monthsCache[s][e]})}weekdays(e,t=!1){return So(this,e,W0,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=Mv(l=>this.extract(l,i,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return So(this,void 0,()=>Y0,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return So(this,e,K0,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Xe.utc(-40,1,1),Xe.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Dv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Iv(e,this.intl,t)}relFormatter(e={}){return new Lv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return yv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||E0(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:q0()?Tv(this.locale):D0}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Jr=null;class Mn extends ro{static get utcInstance(){return Jr===null&&(Jr=new Mn(0)),Jr}static instance(e){return e===0?Mn.utcInstance:new Mn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Mn(Cr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Is(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Is(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Is(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Av extends ro{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Xi(n,e){if(st(n)||n===null)return e;if(n instanceof ro)return n;if(jv(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Sr.instance:t==="utc"||t==="gmt"?Mn.utcInstance:Mn.parseSpecifier(t)||ji.create(n)}else return tl(n)?Mn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Av(n)}const ku={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},bf={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Pv=ku.hanidec.replace(/[\[|\]]/g,"").split("");function Nv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}const za=new Map;function Rv(){za.clear()}function ui({numberingSystem:n},e=""){const t=n||"latn";let i=za.get(t);i===void 0&&(i=new Map,za.set(t,i));let s=i.get(e);return s===void 0&&(s=new RegExp(`${ku[t]}${e}`),i.set(e,s)),s}let kf=()=>Date.now(),yf="system",vf=null,wf=null,Sf=null,Tf=60,$f,Cf=null;class xt{static get now(){return kf}static set now(e){kf=e}static set defaultZone(e){yf=e}static get defaultZone(){return Xi(yf,Sr.instance)}static get defaultLocale(){return vf}static set defaultLocale(e){vf=e}static get defaultNumberingSystem(){return wf}static set defaultNumberingSystem(e){wf=e}static get defaultOutputCalendar(){return Sf}static set defaultOutputCalendar(e){Sf=e}static get defaultWeekSettings(){return Cf}static set defaultWeekSettings(e){Cf=Ua(e)}static get twoDigitCutoffYear(){return Tf}static set twoDigitCutoffYear(e){Tf=e%100}static get throwOnInvalid(){return $f}static set throwOnInvalid(e){$f=e}static resetCaches(){Dt.resetCache(),ji.resetCache(),Xe.resetCache(),Rv()}}class ci{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const I0=[0,31,59,90,120,151,181,212,243,273,304,334],L0=[0,31,60,91,121,152,182,213,244,274,305,335];function ti(n,e){return new ci("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function yu(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function A0(n,e,t){return t+(ao(n)?L0:I0)[e-1]}function P0(n,e){const t=ao(n)?L0:I0,i=t.findIndex(l=>lWs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Or(n)}}function Of(n,e=4,t=1){const{weekYear:i,weekNumber:s,weekday:l}=n,o=vu(yu(i,1,e),t),r=Xl(i);let a=s*7+l-o-7+e,u;a<1?(u=i-1,a+=Xl(u)):a>r?(u=i+1,a-=Xl(i)):u=i;const{month:f,day:c}=P0(u,a);return{year:u,month:f,day:c,...Or(n)}}function Zr(n){const{year:e,month:t,day:i}=n,s=A0(e,t,i);return{year:e,ordinal:s,...Or(n)}}function Mf(n){const{year:e,ordinal:t}=n,{month:i,day:s}=P0(e,t);return{year:e,month:i,day:s,...Or(n)}}function Ef(n,e){if(!st(n.localWeekday)||!st(n.localWeekNumber)||!st(n.localWeekYear)){if(!st(n.weekday)||!st(n.weekNumber)||!st(n.weekYear))throw new Jl("Cannot mix locale-based week fields with ISO-based week fields");return st(n.localWeekday)||(n.weekday=n.localWeekday),st(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),st(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Fv(n,e=4,t=1){const i=Tr(n.weekYear),s=ni(n.weekNumber,1,Ws(n.weekYear,e,t)),l=ni(n.weekday,1,7);return i?s?l?!1:ti("weekday",n.weekday):ti("week",n.weekNumber):ti("weekYear",n.weekYear)}function qv(n){const e=Tr(n.year),t=ni(n.ordinal,1,Xl(n.year));return e?t?!1:ti("ordinal",n.ordinal):ti("year",n.year)}function N0(n){const e=Tr(n.year),t=ni(n.month,1,12),i=ni(n.day,1,ur(n.year,n.month));return e?t?i?!1:ti("day",n.day):ti("month",n.month):ti("year",n.year)}function R0(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ni(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ni(t,0,59),r=ni(i,0,59),a=ni(s,0,999);return l?o?r?a?!1:ti("millisecond",s):ti("second",i):ti("minute",t):ti("hour",e)}function st(n){return typeof n>"u"}function tl(n){return typeof n=="number"}function Tr(n){return typeof n=="number"&&n%1===0}function jv(n){return typeof n=="string"}function Hv(n){return Object.prototype.toString.call(n)==="[object Date]"}function F0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function q0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function zv(n){return Array.isArray(n)?n:[n]}function Df(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function Uv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ns(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ua(n){if(n==null)return null;if(typeof n!="object")throw new bn("Week settings must be an object");if(!ni(n.firstDay,1,7)||!ni(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!ni(e,1,7)))throw new bn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function ni(n,e,t){return Tr(n)&&n>=e&&n<=t}function Vv(n,e){return n-e*Math.floor(n/e)}function ln(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Zi(n){if(!(st(n)||n===null||n===""))return parseInt(n,10)}function ml(n){if(!(st(n)||n===null||n===""))return parseFloat(n)}function wu(n){if(!(st(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Su(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ao(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return ao(n)?366:365}function ur(n,e){const t=Vv(e-1,12)+1,i=n+(e-t)/12;return t===2?ao(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function $r(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function If(n,e,t){return-vu(yu(n,1,e),t)+e-1}function Ws(n,e=4,t=1){const i=If(n,e,t),s=If(n+1,e,t);return(Xl(n)-i+s)/7}function Va(n){return n>99?n:n>xt.twoDigitCutoffYear?1900+n:2e3+n}function j0(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Cr(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function H0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new bn(`Invalid unit value ${n}`);return e}function fr(n,e){const t={};for(const i in n)if(ns(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=H0(s)}return t}function Is(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${ln(t,2)}:${ln(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${ln(t,2)}${ln(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Or(n){return Uv(n,["hour","minute","second","millisecond"])}const Bv=["January","February","March","April","May","June","July","August","September","October","November","December"],z0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wv=["J","F","M","A","M","J","J","A","S","O","N","D"];function U0(n){switch(n){case"narrow":return[...Wv];case"short":return[...z0];case"long":return[...Bv];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const V0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],B0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Yv=["M","T","W","T","F","S","S"];function W0(n){switch(n){case"narrow":return[...Yv];case"short":return[...B0];case"long":return[...V0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Y0=["AM","PM"],Kv=["Before Christ","Anno Domini"],Jv=["BC","AD"],Zv=["B","A"];function K0(n){switch(n){case"narrow":return[...Zv];case"short":return[...Jv];case"long":return[...Kv];default:return null}}function Gv(n){return Y0[n.hour<12?0:1]}function Xv(n,e){return W0(e)[n.weekday-1]}function Qv(n,e){return U0(e)[n.month-1]}function xv(n,e){return K0(e)[n.year<0?0:1]}function e2(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Lf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const t2={D:rr,DD:f0,DDD:c0,DDDD:d0,t:p0,tt:m0,ttt:h0,tttt:_0,T:g0,TT:b0,TTT:k0,TTTT:y0,f:v0,ff:S0,fff:$0,ffff:O0,F:w0,FF:T0,FFF:C0,FFFF:M0};class yn{static create(e,t={}){return new yn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s||/^\s+$/.test(i),val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s||/^\s+$/.test(i),val:i}),l}static macroTokenToFormatOpts(e){return t2[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return ln(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Gv(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Qv(e,m):l(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Xv(e,m):l(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=yn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?xv(e,m):l({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return Lf(yn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=yn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Lf(l,s(r))}}const J0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function as(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function us(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function Z0(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(h||m&&f)?-m:m;return[{years:d(ml(t)),months:d(ml(i)),weeks:d(ml(s)),days:d(ml(l)),hours:d(ml(o)),minutes:d(ml(r)),seconds:d(ml(a),a==="-0"),milliseconds:d(wu(u),c)}]}const m2={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Cu(n,e,t,i,s,l,o){const r={year:e.length===2?Va(Zi(e)):Zi(e),month:z0.indexOf(t)+1,day:Zi(i),hour:Zi(s),minute:Zi(l)};return o&&(r.second=Zi(o)),n&&(r.weekday=n.length>3?V0.indexOf(n)+1:B0.indexOf(n)+1),r}const h2=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function _2(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Cu(e,s,i,t,l,o,r);let m;return a?m=m2[a]:u?m=0:m=Cr(f,c),[d,new Mn(m)]}function g2(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const b2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,k2=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,y2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Af(n){const[,e,t,i,s,l,o,r]=n;return[Cu(e,s,i,t,l,o,r),Mn.utcInstance]}function v2(n){const[,e,t,i,s,l,o,r]=n;return[Cu(e,r,t,i,s,l,o),Mn.utcInstance]}const w2=as(i2,$u),S2=as(l2,$u),T2=as(s2,$u),$2=as(X0),x0=us(f2,cs,uo,fo),C2=us(o2,cs,uo,fo),O2=us(r2,cs,uo,fo),M2=us(cs,uo,fo);function E2(n){return fs(n,[w2,x0],[S2,C2],[T2,O2],[$2,M2])}function D2(n){return fs(g2(n),[h2,_2])}function I2(n){return fs(n,[b2,Af],[k2,Af],[y2,v2])}function L2(n){return fs(n,[d2,p2])}const A2=us(cs);function P2(n){return fs(n,[c2,A2])}const N2=as(a2,u2),R2=as(Q0),F2=us(cs,uo,fo);function q2(n){return fs(n,[N2,x0],[R2,F2])}const Pf="Invalid Duration",ek={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},j2={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...ek},Xn=146097/400,Ul=146097/4800,H2={years:{quarters:4,months:12,weeks:Xn/7,days:Xn,hours:Xn*24,minutes:Xn*24*60,seconds:Xn*24*60*60,milliseconds:Xn*24*60*60*1e3},quarters:{months:3,weeks:Xn/28,days:Xn/4,hours:Xn*24/4,minutes:Xn*24*60/4,seconds:Xn*24*60*60/4,milliseconds:Xn*24*60*60*1e3/4},months:{weeks:Ul/7,days:Ul,hours:Ul*24,minutes:Ul*24*60,seconds:Ul*24*60*60,milliseconds:Ul*24*60*60*1e3},...ek},Sl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],z2=Sl.slice(0).reverse();function Ki(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new Tt(i)}function tk(n,e){let t=e.milliseconds??0;for(const i of z2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Nf(n,e){const t=tk(n,e)<0?-1:1;Sl.reduceRight((i,s)=>{if(st(e[s]))return i;if(i){const l=e[i]*t,o=n[s][i],r=Math.floor(l/o);e[s]+=r*t,e[i]-=r*o*t}return s},null),Sl.reduce((i,s)=>{if(st(e[s]))return i;if(i){const l=e[i]%1;e[i]-=l,e[s]+=l*n[i][s]}return s},null)}function U2(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class Tt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?H2:j2;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Dt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return Tt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new bn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Tt({values:fr(e,Tt.normalizeUnit),loc:Dt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(tl(e))return Tt.fromMillis(e);if(Tt.isDuration(e))return e;if(typeof e=="object")return Tt.fromObject(e);throw new bn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=L2(e);return i?Tt.fromObject(i,t):Tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=P2(e);return i?Tt.fromObject(i,t):Tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new bn("need to specify a reason the Duration is invalid");const i=e instanceof ci?e:new ci(e,t);if(xt.throwOnInvalid)throw new pv(i);return new Tt({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new u0(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?yn.create(this.loc,i).formatDurationFromString(this,e):Pf}toHuman(e={}){if(!this.isValid)return Pf;const t=Sl.map(i=>{const s=this.values[i];return st(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Su(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Xe.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?tk(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e),i={};for(const s of Sl)(ns(t.values,s)||ns(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Ki(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=H0(e(this.values[i],i));return Ki(this,{values:t},!0)}get(e){return this[Tt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...fr(e,Tt.normalizeUnit)};return Ki(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:s}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:i};return Ki(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Nf(this.matrix,e),Ki(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=U2(this.normalize().shiftToAll().toObject());return Ki(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>Tt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Sl)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;tl(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else tl(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Nf(this.matrix,t),Ki(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Ki(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Sl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Vl="Invalid Interval";function V2(n,e){return!n||!n.isValid?Qt.invalid("missing or invalid start"):!e||!e.isValid?Qt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Qt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ks).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Qt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=Tt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Qt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Qt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Qt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Qt.fromDateTimes(t,a.time)),t=null);return Qt.merge(s)}difference(...e){return Qt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Vl}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=rr,t={}){return this.isValid?yn.create(this.s.loc.clone(t),e).formatInterval(this):Vl}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Vl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vl}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Vl}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Vl}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Tt.invalid(this.invalidReason)}mapEndpoints(e){return Qt.fromDateTimes(e(this.s),e(this.e))}}class To{static hasDST(e=xt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ji.isValidZone(e)}static normalizeZone(e){return Xi(e,xt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Dt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Dt.create(t,null,"gregory").eras(e)}static features(){return{relative:F0(),localeWeek:q0()}}}function Rf(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(Tt.fromMillis(i).as("days"))}function B2(n,e,t){const i=[["years",(a,u)=>u.year-a.year],["quarters",(a,u)=>u.quarter-a.quarter+(u.year-a.year)*4],["months",(a,u)=>u.month-a.month+(u.year-a.year)*12],["weeks",(a,u)=>{const f=Rf(a,u);return(f-f%7)/7}],["days",Rf]],s={},l=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,s[a]=u(n,e),r=l.plus(s),r>e?(s[a]--,n=l.plus(s),n>e&&(r=n,s[a]--,n=l.plus(s))):n=r);return[n,s,r,o]}function W2(n,e,t,i){let[s,l,o,r]=B2(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?Tt.fromMillis(a,i).shiftTo(...u).plus(f):f}const Y2="missing Intl.DateTimeFormat.formatToParts support";function Ot(n,e=t=>t){return{regex:n,deser:([t])=>e(Nv(t))}}const K2=" ",nk=`[ ${K2}]`,ik=new RegExp(nk,"g");function J2(n){return n.replace(/\./g,"\\.?").replace(ik,nk)}function Ff(n){return n.replace(/\./g,"").replace(ik," ").toLowerCase()}function fi(n,e){return n===null?null:{regex:RegExp(n.map(J2).join("|")),deser:([t])=>n.findIndex(i=>Ff(t)===Ff(i))+e}}function qf(n,e){return{regex:n,deser:([,t,i])=>Cr(t,i),groups:e}}function $o(n){return{regex:n,deser:([e])=>e}}function Z2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function G2(n,e){const t=ui(e),i=ui(e,"{2}"),s=ui(e,"{3}"),l=ui(e,"{4}"),o=ui(e,"{6}"),r=ui(e,"{1,2}"),a=ui(e,"{1,3}"),u=ui(e,"{1,6}"),f=ui(e,"{1,9}"),c=ui(e,"{2,4}"),d=ui(e,"{4,6}"),m=_=>({regex:RegExp(Z2(_.val)),deser:([k])=>k,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return fi(e.eras("short"),0);case"GG":return fi(e.eras("long"),0);case"y":return Ot(u);case"yy":return Ot(c,Va);case"yyyy":return Ot(l);case"yyyyy":return Ot(d);case"yyyyyy":return Ot(o);case"M":return Ot(r);case"MM":return Ot(i);case"MMM":return fi(e.months("short",!0),1);case"MMMM":return fi(e.months("long",!0),1);case"L":return Ot(r);case"LL":return Ot(i);case"LLL":return fi(e.months("short",!1),1);case"LLLL":return fi(e.months("long",!1),1);case"d":return Ot(r);case"dd":return Ot(i);case"o":return Ot(a);case"ooo":return Ot(s);case"HH":return Ot(i);case"H":return Ot(r);case"hh":return Ot(i);case"h":return Ot(r);case"mm":return Ot(i);case"m":return Ot(r);case"q":return Ot(r);case"qq":return Ot(i);case"s":return Ot(r);case"ss":return Ot(i);case"S":return Ot(a);case"SSS":return Ot(s);case"u":return $o(f);case"uu":return $o(r);case"uuu":return Ot(t);case"a":return fi(e.meridiems(),0);case"kkkk":return Ot(l);case"kk":return Ot(c,Va);case"W":return Ot(r);case"WW":return Ot(i);case"E":case"c":return Ot(t);case"EEE":return fi(e.weekdays("short",!1),1);case"EEEE":return fi(e.weekdays("long",!1),1);case"ccc":return fi(e.weekdays("short",!0),1);case"cccc":return fi(e.weekdays("long",!0),1);case"Z":case"ZZ":return qf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return qf(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return $o(/[a-z_+-/]{1,256}?/i);case" ":return $o(/[^\S\n\r]/);default:return m(_)}})(n)||{invalidReason:Y2};return g.token=n,g}const X2={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Q2(n,e,t){const{type:i,value:s}=n;if(i==="literal"){const a=/^\s+$/.test(s);return{literal:!a,val:a?" ":s}}const l=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=X2[o];if(typeof r=="object"&&(r=r[l]),r)return{literal:!1,val:r}}function x2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function ew(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(ns(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function tw(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return st(n.z)||(t=ji.create(n.z)),st(n.Z)||(t||(t=new Mn(n.Z)),i=n.Z),st(n.q)||(n.M=(n.q-1)*3+1),st(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),st(n.u)||(n.S=wu(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let Gr=null;function nw(){return Gr||(Gr=Xe.fromMillis(1555555555555)),Gr}function iw(n,e){if(n.literal)return n;const t=yn.macroTokenToFormatOpts(n.val),i=rk(t,e);return i==null||i.includes(void 0)?n:i}function lk(n,e){return Array.prototype.concat(...n.map(t=>iw(t,e)))}class sk{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=lk(yn.parseFormat(t),e),this.units=this.tokens.map(i=>G2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,s]=x2(this.units);this.regex=RegExp(i,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[t,i]=ew(e,this.regex,this.handlers),[s,l,o]=i?tw(i):[null,null,void 0];if(ns(i,"a")&&ns(i,"H"))throw new Jl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:s,zone:l,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function ok(n,e,t){return new sk(n,t).explainFromTokens(e)}function lw(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=ok(n,e,t);return[i,s,l,o]}function rk(n,e){if(!n)return null;const i=yn.create(e,n).dtFormatter(nw()),s=i.formatToParts(),l=i.resolvedOptions();return s.map(o=>Q2(o,n,l))}const Xr="Invalid DateTime",sw=864e13;function Cs(n){return new ci("unsupported zone",`the zone "${n.name}" is not supported`)}function Qr(n){return n.weekData===null&&(n.weekData=ar(n.c)),n.weekData}function xr(n){return n.localWeekData===null&&(n.localWeekData=ar(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function hl(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function ak(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Co(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Go(n,e,t){return ak($r(n),e,t)}function jf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,ur(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=Tt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=$r(l);let[a,u]=ak(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Bl(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,u=Xe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Xe.invalid(new ci("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Oo(n,e,t=!0){return n.isValid?yn.create(Dt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ea(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=ln(n.c.year,t?6:4),e?(i+="-",i+=ln(n.c.month),i+="-",i+=ln(n.c.day)):(i+=ln(n.c.month),i+=ln(n.c.day)),i}function Hf(n,e,t,i,s,l){let o=ln(n.c.hour);return e?(o+=":",o+=ln(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=":")):o+=ln(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(o+=ln(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=ln(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=ln(Math.trunc(-n.o/60)),o+=":",o+=ln(Math.trunc(-n.o%60))):(o+="+",o+=ln(Math.trunc(n.o/60)),o+=":",o+=ln(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const uk={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ow={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},rw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},fk=["year","month","day","hour","minute","second","millisecond"],aw=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],uw=["year","ordinal","hour","minute","second","millisecond"];function fw(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new u0(n);return e}function zf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return fw(n)}}function cw(n){if(Os===void 0&&(Os=xt.now()),n.type!=="iana")return n.offset(Os);const e=n.name;let t=Ba.get(e);return t===void 0&&(t=n.offset(Os),Ba.set(e,t)),t}function Uf(n,e){const t=Xi(e.zone,xt.defaultZone);if(!t.isValid)return Xe.invalid(Cs(t));const i=Dt.fromObject(e);let s,l;if(st(n.year))s=xt.now();else{for(const a of fk)st(n[a])&&(n[a]=uk[a]);const o=N0(n)||R0(n);if(o)return Xe.invalid(o);const r=cw(t);[s,l]=Go(n,r,t)}return new Xe({ts:s,zone:t,loc:i,o:l})}function Vf(n,e,t){const i=st(t.round)?!0:t.round,s=(o,r)=>(o=Su(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Bf(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let Os;const Ba=new Map;class Xe{constructor(e){const t=e.zone||xt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ci("invalid input"):null)||(t.isValid?null:Cs(t));this.ts=st(e.ts)?xt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=tl(e.o)&&!e.old?e.o:t.offset(this.ts);s=Co(this.ts,r),i=Number.isNaN(s.year)?new ci("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Dt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Bf(arguments),[i,s,l,o,r,a,u]=t;return Uf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Bf(arguments),[i,s,l,o,r,a,u]=t;return e.zone=Mn.utcInstance,Uf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Hv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const s=Xi(t.zone,xt.defaultZone);return s.isValid?new Xe({ts:i,zone:s,loc:Dt.fromObject(t)}):Xe.invalid(Cs(s))}static fromMillis(e,t={}){if(tl(e))return e<-864e13||e>sw?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Xi(t.zone,xt.defaultZone),loc:Dt.fromObject(t)});throw new bn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(tl(e))return new Xe({ts:e*1e3,zone:Xi(t.zone,xt.defaultZone),loc:Dt.fromObject(t)});throw new bn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Xi(t.zone,xt.defaultZone);if(!i.isValid)return Xe.invalid(Cs(i));const s=Dt.fromObject(t),l=fr(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Ef(l,s),a=xt.now(),u=st(t.specificOffset)?i.offset(a):t.specificOffset,f=!st(l.ordinal),c=!st(l.year),d=!st(l.month)||!st(l.day),m=c||d,h=l.weekYear||l.weekNumber;if((m||f)&&h)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new Jl("Can't mix ordinal dates with month/day");const g=h||l.weekday&&!m;let _,k,S=Co(a,u);g?(_=aw,k=ow,S=ar(S,o,r)):f?(_=uw,k=rw,S=Zr(S)):(_=fk,k=uk);let $=!1;for(const P of _){const N=l[P];st(N)?$?l[P]=k[P]:l[P]=S[P]:$=!0}const T=g?Fv(l,o,r):f?qv(l):N0(l),O=T||R0(l);if(O)return Xe.invalid(O);const E=g?Of(l,o,r):f?Mf(l):l,[L,I]=Go(E,u,i),A=new Xe({ts:L,zone:i,o:I,loc:s});return l.weekday&&m&&e.weekday!==A.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${l.weekday} and a date of ${A.toISO()}`):A.isValid?A:Xe.invalid(A.invalid)}static fromISO(e,t={}){const[i,s]=E2(e);return Bl(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=D2(e);return Bl(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=I2(e);return Bl(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(st(e)||st(t))throw new bn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=lw(o,e,t);return f?Xe.invalid(f):Bl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=q2(e);return Bl(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new bn("need to specify a reason the DateTime is invalid");const i=e instanceof ci?e:new ci(e,t);if(xt.throwOnInvalid)throw new cv(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=rk(e,Dt.fromObject(t));return i?i.map(s=>s?s.val:null).join(""):null}static expandFormat(e,t={}){return lk(yn.parseFormat(e),Dt.fromObject(t)).map(s=>s.val).join("")}static resetCache(){Os=void 0,Ba.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Qr(this).weekYear:NaN}get weekNumber(){return this.isValid?Qr(this).weekNumber:NaN}get weekday(){return this.isValid?Qr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?xr(this).weekday:NaN}get localWeekNumber(){return this.isValid?xr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?xr(this).weekYear:NaN}get ordinal(){return this.isValid?Zr(this.c).ordinal:NaN}get monthShort(){return this.isValid?To.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?To.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?To.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?To.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=$r(this.c),s=this.zone.offset(i-e),l=this.zone.offset(i+e),o=this.zone.offset(i-s*t),r=this.zone.offset(i-l*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Co(a,o),c=Co(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[hl(this,{ts:a}),hl(this,{ts:u})]:[this]}get isInLeapYear(){return ao(this.year)}get daysInMonth(){return ur(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ws(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ws(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=yn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(Mn.instance(e),t)}toLocal(){return this.setZone(xt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Xi(e,xt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=Go(o,l,e)}return hl(this,{ts:s,zone:e})}else return Xe.invalid(Cs(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return hl(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=fr(e,zf),{minDaysInFirstWeek:i,startOfWeek:s}=Ef(t,this.loc),l=!st(t.weekYear)||!st(t.weekNumber)||!st(t.weekday),o=!st(t.ordinal),r=!st(t.year),a=!st(t.month)||!st(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new Jl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new Jl("Can't mix ordinal dates with month/day");let c;l?c=Of({...ar(this.c,i,s),...t},i,s):st(t.ordinal)?(c={...this.toObject(),...t},st(t.day)&&(c.day=Math.min(ur(c.year,c.month),c.day))):c=Mf({...Zr(this.c),...t});const[d,m]=Go(c,this.o,this.zone);return hl(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e);return hl(this,jf(this,t))}minus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e).negate();return hl(this,jf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},s=Tt.normalizeUnit(e);switch(s){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(s==="weeks")if(t){const l=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),r=o?this:e,a=o?e:this,u=W2(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Qt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const s=e.valueOf(),l=this.setZone(e.zone,{keepLocalTime:!0});return l.startOf(t,i)<=s&&s<=l.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new bn("max requires all arguments be DateTimes");return Df(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return ok(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:s=null}=t,l=Dt.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});return new sk(l,e)}static fromFormatParser(e,t,i={}){if(st(e)||st(t))throw new bn("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});if(!o.equals(t.locale))throw new bn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?Xe.invalid(f):Bl(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return rr}static get DATE_MED(){return f0}static get DATE_MED_WITH_WEEKDAY(){return mv}static get DATE_FULL(){return c0}static get DATE_HUGE(){return d0}static get TIME_SIMPLE(){return p0}static get TIME_WITH_SECONDS(){return m0}static get TIME_WITH_SHORT_OFFSET(){return h0}static get TIME_WITH_LONG_OFFSET(){return _0}static get TIME_24_SIMPLE(){return g0}static get TIME_24_WITH_SECONDS(){return b0}static get TIME_24_WITH_SHORT_OFFSET(){return k0}static get TIME_24_WITH_LONG_OFFSET(){return y0}static get DATETIME_SHORT(){return v0}static get DATETIME_SHORT_WITH_SECONDS(){return w0}static get DATETIME_MED(){return S0}static get DATETIME_MED_WITH_SECONDS(){return T0}static get DATETIME_MED_WITH_WEEKDAY(){return hv}static get DATETIME_FULL(){return $0}static get DATETIME_FULL_WITH_SECONDS(){return C0}static get DATETIME_HUGE(){return O0}static get DATETIME_HUGE_WITH_SECONDS(){return M0}}function ks(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&tl(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new bn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const dw=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],pw=[".mp4",".avi",".mov",".3gp",".wmv"],mw=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],hw=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],_w=["relation","file","select"],gw=["text","email","url","editor"],ck=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class U{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||U.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return U.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!U.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!U.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){U.inArray(e,t)||e.push(t)}static mergeUnique(e,t){for(let i of t)U.pushUnique(e,i);return e}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=U.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!U.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!U.isObject(l)&&!Array.isArray(l)||!U.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!U.isObject(s)&&!Array.isArray(s)||!U.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):U.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||U.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||U.isObject(e)&&Object.keys(e).length>0)&&U.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return U.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),U.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],s=t.length>1?t.trim():t;for(let l of e)l=typeof l=="string"?l.trim():"",U.isEmpty(l)||i.push(l.replaceAll(s,"\\"+s));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Xe.fromFormat(e,i,{zone:"UTC"})}return typeof e=="number"?Xe.fromMillis(e):Xe.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return U.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return U.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(typeof e=="object")try{e=JSON.stringify(e,null,2)}catch{}if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),s=window.URL.createObjectURL(i);U.download(s,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!dw.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!pw.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!mw.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!hw.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return U.hasImageExtension(e)?"image":U.hasDocumentExtension(e)?"document":U.hasVideoExtension(e)?"video":U.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(U.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)U.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):U.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){return Object.assign({collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name},U.dummyCollectionSchemaData(e))}static dummyCollectionSchemaData(e,t=!1){var l;const i=(e==null?void 0:e.fields)||[],s={};for(const o of i){if(o.hidden||t&&o.primaryKey&&o.autogeneratePattern||t&&o.type==="autodate")continue;let r=null;if(o.type==="number")r=123;else if(o.type==="date"||o.type==="autodate")r="2022-01-01 10:00:00.123Z";else if(o.type=="bool")r=!0;else if(o.type=="email")r="test@example.com";else if(o.type=="url")r="https://example.com";else if(o.type=="json")r="JSON";else if(o.type=="file"){if(t)continue;r="filename.jpg",o.maxSelect!=1&&(r=[r])}else o.type=="select"?(r=(l=o==null?void 0:o.values)==null?void 0:l[0],(o==null?void 0:o.maxSelect)!=1&&(r=[r])):o.type=="relation"?(r="RELATION_RECORD_ID",(o==null?void 0:o.maxSelect)!=1&&(r=[r])):o.type=="geoPoint"?r={lon:0,lat:0}:r="test";s[o.name]=r}return s}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"password":return"ri-lock-password-line";case"autodate":return"ri-calendar-check-line";case"geoPoint":return"ri-map-pin-2-line";default:return"ri-star-s-line"}}static getFieldValueType(e){switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"geoPoint":return"Object";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="geoPoint"?'{"lon":0,"lat":0}':(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&(e==null?void 0:e.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="fields"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.fields)?e.fields:[],l=Array.isArray(t.fields)?t.fields:[],o=s.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=U.isObject(u)&&U.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.nameo.id==e.collectionId);if(!l)return s;for(const o of l.fields){if(!o.presentable||o.type!="relation"||i<=0)continue;const r=U.getExpandPresentableRelFields(o,t,i-1);for(const a of r)s.push(e.name+"."+a)}return s.length||s.push(e.name),s}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],h=d.create(c,u,m);d.add(h),s(h.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"ltr"),s.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),s.execCommand("mceDirectionRTL")}}])}}),s.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{s.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{s.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=U.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){let r=U.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(U.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?U.plainText(e):e,U.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return U.truncate(e.join(","),i);if(typeof e=="object")try{return U.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of U.extractColumnsFromQuery(e.viewQuery))U.pushUnique(i,t+l);const s=e.fields||[];for(const l of s)l.type=="geoPoint"?(U.pushUnique(i,t+l.name+".lon"),U.pushUnique(i,t+l.name+".lat")):U.pushUnique(i,t+l.name);return i}static getCollectionAutocompleteKeys(e,t,i="",s=0){let l=e.find(r=>r.name==t||r.id==t);if(!l||s>=4)return[];l.fields=l.fields||[];let o=U.getAllCollectionIdentifiers(l,i);for(const r of l.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=U.getCollectionAutocompleteKeys(e,r.collectionId,a+".",s+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&_w.includes(r.type)?(o.push(a+":each"),o.push(a+":length")):gw.includes(r.type)&&o.push(a+":lower")}for(const r of e){r.fields=r.fields||[];for(const a of r.fields)if(a.type=="relation"&&a.collectionId==l.id){const u=i+r.name+"_via_"+a.name,f=U.getCollectionAutocompleteKeys(e,r.id,u+".",s+2);f.length&&(o=o.concat(f))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];let i,s;for(const l of e)if(!l.system){i="@collection."+l.name+".",s=U.getCollectionAutocompleteKeys(e,l.name,i);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.body."),i.push("@request.headers."),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName");const s=e.filter(l=>l.type==="auth");for(const l of s){if(l.system)continue;const o=U.getCollectionAutocompleteKeys(e,l.id,"@request.auth.");for(const r of o)U.pushUnique(i,r)}if(t){const l=U.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const o of l){i.push(o);const r=o.split(".");r.length===3&&r[2].indexOf(":")===-1&&i.push(o+":isset")}}return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!U.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const _=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");_&&t.columns.push({name:_,collate:g[2]||"",sort:((d=g[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+U.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`, `),i.length>1&&(t+=` `),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=U.parseIndex(e);return i.tableName=t,U.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=U.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?U.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return U.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,hidden:!1,required:!1},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const s=i.indexOf("?");s>-1&&(t=i.substring(s+1),i=i.substring(0,s));const l=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?l.delete(a):l.set(a,u)}t=l.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}let Wa,_l;const Ya="app-tooltip";function Wf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function nl(){return _l=_l||document.querySelector("."+Ya),_l||(_l=document.createElement("div"),_l.classList.add(Ya),document.body.appendChild(_l)),_l}function dk(n,e){let t=nl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Ka();return}t.textContent=e.text,t.className=Ya+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Ka(){clearTimeout(Wa),nl().classList.remove("active"),nl().activeNode=void 0}function bw(n,e){nl().activeNode=n,clearTimeout(Wa),Wa=setTimeout(()=>{nl().classList.add("active"),dk(n,e)},isNaN(e.delay)?0:e.delay)}function Re(n,e){let t=Wf(e);function i(){bw(n,t)}function s(){Ka()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",s),nl(),{update(l){var o,r;t=Wf(l),(r=(o=nl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&dk(n,t)},destroy(){var l,o;(o=(l=nl())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Ka(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Mr(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=lo}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function zn(n,{delay:e=0,duration:t=400,easing:i=Mr,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=hf(s),[m,h]=hf(l);return{delay:e,duration:t,easing:i,css:(g,_)=>` transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*m}${h}); opacity: ${a-f*_}`}}function ht(n,{delay:e=0,duration:t=400,easing:i=Mr,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),h=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*h}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*_}px;`}}function Ct(n,{delay:e=0,duration:t=400,easing:i=Mr,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} `}}const kw=n=>({}),Yf=n=>({}),yw=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[4]&&!n[2]&&Zf(n);const T=n[19].header,O=Nt(T,n,n[18],Kf);let E=n[4]&&n[2]&&Gf(n);const L=n[19].default,I=Nt(L,n,n[18],null),A=n[19].footer,P=Nt(A,n,n[18],Yf);return{c(){e=b("div"),t=b("div"),s=C(),l=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),x(l,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(N,R){w(N,e,R),y(e,t),y(e,s),y(e,l),y(l,o),$&&$.m(o,null),y(o,r),O&&O.m(o,null),y(o,a),E&&E.m(o,null),y(l,u),y(l,f),I&&I.m(f,null),n[21](f),y(l,c),y(l,d),P&&P.m(d,null),_=!0,k||(S=[Y(t,"click",it(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=Zf(n),$.c(),M($,1),$.m(o,r)):$&&(oe(),D($,1,1,()=>{$=null}),re()),O&&O.p&&(!_||R[0]&262144)&&Ft(O,T,n,n[18],_?Rt(T,n[18],R,yw):qt(n[18]),Kf),n[4]&&n[2]?E?E.p(n,R):(E=Gf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Ft(I,L,n,n[18],_?Rt(L,n[18],R,null):qt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Ft(P,A,n,n[18],_?Rt(A,n[18],R,kw):qt(n[18]),Yf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!_||R[0]&262)&&x(l,"popup",n[2]),(!_||R[0]&4)&&x(e,"padded",n[2]),(!_||R[0]&1)&&x(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=qe(t,Ys,{duration:Gi,opacity:0},!0)),i.run(1))}),M($),M(O,N),M(I,N),M(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=a0(l,zn,n[2]?{duration:Gi,y:-10}:{duration:Gi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=qe(t,Ys,{duration:Gi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=bu(l,zn,n[2]?{duration:Gi,y:10}:{duration:Gi,x:50})),_=!1},d(N){N&&v(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),k=!1,Ee(S)}}}function Zf(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",it(n[5])),s=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ys,{duration:Gi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ys,{duration:Gi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function Gf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[5])),t=!0)},p:te,d(s){s&&v(e),t=!1,i()}}}function vw(n){let e,t,i,s,l=n[0]&&Jf(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&M(l,1)):(l=Jf(o),l.c(),M(l,1),l.m(e,null)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){t||(M(l),t=!0)},o(o){D(l),t=!1},d(o){o&&v(e),l&&l.d(),n[23](null),i=!1,Ee(s)}}}let gl,ta=[];function pk(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Gi=150;function Xf(){return 1e3+pk().querySelectorAll(".overlay-panel-container.active").length}function ww(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=wt(),h="op_"+U.randomString(10);let g,_,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await _n(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){U.pushUnique(ta,h),document.body.classList.add("overlay-active")}function N(){U.removeByValue(ta,h),ta.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!U.isInput(G.target)&&g&&g.style.zIndex==Xf()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,de){de&&t(8,$=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}an(()=>{pk().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const B=()=>a?E():!0;function J(G){ne[G?"unshift":"push"](()=>{_=G,t(7,_)})}const V=G=>F(G.target);function Z(G){ne[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,l=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,s=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,l,r,a,u,E,g,_,$,R,z,F,f,c,d,O,L,T,s,i,B,J,V,Z]}class nn extends we{constructor(e){super(),ve(this,e,ww,vw,be,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}const Wl=[];function mk(n,e){return{subscribe:Un(n,e).subscribe}}function Un(n,e=te){let t;const i=new Set;function s(r){if(be(n,r)&&(n=r,t)){const a=!Wl.length;for(const u of i)u[1](),Wl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function hk(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return mk(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);l?o(h):c=Lt(h)?h:te},m=s.map((h,g)=>pu(h,_=>{u[g]=_,f&=~(1<{f|=1<t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){ne[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await _n(),t(3,o=!1),_k()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class Ow extends we{constructor(e){super(),ve(this,e,Cw,$w,be,{})}}function Mw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),i0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function Ew(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function Dw(n){let e;function t(l,o){return l[1]?Ew:Mw}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[16](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:te,o:te,d(l){l&&v(e),s.d(),n[16](null)}}}function Iw(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,s,l){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=s,o.onload=()=>{l()},i.head&&i.head.appendChild(o)}function t(i,s,l){n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let Lw=Iw();function na(){return window&&window.tinymce?window.tinymce:null}function Aw(n,e,t){let{id:i="tinymce_svelte"+U.randomString(7)}=e,{inline:s=void 0}=e,{disabled:l=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,k=u,S=l;const $=wt();function T(){const I={...r,target:g,inline:s!==void 0?s:r.inline!==void 0?r.inline:!1,readonly:l,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),na().init(I)}an(()=>(na()!==null?T():Lw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=na())==null||A.remove(_))}catch{}}));function O(I){ne[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(I){ne[I?"unshift":"push"](()=>{g=I,t(4,g)})}function L(I){ne[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,s=I.inline),"disabled"in I&&t(7,l=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,u=I.value),"text"in I&&t(6,f=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&l!==S&&(t(13,S=l),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(l?"readonly":"design"):_.setMode(l?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,s,c,h,g,u,f,l,o,r,a,_,k,S,O,E,L]}class Mu extends we{constructor(e){super(),ve(this,e,Aw,Dw,be,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function Pw(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Mr}=i;return{delay:f,duration:Lt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${l} translate(${g}px, ${_}px) scale(${k}, ${S});`}}}const Er=Un([]);function Ks(n,e=4e3){return Eu(n,"info",e)}function tn(n,e=3e3){return Eu(n,"success",e)}function Mi(n,e=4500){return Eu(n,"error",e)}function Eu(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{gk(i)},t)};Er.update(s=>(Du(s,i.message),U.pushOrReplaceByKey(s,i,"message"),s))}function gk(n){Er.update(e=>(Du(e,n),e))}function Ls(){Er.update(n=>{for(let e of n)Du(n,e);return[]})}function Du(n,e){let t;typeof e=="string"?t=U.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),U.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function Nw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Rw(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Fw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function xf(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,k;function S(E,L){return E[2].type==="info"?qw:E[2].type==="success"?Fw:E[2].type==="warning"?Rw:Nw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),s=C(),l=b("div"),r=W(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){w(E,t,L),y(t,i),T.m(i,null),y(t,s),y(t,l),y(l,r),y(t,a),y(t,u),y(t,f),g=!0,_||(k=Y(u,"click",it(O)),_=!0)},p(E,L){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&se(r,o),(!g||L&1)&&x(t,"alert-info",e[2].type=="info"),(!g||L&1)&&x(t,"alert-success",e[2].type=="success"),(!g||L&1)&&x(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){iv(t),h(),s0(t,m)},a(){h(),h=nv(t,m,Pw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=a0(t,ht,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=bu(t,Ys,{duration:150})),g=!1},d(E){E&&v(t),T.d(),E&&d&&d.end(),_=!1,k()}}}function jw(n){let e,t=[],i=new Map,s,l=ce(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>gk(l)]}class zw extends we{constructor(e){super(),ve(this,e,Hw,jw,be,{})}}function ec(n){let e,t,i;const s=n[18].default,l=Nt(s,n,n[17],null);return{c(){e=b("div"),l&&l.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),i=!0},p(o,r){l&&l.p&&(!i||r[0]&131072)&&Ft(l,s,o,o[17],i?Rt(s,o[17],r,null):qt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(M(l,o),o&&tt(()=>{i&&(t||(t=qe(e,zn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(l,o),o&&(t||(t=qe(e,zn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),l&&l.d(o),n[19](null),o&&t&&t.end()}}}function Uw(n){let e,t,i,s,l=n[0]&&ec(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),l&&l.m(e,null),n[20](e),t=!0,i||(s=[Y(window,"click",n[7]),Y(window,"mousedown",n[6]),Y(window,"keydown",n[5]),Y(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&M(l,1)):(l=ec(o),l.c(),M(l,1),l.m(e,null)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){t||(M(l),t=!0)},o(o){D(l),t=!1},d(o){o&&v(e),l&&l.d(),n[20](null),i=!1,Ee(s)}}}function Vw(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,g,_=!1;const k=wt();function S(G=0){o&&(clearTimeout(g),g=setTimeout($,G))}function $(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function T(){clearTimeout(g),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function O(){o?$():T()}function E(G){return!c||G.classList.contains(u)||c.contains(G)&&G.closest&&G.closest("."+u)}function L(G){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=G||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(G){G.stopPropagation(),E(G.target)&&$()}function P(G){(G.code==="Enter"||G.code==="Space")&&(G.stopPropagation(),E(G.target)&&S(150))}function N(G){G.preventDefault(),G.stopPropagation(),O()}function R(G){(G.code==="Enter"||G.code==="Space")&&(G.preventDefault(),G.stopPropagation(),O())}function z(G){o&&!(m!=null&&m.contains(G.target))&&!(c!=null&&c.contains(G.target))&&O()}function F(G){o&&r&&G.code==="Escape"&&(G.preventDefault(),$())}function B(G){o&&(_=!(c!=null&&c.contains(G.target)))}function J(G){var de;o&&_&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((de=G.target)!=null&&de.closest(".flatpickr-calendar"))&&$()}an(()=>(L(),()=>I()));function V(G){ne[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ne[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,l=G.trigger),"active"in G&&t(0,o=G.active),"escClose"in G&&t(9,r=G.escClose),"autoScroll"in G&&t(10,a=G.autoScroll),"closableClass"in G&&t(11,u=G.closableClass),"class"in G&&t(1,f=G.class),"$$scope"in G&&t(17,s=G.$$scope)},n.$$.update=()=>{var G,de;n.$$.dirty[0]&260&&c&&L(l),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((de=m==null?void 0:m.classList)==null||de.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,B,J,l,r,a,u,S,$,T,O,m,s,i,V,Z]}class Dn extends we{constructor(e){super(),ve(this,e,Vw,Uw,be,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}const rn=Un(""),cr=Un(""),Dl=Un(!1),$n=Un({});function Jt(n){$n.set(n||{})}function Yn(n){$n.update(e=>(U.deleteByPath(e,n),e))}const Dr=Un({});function tc(n){Dr.set(n||{})}class Hn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Hn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Hn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(l=(s=(i=this.originalError)==null?void 0:i.cause)==null?void 0:s.message)!=null&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Mo=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Bw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||Ww;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}bk=typeof atob!="function"||Kw?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const ic="pb_auth";class Iu{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Ir(this.token)}get isSuperuser(){var t,i;let e=xl(this.token);return e.type=="auth"&&(((t=this.record)==null?void 0:t.collectionName)=="_superusers"||!((i=this.record)!=null&&i.collectionName)&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),xl(this.token).type=="auth"&&!this.isSuperuser}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=ic){const i=Bw(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.record||s.model||null)}exportToCookie(e,t=ic){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=xl(this.token);i.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const l={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=nc(t,JSON.stringify(l),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(l.record&&r>4096){l.record={id:(a=l.record)==null?void 0:a.id,email:(u=l.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(l.record[c]=this.record[c]);o=nc(t,JSON.stringify(l),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.record)}}class kk extends Iu{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class Hi{constructor(e){this.client=e}}class Jw extends Hi{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,s){return s=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},s),this.client.send("/api/settings/test/email",s).then(()=>!0)}async generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Zw=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Lu(n){if(n){n.query=n.query||{};for(let e in n)Zw.includes(e)||(n.query[e]=n[e],delete n[e])}}function yk(n){const e=[];for(const t in n){const i=encodeURIComponent(t),s=Array.isArray(n[t])?n[t]:[n[t]];for(let l of s)l=Gw(l),l!==null&&e.push(i+"="+l)}return e.join("&")}function Gw(n){return n==null?null:n instanceof Date?encodeURIComponent(n.toISOString().replace("T"," ")):encodeURIComponent(typeof n=="object"?JSON.stringify(n):n)}class vk extends Hi{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let s=e;if(i){Lu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));s+=(s.includes("?")?"&":"?")+r}const l=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(l),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(s,l):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,l)}async unsubscribe(e){var i;let t=!1;if(e){const s=this.getSubscriptionsByTopic(e);for(let l in s)if(this.hasSubscriptionListeners(l)){for(let o of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,o);delete this.subscriptions[l],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let s in this.subscriptions)if((s+"?").startsWith(e)){t=!0;for(let l of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,l);delete this.subscriptions[s]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var l;let i=!1;const s=this.getSubscriptionsByTopic(e);for(let o in s){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(l=this.eventSource)==null||l.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let s in this.subscriptions)if((i=this.subscriptions[s])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in i)for(let l of i[s])l(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Hn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class wk extends Hi{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(s=>{var l;return s.items=((l=s.items)==null?void 0:l.map(o=>this.decode(o)))||[],s})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var s;if(!((s=i==null?void 0:i.items)!=null&&s.length))throw new Hn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Hn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(s=>this.decode(s))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],s=async l=>this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i});return s(1)}}function Ji(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function ia(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Xw extends wk{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(s=>{var l,o,r;if(((l=this.client.authStore.record)==null?void 0:l.id)===(s==null?void 0:s.id)&&(((o=this.client.authStore.record)==null?void 0:o.collectionId)===this.collectionIdOrName||((r=this.client.authStore.record)==null?void 0:r.collectionName)===this.collectionIdOrName)){let a=Object.assign({},this.client.authStore.record.expand),u=Object.assign({},this.client.authStore.record,s);a&&(u.expand=Object.assign(a,s.expand)),this.client.authStore.save(this.client.authStore.token,u)}return s})}async delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.record)==null?void 0:s.id)!==e||((l=this.client.authStore.record)==null?void 0:l.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.record)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,i){let s;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(s=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||ia(this.client));let l=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return l=this.authResponse(l),s&&this.isSuperusers&&function(r,a,u,f){ia(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((h,g)=>{(!h||(g==null?void 0:g.id)!=(d==null?void 0:d.id)||(g!=null&&g.collectionId||d!=null&&d.collectionId)&&(g==null?void 0:g.collectionId)!=(d==null?void 0:d.collectionId))&&ia(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var $;const _=r.authStore.token;if(($=g.query)!=null&&$.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let k=r.authStore.isValid;if(k&&Ir(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&_==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return g.headers=S,c?c(h,g):{url:h,sendOptions:g}}}(this.client,s,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),l}async authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:s,createData:l}};return a=Ji("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const s=new vk(this.client);function l(){i==null||i.close(),s.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Hn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{l()}),new Promise(async(m,h)=>{var g;try{await s.subscribe("@oauth2",async $=>{var O;const T=s.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new Hn(E))}l()});const _={state:s.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function($){i?i.location.href=$:i=lc($)})(k)}catch(_){l(),h(new Hn(_))}})}).catch(a=>{throw l(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ji("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(s=>this.authResponse(s))}async requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Ji("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ji("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=Ji("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=Ji("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const l=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===l.id&&o.collectionId===l.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=Ji("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=Ji("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const s=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(s.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(s=>this.authResponse(s))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const s=new co(this.client.baseURL,new Iu,this.client.lang),l=await s.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return s.authStore.save(l==null?void 0:l.token,this.decode((l==null?void 0:l.record)||{})),s}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Hn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class Qw extends wk{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then(()=>!0)}}class xw extends Hi{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Hn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class e3 extends Hi{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class t3 extends Hi{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildURL(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class n3 extends Hi{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class i3 extends Hi{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/crons",e)}async run(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/crons/${encodeURIComponent(e)}`,t).then(()=>!0)}}function Ja(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function Za(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function sc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(Ja(i))return!0}return!1}const l3=/^[\-\.\d]+$/;function oc(n){if(typeof n!="string")return n;if(n=="true")return!0;if(n=="false")return!1;if((n[0]==="-"||n[0]>="0"&&n[0]<="9")&&l3.test(n)){let e=+n;if(""+e===n)return e}return n}class s3 extends Hi{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new o3(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let s=0;s{if(a==="@jsonPayload"&&typeof r=="string")try{let u=JSON.parse(r);Object.assign(o,u)}catch(u){console.warn("@jsonPayload error:",u)}else o[a]!==void 0?(Array.isArray(o[a])||(o[a]=[o[a]]),o[a].push(oc(r))):o[a]=oc(r)}),o}(i));for(const s in i){const l=i[s];if(Ja(l))e.files[s]=e.files[s]||[],e.files[s].push(l);else if(Array.isArray(l)){const o=[],r=[];for(const a of l)Ja(a)?o.push(a):r.push(a);if(o.length>0&&o.length==l.length){e.files[s]=e.files[s]||[];for(let a of o)e.files[s].push(a)}else if(e.json[s]=r,o.length>0){let a=s;s.startsWith("+")||s.endsWith("+")||(a+="+"),e.files[a]=e.files[a]||[];for(let u of o)e.files[a].push(u)}}else e.json[s]=l}}}class co{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Iu:this.authStore=new kk,this.collections=new Qw(this),this.files=new t3(this),this.logs=new xw(this),this.settings=new Jw(this),this.realtime=new vk(this),this.health=new e3(this),this.backups=new n3(this),this.crons=new i3(this)}get admins(){return this.collection("_superusers")}createBatch(){return new s3(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Xw(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let s=t[i];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",s)}return e}getFileUrl(e,t,i={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,i)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){var i;let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildURL(e);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=yk(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async s=>{let l={};try{l=await s.json()}catch{}if(this.afterSend&&(l=await this.afterSend(s,l,t)),s.status>=400)throw new Hn({url:s.url,status:s.status,data:l});return l}).catch(s=>{throw new Hn(s)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(s){if(typeof FormData>"u"||s===void 0||typeof s!="object"||s===null||Za(s)||!sc(s))return s;const l=new FormData;for(const o in s){const r=s[o];if(typeof r!="object"||sc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)l.append(o,u)}else{let a={};a[o]=r,l.append("@jsonPayload",JSON.stringify(a))}}return l}(t.body),Lu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||Za(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const s=new AbortController;this.cancelControllers[i]=s,t.signal=s.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const In=Un([]),li=Un({}),Js=Un(!1),Sk=Un({}),Au=Un({});let As;typeof BroadcastChannel<"u"&&(As=new BroadcastChannel("collections"),As.onmessage=()=>{var n;Pu((n=Qb(li))==null?void 0:n.id)});function Tk(){As==null||As.postMessage("reload")}function r3(n){In.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?li.set(t):e.length&&li.set(e.find(i=>!i.system)||e[0]),e})}function a3(n){li.update(e=>U.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),In.update(e=>(U.pushOrReplaceByKey(e,n,"id"),Nu(),Tk(),U.sortCollections(e)))}function u3(n){In.update(e=>(U.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Nu(),Tk(),e))}async function Pu(n=null){Js.set(!0);try{const e=[];e.push(_e.collections.getScaffolds()),e.push(_e.collections.getFullList());let[t,i]=await Promise.all(e);Au.set(t),i=U.sortCollections(i),In.set(i);const s=n&&i.find(l=>l.id==n||l.name==n);s?li.set(s):i.length&&li.set(i.find(l=>!l.system)||i[0]),Nu()}catch(e){_e.error(e)}Js.set(!1)}function Nu(){Sk.update(n=>(In.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(s=>s.type=="file"&&s.protected));return e}),n))}function $k(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function f3(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),e.$on("routeEvent",r[7]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a&4?vt(s,[At(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&j(e,r)}}}function c3(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),e.$on("routeEvent",r[6]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a&6?vt(s,[a&2&&{params:r[1]},a&4&&At(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&j(e,r)}}}function d3(n){let e,t,i,s;const l=[c3,f3],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&v(i),o[e].d(a)}}}function rc(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Lr=mk(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});hk(Lr,n=>n.location);const Ru=hk(Lr,n=>n.querystring),ac=Un(void 0);async function is(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await _n();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function qn(n,e){if(e=fc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return uc(n,e),{update(t){t=fc(t),uc(n,t)}}}function p3(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uc(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||m3(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function m3(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function h3(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(O,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=$k(O);this.path=O,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(O){if(s){if(typeof s=="string")if(O.startsWith(s))O=O.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const A=O.match(s);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(O);if(E===null)return null;if(this._keys===!1)return E;const L={};let I=0;for(;I{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=wt();async function d(T,O){await _n(),c(T,O)}let m=null,h=null;l&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),lv(()=>{p3(m)}));let g=null,_=null;const k=Lr.subscribe(async T=>{g=T;let O=0;for(;O{ac.set(u)});return}t(0,a=null),_=null,ac.set(void 0)});oo(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,$]}class _3 extends we{constructor(e){super(),ve(this,e,h3,d3,be,{routes:3,prefix:4,restoreScrollState:5})}}const la="pb_superuser_file_token";co.prototype.logout=function(n=!0){this.authStore.clear(),n&&is("/login")};co.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Mi(l),U.isEmpty(s.data)||Jt(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),is("/")};co.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Qb(Sk);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(la)||"";return(!t||Ir(t,10))&&(t&&localStorage.removeItem(la),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(la,t),this._superuserFileTokenRequest=null),t};class g3 extends kk{constructor(e="__pb_superuser_auth__"){super(e),this.save(this.token,this.record)}save(e,t){super.save(e,t),(t==null?void 0:t.collectionName)=="_superusers"&&tc(t)}clear(){super.clear(),tc(null)}}const _e=new co("../",new g3);_e.authStore.isValid&&_e.collection(_e.authStore.record.collectionName).authRefresh().catch(n=>{console.warn("Failed to refresh the existing auth token:",n);const e=(n==null?void 0:n.status)<<0;(e==401||e==403)&&_e.authStore.clear()});const Xo=[];let Ck;function Ok(n){const e=n.pattern.test(Ck);cc(n,n.className,e),cc(n,n.inactiveClassName,!e)}function cc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Lr.subscribe(n=>{Ck=n.location+(n.querystring?"?"+n.querystring:""),Xo.map(Ok)});function Si(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?$k(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return Xo.push(i),Ok(i),{destroy(){Xo.splice(Xo.indexOf(i),1)}}}const b3="modulepreload",k3=function(n,e){return new URL(n,e).href},dc={},$t=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));s=Promise.allSettled(t.map(u=>{if(u=k3(u,i),u in dc)return;dc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const g=o[h];if(g.href===u&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":b3,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,g)=>{m.addEventListener("load",h),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return s.then(o=>{for(const r of o||[])r.status==="rejected"&&l(r.reason);return e().catch(l)})};function y3(n){e();function e(){_e.authStore.isValid?is("/collections"):_e.logout()}return[]}class v3 extends we{constructor(e){super(),ve(this,e,y3,null,be,{})}}function pc(n,e,t){const i=n.slice();return i[12]=e[t],i}const w3=n=>({}),mc=n=>({uniqueId:n[4]});function S3(n){let e,t,i=ce(n[3]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=qe(t,Ct,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Ct,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&v(e),a&&s&&s.end(),o=!1,r()}}}function hc(n){let e,t,i=dr(n[12])+"",s,l,o,r;return{c(){e=b("div"),t=b("pre"),s=W(i),l=C(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),y(e,t),y(t,s),y(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=dr(a[12])+"")&&se(s,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=qe(e,ht,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,ht,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function $3(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Nt(a,n,n[8],mc),f=[T3,S3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),s.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),u&&u.m(e,null),y(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!l||h&256)&&Ft(u,a,m,m[8],l?Rt(a,m[8],h,w3):qt(m[8]),mc);let g=i;i=d(m),i===g?c[i].p(m,h):(oe(),D(c[g],1,1,()=>{c[g]=null}),re(),s=c[i],s?s.p(m,h):(s=c[i]=f[i](m),s.c()),M(s,1),s.m(e,null)),(!l||h&2)&&p(e,"class",m[1]),(!l||h&10)&&x(e,"error",m[3].length)},i(m){l||(M(u,m),M(s),l=!0)},o(m){D(u,m),D(s),l=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const _c="Invalid value";function dr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||_c:n||_c}function C3(n,e,t){let i;Ge(n,$n,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Yn(r)}an(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Le.call(this,n,g)}function h(g){ne[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=U.toArray(U.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,m,h]}class fe extends we{constructor(e){super(),ve(this,e,C3,$3,be,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const O3=n=>({}),gc=n=>({});function bc(n){let e,t,i,s,l,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",s=C(),l=b("a"),o=b("span"),o.textContent="PocketBase v0.28.1",p(e,"href","https://pocketbase.io/docs"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(l,"title","Releases")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),w(r,s,a),w(r,l,a),y(l,o)},d(r){r&&(v(e),v(t),v(i),v(s),v(l))}}}function M3(n){var m;let e,t,i,s,l,o,r;const a=n[4].default,u=Nt(a,n,n[3],null),f=n[4].footer,c=Nt(f,n,n[3],gc);let d=((m=n[2])==null?void 0:m.id)&&bc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),s=b("footer"),c&&c.c(),l=C(),d&&d.c(),p(t,"class","page-content"),p(s,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(h,g){w(h,e,g),y(e,t),u&&u.m(t,null),y(e,i),y(e,s),c&&c.m(s,null),y(s,l),d&&d.m(s,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Ft(u,a,h,h[3],r?Rt(a,h[3],g,null):qt(h[3]),null),c&&c.p&&(!r||g&8)&&Ft(c,f,h,h[3],r?Rt(f,h[3],g,O3):qt(h[3]),gc),(_=h[2])!=null&&_.id?d||(d=bc(),d.c(),d.m(s,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&x(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&v(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function E3(n,e,t){let i;Ge(n,Dr,a=>t(2,i=a));let{$$slots:s={},$$scope:l}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,l=a.$$scope)},[o,r,i,l,s]}class oi extends we{constructor(e){super(),ve(this,e,E3,M3,be,{center:0,class:1})}}function D3(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),me(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&me(e,l[7])},i:te,o:te,d(l){l&&v(e),n[13](null),i=!1,s()}}}function I3(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=Ht(o,r(n)),ne.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&v(i),e&&j(e,a)}}}function kc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=qe(e,zn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,zn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&v(e),s&&t&&t.end()}}}function yc(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[15]),s=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,zn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,zn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function L3(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[I3,D3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}l=h(n),o=m[l]=d[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&kc(),_=(n[0].length||n[7].length)&&yc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=C(),o.c(),r=C(),g&&g.c(),a=C(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(k,S){w(k,e,S),y(e,t),y(t,i),y(e,s),m[l].m(e,null),y(e,r),g&&g.m(e,null),y(e,a),_&&_.m(e,null),u=!0,f||(c=[Y(e,"click",en(n[11])),Y(e,"submit",it(n[10]))],f=!0)},p(k,[S]){let $=l;l=h(k),l===$?m[l].p(k,S):(oe(),D(m[$],1,1,()=>{m[$]=null}),re(),o=m[l],o?o.p(k,S):(o=m[l]=d[l](k),o.c()),M(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?S&129&&M(g,1):(g=kc(),g.c(),M(g,1),g.m(e,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&M(_,1)):(_=yc(k),_.c(),M(_,1),_.m(e,null)):_&&(oe(),D(_,1,1,()=>{_=null}),re())},i(k){u||(M(o),M(g),M(_),u=!0)},o(k){D(o),D(g),D(_),u=!1},d(k){k&&v(e),m[l].d(),g&&g.d(),_&&_.d(),f=!1,Ee(c)}}}function A3(n,e,t){const i=wt(),s="search_"+U.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(O=!0){t(7,d=""),O&&(c==null||c.focus()),i("clear")}function h(){t(0,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await $t(async()=>{const{default:O}=await import("./FilterAutocompleteInput-CBf9aYgb.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}an(()=>{g()});function _(O){Le.call(this,n,O)}function k(O){d=O,t(7,d),t(0,l)}function S(O){ne[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,l=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,h,_,k,S,$,T]}class Ar extends we{constructor(e){super(),ve(this,e,A3,L3,be,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function P3(n){let e,t,i,s,l,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),y(e,t),l||(o=[Oe(s=Re.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&Lt(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:te,o:te,d(r){r&&v(e),l=!1,Ee(o)}}}function N3(n,e,t){const i=wt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return an(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Pr extends we{constructor(e){super(),ve(this,e,N3,P3,be,{tooltip:0,class:1})}}const R3=n=>({}),vc=n=>({}),F3=n=>({}),wc=n=>({});function q3(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Nt(u,n,n[10],wc),c=n[11].default,d=Nt(c,n,n[10],null),m=n[11].after,h=Nt(m,n,n[10],vc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),l=C(),h&&h.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,_){w(g,e,_),f&&f.m(e,null),y(e,t),y(e,i),d&&d.m(i,null),n[12](i),y(e,l),h&&h.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&Ft(f,u,g,g[10],o?Rt(u,g[10],_,F3):qt(g[10]),wc),d&&d.p&&(!o||_&1024)&&Ft(d,c,g,g[10],o?Rt(c,g[10],_,null):qt(g[10]),null),(!o||_&9&&s!==(s="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",s),h&&h.p&&(!o||_&1024)&&Ft(h,m,g,g[10],o?Rt(m,g[10],_,R3):qt(g[10]),vc)},i(g){o||(M(f,g),M(d,g),M(h,g),o=!0)},o(g){D(f,g),D(d,g),D(h,g),o=!1},d(g){g&&v(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,Ee(a)}}}function j3(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-g,h=f.scrollHeight-_,h>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),l("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}an(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(L){ne[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,s=L.$$scope)},[o,O,f,c,r,a,u,S,$,T,s,i,E]}class Fu extends we{constructor(e){super(),ve(this,e,j3,q3,be,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function H3(n){let e,t,i,s,l;const o=n[6].default,r=Nt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Ft(r,o,a,a[5],i?Rt(o,a[5],u,null):qt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),s=!1,Ee(l)}}}function z3(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class Qo extends we{constructor(e){super(),ve(this,e,z3,H3,be,{class:1,name:2,sort:0,disable:3})}}function U3(n){let e,t=n[0].replace("Z"," UTC")+"",i,s,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),y(e,i),s||(l=Oe(Re.call(null,e,n[1])),s=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:te,o:te,d(o){o&&v(e),s=!1,l()}}}function V3(n,e,t){let{date:i}=e;const s={get text(){return U.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=l=>{"date"in l&&t(0,i=l.date)},[i,s]}class Mk extends we{constructor(e){super(),ve(this,e,V3,U3,be,{date:0})}}function B3(n){let e,t,i=(n[1]||"UNKN")+"",s,l,o,r,a;return{c(){e=b("div"),t=b("span"),s=W(i),l=W(" ("),o=W(n[0]),r=W(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){w(u,e,f),y(e,t),y(t,s),y(t,l),y(t,o),y(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&se(s,i),f&1&&se(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:te,o:te,d(u){u&&v(e)}}}function W3(n,e,t){let i,{level:s}=e;return n.$$set=l=>{"level"in l&&t(0,s=l.level)},n.$$.update=()=>{var l;n.$$.dirty&1&&t(1,i=(l=ck.find(o=>o.level==s))==null?void 0:l.label)},[s,i]}class Ek extends we{constructor(e){super(),ve(this,e,W3,B3,be,{level:0})}}function Sc(n,e,t){var o;const i=n.slice();i[32]=e[t];const s=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=s;const l=iS(i[32]);return i[34]=l,i}function Tc(n,e,t){const i=n.slice();return i[37]=e[t],i}function Y3(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=C(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),y(e,t),y(e,s),y(e,l),o||(r=Y(t,"change",n[19]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function K3(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function J3(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function Z3(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function G3(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function $c(n){let e;function t(l,o){return l[7]?Q3:X3}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&v(e),s.d(l)}}}function X3(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Cc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=C(),o&&o.c(),l=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,s),o&&o.m(t,null),y(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Cc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function Q3(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function Cc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:te,d(s){s&&v(e),t=!1,i()}}}function Oc(n){let e,t=ce(n[34]),i=[];for(let s=0;s',P=C(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[32].id),l.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(_,"class","flex flex-gap-10"),p(g,"class","col-type-text col-field-message svelte-91v05h"),p(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,G){w(Z,t,G),y(t,i),y(i,s),y(s,l),y(s,a),y(s,u),y(t,c),y(t,d),q(m,d,null),y(t,h),y(t,g),y(g,_),y(_,k),y(k,$),y(g,T),B&&B.m(g,null),y(t,O),y(t,E),q(L,E,null),y(t,I),y(t,A),y(t,P),N=!0,R||(z=[Y(l,"change",F),Y(s,"click",en(e[18])),Y(t,"click",J),Y(t,"keydown",V)],R=!0)},p(Z,G){e=Z,(!N||G[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(l,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(l.checked=r),(!N||G[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const de={};G[0]&8&&(de.level=e[32].level),m.$set(de),(!N||G[0]&8)&&S!==(S=e[32].message+"")&&se($,S),e[34].length?B?B.p(e,G):(B=Oc(e),B.c(),B.m(g,null)):B&&(B.d(1),B=null);const pe={};G[0]&8&&(pe.date=e[32].created),L.$set(pe)},i(Z){N||(M(m.$$.fragment,Z),M(L.$$.fragment,Z),N=!0)},o(Z){D(m.$$.fragment,Z),D(L.$$.fragment,Z),N=!1},d(Z){Z&&v(t),j(m),B&&B.d(),j(L),R=!1,Ee(z)}}}function tS(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S=[],$=new Map,T;function O(V,Z){return V[7]?K3:Y3}let E=O(n),L=E(n);function I(V){n[20](V)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[J3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new Qo({props:A}),ne.push(()=>ge(o,"sort",I));function P(V){n[21](V)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[Z3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new Qo({props:N}),ne.push(()=>ge(u,"sort",P));function R(V){n[22](V)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[G3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new Qo({props:z}),ne.push(()=>ge(d,"sort",R));let F=ce(n[3]);const B=V=>V[32].id;for(let V=0;Vr=!1)),o.$set(G);const de={};Z[1]&512&&(de.$$scope={dirty:Z,ctx:V}),!f&&Z[0]&2&&(f=!0,de.sort=V[1],$e(()=>f=!1)),u.$set(de);const pe={};Z[1]&512&&(pe.$$scope={dirty:Z,ctx:V}),!m&&Z[0]&2&&(m=!0,pe.sort=V[1],$e(()=>m=!1)),d.$set(pe),Z[0]&9369&&(F=ce(V[3]),oe(),S=kt(S,Z,B,1,V,F,$,k,Yt,Ec,null,Sc),re(),!F.length&&J?J.p(V,Z):F.length?J&&(J.d(1),J=null):(J=$c(V),J.c(),J.m(k,null))),(!T||Z[0]&128)&&x(e,"table-loading",V[7])},i(V){if(!T){M(o.$$.fragment,V),M(u.$$.fragment,V),M(d.$$.fragment,V);for(let Z=0;ZLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(l,o){w(l,e,o),y(e,t),i||(s=Y(t,"click",n[27]),i=!0)},p(l,o){o[0]&128&&x(t,"btn-loading",l[7]),o[0]&128&&x(t,"btn-disabled",l[7])},d(l){l&&v(e),i=!1,s()}}}function Ic(n){let e,t,i,s,l,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),s=b("strong"),l=W(n[5]),o=C(),a=W(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){w($,e,T),y(e,t),y(t,i),y(t,s),y(s,l),y(t,o),y(t,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,h),_=!0,k||(S=[Y(f,"click",n[28]),Y(h,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&se(l,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&se(a,r)},i($){_||($&&tt(()=>{_&&(g||(g=qe(e,zn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=qe(e,zn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&v(e),$&&g&&g.end(),k=!1,Ee(S)}}}function nS(n){let e,t,i,s,l;e=new Fu({props:{class:"table-wrapper",$$slots:{default:[tS]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Dc(n),r=n[5]&&Ic(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),s=ke()},m(a,u){q(e,a,u),w(a,t,u),o&&o.m(a,u),w(a,i,u),r&&r.m(a,u),w(a,s,u),l=!0},p(a,u){const f={};u[0]&411|u[1]&512&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=Dc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&M(r,1)):(r=Ic(a),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(oe(),D(r,1,1,()=>{r=null}),re())},i(a){l||(M(e.$$.fragment,a),M(r),l=!0)},o(a){D(e.$$.fragment,a),D(r),l=!1},d(a){a&&(v(t),v(i),v(s)),j(e,a),o&&o.d(a),r&&r.d(a)}}}const Lc=50,sa=/[-:\. ]/gi;function iS(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function lS(n,e,t){let i,s,l;const o=wt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,h=!1,g=0,_={};async function k(G=1,de=!0){t(7,h=!0);const pe=[a,U.normalizeLogsFilter(r)];return u.min&&u.max&&pe.push(`created >= "${u.min}" && created <= "${u.max}"`),_e.logs.getList(G,Lc,{sort:f,skipTotal:1,filter:pe.filter(Boolean).map(ae=>"("+ae+")").join("&&")}).then(async ae=>{var Ye;G<=1&&S();const Ce=U.toArray(ae.items);if(t(7,h=!1),t(6,d=ae.page),t(17,m=((Ye=ae.items)==null?void 0:Ye.length)||0),o("load",c.concat(Ce)),de){const Ke=++g;for(;Ce.length&&g==Ke;){const ct=Ce.splice(0,10);for(let et of ct)U.pushOrReplaceByKey(c,et);t(3,c),await U.yieldToMain()}}else{for(let Ke of Ce)U.pushOrReplaceByKey(c,Ke);t(3,c)}}).catch(ae=>{ae!=null&&ae.isAbort||(t(7,h=!1),console.warn(ae),S(),_e.error(ae,!pe||(ae==null?void 0:ae.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function $(){l?T():O()}function T(){t(4,_={})}function O(){for(const G of c)t(4,_[G.id]=G,_);t(4,_)}function E(G){_[G.id]?delete _[G.id]:t(4,_[G.id]=G,_),t(4,_)}function L(){const G=Object.values(_).sort((ae,Ce)=>ae.createdCe.created?-1:0);if(!G.length)return;if(G.length==1)return U.downloadJson(G[0],"log_"+G[0].created.replaceAll(sa,"")+".json");const de=G[0].created.replaceAll(sa,""),pe=G[G.length-1].created.replaceAll(sa,"");return U.downloadJson(G,`${G.length}_logs_${pe}_to_${de}.json`)}function I(G){Le.call(this,n,G)}const A=()=>$();function P(G){f=G,t(1,f)}function N(G){f=G,t(1,f)}function R(G){f=G,t(1,f)}const z=G=>E(G),F=G=>o("select",G),B=(G,de)=>{de.code==="Enter"&&(de.preventDefault(),o("select",G))},J=()=>t(0,r=""),V=()=>k(d+1),Z=()=>T();return n.$$set=G=>{"filter"in G&&t(0,r=G.filter),"presets"in G&&t(15,a=G.presets),"zoom"in G&&t(16,u=G.zoom),"sort"in G&&t(1,f=G.sort)},n.$$.update=()=>{n.$$.dirty[0]&98307&&(typeof f<"u"||typeof r<"u"||typeof a<"u"||typeof u<"u")&&(S(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=Lc),n.$$.dirty[0]&16&&t(5,s=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,l=c.length&&s===c.length)},[r,f,k,c,_,s,d,h,l,i,o,$,T,E,L,a,u,m,I,A,P,N,R,z,F,B,J,V,Z]}class sS extends we{constructor(e){super(),ve(this,e,lS,nS,be,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme * (c) 2024 Jukka Kurkela * Released under the MIT License */function po(n){return n+.5|0}const Qi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ms(n){return Qi(po(n*2.55),0,255)}function il(n){return Qi(po(n*255),0,255)}function Fi(n){return Qi(po(n/2.55)/100,0,1)}function Ac(n){return Qi(po(n*100),0,100)}const Qn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ga=[..."0123456789ABCDEF"],oS=n=>Ga[n&15],rS=n=>Ga[(n&240)>>4]+Ga[n&15],Eo=n=>(n&240)>>4===(n&15),aS=n=>Eo(n.r)&&Eo(n.g)&&Eo(n.b)&&Eo(n.a);function uS(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Qn[n[1]]*17,g:255&Qn[n[2]]*17,b:255&Qn[n[3]]*17,a:e===5?Qn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Qn[n[1]]<<4|Qn[n[2]],g:Qn[n[3]]<<4|Qn[n[4]],b:Qn[n[5]]<<4|Qn[n[6]],a:e===9?Qn[n[7]]<<4|Qn[n[8]]:255})),t}const fS=(n,e)=>n<255?e(n):"";function cS(n){var e=aS(n)?oS:rS;return n?"#"+e(n.r)+e(n.g)+e(n.b)+fS(n.a,e):void 0}const dS=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Dk(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function pS(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function mS(n,e,t){const i=Dk(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function hS(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=hS(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function ju(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(il)}function Hu(n,e,t){return ju(Dk,n,e,t)}function _S(n,e,t){return ju(mS,n,e,t)}function gS(n,e,t){return ju(pS,n,e,t)}function Ik(n){return(n%360+360)%360}function bS(n){const e=dS.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ms(+e[5]):il(+e[5]));const s=Ik(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=_S(s,l,o):e[1]==="hsv"?i=gS(s,l,o):i=Hu(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function kS(n,e){var t=qu(n);t[0]=Ik(t[0]+e),t=Hu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function yS(n){if(!n)return;const e=qu(n),t=e[0],i=Ac(e[1]),s=Ac(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${Fi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Pc={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Nc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function vS(){const n={},e=Object.keys(Nc),t=Object.keys(Pc);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Do;function wS(n){Do||(Do=vS(),Do.transparent=[0,0,0,0]);const e=Do[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const SS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function TS(n){const e=SS.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Ms(o):Qi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Ms(i):Qi(i,0,255)),s=255&(e[4]?Ms(s):Qi(s,0,255)),l=255&(e[6]?Ms(l):Qi(l,0,255)),{r:i,g:s,b:l,a:t}}}function $S(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Fi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const oa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Yl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function CS(n,e,t){const i=Yl(Fi(n.r)),s=Yl(Fi(n.g)),l=Yl(Fi(n.b));return{r:il(oa(i+t*(Yl(Fi(e.r))-i))),g:il(oa(s+t*(Yl(Fi(e.g))-s))),b:il(oa(l+t*(Yl(Fi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Io(n,e,t){if(n){let i=qu(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Hu(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Lk(n,e){return n&&Object.assign(e||{},n)}function Rc(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=il(n[3]))):(e=Lk(n,{r:0,g:0,b:0,a:1}),e.a=il(e.a)),e}function OS(n){return n.charAt(0)==="r"?TS(n):bS(n)}class Zs{constructor(e){if(e instanceof Zs)return e;const t=typeof e;let i;t==="object"?i=Rc(e):t==="string"&&(i=uS(e)||wS(e)||OS(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Lk(this._rgb);return e&&(e.a=Fi(e.a)),e}set rgb(e){this._rgb=Rc(e)}rgbString(){return this._valid?$S(this._rgb):void 0}hexString(){return this._valid?cS(this._rgb):void 0}hslString(){return this._valid?yS(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=CS(this._rgb,e._rgb,t)),this}clone(){return new Zs(this.rgb)}alpha(e){return this._rgb.a=il(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=po(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Io(this._rgb,2,e),this}darken(e){return Io(this._rgb,2,-e),this}saturate(e){return Io(this._rgb,1,e),this}desaturate(e){return Io(this._rgb,1,-e),this}rotate(e){return kS(this._rgb,e),this}}/*! * Chart.js v4.4.9 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License */function Pi(){}const MS=(()=>{let n=0;return()=>n++})();function Vt(n){return n==null}function cn(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function St(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Tn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function gi(n,e){return Tn(n)?n:e}function Et(n,e){return typeof n>"u"?e:n}const ES=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ft(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let s,l,o;if(cn(n))for(l=n.length,s=0;sn,x:n=>n.x,y:n=>n.y};function LS(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function AS(n){const e=LS(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function hr(n,e){return(Fc[e]||(Fc[e]=AS(e)))(n)}function zu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const _r=n=>typeof n<"u",sl=n=>typeof n=="function",qc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function PS(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const wn=Math.PI,Ci=2*wn,NS=Ci+wn,gr=Number.POSITIVE_INFINITY,RS=wn/180,di=wn/2,bl=wn/4,jc=wn*2/3,Pk=Math.log10,ol=Math.sign;function Ol(n,e,t){return Math.abs(n-e)s-l).pop(),e}function qS(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Xs(n){return!qS(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function jS(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function HS(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Uu(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const $l=(n,e,t,i)=>Uu(n,t,i?s=>{const l=n[s][e];return ln[s][e]Uu(n,t,i=>n[i][e]>=t);function YS(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+zu(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function Uc(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Fk.forEach(l=>{delete n[l]}),delete n._chartjs)}function JS(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const qk=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function jk(n,e){let t=[],i=!1;return function(...s){t=s,i||(i=!0,qk.call(window,()=>{i=!1,n.apply(e,t)}))}}function ZS(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const GS=n=>n==="start"?"left":n==="end"?"right":"center",Vc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function XS(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,vScale:r,_parsed:a}=n,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,f=o.axis,{min:c,max:d,minDefined:m,maxDefined:h}=o.getUserBounds();if(m){if(s=Math.min($l(a,f,c).lo,t?i:$l(e,f,o.getPixelForValue(c)).lo),u){const g=a.slice(0,s+1).reverse().findIndex(_=>!Vt(_[r.axis]));s-=Math.max(0,g)}s=pi(s,0,i-1)}if(h){let g=Math.max($l(a,o.axis,d,!0).hi+1,t?0:$l(e,f,o.getPixelForValue(d),!0).hi+1);if(u){const _=a.slice(g-1).findIndex(k=>!Vt(k[r.axis]));g+=Math.max(0,_)}l=pi(g,s,i)-s}else l=i-s}return{start:s,count:l}}function QS(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Lo=n=>n===0||n===1,Bc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ci/t)),Wc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ci/t)+1,Ns={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*di)+1,easeOutSine:n=>Math.sin(n*di),easeInOutSine:n=>-.5*(Math.cos(wn*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Lo(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Lo(n)?n:Bc(n,.075,.3),easeOutElastic:n=>Lo(n)?n:Wc(n,.075,.3),easeInOutElastic(n){return Lo(n)?n:n<.5?.5*Bc(n*2,.1125,.45):.5+.5*Wc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Ns.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ns.easeInBounce(n*2)*.5:Ns.easeOutBounce(n*2-1)*.5+.5};function Vu(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Yc(n){return Vu(n)?n:new Zs(n)}function ra(n){return Vu(n)?n:new Zs(n).saturate(.5).darken(.1).hexString()}const xS=["x","y","borderWidth","radius","tension"],e4=["color","borderColor","backgroundColor"];function t4(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:e4},numbers:{type:"number",properties:xS}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function n4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Kc=new Map;function i4(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Kc.get(t);return i||(i=new Intl.NumberFormat(n,e),Kc.set(t,i)),i}function Hk(n,e,t){return i4(e,t).format(n)}const l4={values(n){return cn(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=s4(n,t)}const o=Pk(Math.abs(l)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Hk(n,i,a)}};function s4(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var zk={formatters:l4};function o4(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:zk.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Il=Object.create(null),Qa=Object.create(null);function Rs(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>ra(s.backgroundColor),this.hoverBorderColor=(i,s)=>ra(s.borderColor),this.hoverColor=(i,s)=>ra(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return aa(this,e,t)}get(e){return Rs(this,e)}describe(e,t){return aa(Qa,e,t)}override(e,t){return aa(Il,e,t)}route(e,t,i,s){const l=Rs(this,e),o=Rs(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return St(a)?Object.assign({},u,a):Et(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var on=new r4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[t4,n4,o4]);function a4(n){return!n||Vt(n.size)||Vt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Jc(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function kl(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function Zc(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function xa(n,e,t,i){u4(n,e,t,i)}function u4(n,e,t,i,s){let l,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,g=e.radius;let _=(h||0)*RS;if(m&&typeof m=="object"&&(l=m.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(_),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:n.arc(t,i,g,0,Ci),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=jc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=jc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+bl)*a,c=Math.cos(_+bl)*a,r=Math.sin(_+bl)*a,d=Math.sin(_+bl)*a,n.arc(t-c,i-r,u,_-wn,_-di),n.arc(t+d,i-o,u,_-di,_),n.arc(t+c,i+r,u,_,_+di),n.arc(t-d,i+o,u,_+di,_+wn),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*g,f=a,n.rect(t-f,i-a,2*f,2*a);break}_+=bl;case"rectRot":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":_+=bl;case"cross":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),_+=bl,c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(_)*g,r=Math.sin(_)*g,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(_)*g,i+Math.sin(_)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ls(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,d4(n,l),a=0;a+n||0;function Uk(n,e){const t={},i=St(e),s=i?Object.keys(e):e,l=St(n)?i?o=>Et(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=b4(l(o));return t}function k4(n){return Uk(n,{top:"y",right:"x",bottom:"y",left:"x"})}function xo(n){return Uk(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rl(n){const e=k4(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $i(n,e){n=n||{},e=e||on.font;let t=Et(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Et(n.style,e.style);i&&!(""+i).match(_4)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Et(n.family,e.family),lineHeight:g4(Et(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Et(n.weight,e.weight),string:""};return s.string=a4(s),s}function Ao(n,e,t,i){let s,l,o;for(s=0,l=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Pl(n,e){return Object.assign(Object.create(n),e)}function Yu(n,e=[""],t,i,s=()=>n[0]){const l=t||n;typeof i>"u"&&(i=Yk("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:l,_fallback:i,_getTarget:s,override:r=>Yu([r,...n],e,l,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return Bk(r,a,()=>M4(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return xc(r).includes(a)},ownKeys(r){return xc(r)},set(r,a,u){const f=r._storage||(r._storage=s());return r[a]=f[a]=u,delete r._keys,!0}})}function ss(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Vk(n,i),setContext:l=>ss(n,l,t,i),override:l=>ss(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return Bk(l,o,()=>w4(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function Vk(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:sl(t)?t:()=>t,isIndexable:sl(i)?i:()=>i}}const v4=(n,e)=>n?n+zu(e):e,Ku=(n,e)=>St(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Bk(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function w4(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return sl(r)&&o.isScriptable(e)&&(r=S4(e,r,n,t)),cn(r)&&r.length&&(r=T4(e,r,n,o.isIndexable)),Ku(e,r)&&(r=ss(r,s,l&&l[e],o)),r}function S4(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(l,o||i);return r.delete(n),Ku(n,a)&&(a=Ju(s._scopes,s,n,a)),a}function T4(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(typeof l.index<"u"&&i(n))return e[l.index%e.length];if(St(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ju(u,s,n,f);e.push(ss(c,l,o&&o[n],r))}}return e}function Wk(n,e,t){return sl(n)?n(e,t):n}const $4=(n,e)=>n===!0?e:typeof n=="string"?hr(e,n):void 0;function C4(n,e,t,i,s){for(const l of e){const o=$4(t,l);if(o){n.add(o);const r=Wk(o._fallback,t,s);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Ju(n,e,t,i){const s=e._rootScopes,l=Wk(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Qc(r,o,t,l||t,i);return a===null||typeof l<"u"&&l!==t&&(a=Qc(r,o,l,a,i),a===null)?!1:Yu(Array.from(r),[""],s,l,()=>O4(e,t,i))}function Qc(n,e,t,i,s){for(;t;)t=C4(n,e,t,i,s);return t}function O4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return cn(s)&&St(t)?t:s||{}}function M4(n,e,t,i){let s;for(const l of e)if(s=Yk(v4(l,n),t),typeof s<"u")return Ku(n,s)?Ju(t,i,n,s):s}function Yk(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function xc(n){let e=n._keys;return e||(e=n._keys=E4(n._scopes)),e}function E4(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}const D4=Number.EPSILON||1e-14,os=(n,e)=>en==="x"?"y":"x";function I4(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Xa(l,s),a=Xa(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function L4(n,e,t){const i=n.length;let s,l,o,r,a,u=os(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")P4(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;ln.ownerDocument.defaultView.getComputedStyle(n,null);function F4(n,e){return Nr(n).getPropertyValue(e)}const q4=["top","right","bottom","left"];function Ml(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=q4[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const j4=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function H4(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(j4(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function vi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Nr(t),l=s.boxSizing==="border-box",o=Ml(s,"padding"),r=Ml(s,"border","width"),{x:a,y:u,box:f}=H4(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return l&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function z4(n,e,t){let i,s;if(e===void 0||t===void 0){const l=n&&Gu(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Nr(l),a=Ml(r,"border","width"),u=Ml(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=br(r.maxWidth,l,"clientWidth"),s=br(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||gr,maxHeight:s||gr}}const No=n=>Math.round(n*10)/10;function U4(n,e,t,i){const s=Nr(n),l=Ml(s,"margin"),o=br(s.maxWidth,n,"clientWidth")||gr,r=br(s.maxHeight,n,"clientHeight")||gr,a=z4(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const d=Ml(s,"border","width"),m=Ml(s,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?u/i:f-l.height),u=No(Math.min(u,o,a.maxWidth)),f=No(Math.min(f,r,a.maxHeight)),u&&!f&&(f=No(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=No(Math.floor(f*i))),{width:u,height:f}}function ed(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const V4=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Zu()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function td(n,e){const t=F4(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function B4(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function W4(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=vl(n,s,t),r=vl(s,l,t),a=vl(l,e,t),u=vl(o,r,t),f=vl(r,a,t);return vl(u,f,t)}const Y4=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},K4=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function ua(n,e,t){return n?Y4(e,t):K4()}function J4(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Z4(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Jk(n){return n==="angle"?{between:Nk,compare:VS,normalize:yi}:{between:Rk,compare:(e,t)=>e-t,normalize:e=>e}}function nd({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function G4(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=Jk(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(s,$,k)&&r(s,$)!==0,O=()=>r(l,k)===0||a(l,$,k),E=()=>g||T(),L=()=>!g||O();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(k=u(S[i]),k!==$&&(g=a(k,s,l),_===null&&E()&&(_=r(k,s)===0?I:A),_!==null&&L()&&(h.push(nd({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,$=k));return _!==null&&h.push(nd({start:_,end:c,loop:d,count:o,style:m})),h}function Gk(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function Q4(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function x4(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=X4(t,s,l,i);if(i===!0)return id(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=qk.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ni=new iT;const sd="transparent",lT={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Yc(n||sd),s=i.valid&&Yc(e||sd);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class sT{constructor(e,t,i,s){const l=t[i];s=Ao([e.to,s,l,e.from]);const o=Ao([e.from,l,s]);this._active=!0,this._fn=e.fn||lT[e.type||typeof o],this._easing=Ns[e.easing]||Ns.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Ao([e.to,t,s,e.from]),this._from=Ao([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s{const l=e[s];if(!St(l))return;const o={};for(const r of t)o[r]=l[r];(cn(l.properties)&&l.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,s=rT(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&oT(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new sT(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Ni.add(this._chart,i),!0}}function oT(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function ud(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=cT(l,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function mT(n,e){return Pl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function hT(n,e,t){return Pl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function ys(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t],l[i]._visualValues!==void 0&&l[i]._visualValues[t]!==void 0&&delete l[i]._visualValues[t]}}}const da=n=>n==="reset"||n==="none",fd=(n,e)=>e?n:Object.assign({},n),_T=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:xk(t,!0),values:null};class Fs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=fa(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&ys(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,l=t.xAxisID=Et(i.xAxisID,ca(e,"x")),o=t.yAxisID=Et(i.yAxisID,ca(e,"y")),r=t.rAxisID=Et(i.rAxisID,ca(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Uc(this._data,this),e._stacked&&ys(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(St(t)){const s=this._cachedMeta;this._data=fT(t,s)}else if(i!==t){if(i){Uc(i,this);const s=this._cachedMeta;ys(s),s._parsed=[]}t&&Object.isExtensible(t)&&KS(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=fa(t.vScale,t),t.stack!==i.stack&&(s=!0,ys(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&(ud(this,t._parsed),t._stacked=fa(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{cn(s[e])?d=this.parseArrayData(i,s,e,t):St(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const m=()=>c[r]===null||u&&c[r]g||c=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s,t),g=u.resolveNamedOptions(d,m,h,c);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(fd(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new Qk(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||da(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){da(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!da(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r0&&this.getParsed(t-1);for(let O=0;O<$;++O){const E=e[O],L=k?E:{};if(O=S){L.skip=!0;continue}const I=this.getParsed(O),A=Vt(I[m]),P=L[d]=o.getPixelForValue(I[d],O),N=L[m]=l||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],O);L.skip=isNaN(P)||isNaN(N)||A,L.stop=O>0&&Math.abs(I[d]-T[d])>_,g&&(L.parsed=I,L.raw=u.data[O]),c&&(L.options=f||this.resolveDataElementOptions(O,E.active?"active":s)),k||this.updateElement(E,O,L,s),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}pt(er,"id","line"),pt(er,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(er,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function yl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xu{constructor(e){pt(this,"options");this.options=e||{}}static override(e){Object.assign(Xu.prototype,e)}init(){}formats(){return yl()}parse(){return yl()}format(){return yl()}add(){return yl()}diff(){return yl()}startOf(){return yl()}endOf(){return yl()}}var ey={_date:Xu};function gT(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale,a=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const u=r._reversePixels?WS:$l;if(i){if(s._sharedOptions){const f=l[0],c=typeof f.getRange=="function"&&f.getRange(e);if(c){const d=u(l,e,t-c),m=u(l,e,t+c);return{lo:d.lo,hi:m.hi}}}}else{const f=u(l,e,t);if(a){const{vScale:c}=s._cachedMeta,{_parsed:d}=n,m=d.slice(0,f.lo+1).reverse().findIndex(g=>!Vt(g[c.axis]));f.lo-=Math.max(0,m);const h=d.slice(f.hi).findIndex(g=>!Vt(g[c.axis]));f.hi+=Math.max(0,h)}return f}}return{lo:0,hi:l.length-1}}function Rr(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o]&&a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var vT={modes:{index(n,e,t,i){const s=vi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?pa(n,s,l,i,o):ma(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=vi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?pa(n,s,l,i,o):ma(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function dd(n,e){return n.filter(t=>ty.indexOf(t.pos)===-1&&t.box.axis===e)}function ws(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function wT(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=ws(vs(e,"left"),!0),s=ws(vs(e,"right")),l=ws(vs(e,"top"),!0),o=ws(vs(e,"bottom")),r=dd(e,"x"),a=dd(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:vs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function pd(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function ny(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function CT(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!St(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&ny(o,l.getPadding());const r=Math.max(0,e.outerWidth-pd(o,n,"left","right")),a=Math.max(0,e.outerHeight-pd(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function OT(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function MT(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Es(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,_)=>_.box.options&&_.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);ny(d,rl(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),h=TT(a.concat(u),c);Es(r.fullSize,m,c,h),Es(a,m,c,h),Es(u,m,c,h)&&Es(a,m,c,h),OT(m),md(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,md(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},gt(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class iy{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class ET extends iy{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const tr="$chartjs",DT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hd=n=>n===null||n==="";function IT(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[tr]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",hd(s)){const l=td(n,"width");l!==void 0&&(n.width=l)}if(hd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=td(n,"height");l!==void 0&&(n.height=l)}return n}const ly=V4?{passive:!0}:!1;function LT(n,e,t){n&&n.addEventListener(e,t,ly)}function AT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,ly)}function PT(n,e){const t=DT[n.type]||n.type,{x:i,y:s}=vi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function kr(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function NT(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||kr(r.addedNodes,i),o=o&&!kr(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function RT(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||kr(r.removedNodes,i),o=o&&!kr(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const Qs=new Map;let _d=0;function sy(){const n=window.devicePixelRatio;n!==_d&&(_d=n,Qs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function FT(n,e){Qs.size||window.addEventListener("resize",sy),Qs.set(n,e)}function qT(n){Qs.delete(n),Qs.size||window.removeEventListener("resize",sy)}function jT(n,e,t){const i=n.canvas,s=i&&Gu(i);if(!s)return;const l=jk((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),FT(n,l),o}function ha(n,e,t){t&&t.disconnect(),e==="resize"&&qT(n)}function HT(n,e,t){const i=n.canvas,s=jk(l=>{n.ctx!==null&&t(PT(l,n))},n);return LT(i,e,s),s}class zT extends iy{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(IT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[tr])return!1;const i=t[tr].initial;["height","width"].forEach(l=>{const o=i[l];Vt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[tr],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:NT,detach:RT,resize:jT}[t]||HT;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:ha,detach:ha,resize:ha}[t]||AT)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return U4(e,t,i,s)}isAttached(e){const t=e&&Gu(e);return!!(t&&t.isConnected)}}function UT(n){return!Zu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?ET:zT}class Ll{constructor(){pt(this,"x");pt(this,"y");pt(this,"active",!1);pt(this,"options");pt(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Xs(this.x)&&Xs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(l=>{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}pt(Ll,"defaults",{}),pt(Ll,"defaultRoutes");function VT(n,e){const t=n.options.ticks,i=BT(n),s=Math.min(t.maxTicksLimit||i,i),l=t.major.enabled?YT(e):[],o=l.length,r=l[0],a=l[o-1],u=[];if(o>s)return KT(e,u,l,o/s),u;const f=WT(l,e,s);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(jo(e,u,f,Vt(m)?0:r-m,r),c=0,d=o-1;cs)return a}return Math.max(s,1)}function YT(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,gd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,bd=(n,e)=>Math.min(e||n,n);function kd(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function XT(n,e){gt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:gi(t,gi(i,t)),max:gi(i,gi(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=y4(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=pi(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ss(e.grid)-t.padding-yd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=zS(Math.min(Math.asin(pi((f.highest.height+6)/r,-1,1)),Math.asin(pi(a/u,-1,1))-Math.asin(pi(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ft(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=yd(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ss(l)+a):(e.height=this.maxHeight,e.width=Ss(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Tl(this.labelRotation),g=Math.cos(h),_=Math.sin(h);if(r){const k=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,_,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=s*e.width,m=i*t.height):(d=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ft(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[A]||0,height:r[A]||0});return{first:I(0),last:I(t-1),widest:I(E),highest:I(L),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return BS(this._alignToPixels?kl(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o,border:r}=s,a=l.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ss(l),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,k=function(J){return kl(i,J,g)};let S,$,T,O,E,L,I,A,P,N,R,z;if(o==="top")S=k(this.bottom),L=this.bottom-d,A=S-_,N=k(e.top)+_,z=e.bottom;else if(o==="bottom")S=k(this.top),N=e.top,z=k(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=k(this.right),E=this.right-d,I=S-_,P=k(e.left)+_,R=e.right;else if(o==="right")S=k(this.left),P=e.left,R=k(e.right)-_,E=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(St(o)){const J=Object.keys(o)[0],V=o[J];S=k(this.chart.scales[J].getPixelForValue(V))}N=e.top,z=e.bottom,L=S+_,A=L+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(St(o)){const J=Object.keys(o)[0],V=o[J];S=k(this.chart.scales[J].getPixelForValue(V))}E=S-_,I=E-d,P=e.left,R=e.right}const F=Et(s.ticks.maxTicksLimit,c),B=Math.max(1,Math.ceil(c/F));for($=0;$0&&(ct-=Ye/2);break}pe={left:ct,top:Ke,width:Ye+ae.width,height:Ce+ae.height,color:B.backdropColor}}_.push({label:T,font:A,textOffset:R,options:{rotation:g,color:V,strokeColor:Z,strokeWidth:G,textAlign:de,textBaseline:z,translation:[O,E],backdrop:pe}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Tl(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:l}}=this.options,o=this._getLabelSizes(),r=e+l,a=o.widest.width;let u,f;return t==="left"?s?(f=this.right+l,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?s?(f=this.left+l,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:l,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,l,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(l=>l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(l)}}]:[{z:i,draw:l=>{this.drawBackground(),this.drawGrid(l),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:t,draw:l=>{this.drawLabels(l)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");on.route(l,s,a,r)})}function l5(n){return"id"in n&&"defaults"in n}class s5{constructor(){this.controllers=new Ho(Fs,"datasets",!0),this.elements=new Ho(Ll,"elements"),this.plugins=new Ho(Object,"plugins"),this.scales=new Ho(mo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):gt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=zu(e);ft(i["before"+s],[],i),t[e](i),ft(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;tl.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function r5(n){const e={},t=[],i=Object.keys(ki.plugins.items);for(let l=0;l1&&vd(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function wd(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function m5(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return wd(n,"x",t[0])||wd(n,"y",t[0])}return{}}function h5(n,e){const t=Il[n.type]||{scales:{}},i=e.scales||{},s=eu(n.type,e),l=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!St(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=tu(o,r,m5(o,n),on.scales[r.type]),u=d5(a,s),f=t.scales||{};l[o]=Ps(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||eu(r,e),f=(Il[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=c5(c,a),m=o[d+"AxisID"]||d;l[m]=l[m]||Object.create(null),Ps(l[m],[{axis:d},i[m],f[c]])})}),Object.keys(l).forEach(o=>{const r=l[o];Ps(r,[on.scales[r.type],on.scale])}),l}function oy(n){const e=n.options||(n.options={});e.plugins=Et(e.plugins,{}),e.scales=h5(n,e)}function ry(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function _5(n){return n=n||{},n.data=ry(n.data),oy(n),n}const Sd=new Map,ay=new Set;function zo(n,e){let t=Sd.get(n);return t||(t=e(),Sd.set(n,t),ay.add(t)),t}const Ts=(n,e,t)=>{const i=hr(e,t);i!==void 0&&n.add(i)};class g5{constructor(e){this._config=_5(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=ry(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),oy(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return zo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return zo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return zo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return zo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Ts(a,e,c))),f.forEach(c=>Ts(a,s,c)),f.forEach(c=>Ts(a,Il[l]||{},c)),f.forEach(c=>Ts(a,on,c)),f.forEach(c=>Ts(a,Qa,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),ay.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Il[t]||{},on.datasets[t]||{},{type:t},on,Qa]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Td(this._resolverCache,e,s);let a=o;if(k5(o,t)){l.$shared=!1,i=sl(i)?i():i;const u=this.createResolver(e,i,r);a=ss(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Td(this._resolverCache,e,i);return St(t)?ss(l,t,void 0,s):l}}function Td(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Yu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const b5=n=>St(n)&&Object.getOwnPropertyNames(n).some(e=>sl(n[e]));function k5(n,e){const{isScriptable:t,isIndexable:i}=Vk(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(sl(r)||b5(r))||o&&cn(r))return!0}return!1}var y5="4.4.9";const v5=["top","bottom","left","right","chartArea"];function $d(n,e){return n==="top"||n==="bottom"||v5.indexOf(n)===-1&&e==="x"}function Cd(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Od(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ft(t&&t.onComplete,[n],e)}function w5(n){const e=n.chart,t=e.options.animation;ft(t&&t.onProgress,[n],e)}function uy(n){return Zu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const nr={},Md=n=>{const e=uy(n);return Object.values(nr).filter(t=>t.canvas===e).pop()};function S5(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function T5(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class wi{static register(...e){ki.add(...e),Ed()}static unregister(...e){ki.remove(...e),Ed()}constructor(e,t){const i=this.config=new g5(t),s=uy(e),l=Md(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||UT(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=MS(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new o5,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ZS(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],nr[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Ni.listen(this,"complete",Od),Ni.listen(this,"progress",w5),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Vt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ki}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ed(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zc(this.canvas,this.ctx),this}stop(){return Ni.stop(this),this}resize(e,t){Ni.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ed(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ft(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=tu(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),gt(l,o=>{const r=o.options,a=r.id,u=tu(a,r),f=Et(r.type,o.dtype);(r.position===void 0||$d(r.position,u)!==$d(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ki.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(s,(o,r)=>{o||delete i[r]}),gt(i,o=>{qo.configure(this,o,o.options),qo.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Cd("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{qo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!qc(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;S5(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;qo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i={meta:e,index:e.index,cancelable:!0},s=Xk(this,e);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Bu(t,s),e.controller.draw(),s&&Wu(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return ls(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=vT.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Pl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);_r(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Ni.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};gt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!pr(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=PS(e),u=T5(e,this._lastEvent,i,a);i&&(this._lastEvent=null,ft(l.onHover,[e,r,this],this),a&&ft(l.onClick,[e,r,this],this));const f=!pr(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}pt(wi,"defaults",on),pt(wi,"instances",nr),pt(wi,"overrides",Il),pt(wi,"registry",ki),pt(wi,"version",y5),pt(wi,"getChart",Md);function Ed(){return gt(wi.instances,n=>n._plugins.invalidate())}function fy(n,e,t=e){n.lineCap=Et(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Et(t.borderDash,e.borderDash)),n.lineDashOffset=Et(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Et(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Et(t.borderWidth,e.borderWidth),n.strokeStyle=Et(t.borderColor,e.borderColor)}function $5(n,e,t){n.lineTo(t.x,t.y)}function C5(n){return n.stepped?f4:n.tension||n.cubicInterpolationMode==="monotone"?c4:$5}function cy(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%l,$=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=s[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=s[S(d)],m.skip)continue;const T=m.x,O=m.y,E=T|0;E===h?(O_&&(_=O),f=(c*f+T)/++c):($(),n.lineTo(T,O),h=E,c=0,g=_=O),k=O}$()}function nu(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?M5:O5}function E5(n){return n.stepped?B4:n.tension||n.cubicInterpolationMode==="monotone"?W4:vl}function D5(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),fy(n,e.options),n.stroke(s)}function I5(n,e,t,i){const{segments:s,options:l}=e,o=nu(e);for(const r of s)fy(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const L5=typeof Path2D=="function";function A5(n,e,t,i){L5&&!e.options.segment?D5(n,e,t,i):I5(n,e,t,i)}class xi extends Ll{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;R4(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=x4(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=Gk(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=E5(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Dd(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Qu(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function Qu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Id(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function dy(n,e){let t=[],i=!1;return cn(n)?(i=!0,t=n):t=N5(n,e),t.length?new xi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ld(n){return n&&n.fill!==!1}function R5(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Tn(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function F5(n,e,t){const i=z5(n);if(St(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Tn(s)&&Math.floor(s)===s?q5(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function q5(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function j5(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:St(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function H5(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:St(n)?i=n.value:i=e.getBaseValue(),i}function z5(n){const e=n.options,t=e.fill;let i=Et(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function U5(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=V5(e,t);r.push(dy({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&_a(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;Ld(l)&&_a(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Ld(i)||t.drawTime!=="beforeDatasetDraw"||_a(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ds={average(n){if(!n.length)return!1;let e,t,i=new Set,s=0,l=0;for(e=0,t=n.length;er+a)/i.size,y:s/l}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,l,o,r;for(l=0,o=n.length;l-1?n.split(` `):n}function e6(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function Rd(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=$i(e.bodyFont),u=$i(e.titleFont),f=$i(e.footerFont),c=l.length,d=s.length,m=i.length,h=rl(e.padding);let g=h.height,_=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,gt(n.title,$),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,$),gt(T.lines,$),gt(T.after,$)}),S=0,t.font=f.string,gt(n.footer,$),t.restore(),_+=h.width,{width:_,height:g}}function t6(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function n6(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function i6(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),n6(u,n,e,t)&&(u="center"),u}function Fd(n,e,t){const i=t.yAlign||e.yAlign||t6(n,t);return{xAlign:t.xAlign||e.xAlign||i6(n,e,t,i),yAlign:i}}function l6(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function s6(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function qd(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=xo(o);let h=l6(e,r);const g=s6(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:pi(h,0,i.width-e.width),y:pi(g,0,i.height-e.height)}}function Uo(n,e,t){const i=rl(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function jd(n){return bi([],Ri(n))}function o6(n,e,t){return Pl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Hd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const my={beforeTitle:Pi,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?my[e].call(t,i):s}class lu extends Ll{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new Qk(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=o6(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=Pn(i,"beforeTitle",this,e),l=Pn(i,"title",this,e),o=Pn(i,"afterTitle",this,e);let r=[];return r=bi(r,Ri(s)),r=bi(r,Ri(l)),r=bi(r,Ri(o)),r}getBeforeBody(e,t){return jd(Pn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,s=[];return gt(e,l=>{const o={before:[],lines:[],after:[]},r=Hd(i,l);bi(o.before,Ri(Pn(r,"beforeLabel",this,l))),bi(o.lines,Pn(r,"label",this,l)),bi(o.after,Ri(Pn(r,"afterLabel",this,l))),s.push(o)}),s}getAfterBody(e,t){return jd(Pn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,s=Pn(i,"beforeFooter",this,e),l=Pn(i,"footer",this,e),o=Pn(i,"afterFooter",this,e);let r=[];return r=bi(r,Ri(s)),r=bi(r,Ri(l)),r=bi(r,Ri(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),gt(r,f=>{const c=Hd(e.callbacks,f);s.push(Pn(c,"labelColor",this,f)),l.push(Pn(c,"labelPointStyle",this,f)),o.push(Pn(c,"labelTextColor",this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=Ds[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Rd(this,i),u=Object.assign({},r,a),f=Fd(this.chart,i,u),c=qd(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=xo(r),{x:d,y:m}=e,{width:h,height:g}=t;let _,k,S,$,T,O;return l==="center"?(T=m+g/2,s==="left"?(_=d,k=_-o,$=T+o,O=T-o):(_=d+h,k=_+o,$=T-o,O=T+o),S=_):(s==="left"?k=d+Math.max(a,f)+o:s==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,l==="top"?($=m,T=$-o,_=k-o,S=k+o):($=m+g,T=$+o,_=k+o,S=k-o),O=$),{x1:_,x2:k,x3:S,y1:$,y2:T,y3:O}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=ua(i.rtl,this.x,this.width);for(e.x=Uo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=$i(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Xc(e,{x:g,y:h,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Xc(e,{x:_,y:h+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(g,h,u,a),e.strokeRect(g,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,h+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=$i(i.bodyFont);let d=c.lineHeight,m=0;const h=ua(i.rtl,this.x,this.width),g=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+l},_=h.textAlign(o);let k,S,$,T,O,E,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Uo(this,_,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=s.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=Ds[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Rd(this,e),a=Object.assign({},o,this._size),u=Fd(t,e,a),f=qd(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=rl(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),J4(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),Z4(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!pr(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!pr(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=Ds[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}pt(lu,"positioners",Ds);var r6={id:"tooltip",_element:lu,positioners:Ds,afterInit(n,e,t){t&&(n.tooltip=new lu({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:my},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function a6(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=l||1,h=f-1,{min:g,max:_}=e,k=!Vt(o),S=!Vt(r),$=!Vt(u),T=(_-g)/(c+1);let O=Hc((_-g)/h/m)*m,E,L,I,A;if(O<1e-14&&!k&&!S)return[{value:g},{value:_}];A=Math.ceil(_/O)-Math.floor(g/O),A>h&&(O=Hc(A*O/h/m)*m),Vt(a)||(E=Math.pow(10,a),O=Math.ceil(O*E)/E),s==="ticks"?(L=Math.floor(g/O)*O,I=Math.ceil(_/O)*O):(L=g,I=_),k&&S&&l&&jS((r-o)/l,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,L=o,I=r):$?(L=k?o:L,I=S?r:I,A=u-1,O=(I-L)/A):(A=(I-L)/O,Ol(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(zc(O),zc(L));E=Math.pow(10,Vt(a)?P:a),L=Math.round(L*E)/E,I=Math.round(I*E)/E;let N=0;for(k&&(d&&L!==o?(t.push({value:o}),Lr)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ol(t[t.length-1].value,r,zd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function zd(n,e,{horizontal:t,minRotation:i}){const s=Tl(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class u6 extends mo{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Vt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:s,max:l}=this;const o=a=>s=t?s:a,r=a=>l=i?l:a;if(e){const a=ol(s),u=ol(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=l===0?1:Math.abs(l*.05);r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=a6(s,l);return e.bounds==="ticks"&&HS(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Hk(e,this.chart.options.locale,this.options.ticks.format)}}class su extends u6{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Tn(e)?e:0,this.max=Tn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Tl(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}pt(su,"id","linear"),pt(su,"defaults",{ticks:{callback:zk.formatters.numeric}});const Fr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},jn=Object.keys(Fr);function Ud(n,e){return n-e}function Vd(n,e){if(Vt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Tn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Xs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function Bd(n,e,t,i){const s=jn.length;for(let l=jn.indexOf(n);l=jn.indexOf(t);l--){const o=jn[l];if(Fr[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return jn[t?jn.indexOf(t):0]}function c6(n){for(let e=jn.indexOf(n)+1,t=jn.length;e=e?t[i]:t[s];n[l]=!0}}function d6(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Yd(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=pi(t,0,o),i=pi(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||Bd(l.minUnit,t,i,this._getLabelCapacity(t)),r=Et(s.ticks.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Xs(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const s=this.options.time.displayFormats,l=this._unit,o=t||s[l];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.ticks.callback;if(o)return ft(o,[e,t,i],this);const r=l.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,s||(m?c:f))}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=$l(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=$l(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class Kd extends xs{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Vo(t,this.min),this._tableRange=Vo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;os-l)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Vo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Vo(this._table,i*this._tableRange+this._minPos,!0)}}pt(Kd,"id","timeseries"),pt(Kd,"defaults",xs.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license */const p6={datetime:Xe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Xe.TIME_WITH_SECONDS,minute:Xe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};ey._date.override({_id:"luxon",_create:function(n){return Xe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return p6},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Xe.fromFormat(n,e,t):n=Xe.fromISO(n,t):n instanceof Date?n=Xe.fromJSDate(n,t):i==="object"&&!(n instanceof Xe)&&(n=Xe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});var r9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function m6(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hy={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */(function(n){(function(e,t,i,s){var l=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,u=Math.abs,f=Date.now;function c(K,Q,ie){return setTimeout($(K,ie),Q)}function d(K,Q,ie){return Array.isArray(K)?(m(K,ie[Q],ie),!0):!1}function m(K,Q,ie){var he;if(K)if(K.forEach)K.forEach(Q,ie);else if(K.length!==s)for(he=0;he\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",_t=e.console&&(e.console.warn||e.console.log);return _t&&_t.call(e.console,he,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===s||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ie=Object(Q),he=1;he-1}function P(K){return K.trim().split(/\s+/g)}function N(K,Q,ie){if(K.indexOf&&!ie)return K.indexOf(Q);for(var he=0;heCn[Q]}),he}function F(K,Q){for(var ie,he,Ae=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze1&&!ie.firstMultiple?ie.firstMultiple=Gt(Q):Ae===1&&(ie.firstMultiple=!1);var Ze=ie.firstInput,_t=ie.firstMultiple,fn=_t?_t.center:Ze.center,hn=Q.center=gn(he);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=yt(fn,hn),Q.distance=ri(fn,hn),Pe(ie,Q),Q.offsetDirection=Ei(Q.deltaX,Q.deltaY);var Cn=dn(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Cn.x,Q.overallVelocityY=Cn.y,Q.overallVelocity=u(Cn.x)>u(Cn.y)?Cn.x:Cn.y,Q.scale=_t?un(_t.pointers,he):1,Q.rotation=_t?Zn(_t.pointers,he):0,Q.maxPointers=ie.prevInput?Q.pointers.length>ie.prevInput.maxPointers?Q.pointers.length:ie.prevInput.maxPointers:Q.pointers.length,jt(ie,Q);var _i=K.element;I(Q.srcEvent.target,_i)&&(_i=Q.srcEvent.target),Q.target=_i}function Pe(K,Q){var ie=Q.center,he=K.offsetDelta||{},Ae=K.prevDelta||{},Ze=K.prevInput||{};(Q.eventType===et||Ze.eventType===Be)&&(Ae=K.prevDelta={x:Ze.deltaX||0,y:Ze.deltaY||0},he=K.offsetDelta={x:ie.x,y:ie.y}),Q.deltaX=Ae.x+(ie.x-he.x),Q.deltaY=Ae.y+(ie.y-he.y)}function jt(K,Q){var ie=K.lastInterval||Q,he=Q.timeStamp-ie.timeStamp,Ae,Ze,_t,fn;if(Q.eventType!=ut&&(he>ct||ie.velocity===s)){var hn=Q.deltaX-ie.deltaX,Cn=Q.deltaY-ie.deltaY,_i=dn(he,hn,Cn);Ze=_i.x,_t=_i.y,Ae=u(_i.x)>u(_i.y)?_i.x:_i.y,fn=Ei(hn,Cn),K.lastInterval=Q}else Ae=ie.velocity,Ze=ie.velocityX,_t=ie.velocityY,fn=ie.direction;Q.velocity=Ae,Q.velocityX=Ze,Q.velocityY=_t,Q.direction=fn}function Gt(K){for(var Q=[],ie=0;ie=u(Q)?K<0?Ue:De:Q<0?ot:Ie}function ri(K,Q,ie){ie||(ie=zt);var he=Q[ie[0]]-K[ie[0]],Ae=Q[ie[1]]-K[ie[1]];return Math.sqrt(he*he+Ae*Ae)}function yt(K,Q,ie){ie||(ie=zt);var he=Q[ie[0]]-K[ie[0]],Ae=Q[ie[1]]-K[ie[1]];return Math.atan2(Ae,he)*180/Math.PI}function Zn(K,Q){return yt(Q[1],Q[0],Ne)+yt(K[1],K[0],Ne)}function un(K,Q){return ri(Q[0],Q[1],Ne)/ri(K[0],K[1],Ne)}var It={mousedown:et,mousemove:xe,mouseup:Be},Di="mousedown",ul="mousemove mouseup";function Ui(){this.evEl=Di,this.evWin=ul,this.pressed=!1,Me.apply(this,arguments)}S(Ui,Me,{handler:function(Q){var ie=It[Q.type];ie&et&&Q.button===0&&(this.pressed=!0),ie&xe&&Q.which!==1&&(ie=Be),this.pressed&&(ie&Be&&(this.pressed=!1),this.callback(this.manager,ie,{pointers:[Q],changedPointers:[Q],pointerType:Ye,srcEvent:Q}))}});var Vi={pointerdown:et,pointermove:xe,pointerup:Be,pointercancel:ut,pointerout:ut},fl={2:ae,3:Ce,4:Ye,5:Ke},An="pointerdown",Fl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(An="MSPointerDown",Fl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=An,this.evWin=Fl,Me.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,Me,{handler:function(Q){var ie=this.store,he=!1,Ae=Q.type.toLowerCase().replace("ms",""),Ze=Vi[Ae],_t=fl[Q.pointerType]||Q.pointerType,fn=_t==ae,hn=N(ie,Q.pointerId,"pointerId");Ze&et&&(Q.button===0||fn)?hn<0&&(ie.push(Q),hn=ie.length-1):Ze&(Be|ut)&&(he=!0),!(hn<0)&&(ie[hn]=Q,this.callback(this.manager,Ze,{pointers:ie,changedPointers:[Q],pointerType:_t,srcEvent:Q}),he&&ie.splice(hn,1))}});var X={touchstart:et,touchmove:xe,touchend:Be,touchcancel:ut},ee="touchstart",le="touchstart touchmove touchend touchcancel";function Se(){this.evTarget=ee,this.evWin=le,this.started=!1,Me.apply(this,arguments)}S(Se,Me,{handler:function(Q){var ie=X[Q.type];if(ie===et&&(this.started=!0),!!this.started){var he=Fe.call(this,Q,ie);ie&(Be|ut)&&he[0].length-he[1].length===0&&(this.started=!1),this.callback(this.manager,ie,{pointers:he[0],changedPointers:he[1],pointerType:ae,srcEvent:Q})}}});function Fe(K,Q){var ie=R(K.touches),he=R(K.changedTouches);return Q&(Be|ut)&&(ie=z(ie.concat(he),"identifier")),[ie,he]}var Ve={touchstart:et,touchmove:xe,touchend:Be,touchcancel:ut},rt="touchstart touchmove touchend touchcancel";function Je(){this.evTarget=rt,this.targetIds={},Me.apply(this,arguments)}S(Je,Me,{handler:function(Q){var ie=Ve[Q.type],he=ue.call(this,Q,ie);he&&this.callback(this.manager,ie,{pointers:he[0],changedPointers:he[1],pointerType:ae,srcEvent:Q})}});function ue(K,Q){var ie=R(K.touches),he=this.targetIds;if(Q&(et|xe)&&ie.length===1)return he[ie[0].identifier]=!0,[ie,ie];var Ae,Ze,_t=R(K.changedTouches),fn=[],hn=this.target;if(Ze=ie.filter(function(Cn){return I(Cn.target,hn)}),Q===et)for(Ae=0;Ae-1&&he.splice(Ze,1)};setTimeout(Ae,ye)}}function pn(K){for(var Q=K.srcEvent.clientX,ie=K.srcEvent.clientY,he=0;he-1&&this.requireFail.splice(Q,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(K){return!!this.simultaneous[K.id]},emit:function(K){var Q=this,ie=this.state;function he(Ae){Q.manager.emit(Ae,K)}ie=Bi&&he(Q.options.event+ff(ie))},tryEmit:function(K){if(this.canEmit())return this.emit(K);this.state=hi},canEmit:function(){for(var K=0;KQ.threshold&&Ae&Q.direction},attrTest:function(K){return ai.prototype.attrTest.call(this,K)&&(this.state&Gn||!(this.state&Gn)&&this.directionTest(K))},emit:function(K){this.pX=K.deltaX,this.pY=K.deltaY;var Q=cf(K.direction);Q&&(K.additionalEvent=this.options.event+Q),this._super.emit.call(this,K)}});function Hr(){ai.apply(this,arguments)}S(Hr,ai,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ii]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.scale-1)>this.options.threshold||this.state&Gn)},emit:function(K){if(K.scale!==1){var Q=K.scale<1?"in":"out";K.additionalEvent=this.options.event+Q}this._super.emit.call(this,K)}});function zr(){Ai.apply(this,arguments),this._timer=null,this._input=null}S(zr,Ai,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[go]},process:function(K){var Q=this.options,ie=K.pointers.length===Q.pointers,he=K.distanceQ.time;if(this._input=K,!he||!ie||K.eventType&(Be|ut)&&!Ae)this.reset();else if(K.eventType&et)this.reset(),this._timer=c(function(){this.state=Li,this.tryEmit()},Q.time,this);else if(K.eventType&Be)return Li;return hi},reset:function(){clearTimeout(this._timer)},emit:function(K){this.state===Li&&(K&&K.eventType&Be?this.manager.emit(this.options.event+"up",K):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Ur(){ai.apply(this,arguments)}S(Ur,ai,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ii]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.rotation)>this.options.threshold||this.state&Gn)}});function Vr(){ai.apply(this,arguments)}S(Vr,ai,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:We|Te,pointers:1},getTouchAction:function(){return yo.prototype.getTouchAction.call(this)},attrTest:function(K){var Q=this.options.direction,ie;return Q&(We|Te)?ie=K.overallVelocity:Q&We?ie=K.overallVelocityX:Q&Te&&(ie=K.overallVelocityY),this._super.attrTest.call(this,K)&&Q&K.offsetDirection&&K.distance>this.options.threshold&&K.maxPointers==this.options.pointers&&u(ie)>this.options.velocity&&K.eventType&Be},emit:function(K){var Q=cf(K.offsetDirection);Q&&this.manager.emit(this.options.event+Q,K),this.manager.emit(this.options.event,K)}});function vo(){Ai.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(vo,Ai,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[hs]},process:function(K){var Q=this.options,ie=K.pointers.length===Q.pointers,he=K.distancen&&n.enabled&&n.modifierKey,_y=(n,e)=>n&&e[n+"Key"],xu=(n,e)=>n&&!e[n+"Key"];function al(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ga(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function _6(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function g6({x:n,y:e},t){const i=t.scales,s=Object.keys(i);for(let l=0;l=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function gy(n,e,t){const{mode:i="xy",scaleMode:s,overScaleMode:l}=n||{},o=g6(e,t),r=ga(i,t),a=ga(s,t);if(l){const f=ga(l,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return gt(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const ou=new WeakMap;function Zt(n){let e=ou.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},ou.set(n,e)),e}function b6(n){ou.delete(n)}function by(n,e,t,i){const s=Math.max(0,Math.min(1,(n-e)/t||0)),l=1-s;return{min:i*s,max:i*l}}function ky(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function yy(n,e,t){const i=n.max-n.min,s=i*(e-1),l=ky(n,t);return by(l,n.min,i,s)}function k6(n,e,t){const i=ky(n,t);if(i===void 0)return{min:n.min,max:n.max};const s=Math.log10(n.min),l=Math.log10(n.max),o=Math.log10(i),r=l-s,a=r*(e-1),u=by(o,s,r,a);return{min:Math.pow(10,s+u.min),max:Math.pow(10,l-u.max)}}function y6(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Jd(n,e,t,i,s){let l=t[i];if(l==="original"){const o=n.originalScaleLimits[e.id][i];l=Et(o.options,o.scale)}return Et(l,s)}function v6(n,e,t){const i=n.getValueForPixel(e),s=n.getValueForPixel(t);return{min:Math.min(i,s),max:Math.max(i,s)}}function w6(n,{min:e,max:t,minLimit:i,maxLimit:s},l){const o=(n-t+e)/2;e-=o,t+=o;const r=l.min.options??l.min.scale,a=l.max.options??l.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),es&&(t=s,e=Math.max(s-n,i)),{min:e,max:t}}function Nl(n,{min:e,max:t},i,s=!1){const l=Zt(n.chart),{options:o}=n,r=y6(n,i),{minRange:a=0}=r,u=Jd(l,n,r,"min",-1/0),f=Jd(l,n,r,"max",1/0);if(s==="pan"&&(ef))return!0;const c=n.max-n.min,d=s?Math.max(t-e,a):c;if(s&&d===a&&c<=a)return!0;const m=w6(d,{min:e,max:t,minLimit:u,maxLimit:f},l.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,l.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function S6(n,e,t,i){const s=yy(n,e,t),l={min:n.min+s.min,max:n.max-s.max};return Nl(n,l,i,!0)}function T6(n,e,t,i){const s=k6(n,e,t);return Nl(n,s,i,!0)}function $6(n,e,t,i){Nl(n,v6(n,e,t),i,!0)}const Zd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function C6(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(l=Math.max(0,l-u),o=r===1?l:l+r,f=l===0),Nl(n,{min:l,max:o},t)||f}const D6={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function vy(n,e,t,i=!1){const{min:s,max:l,options:o}=n,r=o.time&&o.time.round,a=D6[r]||0,u=n.getValueForPixel(n.getPixelForValue(s+a)-e),f=n.getValueForPixel(n.getPixelForValue(l+a)-e);return isNaN(u)||isNaN(f)?!0:Nl(n,{min:u,max:f},t,i?"pan":!1)}function Gd(n,e,t){return vy(n,e,t,!0)}const ru={category:O6,default:S6,logarithmic:T6},au={default:$6},uu={category:E6,default:vy,logarithmic:Gd,timeseries:Gd};function I6(n,e,t){const{id:i,options:{min:s,max:l}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==s||o.max!==l}function Xd(n,e){gt(n,(t,i)=>{e[i]||delete n[i]})}function ds(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:s}=e;return gt(t,function(l){I6(l,i,s)&&(i[l.id]={min:{scale:l.min,options:l.options.min},max:{scale:l.max,options:l.options.max}})}),Xd(i,t),Xd(s,t),i}function Qd(n,e,t,i){const s=ru[n.type]||ru.default;ft(s,[n,e,t,i])}function xd(n,e,t,i){const s=au[n.type]||au.default;ft(s,[n,e,t,i])}function L6(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function ef(n,e,t="none",i="api"){const{x:s=1,y:l=1,focalPoint:o=L6(n)}=typeof e=="number"?{x:e,y:e}:e,r=Zt(n),{options:{limits:a,zoom:u}}=r;ds(n,r);const f=s!==1,c=l!==1,d=gy(u,o,n);gt(d||n.scales,function(m){m.isHorizontal()&&f?Qd(m,s,o,a):!m.isHorizontal()&&c&&Qd(m,l,o,a)}),n.update(t),ft(u.onZoom,[{chart:n,trigger:i}])}function wy(n,e,t,i="none",s="api"){const l=Zt(n),{options:{limits:o,zoom:r}}=l,{mode:a="xy"}=r;ds(n,l);const u=al(a,"x",n),f=al(a,"y",n);gt(n.scales,function(c){c.isHorizontal()&&u?xd(c,e.x,t.x,o):!c.isHorizontal()&&f&&xd(c,e.y,t.y,o)}),n.update(i),ft(r.onZoom,[{chart:n,trigger:s}])}function A6(n,e,t,i="none",s="api"){var r;const l=Zt(n);ds(n,l);const o=n.scales[e];Nl(o,t,void 0,!0),n.update(i),ft((r=l.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:s}])}function P6(n,e="default"){const t=Zt(n),i=ds(n,t);gt(n.scales,function(s){const l=s.options;i[s.id]?(l.min=i[s.id].min.options,l.max=i[s.id].max.options):(delete l.min,delete l.max),delete t.updatedScaleLimits[s.id]}),n.update(e),ft(t.options.zoom.onZoomComplete,[{chart:n}])}function N6(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:s}=t;return Et(s.options,s.scale)-Et(i.options,i.scale)}function R6(n){const e=Zt(n);let t=1,i=1;return gt(n.scales,function(s){const l=N6(e,s.id);if(l){const o=Math.round(l/(s.max-s.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function ep(n,e,t,i){const{panDelta:s}=i,l=s[n.id]||0;ol(l)===ol(e)&&(e+=l);const o=uu[n.type]||uu.default;ft(o,[n,e,t])?s[n.id]=0:s[n.id]=e}function Sy(n,e,t,i="none"){const{x:s=0,y:l=0}=typeof e=="number"?{x:e,y:e}:e,o=Zt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ds(n,o);const f=s!==0,c=l!==0;gt(t||n.scales,function(d){d.isHorizontal()&&f?ep(d,s,a,o):!d.isHorizontal()&&c&&ep(d,l,a,o)}),n.update(i),ft(u,[{chart:n}])}function Ty(n){const e=Zt(n);ds(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:s,max:l}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:s.scale,max:l.scale}}return t}function F6(n){const e=Zt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function q6(n){const e=Ty(n);for(const t of Object.keys(n.scales)){const{min:i,max:s}=e[t];if(i!==void 0&&n.scales[t].min!==i||s!==void 0&&n.scales[t].max!==s)return!0}return!1}function tp(n){const e=Zt(n);return e.panning||e.dragging}const np=(n,e,t)=>Math.min(t,Math.max(e,n));function Rn(n,e){const{handlers:t}=Zt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function js(n,e,t,i){const{handlers:s,options:l}=Zt(n),o=s[t];if(o&&o.target===e)return;Rn(n,t),s[t]=a=>i(n,a,l),s[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,s[t],{passive:r})}function j6(n,e){const t=Zt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function H6(n,e){const t=Zt(n);!t.dragStart||e.key!=="Escape"||(Rn(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function fu(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return vi(n,e)}function $y(n,e,t){const{onZoomStart:i,onZoomRejected:s}=t;if(i){const l=fu(e,n);if(ft(i,[{chart:n,event:e,point:l}])===!1)return ft(s,[{chart:n,event:e}]),!1}}function z6(n,e){if(n.legend){const l=vi(e,n);if(ls(l,n.legend))return}const t=Zt(n),{pan:i,zoom:s={}}=t.options;if(e.button!==0||_y(eo(i),e)||xu(eo(s.drag),e))return ft(s.onZoomRejected,[{chart:n,event:e}]);$y(n,e,s)!==!1&&(t.dragStart=e,js(n,n.canvas.ownerDocument,"mousemove",j6),js(n,window.document,"keydown",H6))}function U6({begin:n,end:e},t){let i=e.x-n.x,s=e.y-n.y;const l=Math.abs(i/s);l>t?i=Math.sign(i)*Math.abs(s*t):l=0?2-1/(1-l):1+l,r={x:o,y:o,focalPoint:{x:e.clientX-s.left,y:e.clientY-s.top}};ef(n,r,"zoom","wheel"),ft(t,[{chart:n}])}function K6(n,e,t,i){t&&(Zt(n).handlers[e]=_6(()=>ft(t,[{chart:n}]),i))}function J6(n,e){const t=n.canvas,{wheel:i,drag:s,onZoomComplete:l}=e.zoom;i.enabled?(js(n,t,"wheel",Y6),K6(n,"onZoomComplete",l,250)):Rn(n,"wheel"),s.enabled?(js(n,t,"mousedown",z6),js(n,t.ownerDocument,"mouseup",B6)):(Rn(n,"mousedown"),Rn(n,"mousemove"),Rn(n,"mouseup"),Rn(n,"keydown"))}function Z6(n){Rn(n,"mousedown"),Rn(n,"mousemove"),Rn(n,"mouseup"),Rn(n,"wheel"),Rn(n,"click"),Rn(n,"keydown")}function G6(n,e){return function(t,i){const{pan:s,zoom:l={}}=e.options;if(!s||!s.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(xu(eo(s),o)||_y(eo(l.drag),o))?(ft(s.onPanRejected,[{chart:n,event:i}]),!1):!0}}function X6(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),s=t/i;let l,o;return s>.3&&s<1.7?l=o=!0:t>i?l=!0:o=!0,{x:l,y:o}}function Oy(n,e,t){if(e.scale){const{center:i,pointers:s}=t,l=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=X6(s[0],s[1]),a=e.options.zoom.mode,u={x:r.x&&al(a,"x",n)?l:1,y:r.y&&al(a,"y",n)?l:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};ef(n,u,"zoom","pinch"),e.scale=t.scale}}function Q6(n,e,t){if(e.options.zoom.pinch.enabled){const i=vi(t,n);ft(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ft(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function x6(n,e,t){e.scale&&(Oy(n,e,t),e.scale=null,ft(e.options.zoom.onZoomComplete,[{chart:n}]))}function My(n,e,t){const i=e.delta;i&&(e.panning=!0,Sy(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function e$(n,e,t){const{enabled:i,onPanStart:s,onPanRejected:l}=e.options.pan;if(!i)return;const o=t.target.getBoundingClientRect(),r={x:t.center.x-o.left,y:t.center.y-o.top};if(ft(s,[{chart:n,event:t,point:r}])===!1)return ft(l,[{chart:n,event:t}]);e.panScales=gy(e.options.pan,r,n),e.delta={x:0,y:0},My(n,e,t)}function t$(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ft(e.options.pan.onPanComplete,[{chart:n}]))}const cu=new WeakMap;function lp(n,e){const t=Zt(n),i=n.canvas,{pan:s,zoom:l}=e,o=new qs.Manager(i);l&&l.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",r=>Q6(n,t,r)),o.on("pinch",r=>Oy(n,t,r)),o.on("pinchend",r=>x6(n,t,r))),s&&s.enabled&&(o.add(new qs.Pan({threshold:s.threshold,enable:G6(n,t)})),o.on("panstart",r=>e$(n,t,r)),o.on("panmove",r=>My(n,t,r)),o.on("panend",()=>t$(n,t))),cu.set(n,o)}function sp(n){const e=cu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),cu.delete(n))}function n$(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:s,zoom:l}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=l==null?void 0:l.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(s==null?void 0:s.enabled)||(t==null?void 0:t.threshold)!==(s==null?void 0:s.threshold)}var i$="2.2.0";function Bo(n,e,t){const i=t.zoom.drag,{dragStart:s,dragEnd:l}=Zt(n);if(i.drawTime!==e||!l)return;const{left:o,top:r,width:a,height:u}=Cy(n,t.zoom.mode,{dragStart:s,dragEnd:l},i.maintainAspectRatio),f=n.ctx;f.save(),f.beginPath(),f.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",f.fillRect(o,r,a,u),i.borderWidth>0&&(f.lineWidth=i.borderWidth,f.strokeStyle=i.borderColor||"rgba(225,225,225)",f.strokeRect(o,r,a,u)),f.restore()}var l$={id:"zoom",version:i$,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,e,t){const i=Zt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&lp(n,t),n.pan=(s,l,o)=>Sy(n,s,l,o),n.zoom=(s,l)=>ef(n,s,l),n.zoomRect=(s,l,o)=>wy(n,s,l,o),n.zoomScale=(s,l,o)=>A6(n,s,l,o),n.resetZoom=s=>P6(n,s),n.getZoomLevel=()=>R6(n),n.getInitialScaleBounds=()=>Ty(n),n.getZoomedScaleBounds=()=>F6(n),n.isZoomedOrPanned=()=>q6(n),n.isZoomingOrPanning=()=>tp(n)},beforeEvent(n,{event:e}){if(tp(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Zt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Zt(n),s=i.options;i.options=t,n$(s,t)&&(sp(n),lp(n,t)),J6(n,t)},beforeDatasetsDraw(n,e,t){Bo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Bo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Bo(n,"beforeDraw",t)},afterDraw(n,e,t){Bo(n,"afterDraw",t)},stop:function(n){Z6(n),qs&&sp(n),b6(n)},panFunctions:uu,zoomFunctions:ru,zoomRectFunctions:au};function op(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Ct,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&v(e),s&&t&&t.end()}}}function rp(n){let e,t,i;return{c(){e=b("button"),e.textContent="Reset zoom",p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-chart-zoom svelte-kfnurg")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:te,d(s){s&&v(e),t=!1,i()}}}function s$(n){let e,t,i,s,l,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&op(),g=n[3]&&rp(n);return{c(){e=b("div"),t=b("div"),i=W("Found "),s=W(n[1]),l=C(),r=W(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),x(e,"loading",n[2])},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,s),y(t,l),y(t,r),y(e,a),h&&h.m(e,null),y(e,u),y(e,f),n[11](f),y(e,c),g&&g.m(e,null),d||(m=Y(f,"dblclick",n[4]),d=!0)},p(_,[k]){k&2&&se(s,_[1]),k&2&&o!==(o=_[1]==1?"log":"logs")&&se(r,o),k&4&&x(t,"hidden",_[2]),_[2]?h?k&4&&M(h,1):(h=op(),h.c(),M(h,1),h.m(e,u)):h&&(oe(),D(h,1,1,()=>{h=null}),re()),_[3]?g?g.p(_,k):(g=rp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k&4&&x(e,"loading",_[2])},i(_){M(h)},o(_){D(h)},d(_){_&&v(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function o$(n,e,t){let{filter:i=""}=e,{zoom:s={}}=e,{presets:l=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const _=[l,U.normalizeLogsFilter(i)].filter(Boolean).map(k=>"("+k+")").join("&&");return _e.logs.getStats({filter:_}).then(k=>{m(),k=U.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),_e.error(k,!_||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}an(()=>(wi.register(xi,ir,er,su,xs,x5,r6),wi.register(l$),t(9,r=new wi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:_=>{var k;return(k=_.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:_=>{var k;return(k=_.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:_})=>{t(3,c=_.isZoomedOrPanned()),c?(t(5,s.min=U.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",s),t(5,s.max=U.formatToUTCDate(_.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",s)):(s.min||s.max)&&t(5,s={})}}}}}})),()=>r==null?void 0:r.destroy()));function g(_){ne[_?"unshift":"push"](()=>{o=_,t(0,o)})}return n.$$set=_=>{"filter"in _&&t(6,i=_.filter),"zoom"in _&&t(5,s=_.zoom),"presets"in _&&t(7,l=_.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof l<"u")&&d(),n.$$.dirty&1536&&typeof a<"u"&&r&&(t(9,r.data.datasets[0].data=a,r),r.update())},[o,u,f,c,h,s,i,l,d,r,a,g]}class r$ extends we{constructor(e){super(),ve(this,e,o$,s$,be,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function a$(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(s,l){w(s,e,l),y(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(s){s&&v(e)}}}function u$(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,{class:l=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[s]||Prism.languages.javascript,s)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,s=a.language),"class"in a&&t(0,l=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[l,o,i,s]}class tf extends we{constructor(e){super(),ve(this,e,u$,a$,be,{content:2,language:3,class:0})}}function f$(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),s||(l=[Oe(i=Re.call(null,e,n[3]?void 0:n[0])),Y(e,"click",en(n[4]))],s=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Lt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&v(e),s=!1,Ee(l)}}}function c$(n,e,t){let{value:i=""}=e,{tooltip:s="Copy"}=e,{idleClasses:l="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function u(){U.isEmpty(i)||(U.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return an(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,s=f.tooltip),"idleClasses"in f&&t(1,l=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[s,l,o,a,u,i,r]}class Oi extends we{constructor(e){super(),ve(this,e,c$,f$,be,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function ap(n,e,t){const i=n.slice();i[16]=e[t];const s=i[1].data[i[16]];i[17]=s;const l=U.isEmpty(i[17]);i[18]=l;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function d$(n){let e,t,i,s,l,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,B,J,V;d=new Oi({props:{value:n[1].id}}),S=new Ek({props:{level:n[1].level}}),O=new Oi({props:{value:n[1].level}}),N=new Mk({props:{date:n[1].created}}),F=new Oi({props:{value:n[1].created}});let Z=!n[4]&&up(n),G=ce(n[5](n[1].data)),de=[];for(let ae=0;aeD(de[ae],1,1,()=>{de[ae]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="id",l=C(),o=b("td"),r=b("span"),u=W(a),f=C(),c=b("div"),H(d.$$.fragment),m=C(),h=b("tr"),g=b("td"),g.textContent="level",_=C(),k=b("td"),H(S.$$.fragment),$=C(),T=b("div"),H(O.$$.fragment),E=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),H(N.$$.fragment),R=C(),z=b("div"),H(F.$$.fragment),B=C(),Z&&Z.c(),J=C();for(let ae=0;ae{Z=null}),re()):Z?(Z.p(ae,Ce),Ce&16&&M(Z,1)):(Z=up(ae),Z.c(),M(Z,1),Z.m(t,J)),Ce&50){G=ce(ae[5](ae[1].data));let Be;for(Be=0;Be',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function up(n){let e,t,i,s,l,o,r;const a=[h$,m$],u=[];function f(c,d){return c[1].message?0:1}return l=f(n),o=u[l]=a[l](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),s=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(s,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,s),u[l].m(s,null),r=!0},p(c,d){let m=l;l=f(c),l===m?u[l].p(c,d):(oe(),D(u[m],1,1,()=>{u[m]=null}),re(),o=u[l],o?o.p(c,d):(o=u[l]=a[l](c),o.c()),M(o,1),o.m(s,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&v(e),u[l].d()}}}function m$(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function h$(n){let e,t=n[1].message+"",i,s,l,o,r;return o=new Oi({props:{value:n[1].message}}),{c(){e=b("span"),i=W(t),s=C(),l=b("div"),H(o.$$.fragment),p(e,"class","txt"),p(l,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){w(a,e,u),y(e,i),w(a,s,u),w(a,l,u),q(o,l,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&se(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(s),v(l)),j(o)}}}function _$(n){let e,t=n[17]+"",i,s=n[4]&&n[16]=="execTime"?"ms":"",l;return{c(){e=b("span"),i=W(t),l=W(s),p(e,"class","txt")},m(o,r){w(o,e,r),y(e,i),y(e,l)},p(o,r){r&2&&t!==(t=o[17]+"")&&se(i,t),r&18&&s!==(s=o[4]&&o[16]=="execTime"?"ms":"")&&se(l,s)},i:te,o:te,d(o){o&&v(e)}}}function g$(n){let e,t;return e=new tf({props:{content:n[17],language:"html"}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.content=i[17]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function b$(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(s,l){w(s,e,l),y(e,i)},p(s,l){l&2&&t!==(t=s[17]+"")&&se(i,t)},i:te,o:te,d(s){s&&v(e)}}}function k$(n){let e,t;return e=new tf({props:{content:JSON.stringify(n[17],null,2)}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.content=JSON.stringify(i[17],null,2)),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function y$(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function fp(n){let e,t,i;return t=new Oi({props:{value:n[17]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.value=s[17]),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&v(e),j(t)}}}function cp(n){let e,t,i,s=n[16]+"",l,o,r,a,u,f,c,d;const m=[y$,k$,b$,g$,_$],h=[];function g(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=g(n),u=h[a]=m[a](n);let _=!n[18]&&fp(n);return{c(){e=b("tr"),t=b("td"),i=W("data."),l=W(s),o=C(),r=b("td"),u.c(),f=C(),_&&_.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),x(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){w(k,e,S),y(e,t),y(t,i),y(t,l),y(e,o),y(e,r),h[a].m(r,null),y(r,f),_&&_.m(r,null),y(e,c),d=!0},p(k,S){(!d||S&2)&&s!==(s=k[16]+"")&&se(l,s),(!d||S&34)&&x(t,"v-align-top",k[19]);let $=a;a=g(k),a===$?h[a].p(k,S):(oe(),D(h[$],1,1,()=>{h[$]=null}),re(),u=h[a],u?u.p(k,S):(u=h[a]=m[a](k),u.c()),M(u,1),u.m(r,f)),k[18]?_&&(oe(),D(_,1,1,()=>{_=null}),re()):_?(_.p(k,S),S&2&&M(_,1)):(_=fp(k),_.c(),M(_,1),_.m(r,null))},i(k){d||(M(u),M(_),d=!0)},o(k){D(u),D(_),d=!1},d(k){k&&v(e),h[a].d(),_&&_.d()}}}function v$(n){let e,t,i,s;const l=[p$,d$],o=[];function r(a,u){var f;return a[3]?0:(f=a[1])!=null&&f.id?1:-1}return~(e=r(n))&&(t=o[e]=l[e](n)),{c(){t&&t.c(),i=ke()},m(a,u){~e&&o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(oe(),D(o[f],1,1,()=>{o[f]=null}),re()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function w$(n){let e;return{c(){e=b("h4"),e.textContent="Log details"},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function S$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),s=b("i"),l=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(s,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),y(i,s),y(i,l),y(i,o),r||(a=[Y(e,"click",n[9]),Y(i,"click",n[10])],r=!0)},p(u,f){f&8&&(i.disabled=u[3])},d(u){u&&(v(e),v(t),v(i)),r=!1,Ee(a)}}}function T$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[S$],header:[w$],default:[v$]},$$scope:{ctx:n}};return e=new nn({props:i}),n[11](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194330&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}const dp="log_view";function $$(n,e,t){let i;const s=wt();let l,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),h()}),l==null?void 0:l.show()}function u(){return _e.cancelRequest(dp),l==null?void 0:l.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await _e.logs.getOne($,{requestKey:dp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),Mi(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let E of c)typeof $[E]<"u"&&T.push(E);const O=Object.keys($);for(let E of O)T.includes(E)||T.push(E);return T}function m(){U.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){s("show",o)}function g(){s("hide",o),t(1,o={})}const _=()=>u(),k=()=>m();function S($){ne[$?"unshift":"push"](()=>{l=$,t(2,l)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,l,r,i,d,m,g,a,_,k,S]}class C$ extends we{constructor(e){super(),ve(this,e,$$,T$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function O$(n,e,t){const i=n.slice();return i[1]=e[t],i}function M$(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function E$(n){let e,t,i,s=ce(ck),l=[];for(let o=0;o{"class"in s&&t(0,i=s.class)},[i]}class Ey extends we{constructor(e){super(),ve(this,e,D$,E$,be,{class:0})}}function I$(n){let e,t,i,s,l,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[A$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[P$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[N$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[R$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){w(d,e,m),q(t,e,null),y(e,i),q(s,e,null),y(e,l),q(o,e,null),y(e,r),q(a,e,null),u=!0,f||(c=Y(e,"submit",it(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),s.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(s.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(s.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&v(e),j(t),j(s),j(o),j(a),f=!1,c()}}}function L$(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function A$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),s=C(),l=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,s,d),w(c,l,d),me(l,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&2&&mt(l.value)!==c[1].logs.maxDays&&me(l,c[1].logs.maxDays)},d(c){c&&(v(e),v(s),v(l),v(r),v(a)),u=!1,f()}}}function P$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return f=new Ey({}),{c(){e=b("label"),t=W("Min log level"),s=C(),l=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),H(f.$$.fragment),p(e,"for",i=n[23]),p(l,"type","number"),l.required=!0,p(l,"min","-100"),p(l,"max","100"),p(r,"class","help-block")},m(h,g){w(h,e,g),y(e,t),w(h,s,g),w(h,l,g),me(l,n[1].logs.minLevel),w(h,o,g),w(h,r,g),y(r,a),y(r,u),q(f,r,null),c=!0,d||(m=Y(l,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&mt(l.value)!==h[1].logs.minLevel&&me(l,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(v(e),v(s),v(l),v(o),v(r)),j(f),d=!1,m()}}}function N$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIP,w(u,i,f),w(u,s,f),y(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&(v(e),v(i),v(s)),r=!1,a()}}}function R$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logAuthId,w(u,i,f),w(u,s,f),y(s,l),r||(a=Y(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logAuthId),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&(v(e),v(i),v(s)),r=!1,a()}}}function F$(n){let e,t,i,s;const l=[L$,I$],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&v(i),o[e].d(a)}}}function q$(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function j$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[3],x(s,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,s,f),y(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(s.disabled=o),f&8&&x(s,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(s)),r=!1,a()}}}function H$(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[j$],header:[q$],default:[F$]},$$scope:{ctx:n}};return e=new nn({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeHide=s[15]),l&16777274&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}function z$(n,e,t){let i,s;const l=wt(),o="logs_settings_"+U.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Jt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await _e.settings.getAll()||{};k(P)}catch(P){_e.error(P)}t(4,u=!1)}async function _(){if(s){t(3,a=!0);try{const P=await _e.settings.update(U.filterRedactedProps(c));k(P),t(3,a=!1),m(),tn("Successfully saved logs settings."),l("save",P)}catch(P){t(3,a=!1),_e.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=mt(this.value),t(1,c)}function $(){c.logs.minLevel=mt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function L(P){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,s=i!=JSON.stringify(c))},[m,c,r,a,u,s,o,_,d,f,i,S,$,T,O,E,L,I,A]}class U$ extends we{constructor(e){super(),ve(this,e,z$,H$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function V$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"for",o=n[25])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),y(s,l),r||(a=Y(e,"change",n[12]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&33554432&&o!==(o=u[25])&&p(s,"for",o)},d(u){u&&(v(e),v(i),v(s)),r=!1,a()}}}function pp(n){let e,t,i;function s(o){n[14](o)}let l={filter:n[1],presets:n[6]};return n[5]!==void 0&&(l.zoom=n[5]),e=new r$({props:l}),ne.push(()=>ge(e,"zoom",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function mp(n){let e,t,i,s;function l(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new sS({props:r}),ne.push(()=>ge(e,"filter",l)),ne.push(()=>ge(e,"zoom",o)),e.$on("select",n[17]),{c(){H(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){s||(M(e.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function B$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T=n[4],O,E=n[4],L,I,A,P;u=new Pr({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[V$,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Ar({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[13]),S=new Ey({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=pp(n),R=mp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),s=b("div"),l=W(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),H(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),H(h.$$.fragment),g=C(),H(_.$$.fragment),k=C(),H(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ke(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){w(z,e,F),y(e,t),y(t,i),y(i,s),y(s,l),y(t,o),y(t,r),y(t,a),q(u,t,null),y(t,f),y(t,c),y(t,d),y(t,m),q(h,m,null),y(e,g),q(_,e,null),y(e,k),q(S,e,null),y(e,$),N.m(e,null),w(z,O,F),R.m(z,F),w(z,L,F),I=!0,A||(P=[Oe(Re.call(null,r,{text:"Logs settings",position:"right"})),Y(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&se(l,z[7]);const B={};F&100663300&&(B.$$scope={dirty:F,ctx:z}),h.$set(B);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&be(T,T=z[4])?(oe(),D(N,1,1,te),re(),N=pp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&be(E,E=z[4])?(oe(),D(R,1,1,te),re(),R=mp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(_.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(v(e),v(O),v(L)),j(u),j(h),j(_),j(S),N.d(z),R.d(z),A=!1,Ee(P)}}}function W$(n){let e,t,i,s,l,o;e=new oi({props:{$$slots:{default:[B$]},$$scope:{ctx:n}}});let r={};i=new C$({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return l=new U$({props:a}),n[21](l),l.$on("save",n[8]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(u,f){q(e,u,f),w(u,t,f),q(i,u,f),w(u,s,f),q(l,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};l.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(l.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(l.$$.fragment,u),o=!1},d(u){u&&(v(t),v(s)),j(e,u),n[18](null),j(i,u),n[21](null),j(l,u)}}}const Wo="logId",hp="superuserRequests",_p="superuserLogRequests";function Y$(n,e,t){var R;let i,s,l;Ge(n,Ru,z=>t(22,s=z)),Ge(n,rn,z=>t(7,l=z)),En(rn,l="Logs",l);const o=new URLSearchParams(s);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(hp)||((R=window.localStorage)==null?void 0:R.getItem(_p)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[hp]=d<<0||null,U.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ne[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var B;let F={};F[Wo]=((B=z.detail)==null?void 0:B.id)||null,U.replaceHashQueryParams(F)},P=()=>{let z={};z[Wo]=null,U.replaceHashQueryParams(z)};function N(z){ne[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Wo)&&r&&r.show(o.get(Wo)),n.$$.dirty&4&&t(6,i=d?"":'data.auth!="_superusers"'),n.$$.dirty&516&&m!=d&&(t(9,m=d),(z=window.localStorage)==null||z.setItem(_p,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,l,h,m,_,k,S,$,T,O,E,L,I,A,P,N]}class K$ extends we{constructor(e){super(),ve(this,e,Y$,W$,be,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function yp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function J$(n){let e,t=n[15].label+"",i,s,l,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),s=C(),p(e,"type","button"),p(e,"class","sidebar-item"),x(e,"active",n[5]===n[14])},m(a,u){w(a,e,u),y(e,i),y(e,s),l||(o=Y(e,"click",r),l=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&se(i,t),u&40&&x(e,"active",n[5]===n[14])},d(a){a&&v(e),l=!1,o()}}}function Z$(n){let e,t=n[15].label+"",i,s,l,o;return{c(){e=b("div"),i=W(t),s=C(),p(e,"class","sidebar-item disabled")},m(r,a){w(r,e,a),y(e,i),y(e,s),l||(o=Oe(Re.call(null,e,{position:"left",text:"Not enabled for the collection"})),l=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&se(i,t)},d(r){r&&v(e),l=!1,o()}}}function vp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=i&&yp();function r(f,c){return f[15].disabled?Z$:J$}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ke(),o&&o.c(),s=C(),u.c(),l=ke(),this.first=t},m(f,c){w(f,t,c),o&&o.m(f,c),w(f,s,c),u.m(f,c),w(f,l,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=yp(),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(v(t),v(s),v(l)),o&&o.d(f),u.d(f)}}}function wp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:Q$,then:X$,catch:G$,value:19,blocks:[,,,]};return _f(t=n[15].component,s),{c(){e=ke(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&_f(t,s)||rv(s,n,o)},i(l){i||(M(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];D(r)}i=!1},d(l){l&&v(e),s.block.d(l),s.token=null,s=null}}}function G$(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function X$(n){bp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=C()},m(s,l){q(e,s,l),w(s,t,l),i=!0},p(s,l){bp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(M(e.$$.fragment,s),i=!0)},o(s){D(e.$$.fragment,s),i=!1},d(s){s&&v(t),j(e,s)}}}function Q$(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Sp(n,e){let t,i,s,l=e[5]===e[14]&&wp(e);return{key:n,first:null,c(){t=ke(),l&&l.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&M(l,1)):(l=wp(e),l.c(),M(l,1),l.m(i.parentNode,i)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){s||(M(l),s=!0)},o(o){D(l),s=!1},d(o){o&&(v(t),v(i)),l&&l.d(o)}}}function x$(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=ce(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:te,d(s){s&&v(e),t=!1,i()}}}function t8(n){let e,t,i={class:"docs-panel",$$slots:{footer:[e8],default:[x$]},$$scope:{ctx:n}};return e=new nn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function n8(n,e,t){const i={list:{label:"List/Search",component:$t(()=>import("./ListApiDocs-D97szj_n.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:$t(()=>import("./ViewApiDocs-wlifUl4N.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:$t(()=>import("./CreateApiDocs-JPvR8N_9.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:$t(()=>import("./UpdateApiDocs-DL1jPaKQ.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:$t(()=>import("./DeleteApiDocs--Qfsn7Nc.js"),[],import.meta.url)},realtime:{label:"Realtime",component:$t(()=>import("./RealtimeApiDocs-DyIB7QDo.js"),[],import.meta.url)},batch:{label:"Batch",component:$t(()=>import("./BatchApiDocs-EBhE9vAi.js"),[],import.meta.url)}},s={"list-auth-methods":{label:"List auth methods",component:$t(()=>import("./AuthMethodsDocs-kTmmvbiv.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:$t(()=>import("./AuthWithPasswordDocs-DDzkR56i.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:$t(()=>import("./AuthWithOAuth2Docs-DR-QIR8o.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:$t(()=>import("./AuthWithOtpDocs-Bf-89h5e.js"),__vite__mapDeps([11,3]),import.meta.url)},refresh:{label:"Auth refresh",component:$t(()=>import("./AuthRefreshDocs-CN-JUWQG.js"),__vite__mapDeps([12,3]),import.meta.url)},verification:{label:"Verification",component:$t(()=>import("./VerificationDocs-1oXoO_6L.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:$t(()=>import("./PasswordResetDocs-C6_feDjW.js"),[],import.meta.url)},"email-change":{label:"Email change",component:$t(()=>import("./EmailChangeDocs-_bs_4G0n.js"),[],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ne[k?"unshift":"push"](()=>{l=k,t(4,l)})}function g(k){Le.call(this,n,k)}function _(k){Le.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime,delete a.batch):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,m,h,g,_]}class i8 extends we{constructor(e){super(),ve(this,e,n8,t8,be,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}const l8=n=>({active:n&1}),Tp=n=>({active:n[0]});function $p(n){let e,t,i;const s=n[15].default,l=Nt(s,n,n[14],null);return{c(){e=b("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ft(l,s,o,o[14],i?Rt(s,o[14],r,null):qt(o[14]),null)},i(o){i||(M(l,o),o&&tt(()=>{i&&(t||(t=qe(e,ht,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(l,o),o&&(t||(t=qe(e,ht,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),l&&l.d(o),o&&t&&t.end()}}}function s8(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Nt(a,n,n[14],Tp);let f=n[0]&&$p(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),y(e,t),u&&u.m(t,null),y(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",it(n[17])),Y(t,"drop",it(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",it(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Ft(u,a,c,c[14],l?Rt(a,c[14],d,l8):qt(c[14]),Tp),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&1)&&p(t,"aria-expanded",c[0]),(!l||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=$p(c),f.c(),M(f,1),f.m(e,null)):f&&(oe(),D(f,1,1,()=>{f=null}),re()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&x(e,"active",c[0])},i(c){l||(M(u,c),M(f),l=!0)},o(c){D(u,c),D(f),l=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ee(r)}}}function o8(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function g(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of P)N.click()}}an(()=>()=>clearTimeout(r));function $(P){Le.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),l("drop",P))},E=P=>u&&l("dragstart",P),L=P=>{u&&(t(7,m=!0),l("dragenter",P))},I=P=>{u&&(t(7,m=!1),l("dragleave",P))};function A(P){ne[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,s=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,l,d,h,g,_,r,s,i,$,T,O,E,L,I,A]}class zi extends we{constructor(e){super(),ve(this,e,o8,s8,be,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function Cp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Op(n,e,t){const i=n.slice();return i[25]=e[t],i}function Mp(n){let e,t,i=ce(n[3]),s=[];for(let l=0;l0&&Mp(n);return{c(){e=b("label"),t=W("Subject"),s=C(),l=b("input"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[24]),p(l,"type","text"),p(l,"id",o=n[24]),p(l,"spellcheck","false"),l.required=!0},m(m,h){w(m,e,h),y(e,t),w(m,s,h),w(m,l,h),me(l,n[0].subject),w(m,r,h),c&&c.m(m,h),w(m,a,h),u||(f=Y(l,"input",n[14]),u=!0)},p(m,h){var g;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(l,"id",o),h&1&&l.value!==m[0].subject&&me(l,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Mp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(v(e),v(s),v(l),v(r),v(a)),c&&c.d(m),u=!1,f()}}}function a8(n){let e,t,i,s;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),me(e,n[0].body),i||(s=Y(e,"input",n[17]),i=!0)},p(l,o){o&16777216&&t!==(t=l[24])&&p(e,"id",t),o&1&&me(e,l[0].body)},i:te,o:te,d(l){l&&v(e),i=!1,s()}}}function u8(n){let e,t,i,s;function l(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Ht(o,r(n)),ne.push(()=>ge(e,"value",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&v(i),e&&j(e,a)}}}function Dp(n){let e,t,i=ce(n[3]),s=[];for(let l=0;l0&&Dp(n);return{c(){e=b("label"),t=W("Body (HTML)"),s=C(),o.c(),r=C(),m&&m.c(),a=ke(),p(e,"for",i=n[24])},m(g,_){w(g,e,_),y(e,t),w(g,s,_),c[l].m(g,_),w(g,r,_),m&&m.m(g,_),w(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=l;l=d(g),l===k?c[l].p(g,_):(oe(),D(c[k],1,1,()=>{c[k]=null}),re(),o=c[l],o?o.p(g,_):(o=c[l]=f[l](g),o.c()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Dp(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(v(e),v(s),v(r),v(a)),c[l].d(g),m&&m.d(g)}}}function c8(n){let e,t,i,s;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[r8,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[f8,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&2&&(r.name=l[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&2&&(a.name=l[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&v(t),j(e,l),j(i,l)}}}function Lp(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function d8(n){let e,t,i,s,l,o,r,a,u,f=n[7]&&Lp();return{c(){e=b("div"),t=b("i"),i=C(),s=b("span"),l=W(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,s),y(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d&4&&se(l,c[2]),c[7]?f?d&128&&M(f,1):(f=Lp(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function p8(n){let e,t;const i=[n[9]];let s={$$slots:{header:[d8],default:[c8]},$$scope:{ctx:n}};for(let l=0;lt(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ap,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await $t(async()=>{const{default:R}=await import("./CodeEditor-CHQR53XK.js");return{default:R}},__vite__mapDeps([13,1]),import.meta.url)).default),Ap=d,t(6,m=!1))}function S(R){R=R.replace("*",""),U.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ne[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Le.call(this,n,R)}function P(R){Le.call(this,n,R)}function N(R){Le.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Kt(R)),t(9,l=lt(e,s)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!U.isEmpty(U.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||Yn(r))},[u,r,a,f,c,d,m,i,S,l,h,g,_,o,$,T,O,E,L,I,A,P,N]}class h8 extends we{constructor(e){super(),ve(this,e,m8,p8,be,{key:1,title:2,config:0,placeholders:3,expand:10,collapse:11,collapseSiblings:12})}get expand(){return this.$$.ctx[10]}get collapse(){return this.$$.ctx[11]}get collapseSiblings(){return this.$$.ctx[12]}}function _8(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),l=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){w(m,e,h),y(e,t),y(e,i),w(m,l,h),w(m,o,h),me(o,n[0]),w(m,a,h),w(m,u,h),y(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(m,h){h&8&&se(t,m[3]),h&64&&s!==(s=m[6])&&p(e,"for",s),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&&mt(o.value)!==m[0]&&me(o,m[0]),h&2&&x(f,"txt-success",!!m[1])},d(m){m&&(v(e),v(l),v(o),v(a),v(u)),c=!1,Ee(d)}}}function g8(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[_8,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function b8(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=mt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=U.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class k8 extends we{constructor(e){super(),ve(this,e,b8,g8,be,{key:2,label:3,duration:0,secret:1})}}function Pp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Np(n,e){let t,i,s,l,o,r;function a(c){e[5](c,e[8])}function u(c){e[6](c,e[8])}let f={key:e[8].key,label:e[8].label};return e[0][e[8].key].duration!==void 0&&(f.duration=e[0][e[8].key].duration),e[0][e[8].key].secret!==void 0&&(f.secret=e[0][e[8].key].secret),i=new k8({props:f}),ne.push(()=>ge(i,"duration",a)),ne.push(()=>ge(i,"secret",u)),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){w(c,t,d),q(i,t,null),y(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!s&&d&3&&(s=!0,m.duration=e[0][e[8].key].duration,$e(()=>s=!1)),!l&&d&3&&(l=!0,m.secret=e[0][e[8].key].secret,$e(()=>l=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&v(t),j(i)}}}function y8(n){let e,t=[],i=new Map,s,l=ce(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function v8(n){let e,t,i,s,l,o=n[2]&&Rp();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),s=C(),o&&o.c(),l=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),w(r,s,a),o&&o.m(r,a),w(r,l,a)},p(r,a){r[2]?o?a&4&&M(o,1):(o=Rp(),o.c(),M(o,1),o.m(l.parentNode,l)):o&&(oe(),D(o,1,1,()=>{o=null}),re())},d(r){r&&(v(e),v(t),v(i),v(s),v(l)),o&&o.d(r)}}}function w8(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[v8],default:[y8]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2055&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function S8(n,e,t){let i,s,l;Ge(n,$n,c=>t(4,l=c));let{collection:o}=e,r=[];function a(c){if(U.isEmpty(c))return!1;for(let d of r)if(c[d.key])return!0;return!1}function u(c,d){n.$$.not_equal(o[d.key].duration,c)&&(o[d.key].duration=c,t(0,o))}function f(c,d){n.$$.not_equal(o[d.key].secret,c)&&(o[d.key].secret=c,t(0,o))}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,r=i?[{key:"authToken",label:"Auth"},{key:"passwordResetToken",label:"Password reset"},{key:"fileToken",label:"Protected file access"}]:[{key:"authToken",label:"Auth"},{key:"verificationToken",label:"Email verification"},{key:"passwordResetToken",label:"Password reset"},{key:"emailChangeToken",label:"Email change"},{key:"fileToken",label:"Protected file access"}]),n.$$.dirty&16&&t(2,s=a(l))},[o,r,s,i,l,u,f]}class T8 extends we{constructor(e){super(),ve(this,e,S8,w8,be,{collection:0})}}const $8=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]}),C8=n=>({isSuperuserOnly:n&2048}),qp=n=>({isSuperuserOnly:n[11]}),O8=n=>({isSuperuserOnly:n&2048}),jp=n=>({isSuperuserOnly:n[11]});function M8(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[D8,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2064&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),s&8&&(l.name=i[3]),s&2362855&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function E8(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function Hp(n){let e,t,i,s,l,o;return{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-dnx4io"),p(e,"aria-hidden",n[10]),e.disabled=n[10]},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,s),l||(o=Y(e,"click",n[13]),l=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&v(e),l=!1,o()}}}function zp(n){let e,t,i,s,l,o,r,a=!n[10]&&Up();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){w(u,e,f),a&&a.m(e,null),y(e,t),y(e,i),l=!0,o||(r=Y(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Up(),a.c(),a.m(e,t)),(!l||f&1024)&&(e.disabled=u[10]),(!l||f&1024)&&p(e,"aria-hidden",u[10])},i(u){l||(u&&tt(()=>{l&&(s||(s=qe(e,Ct,{duration:150,start:.98},!0)),s.run(1))}),l=!0)},o(u){u&&(s||(s=qe(e,Ct,{duration:150,start:.98},!1)),s.run(0)),l=!1},d(u){u&&v(e),a&&a.d(),u&&s&&s.end(),o=!1,r()}}}function Up(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D8(n){let e,t,i,s,l,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,k,S,$,T,O;const E=n[15].beforeLabel,L=Nt(E,n,n[18],jp),I=n[15].afterLabel,A=Nt(I,n,n[18],qp);let P=n[5]&&!n[11]&&Hp(n);function N(V){n[17](V)}var R=n[8];function z(V,Z){let G={id:V[21],baseCollection:V[1],disabled:V[10]||V[11],placeholder:V[11]?"":V[6]};return V[0]!==void 0&&(G.value=V[0]),{props:G}}R&&(m=Ht(R,z(n)),n[16](m),ne.push(()=>ge(m,"value",N)));let F=n[5]&&n[11]&&zp(n);const B=n[15].default,J=Nt(B,n,n[18],Fp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),s=b("span"),l=W(n[2]),o=C(),a=W(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&H(m.$$.fragment),g=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(s,"class","txt"),x(s,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(V,Z){w(V,e,Z),y(e,t),L&&L.m(t,null),y(t,i),y(t,s),y(s,l),y(s,o),y(s,a),y(t,u),A&&A.m(t,null),y(t,f),P&&P.m(t,null),y(e,d),m&&q(m,e,null),y(e,g),F&&F.m(e,null),w(V,k,Z),w(V,S,Z),J&&J.m(S,null),$=!0,T||(O=Oe(_=Re.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(V,Z){if(L&&L.p&&(!$||Z&264192)&&Ft(L,E,V,V[18],$?Rt(E,V[18],Z,O8):qt(V[18]),jp),(!$||Z&4)&&se(l,V[2]),(!$||Z&2048)&&r!==(r=V[11]?"- Superusers only":"")&&se(a,r),(!$||Z&2048)&&x(s,"txt-hint",V[11]),A&&A.p&&(!$||Z&264192)&&Ft(A,I,V,V[18],$?Rt(I,V[18],Z,C8):qt(V[18]),qp),V[5]&&!V[11]?P?P.p(V,Z):(P=Hp(V),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||Z&2097152&&c!==(c=V[21]))&&p(t,"for",c),Z&256&&R!==(R=V[8])){if(m){oe();const G=m;D(G.$$.fragment,1,0,()=>{j(G,1)}),re()}R?(m=Ht(R,z(V)),V[16](m),ne.push(()=>ge(m,"value",N)),H(m.$$.fragment),M(m.$$.fragment,1),q(m,e,g)):m=null}else if(R){const G={};Z&2097152&&(G.id=V[21]),Z&2&&(G.baseCollection=V[1]),Z&3072&&(G.disabled=V[10]||V[11]),Z&2112&&(G.placeholder=V[11]?"":V[6]),!h&&Z&1&&(h=!0,G.value=V[0],$e(()=>h=!1)),m.$set(G)}V[5]&&V[11]?F?(F.p(V,Z),Z&2080&&M(F,1)):(F=zp(V),F.c(),M(F,1),F.m(e,null)):F&&(oe(),D(F,1,1,()=>{F=null}),re()),_&&Lt(_.update)&&Z&2&&_.update.call(null,V[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||Z&264192)&&Ft(J,B,V,V[18],$?Rt(B,V[18],Z,$8):qt(V[18]),Fp)},i(V){$||(M(L,V),M(A,V),m&&M(m.$$.fragment,V),M(F),M(J,V),$=!0)},o(V){D(L,V),D(A,V),m&&D(m.$$.fragment,V),D(F),D(J,V),$=!1},d(V){V&&(v(e),v(k),v(S)),L&&L.d(V),A&&A.d(V),P&&P.d(),n[16](null),m&&j(m),F&&F.d(),J&&J.d(V),T=!1,O()}}}function I8(n){let e,t,i,s;const l=[E8,M8],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&v(i),o[e].d(a)}}}let Vp;function L8(n,e,t){let i,s,{$$slots:l={},$$scope:o}=e,{collection:r=null}=e,{rule:a=null}=e,{label:u="Rule"}=e,{formKey:f="rule"}=e,{required:c=!1}=e,{disabled:d=!1}=e,{superuserToggle:m=!0}=e,{placeholder:h="Leave empty to grant everyone access..."}=e,g=null,_=null,k=Vp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await $t(async()=>{const{default:I}=await import("./FilterAutocompleteInput-CBf9aYgb.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Vp=k,t(9,S=!1))}async function T(){t(0,a=_||""),await _n(),g==null||g.focus()}function O(){_=a,t(0,a=null)}function E(I){ne[I?"unshift":"push"](()=>{g=I,t(7,g)})}function L(I){a=I,t(0,a)}return n.$$set=I=>{"collection"in I&&t(1,r=I.collection),"rule"in I&&t(0,a=I.rule),"label"in I&&t(2,u=I.label),"formKey"in I&&t(3,f=I.formKey),"required"in I&&t(4,c=I.required),"disabled"in I&&t(14,d=I.disabled),"superuserToggle"in I&&t(5,m=I.superuserToggle),"placeholder"in I&&t(6,h=I.placeholder),"$$scope"in I&&t(18,o=I.$$scope)},n.$$.update=()=>{n.$$.dirty&33&&t(11,i=m&&a===null),n.$$.dirty&16386&&t(10,s=d||r.system)},[a,r,u,f,c,m,h,g,k,S,s,i,T,O,d,l,E,L,o]}class ll extends we{constructor(e){super(),ve(this,e,L8,I8,be,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function A8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(l,"class","txt"),p(s,"for",o=n[5])},m(u,f){w(u,e,f),e.checked=n[0].mfa.enabled,w(u,i,f),w(u,s,f),y(s,l),r||(a=Y(e,"change",n[3]),r=!0)},p(u,f){f&32&&t!==(t=u[5])&&p(e,"id",t),f&1&&(e.checked=u[0].mfa.enabled),f&32&&o!==(o=u[5])&&p(s,"for",o)},d(u){u&&(v(e),v(i),v(s)),r=!1,a()}}}function P8(n){let e,t,i,s,l;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to email != ''.`,s=C(),l=b("p"),l.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:te,d(o){o&&(v(e),v(t),v(i),v(s),v(l))}}}function N8(n){let e,t,i,s,l,o,r,a,u;s=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[A8,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[P8]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new ll({props:c}),ne.push(()=>ge(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

`,t=C(),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),x(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){w(d,e,m),w(d,t,m),w(d,i,m),q(s,i,null),y(i,l),y(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&x(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(s.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(s.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(v(e),v(t),v(i)),j(s),j(r)}}}function R8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function F8(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Bp(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function q8(n){let e,t,i,s,l,o;function r(c,d){return c[0].mfa.enabled?F8:R8}let a=r(n),u=a(n),f=n[1]&&Bp();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&M(f,1):(f=Bp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(t),v(i),v(s),v(l),v(o)),u.d(c),f&&f.d(c)}}}function j8(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[q8],default:[N8]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&67&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function H8(n,e,t){let i,s;Ge(n,$n,a=>t(2,s=a));let{collection:l}=e;function o(){l.mfa.enabled=this.checked,t(0,l)}function r(a){n.$$.not_equal(l.mfa.rule,a)&&(l.mfa.rule=a,t(0,l))}return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!U.isEmpty(s==null?void 0:s.mfa))},[l,i,s,o,r]}class z8 extends we{constructor(e){super(),ve(this,e,H8,j8,be,{collection:0})}}const U8=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i}const V8=n=>({}),Kp=n=>({});function Jp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Zp(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=C(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),y(e,t),y(e,i)},p(s,l){l[0]&4&&se(t,s[2]),l[0]&96&&x(e,"link-hint",!s[5]&&!s[6])},d(s){s&&v(e)}}}function B8(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(s,l){w(s,e,l),y(e,i)},p(s,l){l[0]&1&&t!==(t=s[50]+"")&&se(i,t)},i:te,o:te,d(s){s&&v(e)}}}function W8(n){let e,t,i;const s=[{item:n[50]},n[11]];var l=n[10];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2049?vt(s,[a[0]&1&&{item:r[50]},a[0]&2048&&At(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&j(e,r)}}}function Gp(n){let e,t,i;function s(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,"Clear")),Y(e,"click",en(it(s)))],t=!0)},p(l,o){n=l},d(l){l&&v(e),t=!1,Ee(i)}}}function Xp(n){let e,t,i,s,l,o;const r=[W8,B8],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Gp(n);return{c(){e=b("div"),i.c(),s=C(),f&&f.c(),l=C(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),y(e,s),f&&f.m(e,null),y(e,l),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),M(i,1),i.m(e,s)),c[4]||c[8]?f?f.p(c,d):(f=Gp(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&v(e),a[t].d(),f&&f.d()}}}function Qp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[J8]},$$scope:{ctx:n}};return e=new Dn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(s[7]?"dropdown-upside":"")),l[0]&1048576&&(o.trigger=s[20]),l[0]&6451722|l[1]&16384&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[42](null),j(e,s)}}}function xp(n){let e,t,i,s,l,o,r,a,u=n[17].length&&em(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',s=C(),l=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),y(e,t),y(t,i),y(t,s),y(t,l),me(l,n[17]),y(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&131072&&l.value!==f[17]&&me(l,f[17]),f[17].length?u?u.p(f,c):(u=em(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&v(e),u&&u.d(),r=!1,a()}}}function em(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),y(e,t),i||(s=Y(t,"click",en(it(n[23]))),i=!0)},p:te,d(l){l&&v(e),i=!1,s()}}}function tm(n){let e,t=n[1]&&nm(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=nm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function nm(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),y(e,t)},p(i,s){s[0]&2&&se(t,i[1])},d(i){i&&v(e)}}}function Y8(n){let e=n[50]+"",t;return{c(){t=W(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&4194304&&e!==(e=i[50]+"")&&se(t,e)},i:te,o:te,d(i){i&&v(t)}}}function K8(n){let e,t,i;const s=[{item:n[50]},n[13]];var l=n[12];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&4202496?vt(s,[a[0]&4194304&&{item:r[50]},a[0]&8192&&At(r[13])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&j(e,r)}}}function im(n){let e,t,i,s,l,o,r;const a=[K8,Y8],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[40](n[50],...m)}function d(...m){return n[41](n[50],...m)}return{c(){e=b("div"),i.c(),s=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[50]))},m(m,h){w(m,e,h),u[t].m(e,null),y(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(m,h){n=m;let g=t;t=f(n),t===g?u[t].p(n,h):(oe(),D(u[g],1,1,()=>{u[g]=null}),re(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),M(i,1),i.m(e,s)),(!l||h[0]&512)&&x(e,"closable",n[9]),(!l||h[0]&6291456)&&x(e,"selected",n[21](n[50]))},i(m){l||(M(i),l=!0)},o(m){D(i),l=!1},d(m){m&&v(e),u[t].d(),o=!1,Ee(r)}}}function J8(n){let e,t,i,s,l,o=n[14]&&xp(n);const r=n[36].beforeOptions,a=Nt(r,n,n[45],Kp);let u=ce(n[22]),f=[];for(let g=0;gD(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=tm(n));const m=n[36].afterOptions,h=Nt(m,n,n[45],Wp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;gD(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Zp(n));let c=!n[5]&&!n[6]&&Qp(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),re()),(!o||m[0]&32768&&l!==(l="select "+d[15]))&&p(e,"class",l),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=_()}=e,{toggle:S=d}=e,{closable:$=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=wt();let{class:N=""}=e,R,z="",F,B;function J(Te){if(U.isEmpty(k))return;let nt=U.toArray(k);U.inArray(nt,Te)&&(U.removeByValue(nt,Te),t(0,k=d?nt:(nt==null?void 0:nt[0])||_())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function V(Te){if(d){let nt=U.toArray(k);U.inArray(nt,Te)||t(0,k=[...nt,Te])}else t(0,k=Te);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Z(Te){return s(Te)?J(Te):V(Te)}function G(){t(0,k=_()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function de(){R!=null&&R.show&&(R==null||R.show())}function pe(){R!=null&&R.hide&&(R==null||R.hide())}function ae(){if(U.isEmpty(k)||U.isEmpty(c))return;let Te=U.toArray(k),nt=[];for(const zt of Te)U.inArray(c,zt)||nt.push(zt);if(nt.length){for(const zt of nt)U.removeByValue(Te,zt);t(0,k=d?Te:Te[0])}}function Ce(){t(17,z="")}function Ye(Te,nt){Te=Te||[];const zt=A||G8;return Te.filter(Ne=>zt(Ne,nt))||[]}function Ke(Te,nt){Te.preventDefault(),S&&d?Z(nt):V(nt)}function ct(Te,nt){(Te.code==="Enter"||Te.code==="Space")&&(Ke(Te,nt),$&&pe())}function et(){Ce(),setTimeout(()=>{const Te=F==null?void 0:F.querySelector(".dropdown-item.option.selected");Te&&(Te.focus(),Te.scrollIntoView({block:"nearest"}))},0)}function xe(Te){Te.stopPropagation(),!h&&!m&&(R==null||R.toggle())}an(()=>{const Te=document.querySelectorAll(`label[for="${r}"]`);for(const nt of Te)nt.addEventListener("click",xe);return()=>{for(const nt of Te)nt.removeEventListener("click",xe)}});const Be=Te=>J(Te);function ut(Te){ne[Te?"unshift":"push"](()=>{B=Te,t(20,B)})}function Bt(){z=this.value,t(17,z)}const Ue=(Te,nt)=>Ke(nt,Te),De=(Te,nt)=>ct(nt,Te);function ot(Te){ne[Te?"unshift":"push"](()=>{R=Te,t(18,R)})}function Ie(Te){Le.call(this,n,Te)}function We(Te){ne[Te?"unshift":"push"](()=>{F=Te,t(19,F)})}return n.$$set=Te=>{"id"in Te&&t(27,r=Te.id),"noOptionsText"in Te&&t(1,a=Te.noOptionsText),"selectPlaceholder"in Te&&t(2,u=Te.selectPlaceholder),"searchPlaceholder"in Te&&t(3,f=Te.searchPlaceholder),"items"in Te&&t(28,c=Te.items),"multiple"in Te&&t(4,d=Te.multiple),"disabled"in Te&&t(5,m=Te.disabled),"readonly"in Te&&t(6,h=Te.readonly),"upside"in Te&&t(7,g=Te.upside),"zeroFunc"in Te&&t(29,_=Te.zeroFunc),"selected"in Te&&t(0,k=Te.selected),"toggle"in Te&&t(8,S=Te.toggle),"closable"in Te&&t(9,$=Te.closable),"labelComponent"in Te&&t(10,T=Te.labelComponent),"labelComponentProps"in Te&&t(11,O=Te.labelComponentProps),"optionComponent"in Te&&t(12,E=Te.optionComponent),"optionComponentProps"in Te&&t(13,L=Te.optionComponentProps),"searchable"in Te&&t(14,I=Te.searchable),"searchFunc"in Te&&t(30,A=Te.searchFunc),"class"in Te&&t(15,N=Te.class),"$$scope"in Te&&t(45,o=Te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ae(),Ce()),n.$$.dirty[0]&268566528&&t(22,i=Ye(c,z)),n.$$.dirty[0]&1&&t(21,s=function(Te){const nt=U.toArray(k);return U.inArray(nt,Te)})},[k,a,u,f,d,m,h,g,S,$,T,O,E,L,I,N,J,z,R,F,B,s,i,Ce,Ke,ct,et,r,c,_,A,V,Z,G,de,pe,l,Be,ut,Bt,Ue,De,ot,Ie,We,o]}class ps extends we{constructor(e){super(),ve(this,e,X8,Z8,be,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,zeroFunc:29,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:30,class:15,deselectItem:16,selectItem:31,toggleItem:32,reset:33,showDropdown:34,hideDropdown:35},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[31]}get toggleItem(){return this.$$.ctx[32]}get reset(){return this.$$.ctx[33]}get showDropdown(){return this.$$.ctx[34]}get hideDropdown(){return this.$$.ctx[35]}}function Q8(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[4]],l={};for(let o=0;o',i=C(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ii(s,a)},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Oe(Re.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",it(n[3]))],l=!0)},p(u,f){ii(s,a=vt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(v(e),v(i),v(s)),l=!1,Ee(o)}}}function eC(n){let e;function t(l,o){return l[1]?x8:Q8}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&v(e),s.d(l)}}}function tC(n,e,t){const i=["value","mask"];let s=lt(e,i),{value:l=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,l=""),t(1,o=!1),await _n(),r==null||r.focus()}function u(c){ne[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){l=this.value,t(0,l)}return n.$$set=c=>{e=je(je({},e),Kt(c)),t(4,s=lt(e,i)),"value"in c&&t(0,l=c.value),"mask"in c&&t(1,o=c.mask)},[l,o,r,a,s,u,f]}class nf extends we{constructor(e){super(),ve(this,e,tC,eC,be,{value:0,mask:1})}}function nC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Client ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[1].clientId),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&2&&l.value!==u[1].clientId&&me(l,u[1].clientId)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function iC(n){let e,t,i,s,l,o,r,a;function u(d){n[15](d)}function f(d){n[16](d)}let c={id:n[23]};return n[5]!==void 0&&(c.mask=n[5]),n[1].clientSecret!==void 0&&(c.value=n[1].clientSecret),l=new nf({props:c}),ne.push(()=>ge(l,"mask",u)),ne.push(()=>ge(l,"value",f)),{c(){e=b("label"),t=W("Client secret"),s=C(),H(l.$$.fragment),p(e,"for",i=n[23])},m(d,m){w(d,e,m),y(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(v(e),v(s)),j(l,d)}}}function lm(n){let e,t,i,s;const l=[{key:n[6]},n[3].optionsComponentProps||{}];function o(u){n[17](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;dge(t,"config",o))),{c(){e=b("div"),t&&H(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&q(t,e,null),s=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){oe();const c=t;D(c.$$.fragment,1,0,()=>{j(c,1)}),re()}r?(t=Ht(r,a(u,f)),ne.push(()=>ge(t,"config",o)),H(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?vt(l,[f&64&&{key:u[6]},f&8&&At(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){s||(t&&M(t.$$.fragment,u),s=!0)},o(u){t&&D(t.$$.fragment,u),s=!1},d(u){u&&v(e),t&&j(t)}}}function lC(n){let e,t,i,s,l,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[nC,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[iC,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&lm(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){w(f,e,c),q(t,e,null),y(e,i),q(s,e,null),y(e,l),u&&u.m(e,null),o=!0,r||(a=Y(e,"submit",it(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),s.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=lm(f),u.c(),M(u,1),u.m(e,null)):u&&(oe(),D(u,1,1,()=>{u=null}),re())},i(f){o||(M(t.$$.fragment,f),M(s.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(s.$$.fragment,f),D(u),o=!1},d(f){f&&v(e),j(t),j(s),u&&u.d(),r=!1,a()}}}function sC(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function oC(n){let e,t,i;return{c(){e=b("img"),Sn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&8&&!Sn(e.src,t="./images/oauth2/"+s[3].logo)&&p(e,"src",t),l&8&&i!==(i=s[3].title+" logo")&&p(e,"alt",i)},d(s){s&&v(e)}}}function rC(n){let e,t,i,s=n[3].title+"",l,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?oC:sC}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),l=W(s),o=C(),r=b("small"),a=W("("),f=W(u),c=W(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){w(g,e,_),h.m(e,null),w(g,t,_),w(g,i,_),y(i,l),y(i,o),y(i,r),y(r,a),y(r,f),y(r,c)},p(g,_){m===(m=d(g))&&h?h.p(g,_):(h.d(1),h=m(g),h&&(h.c(),h.m(e,null))),_&8&&s!==(s=g[3].title+"")&&se(l,s),_&8&&u!==(u=g[3].key+"")&&se(f,u)},d(g){g&&(v(e),v(t),v(i)),h.d()}}}function sm(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Oe(Re.call(null,e,{text:"Remove provider",position:"right"})),Y(e,"click",n[10])],s=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),s=!1,Ee(l)}}}function aC(n){let e,t,i,s,l,o,r,a,u=!n[4]&&sm(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[8]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),y(s,l),r||(a=Y(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=sm(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(s.disabled=o)},d(f){f&&(v(e),v(t),v(i),v(s)),u&&u.d(f),r=!1,a()}}}function uC(n){let e,t,i={btnClose:!1,$$slots:{footer:[aC],header:[rC],default:[lC]},$$scope:{ctx:n}};return e=new nn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16777466&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}function fC(n,e,t){let i,s;const l=wt(),o="provider_popup_"+U.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=U.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){Yn(s),r==null||r.hide()}async function _(){l("submit",{uiOptions:a,config:u}),g()}async function k(){vn(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{l("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>_();function L(P){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,s="oauth2.providers."+m)},[g,u,r,a,f,d,s,i,o,_,k,h,c,m,S,$,T,O,E,L,I,A]}class cC extends we{constructor(e){super(),ve(this,e,fC,uC,be,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function dC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Client ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Team ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&me(l,u[3])},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function mC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Key ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&me(l,u[4])},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function hC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",lr),r.required=!0},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,s),w(c,o,d),w(c,r,d),me(r,n[6]),u||(f=[Oe(Re.call(null,s,{text:`Max ${lr} seconds (~${lr/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&mt(r.value)!==c[6]&&me(r,c[6])},d(c){c&&(v(e),v(o),v(r)),u=!1,Ee(f)}}}function _C(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Private key"),s=C(),l=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,s,d),w(c,l,d),me(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&me(l,c[5])},d(c){c&&(v(e),v(s),v(l),v(r),v(a)),u=!1,f()}}}function gC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S;return s=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[dC,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[pC,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[mC,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[hC,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[_C,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),h=C(),H(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){w($,e,T),y(e,t),y(t,i),q(s,i,null),y(t,l),y(t,o),q(r,o,null),y(t,a),y(t,u),q(f,u,null),y(t,c),y(t,d),q(m,d,null),y(t,h),q(g,t,null),_=!0,k||(S=Y(e,"submit",it(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),s.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){_||(M(s.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(g.$$.fragment,$),_=!0)},o($){D(s.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),_=!1},d($){$&&v(e),j(s),j(r),j(f),j(m),j(g),k=!1,S()}}}function bC(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function kC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),s=b("button"),l=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,s,d),y(s,l),y(s,o),y(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&x(s,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(s)),u=!1,f()}}}function yC(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[kC],header:[bC],default:[gC]},$$scope:{ctx:n}};return e=new nn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const lr=15777e3;function vC(n,e,t){let i;const s=wt(),l="apple_secret_"+U.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||lr),Jt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await _e.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),tn("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){_e.error(P)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=mt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!d;function L(P){ne[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,l,g,m,_,k,S,$,T,O,E,L,I,A]}class wC extends we{constructor(e){super(),ve(this,e,vC,yC,be,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function SC(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new wC({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent="Generate secret",o=C(),H(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),y(e,t),y(e,i),y(e,s),w(d,o,m),q(r,d,m),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),j(r,d),u=!1,f()}}}function TC(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){ne[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class $C extends we{constructor(e){super(),ve(this,e,TC,SC,be,{key:1,config:0})}}function CC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,s,d),w(c,l,d),me(l,n[0].authURL),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(l,"id",o),d&1&&l.value!==c[0].authURL&&me(l,c[0].authURL)},d(c){c&&(v(e),v(s),v(l),v(r),v(a)),u=!1,f()}}}function OC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,s,d),w(c,l,d),me(l,n[0].tokenURL),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(l,"id",o),d&1&&l.value!==c[0].tokenURL&&me(l,c[0].tokenURL)},d(c){c&&(v(e),v(s),v(l),v(r),v(a)),u=!1,f()}}}function MC(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[CC,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[OC,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),q(l,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(M(i.$$.fragment,r),M(l.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(l.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(s)),j(i,r),j(l,r)}}}function EC(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authURL=this.value,t(0,s)}function o(){s.tokenURL=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class DC extends we{constructor(e){super(),ve(this,e,EC,MC,be,{key:1,config:0})}}function om(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function IC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&om(n);return{c(){l&&l.c(),e=C(),t=b("span"),s=W(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),y(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=om(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(s,i)},i:te,o:te,d(o){o&&(v(e),v(t)),l&&l.d(o)}}}function LC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class rm extends we{constructor(e){super(),ve(this,e,LC,IC,be,{item:0})}}const AC=n=>({}),am=n=>({});function PC(n){let e;const t=n[8].afterOptions,i=Nt(t,n,n[13],am);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&8192)&&Ft(i,t,s,s[13],e?Rt(t,s[13],l,AC):qt(s[13]),am)},i(s){e||(M(i,s),e=!0)},o(s){D(i,s),e=!1},d(s){i&&i.d(s)}}}function NC(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[PC]},$$scope:{ctx:n}};for(let r=0;rge(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?vt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&At(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function RC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=lt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=rm}=e,{optionComponent:c=rm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e,h=JSON.stringify(m);function g(O){O=U.toArray(O,!0);let E=[];for(let L of O){const I=U.findByKey(r,d,L);I&&E.push(I)}O.length&&!E.length||t(0,u=a?E:E[0])}async function _(O){if(!r.length)return;let E=U.toArray(O,!0).map(I=>I[d]),L=a?E:E[0];JSON.stringify(L)!=h&&(t(6,m=L),h=JSON.stringify(m))}function k(O){u=O,t(0,u)}function S(O){Le.call(this,n,O)}function $(O){Le.call(this,n,O)}function T(O){Le.call(this,n,O)}return n.$$set=O=>{e=je(je({},e),Kt(O)),t(5,s=lt(e,i)),"items"in O&&t(1,r=O.items),"multiple"in O&&t(2,a=O.multiple),"selected"in O&&t(0,u=O.selected),"labelComponent"in O&&t(3,f=O.labelComponent),"optionComponent"in O&&t(4,c=O.optionComponent),"selectionKey"in O&&t(7,d=O.selectionKey),"keyOfSelected"in O&&t(6,m=O.keyOfSelected),"$$scope"in O&&t(13,o=O.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(m),n.$$.dirty&1&&_(u)},[u,r,a,f,c,s,m,d,l,k,S,$,T,o]}class Ln extends we{constructor(e){super(),ve(this,e,RC,NC,be,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function FC(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=U.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Kt(c)),t(5,l=lt(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=U.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class ho extends we{constructor(e){super(),ve(this,e,qC,FC,be,{value:0,separator:1,readonly:2,disabled:3})}}function jC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Display name"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","text"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].displayName),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&l.value!==u[0].displayName&&me(l,u[0].displayName)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function HC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].authURL),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&l.value!==u[0].authURL&&me(l,u[0].authURL)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function zC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].tokenURL),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&l.value!==u[0].tokenURL&&me(l,u[0].tokenURL)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function UC(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new Ln({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Fetch user info from"),s=C(),H(l.$$.fragment),p(e,"for",i=n[13])},m(f,c){w(f,e,c),y(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(v(e),v(s)),j(l,f)}}}function VC(n){let e,t,i,s,l,o,r,a;return s=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[WC,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[YC,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token is a direct result of the trusted server code->token exchange response.`,i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){w(u,e,f),y(e,t),y(e,i),q(s,e,null),y(e,l),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),s.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(s.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=qe(e,ht,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(s.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=qe(e,ht,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),j(s),j(o),u&&r&&r.end()}}}function BC(n){let e,t,i,s;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[KC,({uniqueId:l})=>({13:l}),({uniqueId:l})=>l?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","content")},m(l,o){w(l,e,o),q(t,e,null),s=!0},p(l,o){const r={};o&2&&(r.name=l[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:l}),t.$set(r)},i(l){s||(M(t.$$.fragment,l),l&&tt(()=>{s&&(i||(i=qe(e,ht,{delay:10,duration:150},!0)),i.run(1))}),s=!0)},o(l){D(t.$$.fragment,l),l&&(i||(i=qe(e,ht,{delay:10,duration:150},!1)),i.run(0)),s=!1},d(l){l&&v(e),j(t),l&&i&&i.end()}}}function WC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,s),w(c,o,d),w(c,r,d),me(r,n[0].extra.jwksURL),u||(f=[Oe(Re.call(null,s,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&me(r,c[0].extra.jwksURL)},d(c){c&&(v(e),v(o),v(r)),u=!1,Ee(f)}}}function YC(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ho({props:m}),ne.push(()=>ge(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),s=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13])},m(h,g){w(h,e,g),y(e,t),y(e,i),y(e,s),w(h,o,g),q(r,h,g),u=!0,f||(c=Oe(Re.call(null,s,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&l!==(l=h[13]))&&p(e,"for",l);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(v(e),v(o)),j(r,h),f=!1,c()}}}function KC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function JC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,s,d),y(s,l),y(s,o),y(s,r),u||(f=[Y(e,"change",n[11]),Oe(Re.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(s,"for",a)},d(c){c&&(v(e),v(i),v(s)),u=!1,Ee(f)}}}function ZC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[jC,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[HC,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[zC,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[UC,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[BC,VC],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[JC,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",s=C(),H(l.$$.fragment),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),H(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),w(T,t,O),w(T,i,O),w(T,s,O),q(l,T,O),w(T,o,O),q(r,T,O),w(T,a,O),q(u,T,O),w(T,f,O),w(T,c,O),S[d].m(c,null),w(T,h,O),q(g,T,O),_=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),l.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(oe(),D(S[P],1,1,()=>{S[P]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(l.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(l.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(v(t),v(i),v(s),v(o),v(a),v(f),v(c),v(h)),j(e,T),j(l,T),j(r,T),j(u,T),S[d].d(),j(g,T)}}}function GC(n,e,t){let{key:i=""}=e,{config:s={}}=e;const l=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!s.userInfoURL;U.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC"),s.extra||(s.extra={},o=!0);function r(){o?t(0,s.extra={},s):(t(0,s.userInfoURL="",s),t(0,s.extra=s.extra||{},s))}function a(){s.displayName=this.value,t(0,s)}function u(){s.authURL=this.value,t(0,s)}function f(){s.tokenURL=this.value,t(0,s)}function c(_){o=_,t(2,o)}function d(){s.userInfoURL=this.value,t(0,s)}function m(){s.extra.jwksURL=this.value,t(0,s)}function h(_){n.$$.not_equal(s.extra.issuers,_)&&(s.extra.issuers=_,t(0,s))}function g(){s.pkce=this.checked,t(0,s)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,s=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[s,i,o,l,a,u,f,c,d,m,h,g]}class ba extends we{constructor(e){super(),ve(this,e,GC,ZC,be,{key:1,config:0})}}function XC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].authURL),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].authURL&&me(l,u[0].authURL)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function QC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].tokenURL),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].tokenURL&&me(l,u[0].tokenURL)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function xC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function eO(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[XC,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[QC,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[xC,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),y(e,t),w(f,i,c),q(s,f,c),w(f,l,c),q(o,f,c),w(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(s.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(s.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(v(e),v(i),v(l),v(r)),j(s,f),j(o,f),j(a,f)}}}function tO(n,e,t){let i,{key:s=""}=e,{config:l={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){l.authURL=this.value,t(0,l)}function u(){l.tokenURL=this.value,t(0,l)}function f(){l.userInfoURL=this.value,t(0,l)}return n.$$set=c=>{"key"in c&&t(1,s=c.key),"config"in c&&t(0,l=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(l==null?void 0:l.enabled))},[l,s,r,i,o,a,u,f]}class ka extends we{constructor(e){super(),ve(this,e,tO,eO,be,{key:1,config:0,required:4,title:2})}}const lf=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:$C},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:DC},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:ka,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucket",title:"Bitbucket",logo:"bitbucket.svg"},{key:"gitee",title:"Gitee",logo:"gitee.svg"},{key:"gitea",title:"Gitea",logo:"gitea.svg",optionsComponent:ka,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"trakt",title:"Trakt",logo:"trakt.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:ka,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:ba},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:ba},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:ba}];function um(n,e,t){const i=n.slice();return i[16]=e[t],i}function fm(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,zn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,zn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function nO(n){let e,t,i,s,l,o,r,a,u,f,c=n[1]!=""&&fm(n);return{c(){e=b("label"),t=b("i"),s=C(),l=b("input"),r=C(),c&&c.c(),a=ke(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(l,"id",o=n[19]),p(l,"type","text"),p(l,"placeholder","Search provider")},m(d,m){w(d,e,m),y(e,t),w(d,s,m),w(d,l,m),me(l,n[1]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"input",n[8]),u=!0)},p(d,m){m&524288&&i!==(i=d[19])&&p(e,"for",i),m&524288&&o!==(o=d[19])&&p(l,"id",o),m&2&&l.value!==d[1]&&me(l,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=fm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(oe(),D(c,1,1,()=>{c=null}),re())},d(d){d&&(v(e),v(s),v(l),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function cm(n){let e,t,i,s,l=n[1]!=""&&dm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),l&&l.c(),s=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){w(o,e,r),y(e,t),y(e,i),l&&l.m(e,null),y(e,s)},p(o,r){o[1]!=""?l?l.p(o,r):(l=dm(o),l.c(),l.m(e,s)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function dm(n){let e,t,i;return{c(){e=b("button"),e.textContent="Clear filter",p(e,"type","button"),p(e,"class","btn btn-sm btn-secondary")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[5]),t=!0)},p:te,d(s){s&&v(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=b("img"),Sn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&8&&!Sn(e.src,t="./images/oauth2/"+s[16].logo)&&p(e,"src",t),l&8&&i!==(i=s[16].title+" logo")&&p(e,"alt",i)},d(s){s&&v(e)}}}function mm(n,e){let t,i,s,l,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,k=e[16].logo&&pm(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),s=b("figure"),k&&k.c(),l=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),h=C(),p(s,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"type","button"),p(i,"class","provider-card handle"),p(t,"class","col-6"),this.first=t},m($,T){w($,t,T),y(t,i),y(i,s),k&&k.m(s,null),y(i,l),y(i,o),y(o,r),y(r,u),y(o,f),y(o,c),y(c,m),y(t,h),g||(_=Y(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=pm(e),k.c(),k.m(s,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&se(u,a),T&8&&d!==(d=e[16].key+"")&&se(m,d)},d($){$&&v(t),k&&k.d(),g=!1,_()}}}function iO(n){let e,t,i,s=[],l=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[nO,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=ce(n[3]);const a=f=>f[16].key;for(let f=0;f!s.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=$=>f($);function _($){ne[$?"unshift":"push"](()=>{l=$,t(2,l)})}function k($){Le.call(this,n,$)}function S($){Le.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,s=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||s!==-1)&&t(3,r=c())},[u,o,l,r,f,d,s,a,m,h,g,_,k,S]}class aO extends we{constructor(e){super(),ve(this,e,rO,oO,be,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const s=i[9](i[28].name);return i[29]=s,i}function uO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(s,"for",o=n[27])},m(u,f){w(u,e,f),e.checked=n[0].oauth2.enabled,w(u,i,f),w(u,s,f),y(s,l),r||(a=Y(e,"change",n[10]),r=!0)},p(u,f){f[0]&134217728&&t!==(t=u[27])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].oauth2.enabled),f[0]&134217728&&o!==(o=u[27])&&p(s,"for",o)},d(u){u&&(v(e),v(i),v(s)),r=!1,a()}}}function fO(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function cO(n){let e,t,i;return{c(){e=b("img"),Sn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l[0]&1&&!Sn(e.src,t="./images/oauth2/"+s[29].logo)&&p(e,"src",t),l[0]&1&&i!==(i=s[29].title+" logo")&&p(e,"alt",i)},d(s){s&&v(e)}}}function _m(n){let e,t,i;function s(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,{text:"Edit config",position:"left"})),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&v(e),t=!1,Ee(i)}}}function gm(n,e){var $;let t,i,s,l,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,O){var E;return(E=T[29])!=null&&E.logo?cO:fO}let _=g(e),k=_(e),S=e[29]&&_m(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),s=b("figure"),k.c(),l=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),h=C(),S&&S.c(),p(s,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),x(i,"error",!U.isEmpty((E=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){w(T,t,O),y(t,i),y(i,s),k.m(s,null),y(i,l),y(i,o),y(o,r),y(r,u),y(o,f),y(o,c),y(c,m),y(i,h),S&&S.m(i,null)},p(T,O){var E,L,I,A;e=T,_===(_=g(e))&&k?k.p(e,O):(k.d(1),k=_(e),k&&(k.c(),k.m(s,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&se(u,a),O[0]&1&&d!==(d=e[28].name+"")&&se(m,d),e[29]?S?S.p(e,O):(S=_m(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&x(i,"error",!U.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&v(t),k.d(),S&&S.d()}}}function dO(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function pO(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function bm(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;return s=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[mO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[hO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[_O,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[gO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,k){w(_,e,k),y(e,t),y(t,i),q(s,i,null),y(t,l),y(t,o),q(r,o,null),y(t,a),y(t,u),q(f,u,null),y(t,c),y(t,d),q(m,d,null),g=!0},p(_,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:_}),s.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:_}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:_}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:_}),m.$set(O)},i(_){g||(M(s.$$.fragment,_),M(r.$$.fragment,_),M(f.$$.fragment,_),M(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=qe(e,ht,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(s.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=qe(e,ht,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&v(e),j(s),j(r),j(f),j(m),_&&h&&h.end()}}}function mO(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:SO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),l=new ps({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 full name"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),y(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(v(e),v(s)),j(l,f)}}}function hO(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:TO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),l=new ps({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 avatar"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),y(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(v(e),v(s)),j(l,f)}}}function _O(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:$O,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),l=new ps({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 id"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),y(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(v(e),v(s)),j(l,f)}}}function gO(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:CO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),l=new ps({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 username"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),y(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(v(e),v(s)),j(l,f)}}}function bO(n){let e,t,i,s=[],l=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,k,S,$,T,O,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[uO,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=ce(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=W("Optional "),h=W(m),g=W(" create fields map"),_=C(),N.c(),S=C(),R&&R.c(),$=ke(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),w(z,t,F),w(z,i,F);for(let B=0;B{R=null}),re())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(v(t),v(i),v(u),v(f),v(S),v($)),j(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),w(a,o,u),w(a,r,u)},p(a,u){u[0]&128&&se(t,a[7]),u[0]&128&&s!==(s=a[7]==1?"provider":"providers")&&se(l,s),u[0]&128&&x(e,"label-warning",!a[7]),u[0]&128&&x(e,"label-info",a[7]>0)},d(a){a&&(v(e),v(o),v(r))}}}function km(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function vO(n){let e,t,i,s,l,o;function r(c,d){return c[0].oauth2.enabled?yO:kO}let a=r(n),u=a(n),f=n[8]&&km();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[8]?f?d[0]&256&&M(f,1):(f=km(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(t),v(i),v(s),v(l),v(o)),u.d(c),f&&f.d(c)}}}function wO(n){var u,f;let e,t,i,s,l,o;e=new zi({props:{single:!0,$$slots:{header:[vO],default:[bO]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(ym))||[]};i=new aO({props:r}),n[18](i),i.$on("select",n[19]);let a={};return l=new cC({props:a}),n[20](l),l.$on("remove",n[21]),l.$on("submit",n[22]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(c,d){q(e,c,d),w(c,t,d),q(i,c,d),w(c,s,d),q(l,c,d),o=!0},p(c,d){var _,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:k.map(ym))||[]),i.$set(h);const g={};l.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(l.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(l.$$.fragment,c),o=!1},d(c){c&&(v(t),v(s)),j(e,c),n[18](null),j(i,c),n[20](null),j(l,c)}}}const SO=()=>"",TO=()=>"",$O=()=>"",CO=()=>"",ym=n=>n.name;function OO(n,e,t){let i,s,l;Ge(n,$n,F=>t(1,l=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function g(F=[]){var B,J;t(5,m=((B=F==null?void 0:F.filter(V=>a.includes(V.type)&&!r.includes(V.name)))==null?void 0:B.map(V=>V.name))||[]),t(6,h=((J=F==null?void 0:F.filter(V=>u.includes(V.type)&&!r.includes(V.name)))==null?void 0:J.map(V=>V.name))||[])}function _(F){for(let B of lf)if(B.key==F)return B;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,B,J)=>{c==null||c.show(F,B,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ne[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var B,J;c.show(F.detail,{},((J=(B=o.oauth2)==null?void 0:B.providers)==null?void 0:J.length)||0)};function N(F){ne[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const B=F.detail.uiOptions;U.removeByKey(o.oauth2.providers,"name",B.key),t(0,o)},z=F=>{const B=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),U.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:B.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,B;n.$$.dirty[0]&1&&U.isEmpty(o.oauth2)&&t(0,o.oauth2={enabled:!1,mappedFields:{},providers:[]},o),n.$$.dirty[0]&1&&g(o.fields),n.$$.dirty[0]&2&&t(8,i=!U.isEmpty(l==null?void 0:l.oauth2)),n.$$.dirty[0]&1&&t(7,s=((B=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:B.length)||0)},[o,l,f,c,d,m,h,s,i,_,k,S,$,T,O,E,L,I,A,P,N,R,z]}class MO extends we{constructor(e){super(),ve(this,e,OO,wO,be,{collection:0},null,[-1,-1])}}function vm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(s){s&&v(e),t=!1,i()}}}function EO(n){let e,t,i,s,l,o,r,a,u,f,c=n[2]&&vm();return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"for",o=n[8])},m(d,m){w(d,e,m),e.checked=n[0].otp.enabled,w(d,i,m),w(d,s,m),y(s,l),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=[Y(e,"change",n[4]),Y(e,"change",n[5])],u=!0)},p(d,m){m&256&&t!==(t=d[8])&&p(e,"id",t),m&1&&(e.checked=d[0].otp.enabled),m&256&&o!==(o=d[8])&&p(s,"for",o),d[2]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(i),v(s),v(r),v(a)),c&&c.d(d),u=!1,Ee(f)}}}function DO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Duration (in seconds)"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"min","0"),p(l,"step","1"),p(l,"id",o=n[8]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].otp.duration),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].otp.duration&&me(l,u[0].otp.duration)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function IO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Generated password length"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"min","0"),p(l,"step","1"),p(l,"id",o=n[8]),l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].otp.length),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].otp.length&&me(l,u[0].otp.length)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function LO(n){let e,t,i,s,l,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[EO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[DO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[IO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),p(s,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),w(f,t,c),w(f,i,c),y(i,s),q(l,s,null),y(i,o),y(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),l.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(l.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(v(t),v(i)),j(e,f),j(l),j(a)}}}function AO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function PO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wm(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function NO(n){let e,t,i,s,l,o;function r(c,d){return c[0].otp.enabled?PO:AO}let a=r(n),u=a(n),f=n[1]&&wm();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&M(f,1):(f=wm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(t),v(i),v(s),v(l),v(o)),u.d(c),f&&f.d(c)}}}function RO(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[NO],default:[LO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function FO(n,e,t){let i,s,l;Ge(n,$n,c=>t(3,l=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=mt(this.value),t(0,o)}function f(){o.otp.length=mt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(o.otp)&&t(0,o.otp={enabled:!0,duration:300,length:8},o),n.$$.dirty&1&&t(2,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&8&&t(1,s=!U.isEmpty(l==null?void 0:l.otp))},[o,s,i,l,r,a,u,f]}class qO extends we{constructor(e){super(),ve(this,e,FO,RO,be,{collection:0})}}function Sm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(s){s&&v(e),t=!1,i()}}}function jO(n){let e,t,i,s,l,o,r,a,u,f,c=n[3]&&Sm();return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(s,"for",o=n[9])},m(d,m){w(d,e,m),e.checked=n[0].passwordAuth.enabled,w(d,i,m),w(d,s,m),y(s,l),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(s,"for",o),d[3]?c||(c=Sm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(i),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function HO(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),l=new Ln({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",s=C(),H(l.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){w(f,e,c),y(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(v(e),v(s)),j(l,f)}}}function zO(n){let e,t,i,s;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[jO,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[HO,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&v(t),j(e,l),j(i,l)}}}function UO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function VO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Tm(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),s=!1,l()}}}function BO(n){let e,t,i,s,l,o;function r(c,d){return c[0].passwordAuth.enabled?VO:UO}let a=r(n),u=a(n),f=n[2]&&Tm();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&M(f,1):(f=Tm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(t),v(i),v(s),v(l),v(o)),u.d(c),f&&f.d(c)}}}function WO(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[BO],default:[zO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&1039&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function YO(n,e,t){let i,s,l;Ge(n,$n,d=>t(5,l=d));let{collection:o}=e,r=[],a="";function u(){t(1,r=[{value:"email"}]);const d=(o==null?void 0:o.fields)||[],m=(o==null?void 0:o.indexes)||[];t(4,a=m.join(""));for(let h of m){const g=U.parseIndex(h);if(!g.unique||g.columns.length!=1||g.columns[0].name=="email")continue;const _=d.find(k=>!k.hidden&&k.name.toLowerCase()==g.columns[0].name.toLowerCase());_&&r.push({value:_.name})}}function f(){o.passwordAuth.enabled=this.checked,t(0,o)}function c(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,s=!U.isEmpty(l==null?void 0:l.passwordAuth)),n.$$.dirty&17&&o&&a!=o.indexes.join("")&&u()},[o,r,s,i,a,l,f,c]}class KO extends we{constructor(e){super(),ve(this,e,YO,WO,be,{collection:0})}}function $m(n,e,t){const i=n.slice();return i[27]=e[t],i}function Cm(n,e){let t,i,s,l,o,r=e[27].label+"",a,u,f,c,d,m;return c=Xy(e[15][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),l=C(),o=b("label"),a=W(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[26]+e[27].value),i.__value=e[27].value,me(i,i.__value),p(o,"for",u=e[26]+e[27].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,g){w(h,t,g),y(t,i),i.checked=i.__value===e[3],y(t,l),y(t,o),y(o,a),y(t,f),d||(m=Y(i,"change",e[14]),d=!0)},p(h,g){e=h,g&67108864&&s!==(s=e[26]+e[27].value)&&p(i,"id",s),g&8&&(i.checked=i.__value===e[3]),g&67108864&&u!==(u=e[26]+e[27].value)&&p(o,"for",u)},d(h){h&&v(t),c.r(),d=!1,m()}}}function JO(n){let e=[],t=new Map,i,s=ce(n[11]);const l=o=>o[27].value;for(let o=0;o({26:i}),({uniqueId:i})=>i?67108864:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1140850882&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ZO(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[26],selectPlaceholder:n[7]?"Loading auth collections...":"Select auth collection",noOptionsText:"No auth collections found",selectionKey:"id",items:n[6]};return n[1]!==void 0&&(u.keyOfSelected=n[1]),l=new Ln({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Auth collection"),s=C(),H(l.$$.fragment),p(e,"for",i=n[26])},m(f,c){w(f,e,c),y(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&67108864&&i!==(i=f[26]))&&p(e,"for",i);const d={};c&67108864&&(d.id=f[26]),c&128&&(d.selectPlaceholder=f[7]?"Loading auth collections...":"Select auth collection"),c&64&&(d.items=f[6]),!o&&c&2&&(o=!0,d.keyOfSelected=f[1],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(v(e),v(s)),j(l,f)}}}function GO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("To email address"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","email"),p(l,"id",o=n[26]),l.autofocus=!0,l.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),l.focus(),r||(a=Y(l,"input",n[17]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function XO(n){let e,t,i,s,l,o,r,a;t=new fe({props:{class:"form-field required",name:"template",$$slots:{default:[JO,({uniqueId:f})=>({26:f}),({uniqueId:f})=>f?67108864:0]},$$scope:{ctx:n}}});let u=n[8]&&Om(n);return l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[GO,({uniqueId:f})=>({26:f}),({uniqueId:f})=>f?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),u&&u.c(),s=C(),H(l.$$.fragment),p(e,"id",n[10]),p(e,"autocomplete","off")},m(f,c){w(f,e,c),q(t,e,null),y(e,i),u&&u.m(e,null),y(e,s),q(l,e,null),o=!0,r||(a=Y(e,"submit",it(n[18])),r=!0)},p(f,c){const d={};c&1140850696&&(d.$$scope={dirty:c,ctx:f}),t.$set(d),f[8]?u?(u.p(f,c),c&256&&M(u,1)):(u=Om(f),u.c(),M(u,1),u.m(e,s)):u&&(oe(),D(u,1,1,()=>{u=null}),re());const m={};c&1140850692&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(M(t.$$.fragment,f),M(u),M(l.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),D(u),D(l.$$.fragment,f),o=!1},d(f){f&&v(e),j(t),u&&u.d(),j(l),r=!1,a()}}}function QO(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function xO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),s=b("button"),l=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[5],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[10]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[5],x(s,"btn-loading",n[5])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,s,d),y(s,l),y(s,o),y(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&32&&(e.disabled=c[5]),d&544&&a!==(a=!c[9]||c[5])&&(s.disabled=a),d&32&&x(s,"btn-loading",c[5])},d(c){c&&(v(e),v(i),v(s)),u=!1,f()}}}function eM(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[5],escClose:!n[5],beforeHide:n[19],popup:!0,$$slots:{footer:[xO],header:[QO],default:[XO]},$$scope:{ctx:n}};return e=new nn({props:i}),n[20](e),e.$on("show",n[21]),e.$on("hide",n[22]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.overlayClose=!s[5]),l&32&&(o.escClose=!s[5]),l&32&&(o.beforeHide=s[19]),l&1073742830&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[20](null),j(e,s)}}}const ya="last_email_test",Mm="email_test_request";function tM(n,e,t){let i;const s=wt(),l="email_test_"+U.randomString(5),o=[{label:"Verification",value:"verification"},{label:"Password reset",value:"password-reset"},{label:"Confirm email change",value:"email-change"},{label:"OTP",value:"otp"},{label:"Login alert",value:"login-alert"}];let r,a="",u=localStorage.getItem(ya),f=o[0].value,c=!1,d=null,m=[],h=!1,g=!1;function _(z="",F="",B=""){Jt({}),t(8,g=!1),t(1,a=z||""),a||$(),t(2,u=F||localStorage.getItem(ya)),t(3,f=B||o[0].value),r==null||r.show()}function k(){return clearTimeout(d),r==null?void 0:r.hide()}async function S(){if(!(!i||c||!a)){t(5,c=!0),localStorage==null||localStorage.setItem(ya,u),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Mm),Mi("Test email send timeout.")},3e4);try{await _e.settings.testEmail(a,u,f,{$cancelKey:Mm}),tn("Successfully sent test email."),s("submit"),t(5,c=!1),await _n(),k()}catch(z){t(5,c=!1),_e.error(z)}clearTimeout(d)}}async function $(){var z;t(8,g=!0),t(7,h=!0);try{t(6,m=await _e.collections.getFullList({filter:"type='auth'",sort:"+name",requestKey:l+"_collections_loading"})),t(1,a=((z=m[0])==null?void 0:z.id)||""),t(7,h=!1)}catch(F){F.isAbort||(t(7,h=!1),_e.error(F))}}const T=[[]];function O(){f=this.__value,t(3,f)}function E(z){a=z,t(1,a)}function L(){u=this.value,t(2,u)}const I=()=>S(),A=()=>!c;function P(z){ne[z?"unshift":"push"](()=>{r=z,t(4,r)})}function N(z){Le.call(this,n,z)}function R(z){Le.call(this,n,z)}return n.$$.update=()=>{n.$$.dirty&14&&t(9,i=!!u&&!!f&&!!a)},[k,a,u,f,r,c,m,h,g,i,l,o,S,_,O,T,E,L,I,A,P,N,R]}class Dy extends we{constructor(e){super(),ve(this,e,tM,eM,be,{show:13,hide:0})}get show(){return this.$$.ctx[13]}get hide(){return this.$$.ctx[0]}}function Em(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function nM(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){w(u,e,f),e.checked=n[0].authAlert.enabled,w(u,i,f),w(u,s,f),y(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].authAlert.enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&(v(e),v(i),v(s)),r=!1,a()}}}function Dm(n){let e,t,i;function s(o){n[11](o)}let l={};return n[0]!==void 0&&(l.collection=n[0]),e=new MO({props:l}),ne.push(()=>ge(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Im(n,e){var a;let t,i,s,l;function o(u){e[15](u,e[18])}let r={single:!0,key:e[18].key,title:e[18].label,placeholders:(a=e[18])==null?void 0:a.placeholders};return e[18].config!==void 0&&(r.config=e[18].config),i=new h8({props:r}),ne.push(()=>ge(i,"config",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),q(i,u,f),l=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!s&&f&4&&(s=!0,c.config=e[18].config,$e(()=>s=!1)),i.$set(c)},i(u){l||(M(i.$$.fragment,u),l=!0)},o(u){D(i.$$.fragment,u),l=!1},d(u){u&&v(t),j(i,u)}}}function iM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P=[],N=new Map,R,z,F,B,J,V,Z,G,de,pe,ae;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[nM,({uniqueId:Ie})=>({21:Ie}),({uniqueId:Ie})=>Ie?2097152:0]},$$scope:{ctx:n}}});function Ce(Ie){n[10](Ie)}let Ye={};n[0]!==void 0&&(Ye.collection=n[0]),u=new KO({props:Ye}),ne.push(()=>ge(u,"collection",Ce));let Ke=!n[1]&&Dm(n);function ct(Ie){n[12](Ie)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new qO({props:et}),ne.push(()=>ge(m,"collection",ct));function xe(Ie){n[13](Ie)}let Be={};n[0]!==void 0&&(Be.collection=n[0]),_=new z8({props:Be}),ne.push(()=>ge(_,"collection",xe));let ut=ce(n[2]);const Bt=Ie=>Ie[18].key;for(let Ie=0;Iege(J,"collection",Ue));let ot={};return G=new Dy({props:ot}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),c=C(),Ke&&Ke.c(),d=C(),H(m.$$.fragment),g=C(),H(_.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),E=b("button"),E.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let Ie=0;Ief=!1)),u.$set(nt),Ie[1]?Ke&&(oe(),D(Ke,1,1,()=>{Ke=null}),re()):Ke?(Ke.p(Ie,We),We&2&&M(Ke,1)):(Ke=Dm(Ie),Ke.c(),M(Ke,1),Ke.m(a,d));const zt={};!h&&We&1&&(h=!0,zt.collection=Ie[0],$e(()=>h=!1)),m.$set(zt);const Ne={};!k&&We&1&&(k=!0,Ne.collection=Ie[0],$e(()=>k=!1)),_.$set(Ne),We&4&&(ut=ce(Ie[2]),oe(),P=kt(P,We,Bt,1,Ie,ut,N,A,Yt,Im,null,Em),re());const Me={};!V&&We&1&&(V=!0,Me.collection=Ie[0],$e(()=>V=!1)),J.$set(Me);const bt={};G.$set(bt)},i(Ie){if(!de){M(o.$$.fragment,Ie),M(u.$$.fragment,Ie),M(Ke),M(m.$$.fragment,Ie),M(_.$$.fragment,Ie);for(let We=0;Wec==null?void 0:c.show(u.id);function S(O,E){n.$$.not_equal(E.config,O)&&(E.config=O,t(2,f),t(1,i),t(7,s),t(5,r),t(4,a),t(8,l),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ne[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,E;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,s={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,l={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[s,r,a]:[l,s,o,r,a])},[u,i,f,c,a,r,o,s,l,d,m,h,g,_,k,S,$,T]}class sM extends we{constructor(e){super(),ve(this,e,lM,iM,be,{collection:0})}}const oM=n=>({dragging:n&4,dragover:n&8}),Lm=n=>({dragging:n[2],dragover:n[3]});function rM(n){let e,t,i,s,l;const o=n[10].default,r=Nt(o,n,n[9],Lm);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",it(n[11])),Y(e,"dragleave",it(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Ft(r,o,a,a[9],i?Rt(o,a[9],u,oM):qt(a[9]),Lm),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),s=!1,Ee(l)}}}function aM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),l("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const L=E.index<<0;L{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,s=T.$$scope)},[o,u,c,d,m,h,r,a,f,s,i,g,_,k,S,$]}class ms extends we{constructor(e){super(),ve(this,e,aM,rM,be,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Am(n,e,t){const i=n.slice();return i[27]=e[t],i}function uM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),s=C(),l=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),y(l,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(v(e),v(s),v(l)),a=!1,u()}}}function fM(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Ht(o,r(n)),ne.push(()=>ge(e,"value",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){oe();const c=e;D(c.$$.fragment,1,0,()=>{j(c,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],$e(()=>t=!1)),e.$set(c)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&v(i),e&&j(e,a)}}}function cM(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&v(e)}}}function dM(n){let e,t,i,s;const l=[cM,fM],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&v(i),o[e].d(a)}}}function Pm(n){let e,t,i,s=ce(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[dM,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Pm(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),r&&r.c(),l=ke()},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Pm(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(s),v(l)),j(e,a),j(i,a),r&&r.d(a)}}}function mM(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=b("h4"),i=W(t),s=W(" index")},m(l,o){w(l,e,o),y(e,i),y(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&se(i,t)},d(l){l&&v(e)}}}function Rm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:te,d(s){s&&v(e),t=!1,Ee(i)}}}function hM(n){let e,t,i,s,l,o,r=n[5]!=""&&Rm(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),s=b("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),x(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Rm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(s,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(s)),r&&r.d(a),l=!1,Ee(o)}}}function _M(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[hM],header:[mM],default:[pM]},$$scope:{ctx:n}};for(let l=0;lZ.name==B);V?U.removeByValue(J.columns,V):U.pushUnique(J.columns,{name:B}),t(2,d=U.buildIndex(J))}an(async()=>{t(8,g=!0);try{t(7,h=(await $t(async()=>{const{default:B}=await import("./CodeEditor-CHQR53XK.js");return{default:B}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const E=()=>$(),L=()=>k(),I=()=>T(),A=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=U.buildIndex(s))};function P(B){d=B,t(2,d)}const N=B=>O(B);function R(B){ne[B?"unshift":"push"](()=>{f=B,t(4,f)})}function z(B){Le.call(this,n,B)}function F(B){Le.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),Kt(B)),t(14,r=lt(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,J,V;n.$$.dirty[0]&1&&t(10,i=((J=(B=u==null?void 0:u.fields)==null?void 0:B.filter(Z=>!Z.toDelete&&Z.name!="id"))==null?void 0:J.map(Z=>Z.name))||[]),n.$$.dirty[0]&4&&t(3,s=U.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((V=s.columns)==null?void 0:V.map(Z=>Z.name))||[])},[u,k,d,s,f,c,m,h,g,l,i,$,T,O,r,_,E,L,I,A,P,N,R,z,F]}class bM extends we{constructor(e){super(),ve(this,e,gM,_M,be,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Fm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=U.parseIndex(i[10]);return i[11]=s,i}function qm(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){var u;w(r,e,a),s=!0,l||(o=Oe(t=Re.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),l=!0)},p(r,a){var u;t&&Lt(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){s||(r&&tt(()=>{s&&(i||(i=qe(e,Ct,{duration:150},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Ct,{duration:150},!1)),i.run(0)),s=!1},d(r){r&&v(e),r&&i&&i.end(),l=!1,o()}}}function jm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Hm(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(zm).join(", "))+"",l,o,r,a,u,f=n[11].unique&&jm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),l=W(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;w(m,e,h),f&&f.m(e,null),y(e,t),y(e,i),y(i,l),a||(u=[Oe(r=Re.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),Y(e,"click",c)],a=!0)},p(m,h){var g,_,k,S,$;n=m,n[11].unique?f||(f=jm(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(zm).join(", "))+"")&&se(l,s),h&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Lt(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&v(e),f&&f.d(),a=!1,Ee(u)}}}function kM(n){var O,E,L,I,A;let e,t,i=(((E=(O=n[0])==null?void 0:O.indexes)==null?void 0:E.length)||0)+"",s,l,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&qm(n),k=ce(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;Pge(c,"collection",$)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),s=W(i),l=W(`) `),_&&_.c(),o=C(),r=b("div");for(let P=0;P+ New index',f=C(),H(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){w(P,e,N),y(e,t),y(e,s),y(e,l),_&&_.m(e,null),w(P,o,N),w(P,r,N);for(let R=0;R{_=null}),re()),N&7){k=ce(((V=P[0])==null?void 0:V.indexes)||[]);let Z;for(Z=0;Zd=!1)),c.$set(R)},i(P){m||(M(_),M(c.$$.fragment,P),m=!0)},o(P){D(_),D(c.$$.fragment,P),m=!1},d(P){P&&(v(e),v(o),v(r),v(f)),_&&_.d(),dt(S,P),n[6](null),j(c,P),h=!1,g()}}}const zm=n=>n.name;function yM(n,e,t){let i;Ge(n,$n,m=>t(2,i=m));let{collection:s}=e,l;function o(m,h){for(let g=0;gl==null?void 0:l.show(m,h),a=()=>l==null?void 0:l.show();function u(m){ne[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const c=m=>{for(let h=0;h{var h;(h=i.indexes)!=null&&h.message&&Yn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,c,d]}class vM extends we{constructor(e){super(),ve(this,e,yM,kM,be,{collection:0})}}function Um(n,e,t){const i=n.slice();return i[5]=e[t],i}function Vm(n){let e,t,i,s,l,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent=`${n[5].label}`,l=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){w(u,e,f),y(e,t),y(e,i),y(e,s),y(e,l),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&v(e),o=!1,r()}}}function wM(n){let e,t=ce(n[1]),i=[];for(let s=0;so(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,l,o,r]}class $M extends we{constructor(e){super(),ve(this,e,TM,SM,be,{class:0})}}const CM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Bm=n=>({interactive:n[7],hasErrors:n[6]}),OM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Wm=n=>({interactive:n[7],hasErrors:n[6]}),MM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Ym=n=>({interactive:n[7],hasErrors:n[6]});function Km(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Jm(n){let e,t;return{c(){e=b("span"),t=W(n[5]),p(e,"class","label label-success")},m(i,s){w(i,e,s),y(e,t)},p(i,s){s[0]&32&&se(t,i[5])},d(i){i&&v(e)}}}function Zm(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function EM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=n[0].required&&Jm(n),g=n[0].hidden&&Zm();return{c(){e=b("div"),h&&h.c(),t=C(),g&&g.c(),i=C(),s=b("div"),l=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(l,"class",o=U.getFieldTypeIcon(n[0].type)),p(s,"class","form-field-addon prefix field-type-icon"),x(s,"txt-disabled",!n[7]||n[0].system),p(u,"type","text"),u.required=!0,u.disabled=f=!n[7]||n[0].system,p(u,"spellcheck","false"),p(u,"placeholder","Field name"),u.value=c=n[0].name,p(u,"title","System field")},m(_,k){w(_,e,k),h&&h.m(e,null),y(e,t),g&&g.m(e,null),w(_,i,k),w(_,s,k),y(s,l),w(_,a,k),w(_,u,k),n[22](u),d||(m=[Oe(r=Re.call(null,s,n[0].type+(n[0].system?" (system)":""))),Y(s,"click",n[21]),Y(u,"input",n[23])],d=!0)},p(_,k){_[0].required?h?h.p(_,k):(h=Jm(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Zm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k[0]&1&&o!==(o=U.getFieldTypeIcon(_[0].type))&&p(l,"class",o),r&&Lt(r.update)&&k[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),k[0]&129&&x(s,"txt-disabled",!_[7]||_[0].system),k[0]&129&&f!==(f=!_[7]||_[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=_[0].name)&&u.value!==c&&(u.value=c)},d(_){_&&(v(e),v(i),v(s),v(a),v(u)),h&&h.d(),g&&g.d(),n[22](null),d=!1,Ee(m)}}}function DM(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function IM(n){let e,t,i,s,l,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label",i="Toggle "+n[0].name+" field options"),p(e,"class",s="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),x(e,"btn-hint",!n[4]&&!n[6]),x(e,"btn-danger",n[6])},m(r,a){w(r,e,a),y(e,t),l||(o=Y(e,"click",n[17]),l=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&s!==(s="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",s),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&x(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&x(e,"btn-danger",r[6])},d(r){r&&v(e),l=!1,o()}}}function LM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,"Restore")),Y(e,"click",n[14])],t=!0)},p:te,d(s){s&&v(e),t=!1,Ee(i)}}}function Gm(n){let e,t,i,s,l=!n[0].primaryKey&&n[0].type!="autodate"&&(!n[8]||!n[10].includes(n[0].name)),o,r=!n[0].primaryKey&&(!n[8]||!n[11].includes(n[0].name)),a,u=!n[8]||!n[12].includes(n[0].name),f,c,d,m;const h=n[20].options,g=Nt(h,n,n[28],Wm);let _=l&&Xm(n),k=r&&Qm(n),S=u&&xm(n);const $=n[20].optionsFooter,T=Nt($,n,n[28],Bm);let O=!n[0]._toDelete&&!n[0].primaryKey&&eh(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),s=b("div"),_&&_.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){w(E,e,L),y(e,t),g&&g.m(t,null),y(e,i),y(e,s),_&&_.m(s,null),y(s,o),k&&k.m(s,null),y(s,a),S&&S.m(s,null),y(s,f),T&&T.m(s,null),y(s,c),O&&O.m(s,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Ft(g,h,E,E[28],m?Rt(h,E[28],L,OM):qt(E[28]),Wm),L[0]&257&&(l=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),l?_?(_.p(E,L),L[0]&257&&M(_,1)):(_=Xm(E),_.c(),M(_,1),_.m(s,o)):_&&(oe(),D(_,1,1,()=>{_=null}),re()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?k?(k.p(E,L),L[0]&257&&M(k,1)):(k=Qm(E),k.c(),M(k,1),k.m(s,a)):k&&(oe(),D(k,1,1,()=>{k=null}),re()),L[0]&257&&(u=!E[8]||!E[12].includes(E[0].name)),u?S?(S.p(E,L),L[0]&257&&M(S,1)):(S=xm(E),S.c(),M(S,1),S.m(s,f)):S&&(oe(),D(S,1,1,()=>{S=null}),re()),T&&T.p&&(!m||L[0]&268435648)&&Ft(T,$,E,E[28],m?Rt($,E[28],L,CM):qt(E[28]),Bm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,L),L[0]&1&&M(O,1)):(O=eh(E),O.c(),M(O,1),O.m(s,null)):O&&(oe(),D(O,1,1,()=>{O=null}),re())},i(E){m||(M(g,E),M(_),M(k),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=qe(e,ht,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(_),D(k),D(S),D(T,E),D(O),E&&(d||(d=qe(e,ht,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&v(e),g&&g.d(E),_&&_.d(),k&&k.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function Xm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[AM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435489|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function AM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),o=W(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[34])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,s,h),y(s,l),y(l,o),y(s,r),y(s,a),c||(d=[Y(e,"change",n[24]),Oe(u=Re.call(null,a,{text:`Requires the field value NOT to be ${U.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&(e.checked=m[0].required),h[0]&32&&se(o,m[5]),u&&Lt(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${U.zeroDefaultStr(m[0])}.`}),h[1]&8&&f!==(f=m[34])&&p(s,"for",f)},d(m){m&&(v(e),v(i),v(s)),c=!1,Ee(d)}}}function Qm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[PM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435457|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function PM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].hidden,w(c,i,d),w(c,s,d),y(s,l),y(s,o),y(s,r),u||(f=[Y(e,"change",n[25]),Y(e,"change",n[26]),Oe(Re.call(null,r,{text:"Hide from the JSON API response and filters."}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].hidden),d[1]&8&&a!==(a=c[34])&&p(s,"for",a)},d(c){c&&(v(e),v(i),v(s)),u=!1,Ee(f)}}}function xm(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[NM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435457|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function NM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("input"),s=C(),l=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(l,"for",f=n[34])},m(m,h){w(m,e,h),e.checked=n[0].presentable,w(m,s,h),w(m,l,h),y(l,o),y(l,r),y(l,a),c||(d=[Y(e,"change",n[27]),Oe(Re.call(null,a,{text:"Whether the field should be preferred in the Superuser UI relation listings (default to auto)."}))],c=!0)},p(m,h){h[1]&8&&t!==(t=m[34])&&p(e,"id",t),h[0]&1&&i!==(i=m[0].hidden)&&(e.disabled=i),h[0]&1&&(e.checked=m[0].presentable),h[0]&1&&u!==(u="ri-information-line "+(m[0].hidden?"txt-disabled":"link-hint"))&&p(a,"class",u),h[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(v(e),v(s),v(l)),c=!1,Ee(d)}}}function eh(n){let e,t,i,s,l,o,r;return o=new Dn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[RM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),s=b("i"),l=C(),H(o.$$.fragment),p(s,"class","ri-more-line"),p(s,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(i,s),y(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&v(e),j(o)}}}function th(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[13])),t=!0)},p:te,d(s){s&&v(e),t=!1,i()}}}function RM(n){let e,t,i,s,l,o=!n[0].system&&th(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ke(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){w(r,e,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s||(l=Y(e,"click",it(n[15])),s=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=th(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(v(e),v(t),v(i)),o&&o.d(r),s=!1,l()}}}function FM(n){let e,t,i,s,l,o,r,a,u,f=n[7]&&n[2]&&Km();s=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[EM]},$$scope:{ctx:n}}});const c=n[20].default,d=Nt(c,n,n[28],Ym),m=d||DM();function h(S,$){if(S[0]._toDelete)return LM;if(S[7])return IM}let g=h(n),_=g&&g(n),k=n[7]&&n[4]&&Gm(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),H(s.$$.fragment),l=C(),m&&m.c(),o=C(),_&&_.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[7]&&n[4]),x(e,"deleted",n[0]._toDelete)},m(S,$){w(S,e,$),y(e,t),f&&f.m(t,null),y(t,i),q(s,t,null),y(t,l),m&&m.m(t,null),y(t,o),_&&_.m(t,null),y(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=Km(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),s.$set(T),d&&d.p&&(!u||$[0]&268435648)&&Ft(d,c,S,S[28],u?Rt(c,S[28],$,MM):qt(S[28]),Ym),g===(g=h(S))&&_?_.p(S,$):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&M(k,1)):(k=Gm(S),k.c(),M(k,1),k.m(e,null)):k&&(oe(),D(k,1,1,()=>{k=null}),re()),(!u||$[0]&1)&&x(e,"required",S[0].required),(!u||$[0]&144)&&x(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&x(e,"deleted",S[0]._toDelete)},i(S){u||(M(s.$$.fragment,S),M(m,S),M(k),S&&tt(()=>{u&&(a||(a=qe(e,ht,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(s.$$.fragment,S),D(m,S),D(k),S&&(a||(a=qe(e,ht,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&v(e),f&&f.d(),j(s),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let va=[];function qM(n,e,t){let i,s,l,o,r;Ge(n,$n,pe=>t(19,r=pe));let{$$slots:a={},$$scope:u}=e;const f="f_"+U.randomString(8),c=wt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:k=U.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,O=!1;function E(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function L(){t(0,k._toDelete=!1,k),Jt({})}function I(){k._toDelete||(N(),c("duplicate"))}function A(pe){return U.slugify(pe)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let pe of va)pe.id!=f&&pe.collapse()}an(()=>(va.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{U.removeByKey(va,"id",f)}));const F=()=>T==null?void 0:T.focus();function B(pe){ne[pe?"unshift":"push"](()=>{T=pe,t(3,T)})}const J=pe=>{const ae=k.name;t(0,k.name=A(pe.target.value),k),pe.target.value=k.name,c("rename",{oldName:ae,newName:k.name})};function V(){k.required=this.checked,t(0,k)}function Z(){k.hidden=this.checked,t(0,k)}const G=pe=>{pe.target.checked&&t(0,k.presentable=!1,k)};function de(){k.presentable=this.checked,t(0,k)}return n.$$set=pe=>{"key"in pe&&t(1,_=pe.key),"field"in pe&&t(0,k=pe.field),"draggable"in pe&&t(2,S=pe.draggable),"collection"in pe&&t(18,$=pe.collection),"$$scope"in pe&&t(28,u=pe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,s=!k._toDelete),n.$$.dirty[0]&524290&&t(6,l=!U.isEmpty(U.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,_,S,T,O,o,l,s,i,c,m,h,g,E,L,I,A,R,$,r,a,F,B,J,V,Z,G,de,u]}class Kn extends we{constructor(e){super(),ve(this,e,qM,FM,be,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function jM(n){let e,t,i,s,l,o;function r(u){n[5](u)}let a={id:n[13],items:n[3],disabled:n[0].system,readonly:!n[12]};return n[2]!==void 0&&(a.keyOfSelected=n[2]),t=new Ln({props:a}),ne.push(()=>ge(t,"keyOfSelected",r)),{c(){e=b("div"),H(t.$$.fragment)},m(u,f){w(u,e,f),q(t,e,null),s=!0,l||(o=Oe(Re.call(null,e,{text:"Auto set on:",position:"top"})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],$e(()=>i=!1)),t.$set(c)},i(u){s||(M(t.$$.fragment,u),s=!0)},o(u){D(t.$$.fragment,u),s=!1},d(u){u&&v(e),j(t),l=!1,o()}}}function HM(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[jM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&4096&&(u.class="form-field form-field-single-multiple-select form-field-autodate-select "+(r[12]?"":"readonly")),a&28677&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(s),v(l)),j(i,r)}}}function zM(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[6](r)}let o={$$slots:{default:[HM,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?vt(s,[a&2&&{key:r[1]},a&16&&At(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}const wa=1,Sa=2,Ta=3;function UM(n,e,t){const i=["field","key"];let s=lt(e,i);const l=[{label:"Create",value:wa},{label:"Update",value:Sa},{label:"Create/Update",value:Ta}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Ta:o.onUpdate?Sa:wa}function f(_){switch(_){case wa:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case Sa:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Ta:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!0,o);break}}function c(_){a=_,t(2,a)}function d(_){o=_,t(0,o)}function m(_){Le.call(this,n,_)}function h(_){Le.call(this,n,_)}function g(_){Le.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Kt(_)),t(4,s=lt(e,i)),"field"in _&&t(0,o=_.field),"key"in _&&t(1,r=_.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,l,s,c,d,m,h,g]}class VM extends we{constructor(e){super(),ve(this,e,UM,zM,be,{field:0,key:1})}}function BM(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rge(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function WM(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(c){l=c,t(0,l)}function a(c){Le.call(this,n,c)}function u(c){Le.call(this,n,c)}function f(c){Le.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Kt(c)),t(2,s=lt(e,i)),"field"in c&&t(0,l=c.field),"key"in c&&t(1,o=c.key)},[l,o,s,r,a,u,f]}class YM extends we{constructor(e){super(),ve(this,e,WM,BM,be,{field:0,key:1})}}var $a=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],es={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},to={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Nn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},xn=function(n){return n===!0?1:0};function nh(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Ca=function(n){return n instanceof Array?n:[n]};function On(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Mt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function Yo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Iy(n,e){if(e(n))return n;if(n.parentNode)return Iy(n.parentNode,e)}function Ko(n,e){var t=Mt("div","numInputWrapper"),i=Mt("input","numInput "+n),s=Mt("span","arrowUp"),l=Mt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Vn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Oa=function(){},yr=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},KM={D:Oa,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*xn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Oa,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Oa,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},wl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Hs={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[Hs.w(n,e,t)]},F:function(n,e,t){return yr(Hs.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Nn(Hs.h(n,e,t))},H:function(n){return Nn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[xn(n.getHours()>11)]},M:function(n,e){return yr(n.getMonth(),!0,e)},S:function(n){return Nn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Nn(n.getFullYear(),4)},d:function(n){return Nn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Nn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Nn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Ly=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,s=i===void 0?to:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return Hs[c]&&m[d-1]!=="\\"?Hs[c](r,f,t):c!=="\\"?c:""}).join("")}},du=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,s=i===void 0?to:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||es).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var h=void 0,g=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),le=Ea(t.config);ee.setHours(le.hours,le.minutes,le.seconds,ee.getMilliseconds()),t.selectedDates=[ee],t.latestSelectedDateObj=ee}X!==void 0&&X.type!=="blur"&&cl(X);var Se=t._input.value;c(),An(),t._input.value!==Se&&t._debouncedChange()}function u(X,ee){return X%12+12*xn(ee===t.l10n.amPM[1])}function f(X){switch(X%24){case 0:case 12:return 12;default:return X%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var X=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,ee=(parseInt(t.minuteElement.value,10)||0)%60,le=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(X=u(X,t.amPM.textContent));var Se=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Bn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Fe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Bn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ve=Ma(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Ma(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Je=Ma(X,ee,le);if(Je>rt&&Je=12)]),t.secondElement!==void 0&&(t.secondElement.value=Nn(le)))}function h(X){var ee=Vn(X),le=parseInt(ee.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,ee,le,Se){if(ee instanceof Array)return ee.forEach(function(Fe){return g(X,Fe,le,Se)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,ee,le,Se)});X.addEventListener(ee,le,Se),t._handlers.push({remove:function(){return X.removeEventListener(ee,le,Se)}})}function _(){It("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(Se){return g(Se,"click",t[le])})}),t.isMobile){Zn();return}var X=nh(De,50);if(t._debouncedChange=nh(_,XM),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ue(Vn(le))}),g(t._input,"keydown",Bt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Bt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ct):g(window.document,"mousedown",ct),g(window.document,"focus",ct,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Fl),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",Pt)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var ee=function(le){return Vn(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",$),g([t.hourElement,t.minuteElement],["focus","click"],ee),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(le){a(le)})}t.config.allowInput&&g(t._input,"blur",ut)}function S(X,ee){var le=X!==void 0?t.parseDate(X):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(X);var Fe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Fe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ve=Mt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ve,t.element),Ve.appendChild(t.element),t.altInput&&Ve.appendChild(t.altInput),Ve.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function E(X,ee,le,Se){var Fe=xe(ee,!0),Ve=Mt("span",X,ee.getDate().toString());return Ve.dateObj=ee,Ve.$i=Se,Ve.setAttribute("aria-label",t.formatDate(ee,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Bn(ee,t.now)===0&&(t.todayDateElem=Ve,Ve.classList.add("today"),Ve.setAttribute("aria-current","date")),Fe?(Ve.tabIndex=-1,ul(ee)&&(Ve.classList.add("selected"),t.selectedDateElem=Ve,t.config.mode==="range"&&(On(Ve,"startRange",t.selectedDates[0]&&Bn(ee,t.selectedDates[0],!0)===0),On(Ve,"endRange",t.selectedDates[1]&&Bn(ee,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Ve.classList.add("inRange")))):Ve.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Ui(ee)&&!ul(ee)&&Ve.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&Se%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(ee)+""),It("onDayCreate",Ve),Ve}function L(X){X.focus(),t.config.mode==="range"&&Ue(X)}function I(X){for(var ee=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,Se=ee;Se!=le;Se+=X)for(var Fe=t.daysContainer.children[Se],Ve=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,Je=Ve;Je!=rt;Je+=X){var ue=Fe.children[Je];if(ue.className.indexOf("hidden")===-1&&xe(ue.dateObj))return ue}}function A(X,ee){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,Se=ee>0?t.config.showMonths:-1,Fe=ee>0?1:-1,Ve=le-t.currentMonth;Ve!=Se;Ve+=Fe)for(var rt=t.daysContainer.children[Ve],Je=le-t.currentMonth===Ve?X.$i+ee:ee<0?rt.children.length-1:0,ue=rt.children.length,ye=Je;ye>=0&&ye0?ue:-1);ye+=Fe){var He=rt.children[ye];if(He.className.indexOf("hidden")===-1&&xe(He.dateObj)&&Math.abs(X.$i-ye)>=Math.abs(ee))return L(He)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,ee){var le=l(),Se=Be(le||document.body),Fe=X!==void 0?X:Se?le:t.selectedDateElem!==void 0&&Be(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Be(t.todayDateElem)?t.todayDateElem:I(ee>0?1:-1);Fe===void 0?t._input.focus():Se?A(Fe,ee):L(Fe)}function N(X,ee){for(var le=(new Date(X,ee,1).getDay()-t.l10n.firstDayOfWeek+7)%7,Se=t.utils.getDaysInMonth((ee-1+12)%12,X),Fe=t.utils.getDaysInMonth(ee,X),Ve=window.document.createDocumentFragment(),rt=t.config.showMonths>1,Je=rt?"prevMonthDay hidden":"prevMonthDay",ue=rt?"nextMonthDay hidden":"nextMonthDay",ye=Se+1-le,He=0;ye<=Se;ye++,He++)Ve.appendChild(E("flatpickr-day "+Je,new Date(X,ee-1,ye),ye,He));for(ye=1;ye<=Fe;ye++,He++)Ve.appendChild(E("flatpickr-day",new Date(X,ee,ye),ye,He));for(var Qe=Fe+1;Qe<=42-le&&(t.config.showMonths===1||He%7!==0);Qe++,He++)Ve.appendChild(E("flatpickr-day "+ue,new Date(X,ee+1,Qe%Fe),Qe,He));var at=Mt("div","dayContainer");return at.appendChild(Ve),at}function R(){if(t.daysContainer!==void 0){Yo(t.daysContainer),t.weekNumbers&&Yo(t.weekNumbers);for(var X=document.createDocumentFragment(),ee=0;ee1||t.config.monthSelectorType!=="dropdown")){var X=function(Se){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&Set.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var ee=0;ee<12;ee++)if(X(ee)){var le=Mt("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,ee).getMonth().toString(),le.textContent=yr(ee,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===ee&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Mt("div","flatpickr-month"),ee=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Mt("span","cur-month"):(t.monthsDropdownContainer=Mt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var Je=Vn(rt),ue=parseInt(Je.value,10);t.changeMonth(ue-t.currentMonth),It("onMonthChange")}),z(),le=t.monthsDropdownContainer);var Se=Ko("cur-year",{tabindex:"-1"}),Fe=Se.getElementsByTagName("input")[0];Fe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Fe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Fe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Fe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ve=Mt("div","flatpickr-current-month");return Ve.appendChild(le),Ve.appendChild(Se),ee.appendChild(Ve),X.appendChild(ee),{container:X,yearElement:Fe,monthElement:le}}function B(){Yo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var ee=F();t.yearElements.push(ee.yearElement),t.monthElements.push(ee.monthElement),t.monthNav.appendChild(ee.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Mt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Mt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Mt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(X){t.__hidePrevMonthArrow!==X&&(On(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&(On(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Vi(),t.monthNav}function V(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=Ea(t.config);t.timeContainer=Mt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var ee=Mt("span","flatpickr-time-separator",":"),le=Ko("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var Se=Ko("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=Se.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Nn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Nn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():X.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(le),t.timeContainer.appendChild(ee),t.timeContainer.appendChild(Se),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Ko("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Nn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():X.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(Mt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Mt("span","flatpickr-am-pm",t.l10n.amPM[xn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function Z(){t.weekdayContainer?Yo(t.weekdayContainer):t.weekdayContainer=Mt("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var ee=Mt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(ee)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,ee=ih(t.l10n.weekdays.shorthand);X>0&&X `+ee.join("")+` `}}function de(){t.calendarContainer.classList.add("hasWeeks");var X=Mt("div","flatpickr-weekwrapper");X.appendChild(Mt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ee=Mt("div","flatpickr-weeks");return X.appendChild(ee),{weekWrapper:X,weekNumbers:ee}}function pe(X,ee){ee===void 0&&(ee=!0);var le=ee?X:X-t.currentMonth;le<0&&t._hidePrevMonthArrow===!0||le>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=le,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,It("onYearChange"),z()),R(),It("onMonthChange"),Vi())}function ae(X,ee){if(X===void 0&&(X=!0),ee===void 0&&(ee=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ee===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=Ea(t.config),Se=le.hours,Fe=le.minutes,Ve=le.seconds;m(Se,Fe,Ve)}t.redraw(),X&&It("onChange")}function Ce(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),It("onClose")}function Ye(){t.config!==void 0&&It("onDestroy");for(var X=t._handlers.length;X--;)t._handlers[X].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var ee=t.calendarContainer.parentNode;if(ee.lastChild&&ee.removeChild(ee.lastChild),ee.parentNode){for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(le){try{delete t[le]}catch{}})}function Ke(X){return t.calendarContainer.contains(X)}function ct(X){if(t.isOpen&&!t.config.inline){var ee=Vn(X),le=Ke(ee),Se=ee===t.input||ee===t.altInput||t.element.contains(ee)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!Se&&!le&&!Ke(X.relatedTarget),Ve=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(ee)});Fe&&Ve&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function et(X){if(!(!X||t.config.minDate&&Xt.config.maxDate.getFullYear())){var ee=X,le=t.currentYear!==ee;t.currentYear=ee||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),le&&(t.redraw(),It("onYearChange"),z())}}function xe(X,ee){var le;ee===void 0&&(ee=!0);var Se=t.parseDate(X,void 0,ee);if(t.config.minDate&&Se&&Bn(Se,t.config.minDate,ee!==void 0?ee:!t.minDateHasTime)<0||t.config.maxDate&&Se&&Bn(Se,t.config.maxDate,ee!==void 0?ee:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Se===void 0)return!1;for(var Fe=!!t.config.enable,Ve=(le=t.config.enable)!==null&&le!==void 0?le:t.config.disable,rt=0,Je=void 0;rt=Je.from.getTime()&&Se.getTime()<=Je.to.getTime())return Fe}return!Fe}function Be(X){return t.daysContainer!==void 0?X.className.indexOf("hidden")===-1&&X.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(X):!1}function ut(X){var ee=X.target===t._input,le=t._input.value.trimEnd()!==fl();ee&&le&&!(X.relatedTarget&&Ke(X.relatedTarget))&&t.setDate(t._input.value,!0,X.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Bt(X){var ee=Vn(X),le=t.config.wrap?n.contains(ee):ee===t._input,Se=t.config.allowInput,Fe=t.isOpen&&(!Se||!le),Ve=t.config.inline&&le&&!Se;if(X.keyCode===13&&le){if(Se)return t.setDate(t._input.value,!0,ee===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),ee.blur();t.open()}else if(Ke(ee)||Fe||Ve){var rt=!!t.timeContainer&&t.timeContainer.contains(ee);switch(X.keyCode){case 13:rt?(X.preventDefault(),a(),Ut()):Pt(X);break;case 27:X.preventDefault(),Ut();break;case 8:case 46:le&&!t.config.allowInput&&(X.preventDefault(),t.clear());break;case 37:case 39:if(!rt&&!le){X.preventDefault();var Je=l();if(t.daysContainer!==void 0&&(Se===!1||Je&&Be(Je))){var ue=X.keyCode===39?1:-1;X.ctrlKey?(X.stopPropagation(),pe(ue),P(I(1),0)):P(void 0,ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:X.preventDefault();var ye=X.keyCode===40?1:-1;t.daysContainer&&ee.$i!==void 0||ee===t.input||ee===t.altInput?X.ctrlKey?(X.stopPropagation(),et(t.currentYear-ye),P(I(1),0)):rt||P(void 0,ye*7):ee===t.currentYearElement?et(t.currentYear-ye):t.config.enableTime&&(!rt&&t.hourElement&&t.hourElement.focus(),a(X),t._debouncedChange());break;case 9:if(rt){var He=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Wt){return Wt}),Qe=He.indexOf(ee);if(Qe!==-1){var at=He[Qe+(X.shiftKey?-1:1)];X.preventDefault(),(at||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(ee)&&X.shiftKey&&(X.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&ee===t.amPM)switch(X.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),An();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),An();break}(le||Ke(ee))&&It("onKeyDown",X)}function Ue(X,ee){if(ee===void 0&&(ee="flatpickr-day"),!(t.selectedDates.length!==1||X&&(!X.classList.contains(ee)||X.classList.contains("flatpickr-disabled")))){for(var le=X?X.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Se=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Fe=Math.min(le,t.selectedDates[0].getTime()),Ve=Math.max(le,t.selectedDates[0].getTime()),rt=!1,Je=0,ue=0,ye=Fe;yeFe&&yeJe)?Je=ye:ye>Se&&(!ue||ye ."+ee));He.forEach(function(Qe){var at=Qe.dateObj,Wt=at.getTime(),pn=Je>0&&Wt0&&Wt>ue;if(pn){Qe.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(mn){Qe.classList.remove(mn)});return}else if(rt&&!pn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(mn){Qe.classList.remove(mn)}),X!==void 0&&(X.classList.add(le<=t.selectedDates[0].getTime()?"startRange":"endRange"),Sele&&Wt===Se&&Qe.classList.add("endRange"),Wt>=Je&&(ue===0||Wt<=ue)&&JM(Wt,Se,le)&&Qe.classList.add("inRange"))})}}function De(){t.isOpen&&!t.config.static&&!t.config.inline&&zt()}function ot(X,ee){if(ee===void 0&&(ee=t._positionElement),t.isMobile===!0){if(X){X.preventDefault();var le=Vn(X);le&&le.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),It("onOpen");return}else if(t._input.disabled||t.config.inline)return;var Se=t.isOpen;t.isOpen=!0,Se||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),It("onOpen"),zt(ee)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(X===void 0||!t.timeContainer.contains(X.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Ie(X){return function(ee){var le=t.config["_"+X+"Date"]=t.parseDate(ee,t.config.dateFormat),Se=t.config["_"+(X==="min"?"max":"min")+"Date"];le!==void 0&&(t[X==="min"?"minDateHasTime":"maxDateHasTime"]=le.getHours()>0||le.getMinutes()>0||le.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Fe){return xe(Fe)}),!t.selectedDates.length&&X==="min"&&d(le),An()),t.daysContainer&&(bt(),le!==void 0?t.currentYearElement[X]=le.getFullYear().toString():t.currentYearElement.removeAttribute(X),t.currentYearElement.disabled=!!Se&&le!==void 0&&Se.getFullYear()===le.getFullYear())}}function We(){var X=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],ee=kn(kn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),le={};t.config.parseDate=ee.parseDate,t.config.formatDate=ee.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(He){t.config._enable=dn(He)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(He){t.config._disable=dn(He)}});var Se=ee.mode==="time";if(!ee.dateFormat&&(ee.enableTime||Se)){var Fe=sn.defaultConfig.dateFormat||es.dateFormat;le.dateFormat=ee.noCalendar||Se?"H:i"+(ee.enableSeconds?":S":""):Fe+" H:i"+(ee.enableSeconds?":S":"")}if(ee.altInput&&(ee.enableTime||Se)&&!ee.altFormat){var Ve=sn.defaultConfig.altFormat||es.altFormat;le.altFormat=ee.noCalendar||Se?"h:i"+(ee.enableSeconds?":S K":" K"):Ve+(" h:i"+(ee.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Ie("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Ie("max")});var rt=function(He){return function(Qe){t.config[He==="min"?"_minTime":"_maxTime"]=t.parseDate(Qe,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:rt("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:rt("max")}),ee.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,le,ee);for(var Je=0;Je-1?t.config[ye]=Ca(ue[ye]).map(o).concat(t.config[ye]):typeof ee[ye]>"u"&&(t.config[ye]=ue[ye])}ee.altInputClass||(t.config.altInputClass=Te().className+" "+t.config.altInputClass),It("onParseConfig")}function Te(){return t.config.wrap?n.querySelector("[data-input]"):n}function nt(){typeof t.config.locale!="object"&&typeof sn.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=kn(kn({},sn.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?sn.l10ns[t.config.locale]:void 0),wl.D="("+t.l10n.weekdays.shorthand.join("|")+")",wl.l="("+t.l10n.weekdays.longhand.join("|")+")",wl.M="("+t.l10n.months.shorthand.join("|")+")",wl.F="("+t.l10n.months.longhand.join("|")+")",wl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var X=kn(kn({},e),JSON.parse(JSON.stringify(n.dataset||{})));X.time_24hr===void 0&&sn.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Ly(t),t.parseDate=du({config:t.config,l10n:t.l10n})}function zt(X){if(typeof t.config.position=="function")return void t.config.position(t,X);if(t.calendarContainer!==void 0){It("onPreCalendarPosition");var ee=X||t._positionElement,le=Array.prototype.reduce.call(t.calendarContainer.children,function(_s,jr){return _s+jr.offsetHeight},0),Se=t.calendarContainer.offsetWidth,Fe=t.config.position.split(" "),Ve=Fe[0],rt=Fe.length>1?Fe[1]:null,Je=ee.getBoundingClientRect(),ue=window.innerHeight-Je.bottom,ye=Ve==="above"||Ve!=="below"&&uele,He=window.pageYOffset+Je.top+(ye?-le-2:ee.offsetHeight+2);if(On(t.calendarContainer,"arrowTop",!ye),On(t.calendarContainer,"arrowBottom",ye),!t.config.inline){var Qe=window.pageXOffset+Je.left,at=!1,Wt=!1;rt==="center"?(Qe-=(Se-Je.width)/2,at=!0):rt==="right"&&(Qe-=Se-Je.width,Wt=!0),On(t.calendarContainer,"arrowLeft",!at&&!Wt),On(t.calendarContainer,"arrowCenter",at),On(t.calendarContainer,"arrowRight",Wt);var pn=window.document.body.offsetWidth-(window.pageXOffset+Je.right),mn=Qe+Se>window.document.body.offsetWidth,_o=pn+Se>window.document.body.offsetWidth;if(On(t.calendarContainer,"rightMost",mn),!t.config.static)if(t.calendarContainer.style.top=He+"px",!mn)t.calendarContainer.style.left=Qe+"px",t.calendarContainer.style.right="auto";else if(!_o)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=pn+"px";else{var ql=Ne();if(ql===void 0)return;var go=window.document.body.offsetWidth,hs=Math.max(0,go/2-Se/2),Ii=".flatpickr-calendar.centerMost:before",dl=".flatpickr-calendar.centerMost:after",pl=ql.cssRules.length,jl="{left:"+Je.left+"px;right:auto;}";On(t.calendarContainer,"rightMost",!1),On(t.calendarContainer,"centerMost",!0),ql.insertRule(Ii+","+dl+jl,pl),t.calendarContainer.style.left=hs+"px",t.calendarContainer.style.right="auto"}}}}function Ne(){for(var X=null,ee=0;eet.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Se,t.config.mode==="single")t.selectedDates=[Fe];else if(t.config.mode==="multiple"){var rt=ul(Fe);rt?t.selectedDates.splice(parseInt(rt),1):t.selectedDates.push(Fe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Fe,t.selectedDates.push(Fe),Bn(Fe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(He,Qe){return He.getTime()-Qe.getTime()}));if(c(),Ve){var Je=t.currentYear!==Fe.getFullYear();t.currentYear=Fe.getFullYear(),t.currentMonth=Fe.getMonth(),Je&&(It("onYearChange"),z()),It("onMonthChange")}if(Vi(),R(),An(),!Ve&&t.config.mode!=="range"&&t.config.showMonths===1?L(Se):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var ue=t.config.mode==="single"&&!t.config.enableTime,ye=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(ue||ye)&&Ut()}_()}}var Pe={locale:[nt,G],showMonths:[B,r,Z],minDate:[S],maxDate:[S],positionElement:[yt],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function jt(X,ee){if(X!==null&&typeof X=="object"){Object.assign(t.config,X);for(var le in X)Pe[le]!==void 0&&Pe[le].forEach(function(Se){return Se()})}else t.config[X]=ee,Pe[X]!==void 0?Pe[X].forEach(function(Se){return Se()}):$a.indexOf(X)>-1&&(t.config[X]=Ca(ee));t.redraw(),An(!0)}function Gt(X,ee){var le=[];if(X instanceof Array)le=X.map(function(Se){return t.parseDate(Se,ee)});else if(X instanceof Date||typeof X=="number")le=[t.parseDate(X,ee)];else if(typeof X=="string")switch(t.config.mode){case"single":case"time":le=[t.parseDate(X,ee)];break;case"multiple":le=X.split(t.config.conjunction).map(function(Se){return t.parseDate(Se,ee)});break;case"range":le=X.split(t.l10n.rangeSeparator).map(function(Se){return t.parseDate(Se,ee)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(X)));t.selectedDates=t.config.allowInvalidPreload?le:le.filter(function(Se){return Se instanceof Date&&xe(Se,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Se,Fe){return Se.getTime()-Fe.getTime()})}function gn(X,ee,le){if(ee===void 0&&(ee=!1),le===void 0&&(le=t.config.dateFormat),X!==0&&!X||X instanceof Array&&X.length===0)return t.clear(ee);Gt(X,le),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,ee),d(),t.selectedDates.length===0&&t.clear(!1),An(ee),ee&&It("onChange")}function dn(X){return X.slice().map(function(ee){return typeof ee=="string"||typeof ee=="number"||ee instanceof Date?t.parseDate(ee,void 0,!0):ee&&typeof ee=="object"&&ee.from&&ee.to?{from:t.parseDate(ee.from,void 0),to:t.parseDate(ee.to,void 0)}:ee}).filter(function(ee){return ee})}function Ei(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var X=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);X&&Gt(X,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function ri(){if(t.input=Te(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=Mt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),yt()}function yt(){t._positionElement=t.config.positionElement||t._input}function Zn(){var X=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Mt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=X,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=X==="datetime-local"?"Y-m-d\\TH:i:S":X==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(ee){t.setDate(Vn(ee).value,!1,t.mobileFormatStr),It("onChange"),It("onClose")})}function un(X){if(t.isOpen===!0)return t.close();t.open(X)}function It(X,ee){if(t.config!==void 0){var le=t.config[X];if(le!==void 0&&le.length>0)for(var Se=0;le[Se]&&Se=0&&Bn(X,t.selectedDates[1])<=0}function Vi(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(X,ee){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+ee),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[ee].textContent=yr(le.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=le.getMonth().toString(),X.value=le.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function fl(X){var ee=X||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(le){return t.formatDate(le,ee)}).filter(function(le,Se,Fe){return t.config.mode!=="range"||t.config.enableTime||Fe.indexOf(le)===Se}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function An(X){X===void 0&&(X=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=fl(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=fl(t.config.altFormat)),X!==!1&&It("onValueUpdate")}function Fl(X){var ee=Vn(X),le=t.prevMonthNav.contains(ee),Se=t.nextMonthNav.contains(ee);le||Se?pe(le?-1:1):t.yearElements.indexOf(ee)>=0?ee.select():ee.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):ee.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(X){X.preventDefault();var ee=X.type==="keydown",le=Vn(X),Se=le;t.amPM!==void 0&&le===t.amPM&&(t.amPM.textContent=t.l10n.amPM[xn(t.amPM.textContent===t.l10n.amPM[0])]);var Fe=parseFloat(Se.getAttribute("min")),Ve=parseFloat(Se.getAttribute("max")),rt=parseFloat(Se.getAttribute("step")),Je=parseInt(Se.value,10),ue=X.delta||(ee?X.which===38?1:-1:0),ye=Je+rt*ue;if(typeof Se.value<"u"&&Se.value.length===2){var He=Se===t.hourElement,Qe=Se===t.minuteElement;yeVe&&(ye=Se===t.hourElement?ye-Ve-xn(!t.amPM):Fe,Qe&&T(void 0,1,t.hourElement)),t.amPM&&He&&(rt===1?ye+Je===23:Math.abs(ye-Je)>rt)&&(t.amPM.textContent=t.l10n.amPM[xn(t.amPM.textContent===t.l10n.amPM[0])]),Se.value=Nn(ye)}}return s(),t}function ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function nE(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=lt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:g=void 0}=e;an(()=>{const T=f??h,O=k(d);return O.onReady.push((E,L,I)=>{a===void 0&&S(E,L,I),_n().then(()=>{t(8,m=!0)})}),t(3,g=sn(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=wt();function k(T={}){T=Object.assign({},T);for(const O of r){const E=(L,I,A)=>{_(tE(O),[L,I,A])};O in T?(Array.isArray(T[O])||(T[O]=[T[O]]),T[O].push(E)):T[O]=[E]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,O,E){const L=lh(E,T);!sh(a,L)&&(a||L)&&t(2,a=L),t(4,u=O)}function $(T){ne[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=je(je({},e),Kt(T)),t(1,s=lt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,g=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(sh(a,lh(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[T,O]of Object.entries(k(d)))g.set(T,O)},[h,s,a,g,u,f,c,d,m,o,l,$]}class sf extends we{constructor(e){super(),ve(this,e,nE,eE,be,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function iE(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:U.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),l=new sf({props:c}),ne.push(()=>ge(l,"value",u)),ne.push(()=>ge(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),s=C(),H(l.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),y(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(v(e),v(s)),j(l,d)}}}function lE(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:U.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),l=new sf({props:c}),ne.push(()=>ge(l,"value",u)),ne.push(()=>ge(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),s=C(),H(l.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),y(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(v(e),v(s)),j(l,d)}}}function sE(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[iE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[lE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),q(i,t,null),y(e,s),y(e,l),q(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),j(i),j(o)}}}function oE(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[sE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(s,[a&2&&{key:r[1]},a&32&&At(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function rE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e,r=l==null?void 0:l.min,a=l==null?void 0:l.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,l[O]=T.detail[1],l)}function f(T){r=T,t(2,r),t(0,l)}function c(T){n.$$.not_equal(l.min,T)&&(l.min=T,t(0,l))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,l)}function h(T){n.$$.not_equal(l.max,T)&&(l.max=T,t(0,l))}const g=T=>u(T,"max");function _(T){l=T,t(0,l)}function k(T){Le.call(this,n,T)}function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Kt(T)),t(5,s=lt(e,i)),"field"in T&&t(0,l=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(l==null?void 0:l.min)&&t(2,r=l==null?void 0:l.min),n.$$.dirty&9&&a!=(l==null?void 0:l.max)&&t(3,a=l==null?void 0:l.max)},[l,o,r,a,u,s,f,c,d,m,h,g,_,k,S,$]}class aE extends we{constructor(e){super(),ve(this,e,rE,oE,be,{field:0,key:1})}}function uE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",l=C(),o=b("input"),p(e,"for",s=n[9]),p(o,"type","number"),p(o,"id",r=n[9]),p(o,"step","1"),p(o,"min","0"),p(o,"max",Number.MAX_SAFE_INTEGER),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){w(c,e,d),y(e,t),y(e,i),w(c,l,d),w(c,o,d),u||(f=Y(o,"input",n[3]),u=!0)},p(c,d){d&512&&s!==(s=c[9])&&p(e,"for",s),d&512&&r!==(r=c[9])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(v(e),v(l),v(o)),u=!1,f()}}}function fE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Strip urls domain",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].convertURLs,w(c,i,d),w(c,s,d),y(s,l),y(s,o),y(s,r),u||(f=[Y(e,"change",n[4]),Oe(Re.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].convertURLs),d&512&&a!==(a=c[9])&&p(s,"for",a)},d(c){c&&(v(e),v(i),v(s)),u=!1,Ee(f)}}}function cE(n){let e,t,i,s;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[uE,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[fE,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&2&&(r.name="fields."+l[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&2&&(a.name="fields."+l[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&v(t),j(e,l),j(i,l)}}}function dE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[cE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function pE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;const r=m=>t(0,l.maxSize=parseInt(m.target.value,10),l);function a(){l.convertURLs=this.checked,t(0,l)}function u(m){l=m,t(0,l)}function f(m){Le.call(this,n,m)}function c(m){Le.call(this,n,m)}function d(m){Le.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(2,s=lt(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,u,f,c,d]}class mE extends we{constructor(e){super(),ve(this,e,pE,dE,be,{field:0,key:1})}}function hE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(_){n[3](_)}let g={id:n[9],disabled:!U.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new ho({props:g}),ne.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,s),w(_,o,k),q(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=Oe(Re.call(null,s,{text:`List of domains that are NOT allowed. This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&l!==(l=_[9]))&&p(e,"for",l);const S={};k&512&&(S.id=_[9]),k&1&&(S.disabled=!U.isEmpty(_[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].exceptDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),j(r,_),d=!1,m()}}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(_){n[4](_)}let g={id:n[9]+".onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ho({props:g}),ne.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]+".onlyDomains"),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,s),w(_,o,k),q(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=Oe(Re.call(null,s,{text:`List of domains that are ONLY allowed. This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&l!==(l=_[9]+".onlyDomains"))&&p(e,"for",l);const S={};k&512&&(S.id=_[9]+".onlyDomains"),k&1&&(S.disabled=!U.isEmpty(_[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].onlyDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),j(r,_),d=!1,m()}}}function gE(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[hE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[_E,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),q(i,t,null),y(e,s),y(e,l),q(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),j(i),j(o)}}}function bE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[gE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function kE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(m){n.$$.not_equal(l.exceptDomains,m)&&(l.exceptDomains=m,t(0,l))}function a(m){n.$$.not_equal(l.onlyDomains,m)&&(l.onlyDomains=m,t(0,l))}function u(m){l=m,t(0,l)}function f(m){Le.call(this,n,m)}function c(m){Le.call(this,n,m)}function d(m){Le.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(2,s=lt(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,u,f,c,d]}class Ay extends we{constructor(e){super(),ve(this,e,kE,bE,be,{field:0,key:1})}}function yE(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),s=C(),l=b("small"),r=W(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),y(e,i),w(a,s,u),w(a,l,u),y(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:te,o:te,d(a){a&&(v(e),v(s),v(l))}}}function vE(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class oh extends we{constructor(e){super(),ve(this,e,vE,yE,be,{item:0})}}const wE=[{ext:"",mimeType:"application/octet-stream"},{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".apk",mimeType:"application/vnd.android.package-archive"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".avif",mimeType:"image/avif"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".mj2",mimeType:"video/mj2"},{ext:".dvb",mimeType:"video/vnd.dvb.file"},{ext:".webm",mimeType:"video/webm"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".cbor",mimeType:"application/cbor"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".parquet",mimeType:"application/vnd.apache.parquet"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"application/atom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"text/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"}];function SE(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ln({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TE(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[SE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&16777216&&(u.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(s),v(l)),j(i,r)}}}function $E(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=C(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=C(),l=b("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=C(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(l,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[8]),Y(i,"click",n[9]),Y(l,"click",n[10]),Y(r,"click",n[11])],a=!0)},p:te,d(f){f&&(v(e),v(t),v(i),v(s),v(l),v(o),v(r)),a=!1,Ee(u)}}}function CE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$;function T(E){n[7](E)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:oh,optionComponent:oh};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new Ln({props:O}),ne.push(()=>ge(r,"keyOfSelected",T)),_=new Dn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[$E]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),h=b("i"),g=C(),H(_.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){w(E,e,L),y(e,t),y(e,i),y(e,s),w(E,o,L),q(r,E,L),w(E,u,L),w(E,f,L),y(f,c),y(c,d),y(c,m),y(c,h),y(c,g),q(_,c,null),k=!0,S||($=Oe(Re.call(null,s,{text:`Allow files ONLY with the listed mime types. Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!k||L&8388608&&l!==(l=E[23]))&&p(e,"for",l);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,$e(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){k||(M(r.$$.fragment,E),M(_.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),k=!1},d(E){E&&(v(e),v(o),v(u),v(f)),j(r,E),j(_),S=!1,$()}}}function OE(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH (e.g. 100x50) - crop to WxH viewbox (from center)
  • WxHt (e.g. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (e.g. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (e.g. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (e.g. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 (e.g. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:te,d(t){t&&v(e)}}}function ME(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O;function E(I){n[12](I)}let L={id:n[23],placeholder:"e.g. 50x50, 480x720"};return n[0].thumbs!==void 0&&(L.value=n[0].thumbs),r=new ho({props:L}),ne.push(()=>ge(r,"value",E)),S=new Dn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[OE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=C(),_=b("i"),k=C(),H(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(_,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){w(I,e,A),y(e,t),y(e,i),y(e,s),w(I,o,A),q(r,I,A),w(I,u,A),w(I,f,A),y(f,c),y(f,d),y(f,m),y(m,h),y(m,g),y(m,_),y(m,k),q(S,m,null),$=!0,T||(O=Oe(Re.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!$||A&8388608&&l!==(l=I[23]))&&p(e,"for",l);const P={};A&8388608&&(P.id=I[23]),!a&&A&1&&(a=!0,P.value=I[0].thumbs,$e(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){$||(M(r.$$.fragment,I),M(S.$$.fragment,I),$=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),$=!1},d(I){I&&(v(e),v(o),v(u),v(f)),j(r,I),j(S),T=!1,O()}}}function EE(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),s=C(),l=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","0"),p(l,"max",Number.MAX_SAFE_INTEGER),l.value=r=n[0].maxSize||"",p(l,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,s,m),w(d,l,m),w(d,a,m),w(d,u,m),f||(c=Y(l,"input",n[13]),f=!0)},p(d,m){m&8388608&&i!==(i=d[23])&&p(e,"for",i),m&8388608&&o!==(o=d[23])&&p(l,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&l.value!==r&&(l.value=r)},d(d){d&&(v(e),v(s),v(l),v(a),v(u)),f=!1,c()}}}function rh(n){let e,t,i;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[DE,({uniqueId:s})=>({23:s}),({uniqueId:s})=>s?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="fields."+s[1]+".maxSelect"),l&41943041&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&v(e),j(t)}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Max select"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"id",o=n[23]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),p(l,"max",Number.MAX_SAFE_INTEGER),l.required=!0,p(l,"placeholder","Default to single")},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].maxSelect),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].maxSelect&&me(l,u[0].maxSelect)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function IE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible (Learn more)`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(s,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){w(c,e,d),e.checked=n[0].protected,w(c,i,d),w(c,s,d),y(s,l),w(c,r,d),w(c,a,d),u||(f=Y(e,"change",n[15]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].protected),d&8388608&&o!==(o=c[23])&&p(s,"for",o)},d(c){c&&(v(e),v(i),v(s),v(r),v(a)),u=!1,f()}}}function LE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;i=new fe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[CE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[ME,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[EE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&rh(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[IE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),d=C(),_&&_.c(),m=C(),H(h.$$.fragment),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(k,S){w(k,e,S),y(e,t),q(i,t,null),y(e,s),y(e,l),q(o,l,null),y(e,a),y(e,u),q(f,u,null),y(e,d),_&&_.m(e,null),y(e,m),q(h,e,null),g=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!g||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!g||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?_&&(oe(),D(_,1,1,()=>{_=null}),re()):_?(_.p(k,S),S&4&&M(_,1)):(_=rh(k),_.c(),M(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),h.$set(E)},i(k){g||(M(i.$$.fragment,k),M(o.$$.fragment,k),M(f.$$.fragment,k),M(_),M(h.$$.fragment,k),g=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(_),D(h.$$.fragment,k),g=!1},d(k){k&&v(e),j(i),j(o),j(f),_&&_.d(),j(h)}}}function AE(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{options:[LE],default:[TE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(s,[a&2&&{key:r[1]},a&32&&At(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function PE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=wE.slice(),u=l.maxSelect<=1,f=u;function c(){t(0,l.maxSelect=1,l),t(0,l.thumbs=[],l),t(0,l.mimeTypes=[],l),t(2,u=!0),t(6,f=u)}function d(){if(U.isEmpty(l.mimeTypes))return;const N=[];for(const R of l.mimeTypes)a.find(z=>z.mimeType===R)||N.push({mimeType:R});N.length&&t(3,a=a.concat(N))}function m(N){n.$$.not_equal(l.mimeTypes,N)&&(l.mimeTypes=N,t(0,l),t(6,f),t(2,u))}const h=()=>{t(0,l.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},g=()=>{t(0,l.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},_=()=>{t(0,l.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},k=()=>{t(0,l.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function S(N){n.$$.not_equal(l.thumbs,N)&&(l.thumbs=N,t(0,l),t(6,f),t(2,u))}const $=N=>t(0,l.maxSize=parseInt(N.target.value,10),l);function T(){l.maxSelect=mt(this.value),t(0,l),t(6,f),t(2,u)}function O(){l.protected=this.checked,t(0,l),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function L(N){l=N,t(0,l),t(6,f),t(2,u)}function I(N){Le.call(this,n,N)}function A(N){Le.call(this,n,N)}function P(N){Le.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Kt(N)),t(5,s=lt(e,i)),"field"in N&&t(0,l=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,l.maxSelect=1,l):t(0,l.maxSelect=99,l)),n.$$.dirty&1&&(typeof l.maxSelect>"u"?c():d())},[l,o,u,a,r,s,f,m,h,g,_,k,S,$,T,O,E,L,I,A,P]}class NE extends we{constructor(e){super(),ve(this,e,PE,AE,be,{field:0,key:1})}}function RE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",l=C(),o=b("input"),p(e,"for",s=n[10]),p(o,"type","number"),p(o,"id",r=n[10]),p(o,"step","1"),p(o,"min","0"),p(o,"max",Number.MAX_SAFE_INTEGER),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~1MB")},m(c,d){w(c,e,d),y(e,t),y(e,i),w(c,l,d),w(c,o,d),u||(f=Y(o,"input",n[4]),u=!0)},p(c,d){d&1024&&s!==(s=c[10])&&p(e,"for",s),d&1024&&r!==(r=c[10])&&p(o,"id",r),d&1&&a!==(a=c[0].maxSize||"")&&o.value!==a&&(o.value=a)},d(c){c&&(v(e),v(l),v(o)),u=!1,f()}}}function FE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function qE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ah(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L='"{"a":1,"b":2}"',I,A,P,N,R,z,F,B,J,V,Z,G,de;return{c(){e=b("div"),t=b("div"),i=b("div"),s=W("In order to support seamlessly both "),l=b("code"),l.textContent="application/json",o=W(` and `),r=b("code"),r.textContent="multipart/form-data",a=W(` requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=W(` field is a `),c=b("strong"),c.textContent="plain string",d=W(`: `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",g=C(),_=b("li"),_.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",O=C(),E=b("li"),I=W(L),A=W(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",B=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",V=W(` Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside an object, eg.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(pe,ae){w(pe,e,ae),y(e,t),y(t,i),y(i,s),y(i,l),y(i,o),y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(m,h),y(m,g),y(m,_),y(m,k),y(m,S),y(m,$),y(m,T),y(m,O),y(m,E),y(E,I),y(E,A),y(E,P),y(m,N),y(m,R),y(m,z),y(m,F),y(m,B),y(m,J),y(i,V),y(i,Z),de=!0},i(pe){de||(pe&&tt(()=>{de&&(G||(G=qe(e,ht,{duration:150},!0)),G.run(1))}),de=!0)},o(pe){pe&&(G||(G=qe(e,ht,{duration:150},!1)),G.run(0)),de=!1},d(pe){pe&&v(e),pe&&G&&G.end()}}}function jE(n){let e,t,i,s,l,o,r,a,u,f,c;e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[RE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,k){return _[2]?qE:FE}let m=d(n),h=m(n),g=n[2]&&ah();return{c(){H(e.$$.fragment),t=C(),i=b("button"),s=b("strong"),s.textContent="String value normalizations",l=C(),h.c(),r=C(),g&&g.c(),a=ke(),p(s,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){q(e,_,k),w(_,t,k),w(_,i,k),y(i,s),y(i,l),h.m(i,null),w(_,r,k),g&&g.m(_,k),w(_,a,k),u=!0,f||(c=Y(i,"click",n[5]),f=!0)},p(_,k){const S={};k&2&&(S.name="fields."+_[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?k&4&&M(g,1):(g=ah(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(v(t),v(i),v(r),v(a)),j(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function HE(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[6](r)}let o={$$slots:{options:[jE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?vt(s,[a&2&&{key:r[1]},a&8&&At(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function zE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=h=>t(0,l.maxSize=parseInt(h.target.value,10),l),u=()=>{t(2,r=!r)};function f(h){l=h,t(0,l)}function c(h){Le.call(this,n,h)}function d(h){Le.call(this,n,h)}function m(h){Le.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Kt(h)),t(3,s=lt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,r,s,a,u,f,c,d,m]}class UE extends we{constructor(e){super(),ve(this,e,zE,HE,be,{field:0,key:1})}}function VE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Min"),s=C(),l=b("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10])},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].min),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].min&&me(l,u[0].min)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function BE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max"),s=C(),l=b("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),y(e,t),w(f,s,c),w(f,l,c),me(l,n[0].max),a||(u=Y(l,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&mt(l.value)!==f[0].max&&me(l,f[0].max)},d(f){f&&(v(e),v(s),v(l)),a=!1,u()}}}function WE(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[VE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[BE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),q(i,t,null),y(e,s),y(e,l),q(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&v(e),j(i),j(o)}}}function YE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="No decimals",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].onlyInt,w(c,i,d),w(c,s,d),y(s,l),y(s,o),y(s,r),u||(f=[Y(e,"change",n[3]),Oe(Re.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].onlyInt),d&1024&&a!==(a=c[10])&&p(s,"for",a)},d(c){c&&(v(e),v(i),v(s)),u=!1,Ee(f)}}}function KE(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[YE,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="fields."+i[1]+".onlyInt"),s&3073&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function JE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[KE],options:[WE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function ZE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.onlyInt=this.checked,t(0,l)}function a(){l.min=mt(this.value),t(0,l)}function u(){l.max=mt(this.value),t(0,l)}function f(h){l=h,t(0,l)}function c(h){Le.call(this,n,h)}function d(h){Le.call(this,n,h)}function m(h){Le.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Kt(h)),t(2,s=lt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,m]}class GE extends we{constructor(e){super(),ve(this,e,ZE,JE,be,{field:0,key:1})}}function XE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Min length"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"min","0"),p(l,"placeholder","No min limit"),l.value=r=n[0].min||""},m(f,c){w(f,e,c),y(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"input",n[3]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(l,"id",o),c&1&&r!==(r=f[0].min||"")&&l.value!==r&&(l.value=r)},d(f){f&&(v(e),v(s),v(l)),a=!1,u()}}}function QE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max length"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"placeholder","Up to 71 chars"),p(l,"min",r=n[0].min||0),p(l,"max","71"),l.value=a=n[0].max||""},m(c,d){w(c,e,d),y(e,t),w(c,s,d),w(c,l,d),u||(f=Y(l,"input",n[4]),u=!0)},p(c,d){d&4096&&i!==(i=c[12])&&p(e,"for",i),d&4096&&o!==(o=c[12])&&p(l,"id",o),d&1&&r!==(r=c[0].min||0)&&p(l,"min",r),d&1&&a!==(a=c[0].max||"")&&l.value!==a&&(l.value=a)},d(c){c&&(v(e),v(s),v(l)),u=!1,f()}}}function xE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Bcrypt cost"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"placeholder","Default to 10"),p(l,"step","1"),p(l,"min","6"),p(l,"max","31"),l.value=r=n[0].cost||""},m(f,c){w(f,e,c),y(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"input",n[5]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&p(e,"for",i),c&4096&&o!==(o=f[12])&&p(l,"id",o),c&1&&r!==(r=f[0].cost||"")&&l.value!==r&&(l.value=r)},d(f){f&&(v(e),v(s),v(l)),a=!1,u()}}}function eD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Validation pattern"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",o=n[12]),p(l,"placeholder","ex. ^\\w+$")},m(u,f){w(u,e,f),y(e,t),w(u,s,f),w(u,l,f),me(l,n[0].pattern),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&l.value!==u[0].pattern&&me(l,u[0].pattern)},d(u){u&&(v(e),v(s),v(l)),r=!1,a()}}}function tD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[XE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[QE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[xE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[eD,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){w(h,e,g),y(e,t),q(i,t,null),y(e,s),y(e,l),q(o,l,null),y(e,r),y(e,a),q(u,a,null),y(e,f),y(e,c),q(d,c,null),m=!0},p(h,g){const _={};g&2&&(_.name="fields."+h[1]+".min"),g&12289&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g&2&&(k.name="fields."+h[1]+".max"),g&12289&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g&2&&(S.name="fields."+h[1]+".cost"),g&12289&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const $={};g&2&&($.name="fields."+h[1]+".pattern"),g&12289&&($.$$scope={dirty:g,ctx:h}),d.$set($)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&v(e),j(i),j(o),j(u),j(d)}}}function nD(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[7](r)}let o={$$slots:{options:[tD]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function iD(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.cost=11,l)}const a=_=>t(0,l.min=_.target.value<<0,l),u=_=>t(0,l.max=_.target.value<<0,l),f=_=>t(0,l.cost=_.target.value<<0,l);function c(){l.pattern=this.value,t(0,l)}function d(_){l=_,t(0,l)}function m(_){Le.call(this,n,_)}function h(_){Le.call(this,n,_)}function g(_){Le.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Kt(_)),t(2,s=lt(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(l.id)&&r()},[l,o,s,a,u,f,c,d,m,h,g]}class lD extends we{constructor(e){super(),ve(this,e,iD,nD,be,{field:0,key:1})}}function sD(n){let e,t,i,s,l;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:te,d(o){o&&(v(e),v(t),v(i)),s=!1,l()}}}function oD(n){let e,t,i;function s(o){n[15](o)}let l={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[sD]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(l.keyOfSelected=n[0].collectionId),e=new Ln({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].collectionId,$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function rD(n){let e,t,i;function s(o){n[16](o)}let l={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ln({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[oD,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[rD,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),o=C(),H(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),q(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),q(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="fields."+c[1]+".collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(s),v(l),v(o),v(a),v(u)),j(i,c),j(r,c)}}}function uh(n){let e,t,i,s,l,o;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[uD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[fD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),s=b("div"),H(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),q(t,e,null),w(r,i,a),w(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="fields."+r[1]+".minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="fields."+r[1]+".maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(M(t.$$.fragment,r),M(l.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(l.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(s)),j(t),j(l)}}}function uD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Min select"),s=C(),l=b("input"),p(e,"for",i=n[24]),p(l,"type","number"),p(l,"id",o=n[24]),p(l,"step","1"),p(l,"min","0"),p(l,"placeholder","No min limit"),l.value=r=n[0].minSelect||""},m(f,c){w(f,e,c),y(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"input",n[11]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||"")&&l.value!==r&&(l.value=r)},d(f){f&&(v(e),v(s),v(l)),a=!1,u()}}}function fD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),s=C(),l=b("input"),p(e,"for",i=n[24]),p(l,"type","number"),p(l,"id",o=n[24]),p(l,"step","1"),p(l,"placeholder","Default to single"),p(l,"min",r=n[0].minSelect||1)},m(f,c){w(f,e,c),y(e,t),w(f,s,c),w(f,l,c),me(l,n[0].maxSelect),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||1)&&p(l,"min",r),c&1&&mt(l.value)!==f[0].maxSelect&&me(l,f[0].maxSelect)},d(f){f&&(v(e),v(s),v(l)),a=!1,u()}}}function cD(n){let e,t,i,s,l,o,r,a,u,f,c,d;function m(g){n[13](g)}let h={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(h.keyOfSelected=n[0].cascadeDelete),a=new Ln({props:h}),ne.push(()=>ge(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),s=b("i"),r=C(),H(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(g,_){var k,S;w(g,e,_),y(e,t),y(e,i),y(e,s),w(g,r,_),q(a,g,_),f=!0,c||(d=Oe(l=Re.call(null,s,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` `),position:"top"})),c=!0)},p(g,_){var S,$;l&&Lt(l.update)&&_&20&&l.update.call(null,{text:[`Whether on ${((S=g[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,g[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=g[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` `),position:"top"}),(!f||_&16777216&&o!==(o=g[24]))&&p(e,"for",o);const k={};_&16777216&&(k.id=g[24]),!u&&_&1&&(u=!0,k.keyOfSelected=g[0].cascadeDelete,$e(()=>u=!1)),a.$set(k)},i(g){f||(M(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(v(e),v(r)),j(a,g),c=!1,d()}}}function dD(n){let e,t,i,s,l,o=!n[2]&&uh(n);return s=new fe({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[cD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),H(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),y(e,t),y(e,i),q(s,i,null),l=!0},p(r,a){r[2]?o&&(oe(),D(o,1,1,()=>{o=null}),re()):o?(o.p(r,a),a&4&&M(o,1)):(o=uh(r),o.c(),M(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(M(o),M(s.$$.fragment,r),l=!0)},o(r){D(o),D(s.$$.fragment,r),l=!1},d(r){r&&v(e),o&&o.d(),j(s)}}}function pD(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[dD],default:[aD,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;fge(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return s=new of({props:u}),n[21](s),s.$on("save",n[22]),{c(){H(e.$$.fragment),i=C(),H(s.$$.fragment)},m(f,c){q(e,f,c),w(f,i,c),q(s,f,c),l=!0},p(f,[c]){const d=c&258?vt(o,[c&2&&{key:f[1]},c&256&&At(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],$e(()=>t=!1)),e.$set(d);const m={};s.$set(m)},i(f){l||(M(e.$$.fragment,f),M(s.$$.fragment,f),l=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),l=!1},d(f){f&&v(i),j(e,f),n[21](null),j(s,f)}}}function mD(n,e,t){let i,s;const l=["field","key"];let o=lt(e,l),r;Ge(n,In,R=>t(10,r=R));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=a.maxSelect<=1,h=m;function g(){t(0,a.maxSelect=1,a),t(0,a.collectionId=null,a),t(0,a.cascadeDelete=!1,a),t(2,m=!0),t(9,h=m)}const _=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=mt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const $=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Le.call(this,n,R)}function I(R){Le.call(this,n,R)}function A(R){Le.call(this,n,R)}function P(R){ne[R?"unshift":"push"](()=>{d=R,t(3,d)})}const N=R=>{var z,F;(F=(z=R==null?void 0:R.detail)==null?void 0:z.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=je(je({},e),Kt(R)),t(8,o=lt(e,l)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&g(),n.$$.dirty&1025&&t(4,s=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,s,i,f,c,o,h,r,_,k,S,$,T,O,E,L,I,A,P,N]}class hD extends we{constructor(e){super(),ve(this,e,mD,pD,be,{field:0,key:1})}}function fh(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function ch(n){let e,t;return e=new Dn({props:{class:"dropdown dropdown-block options-dropdown dropdown-left m-t-0 p-0",$$slots:{default:[gD]},$$scope:{ctx:n}}}),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&33554547&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function _D(n){let e,t,i=n[22]+"",s,l,o,r,a,u,f;function c(){return n[15](n[22])}return{c(){e=b("div"),t=b("span"),s=W(i),l=C(),o=b("div"),r=C(),a=b("button"),a.innerHTML='',p(t,"class","txt"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(a,"title","Remove"),p(e,"class","dropdown-item plain svelte-3le152")},m(d,m){w(d,e,m),y(e,t),y(t,s),y(e,l),y(e,o),y(e,r),y(e,a),u||(f=Y(a,"click",en(c)),u=!0)},p(d,m){n=d,m&1&&i!==(i=n[22]+"")&&se(s,i)},d(d){d&&v(e),u=!1,f()}}}function dh(n,e){let t,i,s,l;function o(a){e[16](a)}let r={index:e[24],group:"options_"+e[1],$$slots:{default:[_D]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new ms({props:r}),ne.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[24]),u&2&&(f.group="options_"+e[1]),u&33554433&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&v(t),j(i,a)}}}function gD(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,m,h,g=ce(n[0]);const _=k=>k[22];for(let k=0;k

    Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth methods (otp, identity/password, oauth2) before issuing an auth token. (Learn more) .