pocketbase/ui/dist/assets/index-e4123b79.js

184 lines
852 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(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 X(){}const kl=n=>n;function Ge(n,e){for(const t in e)n[t]=e[t];return n}function bb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Nm(n){return n()}function su(){return Object.create(null)}function Le(n){n.forEach(Nm)}function Zt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function jn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function vb(n){return Object.keys(n).length===0}function Fm(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ke(n,e,t){n.$$.on_destroy.push(Fm(e,t))}function Nt(n,e,t,i){if(n){const s=Rm(n,e,t,i);return n[0](s)}}function Rm(n,e,t,i){return n[1]&&i?Ge(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(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;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Rt(n,e,t,i,s,l){if(s){const o=Rm(e,t,i,l);n.p(o,s)}}function Ht(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Gn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ot(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function yi(n){return n??""}function Wt(n,e,t){return n.set(t),e}function Ie(n){return n&&Zt(n.destroy)?n.destroy:X}const Hm=typeof window<"u";let No=Hm?()=>window.performance.now():()=>Date.now(),fa=Hm?n=>requestAnimationFrame(n):X;const bs=new Set;function jm(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&fa(jm)}function Fo(n){let e;return bs.size===0&&fa(jm),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function _(n,e){n.appendChild(e)}function qm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function yb(n){const e=v("style");return kb(qm(n),e),e.sheet}function kb(n,e){return _(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function yt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function D(){return U(" ")}function Oe(){return U("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ct(n){return function(e){return e.preventDefault(),n.call(this,e)}}function bn(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)}function Zn(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?n[i]=e[i]:p(n,i,e[i])}function dt(n){return n===""?null:+n}function wb(n){return Array.from(n.childNodes)}function re(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function fe(n,e){n.value=e??""}function Ar(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList[t?"add":"remove"](e)}function Vm(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Yt(n,e){return new n(e)}const po=new Map;let ho=0;function Sb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function $b(n,e){const t={stylesheet:yb(e),rules:{}};return po.set(n,t),t}function rl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${Sb(f)}_${r}`,d=qm(n),{stylesheet:h,rules:m}=po.get(d)||$b(d,n);m[c]||(m[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function al(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(", "),ho-=s,ho||Cb())}function Cb(){fa(()=>{ho||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function Tb(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,m;function g(){c&&(m=rl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&al(n,m),d=!1}return Fo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const k=y-a,$=0+1*r(k/o);f($,1-$)}return!0}),g(),f(0,1),b}function Mb(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,zm(n,s)}}function zm(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 ul;function li(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function un(n){wl().$$.on_mount.push(n)}function Db(n){wl().$$.after_update.push(n)}function Bm(n){wl().$$.on_destroy.push(n)}function Ct(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Vm(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Be(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ms=[],ie=[],oo=[],Ir=[],Um=Promise.resolve();let Pr=!1;function Wm(){Pr||(Pr=!0,Um.then(ca))}function In(){return Wm(),Um}function tt(n){oo.push(n)}function we(n){Ir.push(n)}const xo=new Set;let us=0;function ca(){if(us!==0)return;const n=ul;do{try{for(;us<ms.length;){const e=ms[us];us++,li(e),Ob(e.$$)}}catch(e){throw ms.length=0,us=0,e}for(li(null),ms.length=0,us=0;ie.length;)ie.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];xo.has(t)||(xo.add(t),t())}oo.length=0}while(ms.length);for(;Ir.length;)Ir.pop()();Pr=!1,xo.clear(),li(n)}function Ob(n){if(n.fragment!==null){n.update(),Le(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}let Rs;function da(){return Rs||(Rs=Promise.resolve(),Rs.then(()=>{Rs=null})),Rs}function Bi(n,e,t){n.dispatchEvent(Vm(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Yn;function de(){Yn={r:0,c:[],p:Yn}}function pe(){Yn.r||Le(Yn.c),Yn=Yn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Yn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const pa={duration:0};function Ym(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&al(n,o)}function f(){const{delay:d=0,duration:h=300,easing:m=kl,tick:g=X,css:b}=s||pa;b&&(o=rl(n,0,1,h,d,m,b,a++)),g(0,1);const y=No()+d,k=y+h;r&&r.abort(),l=!0,tt(()=>Bi(n,!0,"start")),r=Fo($=>{if(l){if($>=k)return g(1,0),Bi(n,!0,"end"),u(),l=!1;if($>=y){const C=m(($-y)/h);g(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),Zt(s)?(s=s(i),da().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function Km(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Yn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=X,css:h}=s||pa;h&&(o=rl(n,1,0,f,u,c,h));const m=No()+u,g=m+f;tt(()=>Bi(n,!1,"start")),Fo(b=>{if(l){if(b>=g)return d(0,1),Bi(n,!1,"end"),--r.r||Le(r.c),!1;if(b>=m){const y=c((b-m)/f);d(1-y,y)}}return l})}return Zt(s)?da().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&al(n,o),l=!1)}}}function qe(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&al(n,u)}function c(h,m){const g=h.b-o;return m*=Math.abs(g),{a:o,b:h.b,d:g,duration:m,start:h.start,end:h.start+m,group:h.group}}function d(h){const{delay:m=0,duration:g=300,easing:b=kl,tick:y=X,css:k}=l||pa,$={start:No()+m,b:h};h||($.group=Yn,Yn.r+=1),r||a?a=$:(k&&(f(),u=rl(n,o,h,g,m,b,k)),h&&y(0,1),r=c($,g),tt(()=>Bi(n,h,"start")),Fo(C=>{if(a&&C>a.start&&(r=c(a,g),a=null,Bi(n,r.b,"start"),k&&(f(),u=rl(n,o,r.b,r.duration,0,b,l.css))),r){if(C>=r.end)y(o=r.b,1-o),Bi(n,r.b,"end"),a||(r.b?f():--r.group.r||Le(r.group.c)),r=null;else if(C>=r.start){const M=C-r.start;o=r.a+r.d*b(M/r.duration),y(o,1-o)}}return!!(r||a)}))}return{run(h){Zt(l)?da().then(()=>{l=l(s),d(h)}):d(h)},end(){f(),r=a=null}}}function lu(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&&(de(),P(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),pe())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ca()}if(bb(n)){const s=wl();if(n.then(l=>{li(s),i(e.then,1,e.value,l),li(null)},l=>{if(li(s),i(e.catch,2,e.error,l),li(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 Eb(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 Xi(n,e){n.d(1),e.delete(n.key)}function Kt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function Ab(n,e){n.f(),Kt(n,e)}function gt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,m=d;const g={};for(;m--;)g[n[m].key]=m;const b=[],y=new Map,k=new Map;for(m=h;m--;){const T=c(s,l,m),E=t(T);let O=o.get(E);O?i&&O.p(T,e):(O=u(E,T),O.c()),y.set(E,b[m]=O),E in g&&k.set(E,Math.abs(m-g[E]))}const $=new Set,C=new Set;function M(T){A(T,1),T.m(r,f),o.set(T.key,T),f=T.first,h--}for(;d&&h;){const T=b[h-1],E=n[d-1],O=T.key,I=E.key;T===E?(f=T.first,d--,h--):y.has(I)?!o.has(O)||$.has(O)?M(T):C.has(I)?d--:k.get(O)>k.get(I)?(C.add(O),M(T)):($.add(I),d--):(a(E,o),d--)}for(;d--;){const T=n[d];y.has(T.key)||a(T,o)}for(;h;)M(b[h-1]);return b}function nn(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 Xn(n){return typeof n=="object"&&n!==null?n:{}}function ve(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function q(n){n&&n.c()}function H(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||tt(()=>{const o=n.$$.on_mount.map(Nm).filter(Zt);n.$$.on_destroy?n.$$.on_destroy.push(...o):Le(o),n.$$.on_mount=[]}),l.forEach(tt)}function j(n,e){const t=n.$$;t.fragment!==null&&(Le(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ib(n,e){n.$$.dirty[0]===-1&&(ms.push(n),Wm(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function ye(n,e,t,i,s,l,o,r=[-1]){const a=ul;li(n);const u=n.$$={fragment:null,ctx:[],props:l,update:X,not_equal:s,bound:su(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:su(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(c,d,...h)=>{const m=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=m)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](m),f&&Ib(n,c)),d}):[],u.update(),f=!0,Le(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=wb(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),H(n,e.target,e.anchor,e.customElement),ca()}li(a)}class ke{$destroy(){j(this,1),this.$destroy=X}$on(e,t){if(!Zt(t))return X;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&&!vb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Tt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const fs=[];function Jm(n,e){return{subscribe:Pn(n,e).subscribe}}function Pn(n,e=X){let t;const i=new Set;function s(r){if(be(n,r)&&(n=r,t)){const a=!fs.length;for(const u of i)u[1](),fs.push(u,n);if(a){for(let u=0;u<fs.length;u+=2)fs[u][0](fs[u+1]);fs.length=0}}}function l(r){s(r(n))}function o(r,a=X){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||X),r(n),()=>{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function Zm(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return Jm(t,o=>{let r=!1;const a=[];let u=0,f=X;const c=()=>{if(u)return;f();const h=e(i?a[0]:a,o);l?o(h):f=Zt(h)?h:X},d=s.map((h,m)=>Fm(h,g=>{a[m]=g,u&=~(1<<m),r&&c()},()=>{u|=1<<m}));return r=!0,c(),function(){Le(d),f()}})}function Gm(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+(e?"(?=$|/)":"/?$"),"i")}}function Pb(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Ge(a,s[u]);return{props:a}}return l&&(e=Yt(l,o()),e.$on("routeEvent",n[7])),{c(){e&&q(e.$$.fragment),t=Oe()},m(r,a){e&&H(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&4?nn(s,[Xn(r[2])]):{};if(l!==(l=r[0])){if(e){de();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),pe()}l?(e=Yt(l,o()),e.$on("routeEvent",r[7]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Lb(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Ge(a,s[u]);return{props:a}}return l&&(e=Yt(l,o()),e.$on("routeEvent",n[6])),{c(){e&&q(e.$$.fragment),t=Oe()},m(r,a){e&&H(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&6?nn(s,[a&2&&{params:r[1]},a&4&&Xn(r[2])]):{};if(l!==(l=r[0])){if(e){de();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),pe()}l?(e=Yt(l,o()),e.$on("routeEvent",r[6]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Nb(n){let e,t,i,s;const l=[Lb,Pb],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Oe()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(de(),P(o[f],1,1,()=>{o[f]=null}),pe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function ou(){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 Ro=Jm(null,function(e){e(ou());const t=()=>{e(ou())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Zm(Ro,n=>n.location);const ha=Zm(Ro,n=>n.querystring),ru=Pn(void 0);async function $i(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await In();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 Qt(n,e){if(e=uu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return au(n,e),{update(t){t=uu(t),au(n,t)}}}function Fb(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function au(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||Rb(i.currentTarget.getAttribute("href"))})}function uu(n){return n&&typeof n=="string"?{href:n}:n||{}}function Rb(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Hb(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,T){if(!T||typeof T!="function"&&(typeof T!="object"||T._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:E,keys:O}=Gm(M);this.path=M,typeof T=="object"&&T._sveltesparouter===!0?(this.component=T.component,this.conditions=T.conditions||[],this.userData=T.userData,this.props=T.props||{}):(this.component=()=>Promise.resolve(T),this.conditions=[],this.props={}),this._pattern=E,this._keys=O}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=M.match(s);if(I&&I[0])M=M.substr(I[0].length)||"/";else return null}}const T=this._pattern.exec(M);if(T===null)return null;if(this._keys===!1)return T;const E={};let O=0;for(;O<this._keys.length;){try{E[this._keys[O]]=decodeURIComponent(T[O+1]||"")||null}catch{E[this._keys[O]]=null}O++}return E}async checkConditions(M){for(let T=0;T<this.conditions.length;T++)if(!await this.conditions[T](M))return!1;return!0}}const r=[];i instanceof Map?i.forEach((C,M)=>{r.push(new o(M,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,u=null,f={};const c=Ct();async function d(C,M){await In(),c(C,M)}let h=null,m=null;l&&(m=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?h=C.state:h=null},window.addEventListener("popstate",m),Db(()=>{Fb(h)}));let g=null,b=null;const y=Ro.subscribe(async C=>{g=C;let M=0;for(;M<r.length;){const T=r[M].match(C.location);if(!T){M++;continue}const E={route:r[M].path,location:C.location,querystring:C.querystring,userData:r[M].userData,params:T&&typeof T=="object"&&Object.keys(T).length?T:null};if(!await r[M].checkConditions(E)){t(0,a=null),b=null,d("conditionsFailed",E);return}d("routeLoading",Object.assign({},E));const O=r[M].component;if(b!=O){O.loading?(t(0,a=O.loading),b=O,t(1,u=O.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},E,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const I=await O();if(C!=g)return;t(0,a=I&&I.default||I),b=O}T&&typeof T=="object"&&Object.keys(T).length?t(1,u=T):t(1,u=null),t(2,f=r[M].props),d("routeLoaded",Object.assign({},E,{component:a,name:a.name,params:u})).then(()=>{ru.set(u)});return}t(0,a=null),b=null,ru.set(void 0)});Bm(()=>{y(),m&&window.removeEventListener("popstate",m)});function k(C){Be.call(this,n,C)}function $(C){Be.call(this,n,C)}return n.$$set=C=>{"routes"in C&&t(3,i=C.routes),"prefix"in C&&t(4,s=C.prefix),"restoreScrollState"in C&&t(5,l=C.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,k,$]}class jb extends ke{constructor(e){super(),ye(this,e,Hb,Nb,be,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let Xm;function Qm(n){const e=n.pattern.test(Xm);fu(n,n.className,e),fu(n,n.inactiveClassName,!e)}function fu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ro.subscribe(n=>{Xm=n.location+(n.querystring?"?"+n.querystring:""),ao.map(Qm)});function Fn(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"?Gm(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),Qm(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const qb="modulepreload",Vb=function(n,e){return new URL(n,e).href},cu={},rt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=Vb(l,i),l in cu)return;cu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":qb,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var Lr=function(n,e){return Lr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Lr(n,e)};function Jt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Lr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Nr=function(){return Nr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},Nr.apply(this,arguments)};function xt(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}function en(n,e){var t,i,s,l,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(a){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(s=2&c[0]?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[2&c[0],s.value]),c[0]){case 0:case 1:s=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){o.label=c[1];break}if(c[0]===6&&o.label<s[1]){o.label=s[1],s=c;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(c);break}s[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(n,o)}catch(d){c=[6,d],i=0}finally{t=s=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([a,u])}}}var xm,fl=function(n){function e(t){var i,s,l,o,r=this;return(r=n.call(this,"ClientResponseError")||this).url="",r.status=0,r.data={},r.isAbort=!1,r.originalError=null,Object.setPrototypeOf(r,e.prototype),t instanceof e||(r.originalError=t),t!==null&&typeof t=="object"&&(r.url=typeof t.url=="string"?t.url:"",r.status=typeof t.status=="number"?t.status:0,r.data=t.data!==null&&typeof t.data=="object"?t.data:{}),typeof DOMException<"u"&&t instanceof DOMException&&(r.isAbort=!0),r.name="ClientResponseError "+r.status,r.message=(i=r.data)===null||i===void 0?void 0:i.message,r.message||(r.isAbort?r.message="The request was autocancelled. More info you could find in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((o=(l=(s=r.originalError)===null||s===void 0?void 0:s.cause)===null||l===void 0?void 0:l.message)===null||o===void 0)&&o.includes("ECONNREFUSED ::1")?r.message="Failed to connect to the PocketBase server. Try replacing the SDK url from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":r.message="Something went wrong while processing your request."),r}return Jt(e,n),e.prototype.toJSON=function(){return Nr({},this)},e}(Error),Hl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function du(n,e,t){var i=Object.assign({},t||{}),s=i.encode||Bb;if(!Hl.test(n))throw new TypeError("argument name is invalid");var l=s(e);if(l&&!Hl.test(l))throw new TypeError("argument val is invalid");var o=n+"="+l;if(i.maxAge!=null){var r=i.maxAge-0;if(isNaN(r)||!isFinite(r))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(r)}if(i.domain){if(!Hl.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!Hl.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(!function(u){return Object.prototype.toString.call(u)==="[object Date]"||u instanceof Date}(i.expires)||isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}function zb(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function Bb(n){return encodeURIComponent(n)}function pu(n){if(n)try{var e=decodeURIComponent(xm(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}xm=typeof atob=="function"?atob:function(n){var 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};var Sl=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){for(var t=0,i=Object.entries(e);t<i.length;t++){var s=i[t],l=s[0],o=s[1];this[l]=o}this.id=e.id!==void 0?e.id:"",this.created=e.created!==void 0?e.created:"",this.updated=e.updated!==void 0?e.updated:""},Object.defineProperty(n.prototype,"isNew",{get:function(){return!this.id},enumerable:!1,configurable:!0}),n.prototype.clone=function(){var e=typeof structuredClone=="function"?structuredClone(this):JSON.parse(JSON.stringify(this));return new this.constructor(e)},n.prototype.export=function(){return Object.assign({},this)},n}(),Ki=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.collectionId=typeof t.collectionId=="string"?t.collectionId:"",this.collectionName=typeof t.collectionName=="string"?t.collectionName:"",this.loadExpand(t.expand)},e.prototype.loadExpand=function(t){for(var i in t=t||{},this.expand={},t)Array.isArray(t[i])?this.expand[i]=t[i].map(function(s){return new e(s||{})}):this.expand[i]=new e(t[i]||{})},e}(Sl),Ji=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.avatar=typeof t.avatar=="number"?t.avatar:0,this.email=typeof t.email=="string"?t.email:""},e}(Sl),Ub=function(){function n(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!function(t,i){i===void 0&&(i=0);var s=pu(t);return!(Object.keys(s).length>0&&(!s.exp||s.exp-i>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e||"",this.baseModel=t!==null&&typeof t=="object"?t.collectionId!==void 0?new Ki(t):new Ji(t):null,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange()},n.prototype.loadFromCookie=function(e,t){t===void 0&&(t="pb_auth");var i=function(o,r){var a={};if(typeof o!="string")return a;for(var u=Object.assign({},r||{}).decode||zb,f=0;f<o.length;){var c=o.indexOf("=",f);if(c===-1)break;var d=o.indexOf(";",f);if(d===-1)d=o.length;else if(d<c){f=o.lastIndexOf(";",c-1)+1;continue}var h=o.slice(f,c).trim();if(a[h]===void 0){var m=o.slice(c+1,d).trim();m.charCodeAt(0)===34&&(m=m.slice(1,-1));try{a[h]=u(m)}catch{a[h]=m}}f=d+1}return a}(e||"")[t]||"",s={};try{(typeof(s=JSON.parse(i))===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)},n.prototype.exportToCookie=function(e,t){var i,s,l;t===void 0&&(t="pb_auth");var o={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},r=pu(this.token);r!=null&&r.exp?o.expires=new Date(1e3*r.exp):o.expires=new Date("1970-01-01"),e=Object.assign({},o,e);var a={token:this.token,model:((i=this.model)===null||i===void 0?void 0:i.export())||null},u=du(t,JSON.stringify(a),e),f=typeof Blob<"u"?new Blob([u]).size:u.length;return a.model&&f>4096&&(a.model={id:(s=a==null?void 0:a.model)===null||s===void 0?void 0:s.id,email:(l=a==null?void 0:a.model)===null||l===void 0?void 0:l.email},this.model instanceof Ki&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=du(t,JSON.stringify(a),e)),u},n.prototype.onChange=function(e,t){var i=this;return t===void 0&&(t=!1),this._onChangeCallbacks.push(e),t&&e(this.token,this.model),function(){for(var s=i._onChangeCallbacks.length-1;s>=0;s--)if(i._onChangeCallbacks[s]==e)return delete i._onChangeCallbacks[s],void i._onChangeCallbacks.splice(s,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e<t.length;e++){var i=t[e];i&&i(this.token,this.model)}},n}(),eg=function(n){function e(t){t===void 0&&(t="pocketbase_auth");var i=n.call(this)||this;return i.storageFallback={},i.storageKey=t,i}return Jt(e,n),Object.defineProperty(e.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){var t,i=this._storageGet(this.storageKey)||{};return i===null||typeof i!="object"||i.model===null||typeof i.model!="object"?null:((t=i.model)===null||t===void 0?void 0:t.collectionId)===void 0?new Ji(i.model):new Ki(i.model)},enumerable:!1,configurable:!0}),e.prototype.save=function(t,i){this._storageSet(this.storageKey,{token:t,model:i}),n.prototype.save.call(this,t,i)},e.prototype.clear=function(){this._storageRemove(this.storageKey),n.prototype.clear.call(this)},e.prototype._storageGet=function(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){var i=window.localStorage.getItem(t)||"";try{return JSON.parse(i)}catch{return i}}return this.storageFallback[t]},e.prototype._storageSet=function(t,i){if(typeof window<"u"&&(window!=null&&window.localStorage)){var s=i;typeof i!="string"&&(s=JSON.stringify(i)),window.localStorage.setItem(t,s)}else this.storageFallback[t]=i},e.prototype._storageRemove=function(t){var i;typeof window<"u"&&(window!=null&&window.localStorage)&&((i=window.localStorage)===null||i===void 0||i.removeItem(t)),delete this.storageFallback[t]},e}(Ub),$l=function(e){this.client=e},Wb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getAll=function(t){return t===void 0&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then(function(i){return i||{}})},e.prototype.update=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send("/api/settings",{method:"PATCH",params:i,body:t}).then(function(s){return s||{}})},e.prototype.testS3=function(t){return t===void 0&&(t={}),this.client.send("/api/settings/test/s3",{method:"POST",params:t}).then(function(){return!0})},e.prototype.testEmail=function(t,i,s){s===void 0&&(s={});var l={email:t,template:i};return this.client.send("/api/settings/test/email",{method:"POST",params:s,body:l}).then(function(){return!0})},e}($l),tg=function(e,t,i,s,l){this.page=e>0?e:1,this.perPage=t>=0?t:0,this.totalItems=i>=0?i:0,this.totalPages=s>=0?s:0,this.items=l||[]},ma=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getFullList=function(t,i){return t===void 0&&(t=200),i===void 0&&(i={}),this._getFullList(this.baseCrudPath,t,i)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),this._getList(this.baseCrudPath,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),this._getFirstListItem(this.baseCrudPath,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),this._getOne(this.baseCrudPath,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this._create(this.baseCrudPath,t,i)},e.prototype.update=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._update(this.baseCrudPath,t,i,s)},e.prototype.delete=function(t,i){return i===void 0&&(i={}),this._delete(this.baseCrudPath,t,i)},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return xt(l,void 0,void 0,function(){return en(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,h=c.totalItems;return o=o.concat(d),d.length&&h>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u<f.length;u++){var c=f[u];a.push(o.decode(c))}}return new tg((r==null?void 0:r.page)||1,(r==null?void 0:r.perPage)||0,(r==null?void 0:r.totalItems)||0,(r==null?void 0:r.totalPages)||0,a)})},e.prototype._getOne=function(t,i,s){var l=this;return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"GET",params:s}).then(function(o){return l.decode(o)})},e.prototype._getFirstListItem=function(t,i,s){return s===void 0&&(s={}),s=Object.assign({filter:i,$cancelKey:"one_by_filter_"+t+"_"+i},s),this._getList(t,1,1,s).then(function(l){var o;if(!(!((o=l==null?void 0:l.items)===null||o===void 0)&&o.length))throw new fl({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return l.items[0]})},e.prototype._create=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),this.client.send(t,{method:"POST",params:s,body:i}).then(function(o){return l.decode(o)})},e.prototype._update=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"PATCH",params:l,body:s}).then(function(r){return o.decode(r)})},e.prototype._delete=function(t,i,s){return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}($l)),Yb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.decode=function(t){return new Ji(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return"/api/admins"},enumerable:!1,configurable:!0}),e.prototype.update=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),n.prototype.update.call(this,t,i,s).then(function(o){var r,a;return l.client.authStore.model&&((r=l.client.authStore.model)===null||r===void 0?void 0:r.collectionId)===void 0&&((a=l.client.authStore.model)===null||a===void 0?void 0:a.id)===(o==null?void 0:o.id)&&l.client.authStore.save(l.client.authStore.token,o),o})},e.prototype.delete=function(t,i){var s=this;return i===void 0&&(i={}),n.prototype.delete.call(this,t,i).then(function(l){var o,r;return l&&s.client.authStore.model&&((o=s.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&((r=s.client.authStore.model)===null||r===void 0?void 0:r.id)===t&&s.client.authStore.clear(),l})},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:i})},e.prototype.authWithPassword=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({identity:t,password:i},s),this.client.send(this.baseCrudPath+"/auth-with-password",{method:"POST",params:l,body:s}).then(this.authResponse.bind(this))},e.prototype.authRefresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCrudPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCrudPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e}(ma),Kb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.recordId=typeof t.recordId=="string"?t.recordId:"",this.collectionId=typeof t.collectionId=="string"?t.collectionId:"",this.provider=typeof t.provider=="string"?t.provider:"",this.providerId=typeof t.providerId=="string"?t.providerId:""},e}(Sl),Jb=function(n){function e(t,i){var s=n.call(this,t)||this;return s.collectionIdOrName=i,s}return Jt(e,n),e.prototype.decode=function(t){return new Ki(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return this.baseCollectionPath+"/records"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseCollectionPath",{get:function(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)},enumerable:!1,configurable:!0}),e.prototype.subscribeOne=function(t,i){return xt(this,void 0,void 0,function(){return en(this,function(s){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),[2,this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,i)]})})},e.prototype.subscribe=function(t,i){return xt(this,void 0,void 0,function(){var s;return en(this,function(l){if(typeof t=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),[2,this.client.realtime.subscribe(this.collectionIdOrName,t)];if(!i)throw new Error("Missing subscription callback.");if(t==="")throw new Error("Missing topic.");return s=this.collectionIdOrName,t!=="*"&&(s+="/"+t),[2,this.client.realtime.subscribe(s,i)]})})},e.prototype.unsubscribe=function(t){return xt(this,void 0,void 0,function(){return en(this,function(i){return t==="*"?[2,this.client.realtime.unsubscribe(this.collectionIdOrName)]:t?[2,this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t)]:[2,this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)]})})},e.prototype.getFullList=function(t,i){return t===void 0&&(t=200),i===void 0&&(i={}),n.prototype.getFullList.call(this,t,i)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),n.prototype.getList.call(this,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),n.prototype.getFirstListItem.call(this,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),n.prototype.getOne.call(this,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),n.prototype.create.call(this,t,i)},e.prototype.update=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),n.prototype.update.call(this,t,i,s).then(function(o){var r,a;return((r=l.client.authStore.model)===null||r===void 0?void 0:r.collectionId)!==void 0&&((a=l.client.authStore.model)===null||a===void 0?void 0:a.id)===(o==null?void 0:o.id)&&l.client.authStore.save(l.client.authStore.token,o),o})},e.prototype.delete=function(t,i){var s=this;return i===void 0&&(i={}),n.prototype.delete.call(this,t,i).then(function(l){var o,r;return l&&((o=s.client.authStore.model)===null||o===void 0?void 0:o.collectionId)!==void 0&&((r=s.client.authStore.model)===null||r===void 0?void 0:r.id)===t&&s.client.authStore.clear(),l})},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:i})},e.prototype.listAuthMethods=function(t){return t===void 0&&(t={}),this.client.send(this.baseCollectionPath+"/auth-methods",{method:"GET",params:t}).then(function(i){return Object.assign({},i,{usernamePassword:!!(i!=null&&i.usernamePassword),emailPassword:!!(i!=null&&i.emailPassword),authProviders:Array.isArray(i==null?void 0:i.authProviders)?i==null?void 0:i.authProviders:[]})})},e.prototype.authWithPassword=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({identity:t,password:i},s),this.client.send(this.baseCollectionPath+"/auth-with-password",{method:"POST",params:l,body:s}).then(function(r){return o.authResponse(r)})},e.prototype.authWithOAuth2=function(t,i,s,l,o,r,a){var u=this;return o===void 0&&(o={}),r===void 0&&(r={}),a===void 0&&(a={}),r=Object.assign({provider:t,code:i,codeVerifier:s,redirectUrl:l,createData:o},r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",{method:"POST",params:a,body:r}).then(function(f){return u.authResponse(f)})},e.prototype.authRefresh=function(t,i){var s=this;return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCollectionPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(function(l){return s.authResponse(l)})},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e.prototype.requestVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({token:t},i),this.client.send(this.baseCollectionPath+"/confirm-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.requestEmailChange=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({newEmail:t},i),this.client.send(this.baseCollectionPath+"/request-email-change",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmEmailChange=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({token:t,password:i},s),this.client.send(this.baseCollectionPath+"/confirm-email-change",{method:"POST",params:l,body:s}).then(function(){return!0})},e.prototype.listExternalAuths=function(t,i){return i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:i}).then(function(s){var l=[];if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];l.push(new Kb(a))}return l})},e.prototype.unlinkExternalAuth=function(t,i,s){return s===void 0&&(s={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}(ma),fn=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){this.id=e.id!==void 0?e.id:"",this.name=e.name!==void 0?e.name:"",this.type=e.type!==void 0?e.type:"text",this.system=!!e.system,this.required=!!e.required,this.unique=!!e.unique,this.options=typeof e.options=="object"&&e.options!==null?e.options:{}},n}(),gn=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.system=!!t.system,this.name=typeof t.name=="string"?t.name:"",this.type=typeof t.type=="string"?t.type:"base",this.options=t.options!==void 0?t.options:{},this.listRule=typeof t.listRule=="string"?t.listRule:null,this.viewRule=typeof t.viewRule=="string"?t.viewRule:null,this.createRule=typeof t.createRule=="string"?t.createRule:null,this.updateRule=typeof t.updateRule=="string"?t.updateRule:null,this.deleteRule=typeof t.deleteRule=="string"?t.deleteRule:null,t.schema=Array.isArray(t.schema)?t.schema:[],this.schema=[];for(var i=0,s=t.schema;i<s.length;i++){var l=s[i];this.schema.push(new fn(l))}},Object.defineProperty(e.prototype,"isBase",{get:function(){return this.type==="base"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAuth",{get:function(){return this.type==="auth"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSingle",{get:function(){return this.type==="single"},enumerable:!1,configurable:!0}),e}(Sl),Zb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.decode=function(t){return new gn(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return"/api/collections"},enumerable:!1,configurable:!0}),e.prototype.import=function(t,i,s){return i===void 0&&(i=!1),s===void 0&&(s={}),xt(this,void 0,void 0,function(){return en(this,function(l){return[2,this.client.send(this.baseCrudPath+"/import",{method:"PUT",params:s,body:{collections:t,deleteMissing:i}}).then(function(){return!0})]})})},e}(ma),Fr=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),t.remoteIp=t.remoteIp||t.ip,this.url=typeof t.url=="string"?t.url:"",this.method=typeof t.method=="string"?t.method:"GET",this.status=typeof t.status=="number"?t.status:200,this.auth=typeof t.auth=="string"?t.auth:"guest",this.remoteIp=typeof t.remoteIp=="string"?t.remoteIp:"",this.userIp=typeof t.userIp=="string"?t.userIp:"",this.referer=typeof t.referer=="string"?t.referer:"",this.userAgent=typeof t.userAgent=="string"?t.userAgent:"",this.meta=typeof t.meta=="object"&&t.meta!==null?t.meta:{}},e}(Sl),Gb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getRequestsList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),s=Object.assign({page:t,perPage:i},s),this.client.send("/api/logs/requests",{method:"GET",params:s}).then(function(l){var o=[];if(l!=null&&l.items){l.items=(l==null?void 0:l.items)||[];for(var r=0,a=l.items;r<a.length;r++){var u=a[r];o.push(new Fr(u))}}return new tg((l==null?void 0:l.page)||1,(l==null?void 0:l.perPage)||0,(l==null?void 0:l.totalItems)||0,(l==null?void 0:l.totalPages)||0,o)})},e.prototype.getRequest=function(t,i){return i===void 0&&(i={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:i}).then(function(s){return new Fr(s)})},e.prototype.getRequestsStats=function(t){return t===void 0&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then(function(i){return i})},e}($l),Xb=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t.lastSentTopics=[],t.maxConnectTimeout=15e3,t.reconnectAttempts=0,t.maxReconnectAttempts=1/0,t.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],t.pendingConnects=[],t}return Jt(e,n),Object.defineProperty(e.prototype,"isConnected",{get:function(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t,i){var s;return xt(this,void 0,void 0,function(){var l,o=this;return en(this,function(r){switch(r.label){case 0:if(!t)throw new Error("topic must be set.");return l=function(a){var u,f=a;try{u=JSON.parse(f==null?void 0:f.data)}catch{}i(u||{})},this.subscriptions[t]||(this.subscriptions[t]=[]),this.subscriptions[t].push(l),this.isConnected?[3,2]:[4,this.connect()];case 1:return r.sent(),[3,5];case 2:return this.subscriptions[t].length!==1?[3,4]:[4,this.submitSubscriptions()];case 3:return r.sent(),[3,5];case 4:(s=this.eventSource)===null||s===void 0||s.addEventListener(t,l),r.label=5;case 5:return[2,function(){return xt(o,void 0,void 0,function(){return en(this,function(a){return[2,this.unsubscribeByTopicAndListener(t,l)]})})}]}})})},e.prototype.unsubscribe=function(t){var i;return xt(this,void 0,void 0,function(){var s,l,o;return en(this,function(r){switch(r.label){case 0:if(!this.hasSubscriptionListeners(t))return[2];if(t){for(s=0,l=this.subscriptions[t];s<l.length;s++)o=l[s],(i=this.eventSource)===null||i===void 0||i.removeEventListener(t,o);delete this.subscriptions[t]}else this.subscriptions={};return this.hasSubscriptionListeners()?[3,1]:(this.disconnect(),[3,3]);case 1:return this.hasSubscriptionListeners(t)?[3,3]:[4,this.submitSubscriptions()];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.unsubscribeByPrefix=function(t){var i;return xt(this,void 0,void 0,function(){var s,l,o,r,a;return en(this,function(u){switch(u.label){case 0:for(l in s=!1,this.subscriptions)if(l.startsWith(t)){for(s=!0,o=0,r=this.subscriptions[l];o<r.length;o++)a=r[o],(i=this.eventSource)===null||i===void 0||i.removeEventListener(l,a);delete this.subscriptions[l]}return s?this.hasSubscriptionListeners()?[4,this.submitSubscriptions()]:[3,2]:[2];case 1:return u.sent(),[3,3];case 2:this.disconnect(),u.label=3;case 3:return[2]}})})},e.prototype.unsubscribeByTopicAndListener=function(t,i){var s;return xt(this,void 0,void 0,function(){var l,o;return en(this,function(r){switch(r.label){case 0:if(!Array.isArray(this.subscriptions[t])||!this.subscriptions[t].length)return[2];for(l=!1,o=this.subscriptions[t].length-1;o>=0;o--)this.subscriptions[t][o]===i&&(l=!0,delete this.subscriptions[t][o],this.subscriptions[t].splice(o,1),(s=this.eventSource)===null||s===void 0||s.removeEventListener(t,i));return l?(this.subscriptions[t].length||delete this.subscriptions[t],this.hasSubscriptionListeners()?[3,1]:(this.disconnect(),[3,3])):[2];case 1:return this.hasSubscriptionListeners(t)?[3,3]:[4,this.submitSubscriptions()];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.hasSubscriptionListeners=function(t){var i,s;if(this.subscriptions=this.subscriptions||{},t)return!!(!((i=this.subscriptions[t])===null||i===void 0)&&i.length);for(var l in this.subscriptions)if(!((s=this.subscriptions[l])===null||s===void 0)&&s.length)return!0;return!1},e.prototype.submitSubscriptions=function(){return xt(this,void 0,void 0,function(){return en(this,function(t){return this.clientId?(this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},params:{$cancelKey:"realtime_"+this.clientId}}).catch(function(i){if(!(i!=null&&i.isAbort))throw i})]):[2]})})},e.prototype.getNonEmptySubscriptionTopics=function(){var t=[];for(var i in this.subscriptions)this.subscriptions[i].length&&t.push(i);return t},e.prototype.addAllSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeAllSubscriptionListeners(),this.subscriptions)for(var i=0,s=this.subscriptions[t];i<s.length;i++){var l=s[i];this.eventSource.addEventListener(t,l)}},e.prototype.removeAllSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)for(var i=0,s=this.subscriptions[t];i<s.length;i++){var l=s[i];this.eventSource.removeEventListener(t,l)}},e.prototype.connect=function(){return xt(this,void 0,void 0,function(){var t=this;return en(this,function(i){return this.reconnectAttempts>0?[2]:[2,new Promise(function(s,l){t.pendingConnects.push({resolve:s,reject:l}),t.pendingConnects.length>1||t.initConnect()})]})})},e.prototype.initConnect=function(){var t=this;this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(function(){t.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=function(i){t.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",function(i){var s=i;t.clientId=s==null?void 0:s.lastEventId,t.submitSubscriptions().then(function(){return xt(t,void 0,void 0,function(){var l;return en(this,function(o){switch(o.label){case 0:l=3,o.label=1;case 1:return this.hasUnsentSubscriptions()&&l>0?(l--,[4,this.submitSubscriptions()]):[3,3];case 2:return o.sent(),[3,1];case 3:return[2]}})})}).then(function(){for(var l=0,o=t.pendingConnects;l<o.length;l++)o[l].resolve();t.pendingConnects=[],t.reconnectAttempts=0,clearTimeout(t.reconnectTimeoutId),clearTimeout(t.connectTimeoutId)}).catch(function(l){t.clientId="",t.connectErrorHandler(l)})})},e.prototype.hasUnsentSubscriptions=function(){var t=this.getNonEmptySubscriptionTopics();if(t.length!=this.lastSentTopics.length)return!0;for(var i=0,s=t;i<s.length;i++){var l=s[i];if(!this.lastSentTopics.includes(l))return!0}return!1},e.prototype.connectErrorHandler=function(t){var i=this;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(var s=0,l=this.pendingConnects;s<l.length;s++)l[s].reject(new fl(t));this.disconnect()}else{this.disconnect(!0);var o=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(function(){i.initConnect()},o)}},e.prototype.disconnect=function(t){var i;if(t===void 0&&(t=!1),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),(i=this.eventSource)===null||i===void 0||i.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(var s=new fl(new Error("Realtime disconnected.")),l=0,o=this.pendingConnects;l<o.length;l++)o[l].reject(s);this.pendingConnects=[]}},e}($l),Qb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.check=function(t){return t===void 0&&(t={}),this.client.send("/api/health",{method:"GET",params:t})},e}($l),ga=function(){function n(e,t,i){e===void 0&&(e="/"),i===void 0&&(i="en-US"),this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new eg,this.admins=new Yb(this),this.collections=new Zb(this),this.logs=new Gb(this),this.settings=new Wb(this),this.realtime=new Xb(this),this.health=new Qb(this)}return n.prototype.collection=function(e){return this.recordServices[e]||(this.recordServices[e]=new Jb(this,e)),this.recordServices[e]},n.prototype.autoCancellation=function(e){return this.enableAutoCancellation=!!e,this},n.prototype.cancelRequest=function(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this},n.prototype.cancelAllRequests=function(){for(var e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this},n.prototype.send=function(e,t){var i,s,l,o,r,a,u,f;return xt(this,void 0,void 0,function(){var c,d,h,m,g,b=this;return en(this,function(y){return(c=Object.assign({method:"GET"},t)).body&&c.body.constructor.name!=="FormData"&&(typeof c.body!="string"&&(c.body=JSON.stringify(c.body)),((i=c==null?void 0:c.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(c.headers=Object.assign({},c.headers,{"Content-Type":"application/json"}))),((s=c==null?void 0:c.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(c.headers=Object.assign({},c.headers,{"Accept-Language":this.lang})),!((l=this.authStore)===null||l===void 0)&&l.token&&((o=c==null?void 0:c.headers)===null||o===void 0?void 0:o.Authorization)===void 0&&(c.headers=Object.assign({},c.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&((r=c.params)===null||r===void 0?void 0:r.$autoCancel)!==!1&&(d=((a=c.params)===null||a===void 0?void 0:a.$cancelKey)||(c.method||"GET")+e,this.cancelRequest(d),h=new AbortController,this.cancelControllers[d]=h,c.signal=h.signal),(u=c.params)===null||u===void 0||delete u.$autoCancel,(f=c.params)===null||f===void 0||delete f.$cancelKey,m=this.buildUrl(e),c.params!==void 0&&((g=this.serializeQueryParams(c.params))&&(m+=(m.includes("?")?"&":"?")+g),delete c.params),this.beforeSend&&(c=Object.assign({},this.beforeSend(m,c))),[2,fetch(m,c).then(function(k){return xt(b,void 0,void 0,function(){var $;return en(this,function(C){switch(C.label){case 0:$={},C.label=1;case 1:return C.trys.push([1,3,,4]),[4,k.json()];case 2:return $=C.sent(),[3,4];case 3:return C.sent(),[3,4];case 4:if(this.afterSend&&($=this.afterSend(k,$)),k.status>=400)throw new fl({url:k.url,status:k.status,data:$});return[2,$]}})})}).catch(function(k){throw new fl(k)})]})})},n.prototype.getFileUrl=function(e,t,i){i===void 0&&(i={});var s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));var l=this.buildUrl(s.join("/"));if(Object.keys(i).length){var o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];t.push(l+"="+encodeURIComponent(a))}else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")},n}();class Qi extends Error{}class xb extends Qi{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class e0 extends Qi{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class t0 extends Qi{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Zs extends Qi{}class ng extends Qi{constructor(e){super(`Invalid unit ${e}`)}}class Cn extends Qi{}class ci extends Qi{constructor(){super("Zone is an abstract class")}}const De="numeric",qn="short",_n="long",Rr={year:De,month:De,day:De},ig={year:De,month:qn,day:De},n0={year:De,month:qn,day:De,weekday:qn},sg={year:De,month:_n,day:De},lg={year:De,month:_n,day:De,weekday:_n},og={hour:De,minute:De},rg={hour:De,minute:De,second:De},ag={hour:De,minute:De,second:De,timeZoneName:qn},ug={hour:De,minute:De,second:De,timeZoneName:_n},fg={hour:De,minute:De,hourCycle:"h23"},cg={hour:De,minute:De,second:De,hourCycle:"h23"},dg={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:qn},pg={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:_n},hg={year:De,month:De,day:De,hour:De,minute:De},mg={year:De,month:De,day:De,hour:De,minute:De,second:De},gg={year:De,month:qn,day:De,hour:De,minute:De},_g={year:De,month:qn,day:De,hour:De,minute:De,second:De},i0={year:De,month:qn,day:De,weekday:qn,hour:De,minute:De},bg={year:De,month:_n,day:De,hour:De,minute:De,timeZoneName:qn},vg={year:De,month:_n,day:De,hour:De,minute:De,second:De,timeZoneName:qn},yg={year:De,month:_n,day:De,weekday:_n,hour:De,minute:De,timeZoneName:_n},kg={year:De,month:_n,day:De,weekday:_n,hour:De,minute:De,second:De,timeZoneName:_n};function Qe(n){return typeof n>"u"}function Ui(n){return typeof n=="number"}function Ho(n){return typeof n=="number"&&n%1===0}function s0(n){return typeof n=="string"}function l0(n){return Object.prototype.toString.call(n)==="[object Date]"}function wg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function o0(n){return Array.isArray(n)?n:[n]}function hu(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 r0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function $s(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function oi(n,e,t){return Ho(n)&&n>=e&&n<=t}function a0(n,e){return n-e*Math.floor(n/e)}function Mt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function pi(n){if(!(Qe(n)||n===null||n===""))return parseInt(n,10)}function Ii(n){if(!(Qe(n)||n===null||n===""))return parseFloat(n)}function _a(n){if(!(Qe(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ba(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Cl(n){return n%4===0&&(n%100!==0||n%400===0)}function xs(n){return Cl(n)?366:365}function mo(n,e){const t=a0(e-1,12)+1,i=n+(e-t)/12;return t===2?Cl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function va(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(e.getUTCFullYear()-1900)),+e}function go(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Hr(n){return n>99?n:n>60?1900+n:2e3+n}function Sg(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 jo(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 $g(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Cn(`Invalid unit value ${n}`);return e}function _o(n,e){const t={};for(const i in n)if($s(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=$g(s)}return t}function el(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}${Mt(t,2)}:${Mt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Mt(t,2)}${Mt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function qo(n){return r0(n,["hour","minute","second","millisecond"])}const Cg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,u0=["January","February","March","April","May","June","July","August","September","October","November","December"],Tg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],f0=["J","F","M","A","M","J","J","A","S","O","N","D"];function Mg(n){switch(n){case"narrow":return[...f0];case"short":return[...Tg];case"long":return[...u0];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 Dg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Og=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],c0=["M","T","W","T","F","S","S"];function Eg(n){switch(n){case"narrow":return[...c0];case"short":return[...Og];case"long":return[...Dg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ag=["AM","PM"],d0=["Before Christ","Anno Domini"],p0=["BC","AD"],h0=["B","A"];function Ig(n){switch(n){case"narrow":return[...h0];case"short":return[...p0];case"long":return[...d0];default:return null}}function m0(n){return Ag[n.hour<12?0:1]}function g0(n,e){return Eg(e)[n.weekday-1]}function _0(n,e){return Mg(e)[n.month-1]}function b0(n,e){return Ig(e)[n.year<0?0:1]}function v0(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 mu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const y0={D:Rr,DD:ig,DDD:sg,DDDD:lg,t:og,tt:rg,ttt:ag,tttt:ug,T:fg,TT:cg,TTT:dg,TTTT:pg,f:hg,ff:gg,fff:bg,ffff:yg,F:mg,FF:_g,FFF:vg,FFFF:kg};class an{static create(e,t={}){return new an(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o<e.length;o++){const r=e.charAt(o);r==="'"?(i.length>0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return y0[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()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Mt(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=(h,m)=>this.loc.extract(e,h,m),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?m0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,m)=>i?_0(e,h):l(m?{month:h}:{month:h,day:"numeric"},"month"),u=(h,m)=>i?g0(e,h):l(m?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const m=an.macroTokenToFormatOpts(h);return m?this.formatWithSystemDefault(e,m):h},c=h=>i?b0(e,h):l({era:h},"era"),d=h=>{switch(h){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"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(h)}};return mu(an.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=an.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 mu(l,s(r))}}class Rn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Tl{get type(){throw new ci}get name(){throw new ci}get ianaName(){return this.name}get isUniversal(){throw new ci}offsetName(e,t){throw new ci}formatOffset(e,t){throw new ci}offset(e){throw new ci}equals(e){throw new ci}get isValid(){throw new ci}}let er=null;class ya extends Tl{static get instance(){return er===null&&(er=new ya),er}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Sg(e,t,i)}formatOffset(e,t){return el(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function k0(n){return uo[n]||(uo[n]=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"})),uo[n]}const w0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function S0(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 $0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=w0[l];l==="era"?i[r]=o:Qe(r)||(i[r]=parseInt(o,10))}return i}let jl={};class ri extends Tl{static create(e){return jl[e]||(jl[e]=new ri(e)),jl[e]}static resetCache(){jl={},uo={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=ri.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Sg(e,t,i,this.name)}formatOffset(e,t){return el(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=k0(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?$0(i,t):S0(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=va({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let h=+t;const m=h%1e3;return h-=m>=0?m:1e3+m,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let tr=null;class tn extends Tl{static get utcInstance(){return tr===null&&(tr=new tn(0)),tr}static instance(e){return e===0?tn.utcInstance:new tn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new tn(jo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${el(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${el(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return el(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 C0 extends Tl{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 hi(n,e){if(Qe(n)||n===null)return e;if(n instanceof Tl)return n;if(s0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?tn.utcInstance:tn.parseSpecifier(t)||ri.create(n)}else return Ui(n)?tn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new C0(n)}let gu=()=>Date.now(),_u="system",bu=null,vu=null,yu=null,ku;class Lt{static get now(){return gu}static set now(e){gu=e}static set defaultZone(e){_u=e}static get defaultZone(){return hi(_u,ya.instance)}static get defaultLocale(){return bu}static set defaultLocale(e){bu=e}static get defaultNumberingSystem(){return vu}static set defaultNumberingSystem(e){vu=e}static get defaultOutputCalendar(){return yu}static set defaultOutputCalendar(e){yu=e}static get throwOnInvalid(){return ku}static set throwOnInvalid(e){ku=e}static resetCaches(){mt.resetCache(),ri.resetCache()}}let wu={};function T0(n,e={}){const t=JSON.stringify([n,e]);let i=wu[t];return i||(i=new Intl.ListFormat(n,e),wu[t]=i),i}let jr={};function qr(n,e={}){const t=JSON.stringify([n,e]);let i=jr[t];return i||(i=new Intl.DateTimeFormat(n,e),jr[t]=i),i}let Vr={};function M0(n,e={}){const t=JSON.stringify([n,e]);let i=Vr[t];return i||(i=new Intl.NumberFormat(n,e),Vr[t]=i),i}let zr={};function D0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=zr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),zr[s]=l),l}let Gs=null;function O0(){return Gs||(Gs=new Intl.DateTimeFormat().resolvedOptions().locale,Gs)}function E0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=qr(n).resolvedOptions()}catch{t=qr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function A0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function I0(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2016,t,1);e.push(n(i))}return e}function P0(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function ql(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function L0(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class N0{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=M0(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):ba(e,3);return Mt(t,this.padTo)}}}class F0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ri.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:je.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=qr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class R0{constructor(e,t,i){this.opts={style:"long",...i},!t&&wg()&&(this.rtf=D0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):v0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class mt{static fromOpts(e){return mt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Lt.defaultLocale,o=l||(s?"en-US":O0()),r=t||Lt.defaultNumberingSystem,a=i||Lt.defaultOutputCalendar;return new mt(o,r,a,l)}static resetCache(){Gs=null,jr={},Vr={},zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return mt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=E0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=A0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=L0(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:mt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return ql(this,e,i,Mg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=I0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return ql(this,e,i,Eg,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=P0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return ql(this,void 0,e,()=>Ag,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return ql(this,e,t,Ig,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(s=>this.extract(s,i,"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 N0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new F0(e,this.intl,t)}relFormatter(e={}){return new R0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return T0(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function As(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Is(...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 Ps(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 Pg(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=pi(e[t+s]);return[i,null,t+s]}}const Lg=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,H0=`(?:${Lg.source}?(?:\\[(${Cg.source})\\])?)?`,ka=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ng=RegExp(`${ka.source}${H0}`),wa=RegExp(`(?:T${Ng.source})?`),j0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,q0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,V0=/(\d{4})-?(\d{3})/,z0=Pg("weekYear","weekNumber","weekDay"),B0=Pg("year","ordinal"),U0=/(\d{4})-(\d\d)-(\d\d)/,Fg=RegExp(`${ka.source} ?(?:${Lg.source}|(${Cg.source}))?`),W0=RegExp(`(?: ${Fg.source})?`);function vs(n,e,t){const i=n[e];return Qe(i)?t:pi(i)}function Y0(n,e){return[{year:vs(n,e),month:vs(n,e+1,1),day:vs(n,e+2,1)},null,e+3]}function Ls(n,e){return[{hours:vs(n,e,0),minutes:vs(n,e+1,0),seconds:vs(n,e+2,0),milliseconds:_a(n[e+3])},null,e+4]}function Ml(n,e){const t=!n[e]&&!n[e+1],i=jo(n[e+1],n[e+2]),s=t?null:tn.instance(i);return[{},s,e+3]}function Dl(n,e){const t=n[e]?ri.create(n[e]):null;return[{},t,e+1]}const K0=RegExp(`^T?${ka.source}$`),J0=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Z0(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(h,m=!1)=>h!==void 0&&(m||h&&f)?-h:h;return[{years:d(Ii(t)),months:d(Ii(i)),weeks:d(Ii(s)),days:d(Ii(l)),hours:d(Ii(o)),minutes:d(Ii(r)),seconds:d(Ii(a),a==="-0"),milliseconds:d(_a(u),c)}]}const G0={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 Sa(n,e,t,i,s,l,o){const r={year:e.length===2?Hr(pi(e)):pi(e),month:Tg.indexOf(t)+1,day:pi(i),hour:pi(s),minute:pi(l)};return o&&(r.second=pi(o)),n&&(r.weekday=n.length>3?Dg.indexOf(n)+1:Og.indexOf(n)+1),r}const X0=/^(?:(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 Q0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Sa(e,s,i,t,l,o,r);let h;return a?h=G0[a]:u?h=0:h=jo(f,c),[d,new tn(h)]}function x0(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const e1=/^(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$/,t1=/^(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$/,n1=/^(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 Su(n){const[,e,t,i,s,l,o,r]=n;return[Sa(e,s,i,t,l,o,r),tn.utcInstance]}function i1(n){const[,e,t,i,s,l,o,r]=n;return[Sa(e,r,t,i,s,l,o),tn.utcInstance]}const s1=As(j0,wa),l1=As(q0,wa),o1=As(V0,wa),r1=As(Ng),Rg=Is(Y0,Ls,Ml,Dl),a1=Is(z0,Ls,Ml,Dl),u1=Is(B0,Ls,Ml,Dl),f1=Is(Ls,Ml,Dl);function c1(n){return Ps(n,[s1,Rg],[l1,a1],[o1,u1],[r1,f1])}function d1(n){return Ps(x0(n),[X0,Q0])}function p1(n){return Ps(n,[e1,Su],[t1,Su],[n1,i1])}function h1(n){return Ps(n,[J0,Z0])}const m1=Is(Ls);function g1(n){return Ps(n,[K0,m1])}const _1=As(U0,W0),b1=As(Fg),v1=Is(Ls,Ml,Dl);function y1(n){return Ps(n,[_1,Rg],[b1,v1])}const k1="Invalid Duration",Hg={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}},w1={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},...Hg},yn=146097/400,cs=146097/4800,S1={years:{quarters:4,months:12,weeks:yn/7,days:yn,hours:yn*24,minutes:yn*24*60,seconds:yn*24*60*60,milliseconds:yn*24*60*60*1e3},quarters:{months:3,weeks:yn/28,days:yn/4,hours:yn*24/4,minutes:yn*24*60/4,seconds:yn*24*60*60/4,milliseconds:yn*24*60*60*1e3/4},months:{weeks:cs/7,days:cs,hours:cs*24,minutes:cs*24*60,seconds:cs*24*60*60,milliseconds:cs*24*60*60*1e3},...Hg},Hi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],$1=Hi.slice(0).reverse();function Pi(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};return new it(i)}function C1(n){return n<0?Math.floor(n):Math.ceil(n)}function jg(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?C1(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function T1(n,e){$1.reduce((t,i)=>Qe(e[i])?t:(t&&jg(n,e,t,e,i),i),null)}class it{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||mt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?S1:w1,this.isLuxonDuration=!0}static fromMillis(e,t){return it.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Cn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new it({values:_o(e,it.normalizeUnit),loc:mt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Ui(e))return it.fromMillis(e);if(it.isDuration(e))return e;if(typeof e=="object")return it.fromObject(e);throw new Cn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=h1(e);return i?it.fromObject(i,t):it.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=g1(e);return i?it.fromObject(i,t):it.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Cn("need to specify a reason the Duration is invalid");const i=e instanceof Rn?e:new Rn(e,t);if(Lt.throwOnInvalid)throw new t0(i);return new it({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 ng(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?an.create(this.loc,i).formatDurationFromString(this,e):k1}toHuman(e={}){const t=Hi.map(i=>{const s=this.values[i];return Qe(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+=ba(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=it.fromDurationLike(e),i={};for(const s of Hi)($s(t.values,s)||$s(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Pi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=it.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]=$g(e(this.values[i],i));return Pi(this,{values:t},!0)}get(e){return this[it.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,..._o(e,it.normalizeUnit)};return Pi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Pi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return T1(this.matrix,e),Pi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>it.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Hi)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;Ui(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Hi.indexOf(u)>Hi.indexOf(o)&&jg(this.matrix,s,u,t,o)}else Ui(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 Pi(this,{values:t},!0).normalize()}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 Pi(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 Hi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Hs="Invalid Interval";function M1(n,e){return!n||!n.isValid?_t.invalid("missing or invalid start"):!e||!e.isValid?_t.invalid("missing or invalid end"):e<n?_t.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class _t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Cn("need to specify a reason the Interval is invalid");const i=e instanceof Rn?e:new Rn(e,t);if(Lt.throwOnInvalid)throw new e0(i);return new _t({invalid:i})}static fromDateTimes(e,t){const i=Vs(e),s=Vs(t),l=M1(i,s);return l??new _t({start:i,end:s})}static after(e,t){const i=it.fromDurationLike(t),s=Vs(e);return _t.fromDateTimes(s,s.plus(i))}static before(e,t){const i=it.fromDurationLike(t),s=Vs(e);return _t.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=je.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=je.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return _t.fromDateTimes(l,r);if(o){const u=it.fromISO(s,t);if(u.isValid)return _t.after(l,u)}else if(a){const u=it.fromISO(i,t);if(u.isValid)return _t.before(r,u)}}return _t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),i=this.end.startOf(e);return Math.floor(i.diff(t,e).get(e))+1}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!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?_t.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Vs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s<this.e;){const o=t[l]||this.e,r=+o>+this.e?this.e:o;i.push(_t.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=it.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;i<this.e;){const r=this.start.plus(t.mapUnits(a=>a*s));l=+r>+this.e?this.e:r,o.push(_t.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}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=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<e.e?this.e:e.e;return t>=i?null:_t.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return _t.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(_t.fromDateTimes(t,a.time)),t=null);return _t.merge(s)}difference(...e){return _t.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:Hs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Hs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Hs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Hs}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Hs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):it.invalid(this.invalidReason)}mapEndpoints(e){return _t.fromDateTimes(e(this.s),e(this.e))}}class Vl{static hasDST(e=Lt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ri.isValidZone(e)}static normalizeZone(e){return hi(e,Lt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||mt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||mt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||mt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||mt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return mt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return mt.create(t,null,"gregory").eras(e)}static features(){return{relative:wg()}}}function $u(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(it.fromMillis(i).as("days"))}function D1(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=$u(r,a);return(u-u%7)/7}],["days",$u]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function O1(n,e,t,i){let[s,l,o,r]=D1(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=it.fromObject(l,i);return u.length>0?it.fromMillis(a,i).shiftTo(...u).plus(f):f}const $a={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},Cu={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]},E1=$a.hanidec.replace(/[\[|\]]/g,"").split("");function A1(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);if(n[t].search($a.hanidec)!==-1)e+=E1.indexOf(n[t]);else for(const s in Cu){const[l,o]=Cu[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Ln({numberingSystem:n},e=""){return new RegExp(`${$a[n||"latn"]}${e}`)}const I1="missing Intl.DateTimeFormat.formatToParts support";function st(n,e=t=>t){return{regex:n,deser:([t])=>e(A1(t))}}const P1=String.fromCharCode(160),qg=`[ ${P1}]`,Vg=new RegExp(qg,"g");function L1(n){return n.replace(/\./g,"\\.?").replace(Vg,qg)}function Tu(n){return n.replace(/\./g,"").replace(Vg," ").toLowerCase()}function Nn(n,e){return n===null?null:{regex:RegExp(n.map(L1).join("|")),deser:([t])=>n.findIndex(i=>Tu(t)===Tu(i))+e}}function Mu(n,e){return{regex:n,deser:([,t,i])=>jo(t,i),groups:e}}function nr(n){return{regex:n,deser:([e])=>e}}function N1(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function F1(n,e){const t=Ln(e),i=Ln(e,"{2}"),s=Ln(e,"{3}"),l=Ln(e,"{4}"),o=Ln(e,"{6}"),r=Ln(e,"{1,2}"),a=Ln(e,"{1,3}"),u=Ln(e,"{1,6}"),f=Ln(e,"{1,9}"),c=Ln(e,"{2,4}"),d=Ln(e,"{4,6}"),h=b=>({regex:RegExp(N1(b.val)),deser:([y])=>y,literal:!0}),g=(b=>{if(n.literal)return h(b);switch(b.val){case"G":return Nn(e.eras("short",!1),0);case"GG":return Nn(e.eras("long",!1),0);case"y":return st(u);case"yy":return st(c,Hr);case"yyyy":return st(l);case"yyyyy":return st(d);case"yyyyyy":return st(o);case"M":return st(r);case"MM":return st(i);case"MMM":return Nn(e.months("short",!0,!1),1);case"MMMM":return Nn(e.months("long",!0,!1),1);case"L":return st(r);case"LL":return st(i);case"LLL":return Nn(e.months("short",!1,!1),1);case"LLLL":return Nn(e.months("long",!1,!1),1);case"d":return st(r);case"dd":return st(i);case"o":return st(a);case"ooo":return st(s);case"HH":return st(i);case"H":return st(r);case"hh":return st(i);case"h":return st(r);case"mm":return st(i);case"m":return st(r);case"q":return st(r);case"qq":return st(i);case"s":return st(r);case"ss":return st(i);case"S":return st(a);case"SSS":return st(s);case"u":return nr(f);case"uu":return nr(r);case"uuu":return st(t);case"a":return Nn(e.meridiems(),0);case"kkkk":return st(l);case"kk":return st(c,Hr);case"W":return st(r);case"WW":return st(i);case"E":case"c":return st(t);case"EEE":return Nn(e.weekdays("short",!1,!1),1);case"EEEE":return Nn(e.weekdays("long",!1,!1),1);case"ccc":return Nn(e.weekdays("short",!0,!1),1);case"cccc":return Nn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Mu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Mu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return nr(/[a-z_+-/]{1,256}?/i);default:return h(b)}})(n)||{invalidReason:I1};return g.token=n,g}const R1={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",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function H1(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=R1[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function j1(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function q1(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if($s(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 V1(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 Qe(n.z)||(t=ri.create(n.z)),Qe(n.Z)||(t||(t=new tn(n.Z)),i=n.Z),Qe(n.q)||(n.M=(n.q-1)*3+1),Qe(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),Qe(n.u)||(n.S=_a(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ir=null;function z1(){return ir||(ir=je.fromMillis(1555555555555)),ir}function B1(n,e){if(n.literal)return n;const t=an.macroTokenToFormatOpts(n.val);if(!t)return n;const l=an.create(e,t).formatDateTimeParts(z1()).map(o=>H1(o,e,t));return l.includes(void 0)?n:l}function U1(n,e){return Array.prototype.concat(...n.map(t=>B1(t,e)))}function zg(n,e,t){const i=U1(an.parseFormat(t),n),s=i.map(o=>F1(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=j1(s),a=RegExp(o,"i"),[u,f]=q1(e,a,r),[c,d,h]=f?V1(f):[null,null,void 0];if($s(f,"a")&&$s(f,"H"))throw new Zs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function W1(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=zg(n,e,t);return[i,s,l,o]}const Bg=[0,31,59,90,120,151,181,212,243,273,304,334],Ug=[0,31,60,91,121,152,182,213,244,274,305,335];function Mn(n,e){return new Rn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Wg(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 Yg(n,e,t){return t+(Cl(n)?Ug:Bg)[e-1]}function Kg(n,e){const t=Cl(n)?Ug:Bg,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Br(n){const{year:e,month:t,day:i}=n,s=Yg(e,t,i),l=Wg(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=go(r)):o>go(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...qo(n)}}function Du(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Wg(e,1,4),l=xs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=xs(r)):o>l?(r=e+1,o-=xs(e)):r=e;const{month:a,day:u}=Kg(r,o);return{year:r,month:a,day:u,...qo(n)}}function sr(n){const{year:e,month:t,day:i}=n,s=Yg(e,t,i);return{year:e,ordinal:s,...qo(n)}}function Ou(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Kg(e,t);return{year:e,month:i,day:s,...qo(n)}}function Y1(n){const e=Ho(n.weekYear),t=oi(n.weekNumber,1,go(n.weekYear)),i=oi(n.weekday,1,7);return e?t?i?!1:Mn("weekday",n.weekday):Mn("week",n.week):Mn("weekYear",n.weekYear)}function K1(n){const e=Ho(n.year),t=oi(n.ordinal,1,xs(n.year));return e?t?!1:Mn("ordinal",n.ordinal):Mn("year",n.year)}function Jg(n){const e=Ho(n.year),t=oi(n.month,1,12),i=oi(n.day,1,mo(n.year,n.month));return e?t?i?!1:Mn("day",n.day):Mn("month",n.month):Mn("year",n.year)}function Zg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=oi(e,0,23)||e===24&&t===0&&i===0&&s===0,o=oi(t,0,59),r=oi(i,0,59),a=oi(s,0,999);return l?o?r?a?!1:Mn("millisecond",s):Mn("second",i):Mn("minute",t):Mn("hour",e)}const lr="Invalid DateTime",Eu=864e13;function zl(n){return new Rn("unsupported zone",`the zone "${n.name}" is not supported`)}function or(n){return n.weekData===null&&(n.weekData=Br(n.c)),n.weekData}function js(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function Gg(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 Au(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 fo(n,e,t){return Gg(va(n),e,t)}function Iu(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,mo(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=it.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=va(l);let[a,u]=Gg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function qs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=je.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return je.invalid(new Rn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Bl(n,e,t=!0){return n.isValid?an.create(mt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function rr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Mt(n.c.year,t?6:4),e?(i+="-",i+=Mt(n.c.month),i+="-",i+=Mt(n.c.day)):(i+=Mt(n.c.month),i+=Mt(n.c.day)),i}function Pu(n,e,t,i,s,l){let o=Mt(n.c.hour);return e?(o+=":",o+=Mt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Mt(n.c.minute),(n.c.second!==0||!t)&&(o+=Mt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Mt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Mt(Math.trunc(-n.o/60)),o+=":",o+=Mt(Math.trunc(-n.o%60))):(o+="+",o+=Mt(Math.trunc(n.o/60)),o+=":",o+=Mt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Xg={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},J1={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Z1={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Qg=["year","month","day","hour","minute","second","millisecond"],G1=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],X1=["year","ordinal","hour","minute","second","millisecond"];function Lu(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 ng(n);return e}function Nu(n,e){const t=hi(e.zone,Lt.defaultZone),i=mt.fromObject(e),s=Lt.now();let l,o;if(Qe(n.year))l=s;else{for(const u of Qg)Qe(n[u])&&(n[u]=Xg[u]);const r=Jg(n)||Zg(n);if(r)return je.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new je({ts:l,zone:t,loc:i,o})}function Fu(n,e,t){const i=Qe(t.round)?!0:t.round,s=(o,r)=>(o=ba(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 Ru(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]}class je{constructor(e){const t=e.zone||Lt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Rn("invalid input"):null)||(t.isValid?null:zl(t));this.ts=Qe(e.ts)?Lt.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=t.offset(this.ts);s=Au(this.ts,r),i=Number.isNaN(s.year)?new Rn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||mt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Ru(arguments),[i,s,l,o,r,a,u]=t;return Nu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Ru(arguments),[i,s,l,o,r,a,u]=t;return e.zone=tn.utcInstance,Nu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=l0(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const s=hi(t.zone,Lt.defaultZone);return s.isValid?new je({ts:i,zone:s,loc:mt.fromObject(t)}):je.invalid(zl(s))}static fromMillis(e,t={}){if(Ui(e))return e<-Eu||e>Eu?je.invalid("Timestamp out of range"):new je({ts:e,zone:hi(t.zone,Lt.defaultZone),loc:mt.fromObject(t)});throw new Cn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ui(e))return new je({ts:e*1e3,zone:hi(t.zone,Lt.defaultZone),loc:mt.fromObject(t)});throw new Cn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=hi(t.zone,Lt.defaultZone);if(!i.isValid)return je.invalid(zl(i));const s=Lt.now(),l=Qe(t.specificOffset)?i.offset(s):t.specificOffset,o=_o(e,Lu),r=!Qe(o.ordinal),a=!Qe(o.year),u=!Qe(o.month)||!Qe(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=mt.fromObject(t);if((f||r)&&c)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Zs("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let m,g,b=Au(s,l);h?(m=G1,g=J1,b=Br(b)):r?(m=X1,g=Z1,b=sr(b)):(m=Qg,g=Xg);let y=!1;for(const O of m){const I=o[O];Qe(I)?y?o[O]=g[O]:o[O]=b[O]:y=!0}const k=h?Y1(o):r?K1(o):Jg(o),$=k||Zg(o);if($)return je.invalid($);const C=h?Du(o):r?Ou(o):o,[M,T]=fo(C,l,i),E=new je({ts:M,zone:i,o:T,loc:d});return o.weekday&&f&&e.weekday!==E.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[i,s]=c1(e);return qs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=d1(e);return qs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=p1(e);return qs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Qe(e)||Qe(t))throw new Cn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=mt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=W1(o,e,t);return f?je.invalid(f):qs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=y1(e);return qs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Cn("need to specify a reason the DateTime is invalid");const i=e instanceof Rn?e:new Rn(e,t);if(Lt.throwOnInvalid)throw new xb(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}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?or(this).weekYear:NaN}get weekNumber(){return this.isValid?or(this).weekNumber:NaN}get weekday(){return this.isValid?or(this).weekday:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Vl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Vl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Vl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Vl.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}get isInLeapYear(){return Cl(this.year)}get daysInMonth(){return mo(this.year,this.month)}get daysInYear(){return this.isValid?xs(this.year):NaN}get weeksInWeekYear(){return this.isValid?go(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=an.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(tn.instance(e),t)}toLocal(){return this.setZone(Lt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=hi(e,Lt.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]=fo(o,l,e)}return js(this,{ts:s,zone:e})}else return je.invalid(zl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return js(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_o(e,Lu),i=!Qe(t.weekYear)||!Qe(t.weekNumber)||!Qe(t.weekday),s=!Qe(t.ordinal),l=!Qe(t.year),o=!Qe(t.month)||!Qe(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Zs("Can't mix ordinal dates with month/day");let u;i?u=Du({...Br(this.c),...t}):Qe(t.ordinal)?(u={...this.toObject(),...t},Qe(t.day)&&(u.day=Math.min(mo(u.year,u.month),u.day))):u=Ou({...sr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return js(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=it.fromDurationLike(e);return js(this,Iu(this,t))}minus(e){if(!this.isValid)return this;const t=it.fromDurationLike(e).negate();return js(this,Iu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=it.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?an.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):lr}toLocaleString(e=Rr,t={}){return this.isValid?an.create(this.loc.clone(t),e).formatDateTime(this):lr}toLocaleParts(e={}){return this.isValid?an.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=rr(this,o);return r+="T",r+=Pu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?rr(this,e==="extended"):null}toISOWeekDate(){return Bl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Pu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Bl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Bl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Bl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():lr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return it.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=o0(t).map(it.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=O1(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?_t.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}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||je.fromObject({},{zone:this.zone}),i=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],l=e.unit;return Array.isArray(e.unit)&&(s=e.unit,l=void 0),Fu(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Fu(e.base||je.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(je.isDateTime))throw new Cn("min requires all arguments be DateTimes");return hu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new Cn("max requires all arguments be DateTimes");return hu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=mt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return zg(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Rr}static get DATE_MED(){return ig}static get DATE_MED_WITH_WEEKDAY(){return n0}static get DATE_FULL(){return sg}static get DATE_HUGE(){return lg}static get TIME_SIMPLE(){return og}static get TIME_WITH_SECONDS(){return rg}static get TIME_WITH_SHORT_OFFSET(){return ag}static get TIME_WITH_LONG_OFFSET(){return ug}static get TIME_24_SIMPLE(){return fg}static get TIME_24_WITH_SECONDS(){return cg}static get TIME_24_WITH_SHORT_OFFSET(){return dg}static get TIME_24_WITH_LONG_OFFSET(){return pg}static get DATETIME_SHORT(){return hg}static get DATETIME_SHORT_WITH_SECONDS(){return mg}static get DATETIME_MED(){return gg}static get DATETIME_MED_WITH_SECONDS(){return _g}static get DATETIME_MED_WITH_WEEKDAY(){return i0}static get DATETIME_FULL(){return bg}static get DATETIME_FULL_WITH_SECONDS(){return vg}static get DATETIME_HUGE(){return yg}static get DATETIME_HUGE_WITH_SECONDS(){return kg}}function Vs(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Ui(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new Cn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Q1=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],x1=[".mp4",".avi",".mov",".3gp",".wmv"],ev=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],tv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class B{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||B.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.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return B.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!B.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!B.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){B.inArray(e,t)||e.push(t)}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]=B.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(!B.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)(!B.isObject(l)&&!Array.isArray(l)||!B.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)(!B.isObject(s)&&!Array.isArray(s)||!B.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):B.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||B.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||B.isObject(e)&&Object.keys(e).length>0)&&B.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!1){return e=e||"",e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let s=e[i];typeof s=="string"&&(s=B.truncate(s,150,!0)),t[i]=s}return t}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const s={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let o in s)e=e.replace(s[o],o);const l=e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t);return l.charAt(0).toLowerCase()+l.slice(1)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=(e||"").split(t),s=[];for(let l of i)l=l.trim(),B.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",B.isEmpty(s)||i.push(s);return i.join(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:ssZ",24:"yyyy-MM-dd HH:mm:ss.SSSZ"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return B.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return B.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;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 downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}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!!Q1.find(t=>e.endsWith(t))}static hasVideoExtension(e){return!!x1.find(t=>e.endsWith(t))}static hasAudioExtension(e){return!!ev.find(t=>e.endsWith(t))}static hasDocumentExtension(e){return!!tv.find(t=>e.endsWith(t))}static getFileType(e){return B.hasImageExtension(e)?"image":B.hasDocumentExtension(e)?"document":B.hasVideoExtension(e)?"video":B.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(B.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)B.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):B.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var s,l,o,r,a;const t=(e==null?void 0:e.schema)||[],i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name,created:"2022-01-01 01:00:00.123Z",updated:"2022-01-01 23:59:59.456Z"};e!=null&&e.isAuth&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com");for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00.123Z":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)!==1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):u.type==="relation"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)!==1&&(f=[f])):f="test",i[u.name]=f}return i}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"single":return"ri-file-list-2-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){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"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.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!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!B.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!B.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=B.isObject(u)&&B.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 l of e)l.type==="auth"?t.push(l):l.type==="single"?i.push(l):s.push(l);return[].concat(t,i,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(){return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_css:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","insertdatetime","media","table","code"],toolbar:"code undo redo insert | styles | bold italic | alignleft aligncenter alignright | bullist numlist | link image table | forecolor backcolor fullscreen",file_picker_types:"image",file_picker_callback:(e,t,i)=>{const s=document.createElement("input");s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.addEventListener("change",l=>{const o=l.target.files[0],r=new FileReader;r.addEventListener("load",()=>{if(!tinymce)return;const a="blobid"+new Date().getTime(),u=tinymce.activeEditor.editorUpload.blobCache,f=r.result.split(",")[1],c=u.create(a,o,f);u.add(c),e(c.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()}}}static displayValue(e,t){e=e||{},t=t||[];let i=[];for(const l of t){let o=e[l];typeof o>"u"||(B.isEmpty(o)?i.push("N/A"):typeof o=="boolean"?i.push(o?"True":"False"):typeof o=="string"?(o=o.indexOf("<")>=0?B.plainText(o):o,i.push(B.truncate(o))):i.push(o))}if(i.length>0)return i.join(", ");const s=["title","name","email","username","heading","label","key","id"];for(const l of s)if(!B.isEmpty(e[l]))return e[l];return"N/A"}}const Vo=Pn([]);function xg(n,e=4e3){return zo(n,"info",e)}function qt(n,e=3e3){return zo(n,"success",e)}function cl(n,e=4500){return zo(n,"error",e)}function nv(n,e=4500){return zo(n,"warning",e)}function zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{e_(i)},t)};Vo.update(s=>(Ta(s,i.message),B.pushOrReplaceByKey(s,i,"message"),s))}function e_(n){Vo.update(e=>(Ta(e,n),e))}function Ca(){Vo.update(n=>{for(let e of n)Ta(n,e);return[]})}function Ta(n,e){let t;typeof e=="string"?t=B.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),B.removeByKey(n,"message",t.message))}const Ci=Pn({});function Vn(n){Ci.set(n||{})}function Cs(n){Ci.update(e=>(B.deleteByPath(e,n),e))}const Ma=Pn({});function Ur(n){Ma.set(n||{})}ga.prototype.logout=function(n=!0){this.authStore.clear(),n&&$i("/login")};ga.prototype.errorResponseHandler=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)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&cl(l)}if(B.isEmpty(s.data)||Vn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),$i("/")};class iv extends eg{save(e,t){super.save(e,t),t instanceof Ji&&Ur(t)}clear(){super.clear(),Ur(null)}}const he=new ga("../",new iv("pb_admin_auth"));he.authStore.model instanceof Ji&&Ur(he.authStore.model);function sv(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=n[3].default,m=Nt(h,n,n[2],null);return{c(){e=v("div"),t=v("main"),m&&m.c(),i=D(),s=v("footer"),l=v("a"),l.innerHTML='<span class="txt">Docs</span>',o=D(),r=v("span"),r.textContent="|",a=D(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.12.0",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(g,b){S(g,e,b),_(e,t),m&&m.m(t,null),_(e,i),_(e,s),_(s,l),_(s,o),_(s,r),_(s,a),_(s,u),_(u,f),d=!0},p(g,[b]){m&&m.p&&(!d||b&4)&&Rt(m,h,g,g[2],d?Ft(h,g[2],b,null):Ht(g[2]),null),(!d||b&2&&c!==(c="page-wrapper "+g[1]))&&p(e,"class",c),(!d||b&3)&&x(e,"center-content",g[0])},i(g){d||(A(m,g),d=!0)},o(g){P(m,g),d=!1},d(g){g&&w(e),m&&m.d(g)}}}function lv(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class vn extends ke{constructor(e){super(),ye(this,e,lv,sv,be,{center:0,class:1})}}function Hu(n){let e,t,i;return{c(){e=v("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function ov(n){let e,t,i,s=!n[0]&&Hu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),_(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Hu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):Ht(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function rv(n){let e,t;return e=new vn({props:{class:"full-page",center:!0,$$slots:{default:[ov]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function av(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class t_ extends ke{constructor(e){super(),ye(this,e,av,rv,be,{nobranding:0})}}function ju(n,e,t){const i=n.slice();return i[11]=e[t],i}const uv=n=>({}),qu=n=>({uniqueId:n[3]});function fv(n){let e=(n[11]||bo)+"",t;return{c(){t=U(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||bo)+"")&&re(t,e)},d(i){i&&w(t)}}}function cv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||bo)+"",i;return{c(){e=v("pre"),i=U(t)},m(o,r){S(o,e,r),_(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||bo)+"")&&re(i,t)},d(o){o&&w(e)}}}function Vu(n){let e,t;function i(o,r){return typeof o[11]=="object"?cv:fv}let s=i(n),l=s(n);return{c(){e=v("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){S(o,e,r),l.m(e,null),_(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function dv(n){let e,t,i,s,l;const o=n[7].default,r=Nt(o,n,n[6],qu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Vu(ju(n,a,f));return{c(){e=v("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),x(e,"error",n[2].length)},m(f,c){S(f,e,c),r&&r.m(e,null),_(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=Y(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Rt(r,o,f,f[6],i?Ft(o,f[6],c,uv):Ht(f[6]),qu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=ju(f,a,d);u[d]?u[d].p(h,c):(u[d]=Vu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),(!i||c&5)&&x(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&w(e),r&&r.d(f),yt(u,f),n[9](null),s=!1,l()}}}const bo="Invalid value";function pv(n,e,t){let i;Ke(n,Ci,m=>t(5,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+B.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Cs(r)}un(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(m){Be.call(this,n,m)}function h(m){ie[m?"unshift":"push"](()=>{u=m,t(1,u)})}return n.$$set=m=>{"name"in m&&t(4,r=m.name),"class"in m&&t(0,a=m.class),"$$scope"in m&&t(6,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=B.toArray(B.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class me extends ke{constructor(e){super(),ye(this,e,pv,dv,be,{name:4,class:0})}}function hv(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=D(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),fe(l,n[1]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&fe(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function gv(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=D(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&fe(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function _v(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new me({props:{class:"form-field required",name:"email",$$slots:{default:[hv,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[mv,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gv,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),f=v("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(m,g){S(m,e,g),_(e,t),_(e,i),H(s,e,null),_(e,l),H(o,e,null),_(e,r),H(a,e,null),_(e,u),_(e,f),c=!0,d||(h=Y(e,"submit",ct(n[4])),d=!0)},p(m,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:m}),s.$set(b);const y={};g&1538&&(y.$$scope={dirty:g,ctx:m}),o.$set(y);const k={};g&1540&&(k.$$scope={dirty:g,ctx:m}),a.$set(k),(!c||g&8)&&x(f,"btn-disabled",m[3]),(!c||g&8)&&x(f,"btn-loading",m[3])},i(m){c||(A(s.$$.fragment,m),A(o.$$.fragment,m),A(a.$$.fragment,m),c=!0)},o(m){P(s.$$.fragment,m),P(o.$$.fragment,m),P(a.$$.fragment,m),c=!1},d(m){m&&w(e),j(s),j(o),j(a),d=!1,h()}}}function bv(n,e,t){const i=Ct();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await he.admins.create({email:s,password:l,passwordConfirm:o}),await he.admins.authWithPassword(s,l),i("submit")}catch(d){he.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class vv extends ke{constructor(e){super(),ye(this,e,bv,_v,be,{})}}function zu(n){let e,t;return e=new t_({props:{$$slots:{default:[yv]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function yv(n){let e,t;return e=new vv({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function kv(n){let e,t,i=n[0]&&zu(n);return{c(){i&&i.c(),e=Oe()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=zu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(de(),P(i,1,1,()=>{i=null}),pe())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function wv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){he.logout(!1),t(0,i=!0);return}he.authStore.isValid?$i("/collections"):he.logout()}return[i,async()=>{t(0,i=!1),await In(),window.location.search=""}]}class Sv extends ke{constructor(e){super(),ye(this,e,wv,kv,be,{})}}const kt=Pn(""),vo=Pn(""),Ts=Pn(!1);function Bo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function On(n,{delay:e=0,duration:t=400,easing:i=Bo,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);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function Et(n,{delay:e=0,duration:t=400,easing:i=Bo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function At(n,{delay:e=0,duration:t=400,easing:i=Bo,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}
`}}function $v(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),fe(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]&&fe(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function Cv(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Yt(o,r(n)),ie.push(()=>ve(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=Oe()},m(a,u){e&&H(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(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],we(()=>t=!1)),o!==(o=a[4])){if(e){de();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),pe()}o?(e=Yt(o,r(a)),ie.push(()=>ve(e,"value",l)),e.$on("submit",a[10]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Bu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Uu();return{c(){r&&r.c(),e=D(),t=v("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Uu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(de(),P(r,1,1,()=>{r=null}),pe())},i(a){s||(A(r),a&&tt(()=>{i||(i=qe(t,On,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=qe(t,On,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Uu(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{t||(t=qe(e,On,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,On,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Tv(n){let e,t,i,s,l,o,r,a,u,f;const c=[Cv,$v],d=[];function h(g,b){return g[4]&&!g[5]?0:1}l=h(n),o=d[l]=c[l](n);let m=(n[0].length||n[7].length)&&Bu(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=D(),o.c(),r=D(),m&&m.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(g,b){S(g,e,b),_(e,t),_(t,i),_(e,s),d[l].m(e,null),_(e,r),m&&m.m(e,null),a=!0,u||(f=[Y(e,"click",bn(n[11])),Y(e,"submit",ct(n[10]))],u=!0)},p(g,[b]){let y=l;l=h(g),l===y?d[l].p(g,b):(de(),P(d[y],1,1,()=>{d[y]=null}),pe(),o=d[l],o?o.p(g,b):(o=d[l]=c[l](g),o.c()),A(o,1),o.m(e,r)),g[0].length||g[7].length?m?(m.p(g,b),b&129&&A(m,1)):(m=Bu(g),m.c(),A(m,1),m.m(e,null)):m&&(de(),P(m,1,1,()=>{m=null}),pe())},i(g){a||(A(o),A(m),a=!0)},o(g){P(o),P(m),a=!1},d(g){g&&w(e),d[l].d(),m&&m.d(),u=!1,Le(f)}}}function Mv(n,e,t){const i=Ct(),s="search_"+B.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new gn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function m(){t(0,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-1e85f96b.js"),["./FilterAutocompleteInput-1e85f96b.js","./index-0935db40.js"],import.meta.url)).default),t(5,f=!1))}un(()=>{g()});function b(M){Be.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function k(M){ie[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const C=()=>{h(!1),m()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,m,b,y,k,$,C]}class Uo extends ke{constructor(e){super(),ye(this,e,Mv,Tv,be,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Wr,Li;const Yr="app-tooltip";function Wu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function bi(){return Li=Li||document.querySelector("."+Yr),Li||(Li=document.createElement("div"),Li.classList.add(Yr),document.body.appendChild(Li)),Li}function n_(n,e){let t=bi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Kr();return}t.textContent=e.text,t.className=Yr+" 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 Kr(){clearTimeout(Wr),bi().classList.remove("active"),bi().activeNode=void 0}function Dv(n,e){bi().activeNode=n,clearTimeout(Wr),Wr=setTimeout(()=>{bi().classList.add("active"),n_(n,e)},isNaN(e.delay)?0:e.delay)}function We(n,e){let t=Wu(e);function i(){Dv(n,t)}function s(){Kr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&B.isFocusable(n))&&n.addEventListener("click",s),bi(),{update(l){var o,r;t=Wu(l),(r=(o=bi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&n_(n,t)},destroy(){var l,o;(o=(l=bi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Kr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Ov(n){let e,t,i,s;return{c(){e=v("button"),e.innerHTML='<i class="ri-refresh-line svelte-1bvelc2"></i>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle svelte-1bvelc2"),x(e,"refreshing",n[1])},m(l,o){S(l,e,o),i||(s=[Ie(t=We.call(null,e,n[0])),Y(e,"click",n[2])],i=!0)},p(l,[o]){t&&Zt(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&x(e,"refreshing",l[1])},i:X,o:X,d(l){l&&w(e),i=!1,Le(s)}}}function Ev(n,e,t){const i=Ct();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},150))}return un(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Da extends ke{constructor(e){super(),ye(this,e,Ev,Ov,be,{tooltip:0})}}function Av(n){let e,t,i,s,l;const o=n[6].default,r=Nt(o,n,n[5],null);return{c(){e=v("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){S(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)&&Rt(r,o,a,a[5],i?Ft(o,a[5],u,null):Ht(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||(A(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,Le(l)}}}function Iv(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 Bt extends ke{constructor(e){super(),ye(this,e,Iv,Av,be,{class:1,name:2,sort:0,disable:3})}}function Pv(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Lv(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("div"),i=U(n[2]),s=D(),l=v("div"),o=U(n[1]),r=U(" UTC"),p(t,"class","date"),p(l,"class","time svelte-zdiknu"),p(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),_(e,t),_(t,i),_(e,s),_(e,l),_(l,o),_(l,r)},p(a,u){u&4&&re(i,a[2]),u&2&&re(o,a[1])},d(a){a&&w(e)}}}function Nv(n){let e;function t(l,o){return l[0]?Lv:Pv}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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:X,o:X,d(l){s.d(l),l&&w(e)}}}function Fv(n,e,t){let i,s,{date:l=""}=e;return n.$$set=o=>{"date"in o&&t(0,l=o.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i]}class Zi extends ke{constructor(e){super(),ye(this,e,Fv,Nv,be,{date:0})}}const Rv=n=>({}),Yu=n=>({}),Hv=n=>({}),Ku=n=>({});function jv(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Nt(u,n,n[4],Ku),c=n[5].default,d=Nt(c,n,n[4],null),h=n[5].after,m=Nt(h,n,n[4],Yu);return{c(){e=v("div"),f&&f.c(),t=D(),i=v("div"),d&&d.c(),l=D(),m&&m.c(),p(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),p(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(g,b){S(g,e,b),f&&f.m(e,null),_(e,t),_(e,i),d&&d.m(i,null),n[6](i),_(e,l),m&&m.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(g,[b]){f&&f.p&&(!o||b&16)&&Rt(f,u,g,g[4],o?Ft(u,g[4],b,Hv):Ht(g[4]),Ku),d&&d.p&&(!o||b&16)&&Rt(d,c,g,g[4],o?Ft(c,g[4],b,null):Ht(g[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+g[0]+" "+g[3]+" svelte-wc2j9h"))&&p(i,"class",s),m&&m.p&&(!o||b&16)&&Rt(m,h,g,g[4],o?Ft(h,g[4],b,Rv):Ht(g[4]),Yu)},i(g){o||(A(f,g),A(d,g),A(m,g),o=!0)},o(g){P(f,g),P(d,g),P(m,g),o=!1},d(g){g&&w(e),f&&f.d(g),d&&d.d(g),n[6](null),m&&m.d(g),r=!1,Le(a)}}}function qv(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,u;function f(){o&&(clearTimeout(a),a=setTimeout(()=>{const d=o.offsetWidth,h=o.scrollWidth;h-d?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+d==h&&t(3,r+=" scroll-end")):t(3,r="")},100))}un(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function c(d){ie[d?"unshift":"push"](()=>{o=d,t(2,o)})}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"$$scope"in d&&t(4,s=d.$$scope)},[l,f,o,r,s,i,c]}class Oa extends ke{constructor(e){super(),ye(this,e,qv,jv,be,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function Ju(n,e,t){const i=n.slice();return i[23]=e[t],i}function Vv(n){let e;return{c(){e=v("div"),e.innerHTML=`<i class="ri-global-line"></i>
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function zv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Bv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Uv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="User IP",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Wv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Yv(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Zu(n){let e;function t(l,o){return l[6]?Jv:Kv}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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){s.d(l),l&&w(e)}}}function Kv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Gu(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),_(e,t),_(t,i),_(t,s),o&&o.m(t,null),_(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Gu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Jv(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Gu(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Xu(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Qu(n,e){var Ce,$e,Ye;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,h,m,g,b,y,k=(e[23].referer||"N/A")+"",$,C,M,T,E,O=(e[23].userIp||"N/A")+"",I,L,N,F,V,G=e[23].status+"",se,K,te,ne,z,Q,J,ae,He,Fe,Ne=((($e=e[23].meta)==null?void 0:$e.errorMessage)||((Ye=e[23].meta)==null?void 0:Ye.errorData))&&Xu();ne=new Zi({props:{date:e[23].created}});function Re(){return e[17](e[23])}function ge(...ze){return e[18](e[23],...ze)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=D(),u=v("td"),f=v("span"),d=U(c),m=D(),Ne&&Ne.c(),g=D(),b=v("td"),y=v("span"),$=U(k),M=D(),T=v("td"),E=v("span"),I=U(O),N=D(),F=v("td"),V=v("span"),se=U(G),K=D(),te=v("td"),q(ne.$$.fragment),z=D(),Q=v("td"),Q.innerHTML='<i class="ri-arrow-right-line"></i>',J=D(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",C=e[23].referer),x(y,"txt-hint",!e[23].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","txt txt-ellipsis"),p(E,"title",L=e[23].userIp),x(E,"txt-hint",!e[23].userIp),p(T,"class","col-type-number col-field-userIp"),p(V,"class","label"),x(V,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(te,"class","col-type-date col-field-created"),p(Q,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ze,oe){S(ze,t,oe),_(t,i),_(i,s),_(s,o),_(t,a),_(t,u),_(u,f),_(f,d),_(u,m),Ne&&Ne.m(u,null),_(t,g),_(t,b),_(b,y),_(y,$),_(t,M),_(t,T),_(T,E),_(E,I),_(t,N),_(t,F),_(F,V),_(V,se),_(t,K),_(t,te),H(ne,te,null),_(t,z),_(t,Q),_(t,J),ae=!0,He||(Fe=[Y(t,"click",Re),Y(t,"keydown",ge)],He=!0)},p(ze,oe){var Z,ce,Se;e=ze,(!ae||oe&8)&&l!==(l=((Z=e[23].method)==null?void 0:Z.toUpperCase())+"")&&re(o,l),(!ae||oe&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ae||oe&8)&&c!==(c=e[23].url+"")&&re(d,c),(!ae||oe&8&&h!==(h=e[23].url))&&p(f,"title",h),(ce=e[23].meta)!=null&&ce.errorMessage||(Se=e[23].meta)!=null&&Se.errorData?Ne||(Ne=Xu(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!ae||oe&8)&&k!==(k=(e[23].referer||"N/A")+"")&&re($,k),(!ae||oe&8&&C!==(C=e[23].referer))&&p(y,"title",C),(!ae||oe&8)&&x(y,"txt-hint",!e[23].referer),(!ae||oe&8)&&O!==(O=(e[23].userIp||"N/A")+"")&&re(I,O),(!ae||oe&8&&L!==(L=e[23].userIp))&&p(E,"title",L),(!ae||oe&8)&&x(E,"txt-hint",!e[23].userIp),(!ae||oe&8)&&G!==(G=e[23].status+"")&&re(se,G),(!ae||oe&8)&&x(V,"label-danger",e[23].status>=400);const ue={};oe&8&&(ue.date=e[23].created),ne.$set(ue)},i(ze){ae||(A(ne.$$.fragment,ze),ae=!0)},o(ze){P(ne.$$.fragment,ze),ae=!1},d(ze){ze&&w(t),Ne&&Ne.d(),j(ne),He=!1,Le(Fe)}}}function Zv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I=[],L=new Map,N;function F(ge){n[11](ge)}let V={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Vv]},$$scope:{ctx:n}};n[1]!==void 0&&(V.sort=n[1]),s=new Bt({props:V}),ie.push(()=>ve(s,"sort",F));function G(ge){n[12](ge)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[zv]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),r=new Bt({props:se}),ie.push(()=>ve(r,"sort",G));function K(ge){n[13](ge)}let te={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Bv]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),f=new Bt({props:te}),ie.push(()=>ve(f,"sort",K));function ne(ge){n[14](ge)}let z={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Uv]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),h=new Bt({props:z}),ie.push(()=>ve(h,"sort",ne));function Q(ge){n[15](ge)}let J={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Wv]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),b=new Bt({props:J}),ie.push(()=>ve(b,"sort",Q));function ae(ge){n[16](ge)}let He={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Yv]},$$scope:{ctx:n}};n[1]!==void 0&&(He.sort=n[1]),$=new Bt({props:He}),ie.push(()=>ve($,"sort",ae));let Fe=n[3];const Ne=ge=>ge[23].id;for(let ge=0;ge<Fe.length;ge+=1){let Ce=Ju(n,Fe,ge),$e=Ne(Ce);L.set($e,I[ge]=Qu($e,Ce))}let Re=null;return Fe.length||(Re=Zu(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),q(s.$$.fragment),o=D(),q(r.$$.fragment),u=D(),q(f.$$.fragment),d=D(),q(h.$$.fragment),g=D(),q(b.$$.fragment),k=D(),q($.$$.fragment),M=D(),T=v("th"),E=D(),O=v("tbody");for(let ge=0;ge<I.length;ge+=1)I[ge].c();Re&&Re.c(),p(T,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[6])},m(ge,Ce){S(ge,e,Ce),_(e,t),_(t,i),H(s,i,null),_(i,o),H(r,i,null),_(i,u),H(f,i,null),_(i,d),H(h,i,null),_(i,g),H(b,i,null),_(i,k),H($,i,null),_(i,M),_(i,T),_(e,E),_(e,O);for(let $e=0;$e<I.length;$e+=1)I[$e].m(O,null);Re&&Re.m(O,null),N=!0},p(ge,Ce){const $e={};Ce&67108864&&($e.$$scope={dirty:Ce,ctx:ge}),!l&&Ce&2&&(l=!0,$e.sort=ge[1],we(()=>l=!1)),s.$set($e);const Ye={};Ce&67108864&&(Ye.$$scope={dirty:Ce,ctx:ge}),!a&&Ce&2&&(a=!0,Ye.sort=ge[1],we(()=>a=!1)),r.$set(Ye);const ze={};Ce&67108864&&(ze.$$scope={dirty:Ce,ctx:ge}),!c&&Ce&2&&(c=!0,ze.sort=ge[1],we(()=>c=!1)),f.$set(ze);const oe={};Ce&67108864&&(oe.$$scope={dirty:Ce,ctx:ge}),!m&&Ce&2&&(m=!0,oe.sort=ge[1],we(()=>m=!1)),h.$set(oe);const ue={};Ce&67108864&&(ue.$$scope={dirty:Ce,ctx:ge}),!y&&Ce&2&&(y=!0,ue.sort=ge[1],we(()=>y=!1)),b.$set(ue);const Z={};Ce&67108864&&(Z.$$scope={dirty:Ce,ctx:ge}),!C&&Ce&2&&(C=!0,Z.sort=ge[1],we(()=>C=!1)),$.$set(Z),Ce&841&&(Fe=ge[3],de(),I=gt(I,Ce,Ne,1,ge,Fe,L,O,Kt,Qu,null,Ju),pe(),!Fe.length&&Re?Re.p(ge,Ce):Fe.length?Re&&(Re.d(1),Re=null):(Re=Zu(ge),Re.c(),Re.m(O,null))),(!N||Ce&64)&&x(e,"table-loading",ge[6])},i(ge){if(!N){A(s.$$.fragment,ge),A(r.$$.fragment,ge),A(f.$$.fragment,ge),A(h.$$.fragment,ge),A(b.$$.fragment,ge),A($.$$.fragment,ge);for(let Ce=0;Ce<Fe.length;Ce+=1)A(I[Ce]);N=!0}},o(ge){P(s.$$.fragment,ge),P(r.$$.fragment,ge),P(f.$$.fragment,ge),P(h.$$.fragment,ge),P(b.$$.fragment,ge),P($.$$.fragment,ge);for(let Ce=0;Ce<I.length;Ce+=1)P(I[Ce]);N=!1},d(ge){ge&&w(e),j(s),j(r),j(f),j(h),j(b),j($);for(let Ce=0;Ce<I.length;Ce+=1)I[Ce].d();Re&&Re.d()}}}function xu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=v("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),_(e,t),_(e,s),_(e,l),_(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&re(s,i),a&16&&re(o,r[4])},d(r){r&&w(e)}}}function ef(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=v("div"),t=v("button"),i=v("span"),s=U("Load more ("),o=U(l),r=U(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-transparent btn-expanded"),x(t,"btn-loading",n[6]),x(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),_(e,t),_(t,i),_(i,s),_(i,o),_(i,r),a||(u=Y(t,"click",n[20]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&re(o,l),c&64&&x(t,"btn-loading",f[6]),c&64&&x(t,"btn-disabled",f[6])},d(f){f&&w(e),a=!1,u()}}}function Gv(n){let e,t,i,s,l;e=new Oa({props:{class:"table-wrapper",$$slots:{default:[Zv]},$$scope:{ctx:n}}});let o=n[3].length&&xu(n),r=n[3].length&&n[7]&&ef(n);return{c(){q(e.$$.fragment),t=D(),o&&o.c(),i=D(),r&&r.c(),s=Oe()},m(a,u){H(e,a,u),S(a,t,u),o&&o.m(a,u),S(a,i,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,[u]){const f={};u&67108939&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length?o?o.p(a,u):(o=xu(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[3].length&&a[7]?r?r.p(a,u):(r=ef(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){l||(A(e.$$.fragment,a),l=!0)},o(a){P(e.$$.fragment,a),l=!1},d(a){j(e,a),a&&w(t),o&&o.d(a),a&&w(i),r&&r.d(a),a&&w(s)}}}function Xv(n,e,t){let i;const s=Ct(),l={get:"label-info",post:"label-success",patch:"label-warning",delete:"label-danger"};let{filter:o=""}=e,{presets:r=""}=e,{sort:a="-rowid"}=e,u=[],f=1,c=0,d=!1,h=0;async function m(L=1,N=!0){return t(6,d=!0),he.logs.getRequestsList(L,30,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(async F=>{if(L<=1&&g(),t(6,d=!1),t(5,f=F.page),t(4,c=F.totalItems),s("load",u.concat(F.items)),N){const V=++h;for(;F.items.length&&h==V;)t(3,u=u.concat(F.items.splice(0,10))),await B.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),g(),he.errorResponseHandler(F,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function b(L){a=L,t(1,a)}function y(L){a=L,t(1,a)}function k(L){a=L,t(1,a)}function $(L){a=L,t(1,a)}function C(L){a=L,t(1,a)}function M(L){a=L,t(1,a)}const T=L=>s("select",L),E=(L,N)=>{N.code==="Enter"&&(N.preventDefault(),s("select",L))},O=()=>t(0,o=""),I=()=>m(f+1);return n.$$set=L=>{"filter"in L&&t(0,o=L.filter),"presets"in L&&t(10,r=L.presets),"sort"in L&&t(1,a=L.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),m(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,m,u,c,f,d,i,s,l,r,b,y,k,$,C,M,T,E,O,I]}class Qv extends ke{constructor(e){super(),ye(this,e,Xv,Gv,be,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function ti(){}const xv=function(){let n=0;return function(){return n++}}();function ot(n){return n===null||typeof n>"u"}function ht(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 Ze(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const $t=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function wn(n,e){return $t(n)?n:e}function xe(n,e){return typeof n>"u"?e:n}const ey=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,i_=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function bt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function at(n,e,t,i){let s,l,o;if(ht(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ze(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function ko(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function wo(n){if(ht(n))return n.map(wo);if(Ze(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=wo(n[t[s]]);return e}return n}function s_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function ty(n,e,t,i){if(!s_(n))return;const s=e[n],l=t[n];Ze(s)&&Ze(l)?dl(s,l,i):e[n]=wo(l)}function dl(n,e,t){const i=ht(e)?e:[e],s=i.length;if(!Ze(n))return n;t=t||{};const l=t.merger||ty;for(let o=0;o<s;++o){if(e=i[o],!Ze(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function tl(n,e){return dl(n,e,{merger:ny})}function ny(n,e,t){if(!s_(n))return;const i=e[n],s=t[n];Ze(i)&&Ze(s)?tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=wo(s))}const tf={"":n=>n,x:n=>n.x,y:n=>n.y};function ki(n,e){return(tf[e]||(tf[e]=iy(e)))(n)}function iy(n){const e=sy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function sy(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 Ea(n){return n.charAt(0).toUpperCase()+n.slice(1)}const En=n=>typeof n<"u",wi=n=>typeof n=="function",nf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function ly(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const wt=Math.PI,ft=2*wt,oy=ft+wt,So=Number.POSITIVE_INFINITY,ry=wt/180,vt=wt/2,zs=wt/4,sf=wt*2/3,Tn=Math.log10,Jn=Math.sign;function lf(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Tn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function ay(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)<t}function uy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function l_(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Hn(n){return n*(wt/180)}function Aa(n){return n*(180/wt)}function of(n){if(!$t(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function o_(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*wt&&(l+=ft),{angle:l,distance:s}}function Jr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function fy(n,e){return(n-e+oy)%ft-wt}function hn(n){return(n%ft+ft)%ft}function pl(n,e,t,i){const s=hn(n),l=hn(e),o=hn(t),r=hn(l-s),a=hn(o-s),u=hn(s-l),f=hn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Ut(n,e,t){return Math.max(e,Math.min(t,n))}function cy(n){return Ut(n,-32768,32767)}function hl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ia(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const zi=(n,e,t,i)=>Ia(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),dy=(n,e,t)=>Ia(n,t,i=>n[i][e]>=t);function py(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const r_=["push","pop","shift","splice","unshift"];function hy(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),r_.forEach(t=>{const i="_onData"+Ea(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 rf(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)&&(r_.forEach(l=>{delete n[l]}),delete n._chartjs)}function a_(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const u_=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function f_(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,u_.call(window,()=>{s=!1,n.apply(e,l)}))}}function my(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const gy=n=>n==="start"?"left":n==="end"?"right":"center",af=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function c_(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=Ut(Math.min(zi(r,o.axis,u).lo,t?i:zi(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=Ut(Math.max(zi(r,o.axis,f,!0).hi+1,t?0:zi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function d_(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 Ul=n=>n===0||n===1,uf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ft/t)),ff=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ft/t)+1,il={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*vt)+1,easeOutSine:n=>Math.sin(n*vt),easeInOutSine:n=>-.5*(Math.cos(wt*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=>Ul(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=>Ul(n)?n:uf(n,.075,.3),easeOutElastic:n=>Ul(n)?n:ff(n,.075,.3),easeInOutElastic(n){return Ul(n)?n:n<.5?.5*uf(n*2,.1125,.45):.5+.5*ff(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-il.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?il.easeInBounce(n*2)*.5:il.easeOutBounce(n*2-1)*.5+.5};/*!
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Ol(n){return n+.5|0}const mi=(n,e,t)=>Math.max(Math.min(n,t),e);function Xs(n){return mi(Ol(n*2.55),0,255)}function vi(n){return mi(Ol(n*255),0,255)}function si(n){return mi(Ol(n/2.55)/100,0,1)}function cf(n){return mi(Ol(n*100),0,100)}const kn={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},Zr=[..."0123456789ABCDEF"],_y=n=>Zr[n&15],by=n=>Zr[(n&240)>>4]+Zr[n&15],Wl=n=>(n&240)>>4===(n&15),vy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function yy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&kn[n[1]]*17,g:255&kn[n[2]]*17,b:255&kn[n[3]]*17,a:e===5?kn[n[4]]*17:255}:(e===7||e===9)&&(t={r:kn[n[1]]<<4|kn[n[2]],g:kn[n[3]]<<4|kn[n[4]],b:kn[n[5]]<<4|kn[n[6]],a:e===9?kn[n[7]]<<4|kn[n[8]]:255})),t}const ky=(n,e)=>n<255?e(n):"";function wy(n){var e=vy(n)?_y:by;return n?"#"+e(n.r)+e(n.g)+e(n.b)+ky(n.a,e):void 0}const Sy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function p_(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 $y(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 Cy(n,e,t){const i=p_(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 Ty(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Pa(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=Ty(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function La(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(vi)}function Na(n,e,t){return La(p_,n,e,t)}function My(n,e,t){return La(Cy,n,e,t)}function Dy(n,e,t){return La($y,n,e,t)}function h_(n){return(n%360+360)%360}function Oy(n){const e=Sy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):vi(+e[5]));const s=h_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=My(s,l,o):e[1]==="hsv"?i=Dy(s,l,o):i=Na(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Ey(n,e){var t=Pa(n);t[0]=h_(t[0]+e),t=Na(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Ay(n){if(!n)return;const e=Pa(n),t=e[0],i=cf(e[1]),s=cf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${si(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const df={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"},pf={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 Iy(){const n={},e=Object.keys(pf),t=Object.keys(df);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s],r=r.replace(l,df[l]);l=parseInt(pf[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let Yl;function Py(n){Yl||(Yl=Iy(),Yl.transparent=[0,0,0,0]);const e=Yl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Ly=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ny(n){const e=Ly.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Xs(o):mi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Xs(i):mi(i,0,255)),s=255&(e[4]?Xs(s):mi(s,0,255)),l=255&(e[6]?Xs(l):mi(l,0,255)),{r:i,g:s,b:l,a:t}}}function Fy(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${si(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ar=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ds=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Ry(n,e,t){const i=ds(si(n.r)),s=ds(si(n.g)),l=ds(si(n.b));return{r:vi(ar(i+t*(ds(si(e.r))-i))),g:vi(ar(s+t*(ds(si(e.g))-s))),b:vi(ar(l+t*(ds(si(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Kl(n,e,t){if(n){let i=Pa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Na(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function m_(n,e){return n&&Object.assign(e||{},n)}function hf(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=vi(n[3]))):(e=m_(n,{r:0,g:0,b:0,a:1}),e.a=vi(e.a)),e}function Hy(n){return n.charAt(0)==="r"?Ny(n):Oy(n)}class $o{constructor(e){if(e instanceof $o)return e;const t=typeof e;let i;t==="object"?i=hf(e):t==="string"&&(i=yy(e)||Py(e)||Hy(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=m_(this._rgb);return e&&(e.a=si(e.a)),e}set rgb(e){this._rgb=hf(e)}rgbString(){return this._valid?Fy(this._rgb):void 0}hexString(){return this._valid?wy(this._rgb):void 0}hslString(){return this._valid?Ay(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=Ry(this._rgb,e._rgb,t)),this}clone(){return new $o(this.rgb)}alpha(e){return this._rgb.a=vi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Ol(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 Kl(this._rgb,2,e),this}darken(e){return Kl(this._rgb,2,-e),this}saturate(e){return Kl(this._rgb,1,e),this}desaturate(e){return Kl(this._rgb,1,-e),this}rotate(e){return Ey(this._rgb,e),this}}function g_(n){return new $o(n)}function __(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function mf(n){return __(n)?n:g_(n)}function ur(n){return __(n)?n:g_(n).saturate(.5).darken(.1).hexString()}const Gi=Object.create(null),Gr=Object.create(null);function sl(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const l=t[i];n=n[l]||(n[l]=Object.create(null))}return n}function fr(n,e,t){return typeof e=="string"?dl(sl(n,e),t):dl(sl(n,""),e)}class jy{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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=(t,i)=>ur(i.backgroundColor),this.hoverBorderColor=(t,i)=>ur(i.borderColor),this.hoverColor=(t,i)=>ur(i.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)}set(e,t){return fr(this,e,t)}get(e){return sl(this,e)}describe(e,t){return fr(Gr,e,t)}override(e,t){return fr(Gi,e,t)}route(e,t,i,s){const l=sl(this,e),o=sl(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 Ze(a)?Object.assign({},u,a):xe(a,u)},set(a){this[r]=a}}})}}var et=new jy({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qy(n){return!n||ot(n.size)||ot(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Co(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 Vy(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;a<r;a++)if(c=t[a],c!=null&&ht(c)!==!0)o=Co(n,s,l,o,c);else if(ht(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!ht(d)&&(o=Co(n,s,l,o,d));n.restore();const h=l.length/2;if(h>t.length){for(a=0;a<h;a++)delete s[l[a]];l.splice(0,h)}return o}function Ni(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 gf(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Xr(n,e,t,i){zy(n,e,t,i,null)}function zy(n,e,t,i,s){let l,o,r,a,u,f;const c=e.pointStyle,d=e.rotation,h=e.radius;let m=(d||0)*ry;if(c&&typeof c=="object"&&(l=c.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(m),n.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),n.restore();return}if(!(isNaN(h)||h<=0)){switch(n.beginPath(),c){default:s?n.ellipse(t,i,s/2,h,0,0,ft):n.arc(t,i,h,0,ft),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(m)*h,i-Math.cos(m)*h),m+=sf,n.lineTo(t+Math.sin(m)*h,i-Math.cos(m)*h),m+=sf,n.lineTo(t+Math.sin(m)*h,i-Math.cos(m)*h),n.closePath();break;case"rectRounded":u=h*.516,a=h-u,o=Math.cos(m+zs)*a,r=Math.sin(m+zs)*a,n.arc(t-o,i-r,u,m-wt,m-vt),n.arc(t+r,i-o,u,m-vt,m),n.arc(t+o,i+r,u,m,m+vt),n.arc(t-r,i+o,u,m+vt,m+wt),n.closePath();break;case"rect":if(!d){a=Math.SQRT1_2*h,f=s?s/2:a,n.rect(t-f,i-a,2*f,2*a);break}m+=zs;case"rectRot":o=Math.cos(m)*h,r=Math.sin(m)*h,n.moveTo(t-o,i-r),n.lineTo(t+r,i-o),n.lineTo(t+o,i+r),n.lineTo(t-r,i+o),n.closePath();break;case"crossRot":m+=zs;case"cross":o=Math.cos(m)*h,r=Math.sin(m)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"star":o=Math.cos(m)*h,r=Math.sin(m)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o),m+=zs,o=Math.cos(m)*h,r=Math.sin(m)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"line":o=s?s/2:Math.cos(m)*h,r=Math.sin(m)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(m)*h,i+Math.sin(m)*h);break}n.fill(),e.borderWidth>0&&n.stroke()}}function ml(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function Fa(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Ra(n){n.restore()}function By(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){const l=(e.x+t.x)/2;n.lineTo(l,e.y),n.lineTo(l,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function Uy(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function To(n,e,t,i,s,l={}){const o=ht(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,Wy(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),ot(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),Yy(n,t,i,u,l),i+=s.lineHeight;n.restore()}function Wy(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),ot(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function Yy(n,e,t,i,s){if(s.strikethrough||s.underline){const l=n.measureText(i),o=e-l.actualBoundingBoxLeft,r=e+l.actualBoundingBoxRight,a=t-l.actualBoundingBoxAscent,u=t+l.actualBoundingBoxDescent,f=s.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function Mo(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-vt,wt,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,wt,vt,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,vt,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-vt,!0),n.lineTo(t+o.topLeft,i)}const Ky=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Jy=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Zy(n,e){const t=(""+n).match(Ky);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const Gy=n=>+n||0;function Ha(n,e){const t={},i=Ze(e),s=i?Object.keys(e):e,l=Ze(n)?i?o=>xe(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=Gy(l(o));return t}function b_(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function An(n){const e=b_(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function mn(n,e){n=n||{},e=e||et.font;let t=xe(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=xe(n.style,e.style);i&&!(""+i).match(Jy)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:xe(n.family,e.family),lineHeight:Zy(xe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:xe(n.weight,e.weight),string:""};return s.string=qy(s),s}function Jl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;l<o;++l)if(r=n[l],r!==void 0&&(e!==void 0&&typeof r=="function"&&(r=r(e),s=!1),t!==void 0&&ht(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function Xy(n,e,t){const{min:i,max:s}=n,l=i_(e,(s-i)/2),o=(r,a)=>t&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Ti(n,e){return Object.assign(Object.create(n),e)}function ja(n,e=[""],t=n,i,s=()=>n[0]){En(i)||(i=w_("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>ja([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return y_(o,r,()=>l2(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return bf(o).includes(r)},ownKeys(o){return bf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ds(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:v_(n,i),setContext:l=>Ds(n,l,t,i),override:l=>Ds(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 y_(l,o,()=>xy(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 v_(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:wi(t)?t:()=>t,isIndexable:wi(i)?i:()=>i}}const Qy=(n,e)=>n?n+Ea(e):e,qa=(n,e)=>Ze(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function y_(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function xy(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return wi(r)&&o.isScriptable(e)&&(r=e2(e,r,n,t)),ht(r)&&r.length&&(r=t2(e,r,n,o.isIndexable)),qa(e,r)&&(r=Ds(r,s,l&&l[e],o)),r}function e2(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);return r.add(n),e=e(l,o||i),r.delete(n),qa(n,e)&&(e=Va(s._scopes,s,n,e)),e}function t2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(En(l.index)&&i(n))e=e[l.index%e.length];else if(Ze(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Va(u,s,n,f);e.push(Ds(c,l,o&&o[n],r))}}return e}function k_(n,e,t){return wi(n)?n(e,t):n}const n2=(n,e)=>n===!0?e:typeof n=="string"?ki(e,n):void 0;function i2(n,e,t,i,s){for(const l of e){const o=n2(t,l);if(o){n.add(o);const r=k_(o._fallback,t,s);if(En(r)&&r!==t&&r!==i)return r}else if(o===!1&&En(i)&&t!==i)return null}return!1}function Va(n,e,t,i){const s=e._rootScopes,l=k_(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=_f(r,o,t,l||t,i);return a===null||En(l)&&l!==t&&(a=_f(r,o,l,a,i),a===null)?!1:ja(Array.from(r),[""],s,l,()=>s2(e,t,i))}function _f(n,e,t,i,s){for(;t;)t=i2(n,e,t,i,s);return t}function s2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return ht(s)&&Ze(t)?t:s}function l2(n,e,t,i){let s;for(const l of e)if(s=w_(Qy(l,n),t),En(s))return qa(n,s)?Va(t,i,n,s):s}function w_(n,e){for(const t of e){if(!t)continue;const i=t[n];if(En(i))return i}}function bf(n){let e=n._keys;return e||(e=n._keys=o2(n._scopes)),e}function o2(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)}function S_(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;r<a;++r)u=r+t,f=e[u],o[r]={r:s.parse(ki(f,l),u)};return o}const r2=Number.EPSILON||1e-14,Os=(n,e)=>e<n.length&&!n[e].skip&&n[e],$_=n=>n==="x"?"y":"x";function a2(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Jr(l,s),a=Jr(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 u2(n,e,t){const i=n.length;let s,l,o,r,a,u=Os(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Os(n,f+1),!(!a||!u)){if(nl(e[f],0,r2)){t[f]=t[f+1]=0;continue}s=t[f]/e[f],l=t[f+1]/e[f],r=Math.pow(s,2)+Math.pow(l,2),!(r<=9)&&(o=3/Math.sqrt(r),t[f]=s*o*e[f],t[f+1]=l*o*e[f])}}function f2(n,e,t="x"){const i=$_(t),s=n.length;let l,o,r,a=Os(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=Os(n,u+1),!r)continue;const f=r[t],c=r[i];o&&(l=(f-o[t])/3,r[`cp1${t}`]=f-l,r[`cp1${i}`]=c-l*e[u]),a&&(l=(a[t]-f)/3,r[`cp2${t}`]=f+l,r[`cp2${i}`]=c+l*e[u])}}function c2(n,e="x"){const t=$_(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=Os(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Os(n,o+1),!!a){if(u){const f=u[e]-a[e];s[o]=f!==0?(u[t]-a[t])/f:0}l[o]=r?u?Jn(s[o-1])!==Jn(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}u2(n,s,l),f2(n,l,e)}function Zl(n,e,t){return Math.max(Math.min(n,t),e)}function d2(n,e){let t,i,s,l,o,r=ml(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&ml(n[t+1],e),l&&(s=n[t],o&&(s.cp1x=Zl(s.cp1x,e.left,e.right),s.cp1y=Zl(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Zl(s.cp2x,e.left,e.right),s.cp2y=Zl(s.cp2y,e.top,e.bottom)))}function p2(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")c2(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;l<o;++l)r=n[l],a=a2(u,r,n[Math.min(l+1,o-(i?0:1))%o],e.tension),r.cp1x=a.previous.x,r.cp1y=a.previous.y,r.cp2x=a.next.x,r.cp2y=a.next.y,u=r}e.capBezierPoints&&d2(n,t)}function C_(){return typeof window<"u"&&typeof document<"u"}function za(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Do(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const Wo=n=>window.getComputedStyle(n,null);function h2(n,e){return Wo(n).getPropertyValue(e)}const m2=["top","right","bottom","left"];function Wi(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=m2[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const g2=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function _2(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(g2(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 ji(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Wo(t),l=s.boxSizing==="border-box",o=Wi(s,"padding"),r=Wi(s,"border","width"),{x:a,y:u,box:f}=_2(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:m}=e;return l&&(h-=o.width+r.width,m-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/m*t.height/i)}}function b2(n,e,t){let i,s;if(e===void 0||t===void 0){const l=za(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Wo(l),a=Wi(r,"border","width"),u=Wi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Do(r.maxWidth,l,"clientWidth"),s=Do(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||So,maxHeight:s||So}}const cr=n=>Math.round(n*10)/10;function v2(n,e,t,i){const s=Wo(n),l=Wi(s,"margin"),o=Do(s.maxWidth,n,"clientWidth")||So,r=Do(s.maxHeight,n,"clientHeight")||So,a=b2(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=Wi(s,"border","width"),d=Wi(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=cr(Math.min(u,o,a.maxWidth)),f=cr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=cr(u/2)),{width:u,height:f}}function vf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;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 y2=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function yf(n,e){const t=h2(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function qi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function k2(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 w2(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=qi(n,s,t),r=qi(s,l,t),a=qi(l,e,t),u=qi(o,r,t),f=qi(r,a,t);return qi(u,f,t)}const kf=new Map;function S2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=kf.get(t);return i||(i=new Intl.NumberFormat(n,e),kf.set(t,i)),i}function El(n,e,t){return S2(e,t).format(n)}const $2=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}}},C2=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function dr(n,e,t){return n?$2(e,t):C2()}function T2(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 M2(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function T_(n){return n==="angle"?{between:pl,compare:fy,normalize:hn}:{between:hl,compare:(e,t)=>e-t,normalize:e=>e}}function wf({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 D2(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=T_(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;d<h&&o(r(e[u%a][i]),s,l);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function M_(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=T_(i),{start:f,end:c,loop:d,style:h}=D2(n,e,t),m=[];let g=!1,b=null,y,k,$;const C=()=>a(s,$,y)&&r(s,$)!==0,M=()=>r(l,y)===0||a(l,$,y),T=()=>g||C(),E=()=>!g||M();for(let O=f,I=f;O<=c;++O)k=e[O%o],!k.skip&&(y=u(k[i]),y!==$&&(g=a(y,s,l),b===null&&T()&&(b=r(y,s)===0?O:I),b!==null&&E()&&(m.push(wf({start:b,end:O,loop:d,count:o,style:h})),b=null),I=O,$=y));return b!==null&&m.push(wf({start:b,end:c,loop:d,count:o,style:h})),m}function D_(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=M_(i[s],n.points,e);l.length&&t.push(...l)}return t}function O2(n,e,t,i){let s=0,l=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(l+=s);l>s&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function E2(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 A2(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=O2(t,s,l,i);if(i===!0)return Sf(n,[{start:o,end:r,loop:l}],t,e);const a=r<o?r+s:r,u=!!n._fullLoop&&o===0&&r===s-1;return Sf(n,E2(t,o,a,u),t,e)}function Sf(n,e,t,i){return!i||!i.setContext||!t?e:I2(n,e,t,i)}function I2(n,e,t,i){const s=n._chart.getContext(),l=$f(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function h(m,g,b,y){const k=r?-1:1;if(m!==g){for(m+=a;t[m%a].skip;)m-=k;for(;t[g%a].skip;)g+=k;m%a!==g%a&&(u.push({start:m%a,end:g%a,loop:b,style:y}),f=y,c=g%a)}}for(const m of e){c=r?c:m.start;let g=t[c%a],b;for(d=c+1;d<=m.end;d++){const y=t[d%a];b=$f(i.setContext(Ti(s,{type:"segment",p0:g,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),P2(b,f)&&h(c,d-1,m.loop,f),g=y,f=b}c<d-1&&h(c,d-1,m.loop,f)}return u}function $f(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function P2(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class L2{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=u_.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 L2;const Cf="transparent",N2={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=mf(n||Cf),s=i.valid&&mf(e||Cf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class F2{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||N2[e.type||typeof o],this._easing=il[e.easing]||il.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=Jl([e.to,t,s,e.from]),this._from=Jl([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||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?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<i.length;s++)i[s][t]()}}const R2=["x","y","borderWidth","radius","tension"],H2=["color","borderColor","backgroundColor"];et.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const j2=Object.keys(et.animation);et.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});et.set("animations",{colors:{type:"color",properties:H2},numbers:{type:"number",properties:R2}});et.describe("animations",{_fallback:"animation"});et.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:n=>n|0}}}});class O_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ze(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ze(s))return;const l={};for(const o of j2)l[o]=s[o];(ht(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=V2(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&q2(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 F2(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 q2(n,e){const t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const l=n[i[s]];l&&l.active()&&t.push(l.wait())}return Promise.all(t)}function V2(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Tf(n,e){const t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,l=t.max===void 0?e:0;return{start:i?l:s,end:i?s:l}}function z2(n,e,t){if(t===!1)return!1;const i=Tf(n,t),s=Tf(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function B2(n){let e,t,i,s;return Ze(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function E_(n,e){const t=[],i=n._getSortedDatasetMetas(e);let s,l;for(s=0,l=i.length;s<l;++s)t.push(i[s].index);return t}function Mf(n,e,t,i={}){const s=n.keys,l=i.mode==="single";let o,r,a,u;if(e!==null){for(o=0,r=s.length;o<r;++o){if(a=+s[o],a===t){if(i.all)continue;break}u=n.values[a],$t(u)&&(l||e===0||Jn(e)===Jn(u))&&(e+=u)}return e}}function U2(n){const e=Object.keys(n),t=new Array(e.length);let i,s,l;for(i=0,s=e.length;i<s;++i)l=e[i],t[i]={x:l,y:n[l]};return t}function Df(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function W2(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function Y2(n){const{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function K2(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function Of(n,e,t,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const l=n[s.index];if(t&&l>0||!t&&l<0)return s.index}return null}function Ef(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=W2(l,o,i),c=e.length;let d;for(let h=0;h<c;++h){const m=e[h],{[a]:g,[u]:b}=m,y=m._stacks||(m._stacks={});d=y[u]=K2(s,f,g),d[r]=b,d._top=Of(d,o,!0,i.type),d._bottom=Of(d,o,!1,i.type)}}function pr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function J2(n,e){return Ti(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Z2(n,e,t){return Ti(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Bs(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]}}}const hr=n=>n==="reset"||n==="none",Af=(n,e)=>e?n:Object.assign({},n),G2=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:E_(t,!0),values:null};class zn{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.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Df(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Bs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,m)=>c==="x"?d:c==="r"?m:h,l=t.xAxisID=xe(i.xAxisID,pr(e,"x")),o=t.yAxisID=xe(i.yAxisID,pr(e,"y")),r=t.rAxisID=xe(i.rAxisID,pr(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&&rf(this._data,this),e._stacked&&Bs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(Ze(t))this._data=U2(t);else if(i!==t){if(i){rf(i,this);const s=this._cachedMeta;Bs(s),s._parsed=[]}t&&Object.isExtensible(t)&&hy(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=Df(t.vScale,t),t.stack!==i.stack&&(s=!0,Bs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Ef(this,t._parsed)}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{ht(s[e])?d=this.parseArrayData(i,s,e,t):Ze(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(h()&&(a=!1),u=c);i._sorted=a}o&&Ef(this,d)}parsePrimitiveData(e,t,i,s){const{iScale:l,vScale:o}=e,r=l.axis,a=o.axis,u=l.getLabels(),f=l===o,c=new Array(s);let d,h,m;for(d=0,h=s;d<h;++d)m=d+i,c[d]={[r]:f||l.parse(u[m],m),[a]:o.parse(t[m],m)};return c}parseArrayData(e,t,i,s){const{xScale:l,yScale:o}=e,r=new Array(s);let a,u,f,c;for(a=0,u=s;a<u;++a)f=a+i,c=t[f],r[a]={x:l.parse(c[0],f),y:o.parse(c[1],f)};return r}parseObjectData(e,t,i,s){const{xScale:l,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(s);let f,c,d,h;for(f=0,c=s;f<c;++f)d=f+i,h=t[d],u[f]={x:l.parse(ki(h,r),d),y:o.parse(ki(h,a),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,l=this._cachedMeta,o=t[e.axis],r={keys:E_(s,!0),values:t._stacks[e.axis]};return Mf(r,o,l.index,{mode:i})}updateRangeFromParsed(e,t,i,s){const l=i[t.axis];let o=l===null?NaN:l;const r=s&&i._stacks[t.axis];s&&r&&(s.values=r,o=Mf(s,l,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,s=i._parsed,l=i._sorted&&e===i.iScale,o=s.length,r=this._getOtherScale(e),a=G2(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=Y2(r);let d,h;function m(){h=s[d];const g=h[r.axis];return!$t(h[e.axis])||f>g||c<g}for(d=0;d<o&&!(!m()&&(this.updateRangeFromParsed(u,e,h,a),l));++d);if(l){for(d=o-1;d>=0;--d)if(!m()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s<l;++s)o=t[s][e.axis],$t(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,s=t.vScale,l=this.getParsed(e);return{label:i?""+i.getLabelForValue(l[i.axis]):"",value:s?""+s.getLabelForValue(l[s.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=B2(xe(this.options.clip,z2(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],l=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,l,r,a),f=r;f<r+a;++f){const c=s[f];c.hidden||(c.active&&u?o.push(c):c.draw(e,l))}for(f=0;f<o.length;++f)o[f].draw(e,l)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let l;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];l=o.$context||(o.$context=Z2(this.getContext(),e,o)),l.parsed=this.getParsed(e),l.raw=s.data[e],l.index=l.dataIndex=e}else l=this.$context||(this.$context=J2(this.chart.getContext(),this.index)),l.dataset=s,l.index=l.datasetIndex=this.index;return l.active=!!t,l.mode=i,l}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const s=t==="active",l=this._cachedDataOpts,o=e+"-"+t,r=l[o],a=this.enableOptionSharing&&En(i);if(r)return Af(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=s?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),h=Object.keys(et.elements[e]),m=()=>this.getContext(i,s),g=u.resolveNamedOptions(d,h,m,c);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(Af(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 O_(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||hr(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){hr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!hr(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<s&&this._removeElements(l,s-l)}_insertElements(e,t,i=!0){const s=this._cachedMeta,l=s.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r<o;++r)l[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(e,t),i&&this.updateElements(l,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&Bs(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}zn.defaults={};zn.prototype.datasetElementType=null;zn.prototype.dataElementType=null;function X2(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let s=0,l=t.length;s<l;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=a_(i.sort((s,l)=>s-l))}return n._cache.$bar}function Q2(n){const e=n.iScale,t=X2(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(En(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s<l;++s)o=e.getPixelForValue(t[s]),a();for(r=void 0,s=0,l=e.ticks.length;s<l;++s)o=e.getPixelForTick(s),a();return i}function x2(n,e,t,i){const s=t.barThickness;let l,o;return ot(s)?(l=e.min*t.categoryPercentage,o=t.barPercentage):(l=s*i,o=1),{chunk:l/i,ratio:o,start:e.pixels[n]-l/2}}function ek(n,e,t,i){const s=e.pixels,l=s[n];let o=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const a=t.categoryPercentage;o===null&&(o=l-(r===null?e.end-e.start:r-l)),r===null&&(r=l+l-o);const u=l-(l-Math.min(o,r))/2*a;return{chunk:Math.abs(r-o)/2*a/i,ratio:t.barPercentage,start:u}}function tk(n,e,t,i){const s=t.parse(n[0],i),l=t.parse(n[1],i),o=Math.min(s,l),r=Math.max(s,l);let a=o,u=r;Math.abs(o)>Math.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function A_(n,e,t,i){return ht(n)?tk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function If(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u<f;++u)d=e[u],c={},c[s.axis]=r||s.parse(o[u],u),a.push(A_(d,c,l,u));return a}function mr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function nk(n,e,t){return n!==0?Jn(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function ik(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",l="start"):(s="start",l="end"),{start:t,end:i,reverse:e,top:s,bottom:l}}function sk(n,e,t,i){let s=e.borderSkipped;const l={};if(!s){n.borderSkipped=l;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:r,reverse:a,top:u,bottom:f}=ik(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[Pf(f,o,r,a)]=!0,s=u)),l[Pf(s,o,r,a)]=!0,n.borderSkipped=l}function Pf(n,e,t,i){return i?(n=lk(n,e,t),n=Lf(n,t,e)):n=Lf(n,e,t),n}function lk(n,e,t){return n===e?t:n===t?e:n}function Lf(n,e,t){return n==="start"?e:n==="end"?t:n}function ok(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Ba extends zn{parsePrimitiveData(e,t,i,s){return If(e,t,i,s)}parseArrayData(e,t,i,s){return If(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:l,vScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=l.axis==="x"?r:a,f=o.axis==="x"?r:a,c=[];let d,h,m,g;for(d=i,h=i+s;d<h;++d)g=t[d],m={},m[l.axis]=l.parse(ki(g,u),d),c.push(A_(ki(g,f),m,o,d));return c}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const l=i._custom;l&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,l.min),e.max=Math.max(e.max,l.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,l=this.getParsed(e),o=l._custom,r=mr(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(l[s.axis]);return{label:""+i.getLabelForValue(l[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const l=s==="reset",{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),u=r.isHorizontal(),f=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s);for(let h=t;h<t+i;h++){const m=this.getParsed(h),g=l||ot(m[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(h),b=this._calculateBarIndexPixels(h,f),y=(m._stacks||{})[r.axis],k={horizontal:u,base:g.base,enableBorderRadius:!y||mr(m._custom)||o===y._top||o===y._bottom,x:u?g.head:b.center,y:u?b.center:g.head,height:u?b.size:Math.abs(g.size),width:u?Math.abs(g.size):b.size};d&&(k.options=c||this.resolveDataElementOptions(h,e[h].active?"active":s));const $=k.options||e[h].options;sk(k,$,y,o),ok(k,$,f.ratio),this.updateElement(e[h],h,k,s)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(a=>a.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(ot(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l<o;++l)s.push(i.getPixelForValue(this.getParsed(l)[i.axis],l));const r=e.barThickness;return{min:r||Q2(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i},options:{base:s,minBarLength:l}}=this,o=s||0,r=this.getParsed(e),a=r._custom,u=mr(a);let f=r[t.axis],c=0,d=i?this.applyStack(t,r,i):f,h,m;d!==f&&(c=d-f,d=f),u&&(f=a.barStart,d=a.barEnd-a.barStart,f!==0&&Jn(f)!==Jn(a.barEnd)&&(c=0),c+=f);const g=!ot(s)&&!u?s:c;let b=t.getPixelForValue(g);if(this.chart.getDataVisibility(e)?h=t.getPixelForValue(c+d):h=b,m=h-b,Math.abs(m)<l){m=nk(m,t,o)*l,f===o&&(b-=m/2);const y=t.getPixelForDecimal(0),k=t.getPixelForDecimal(1),$=Math.min(y,k),C=Math.max(y,k);b=Math.max(Math.min(b,C),$),h=b+m}if(b===t.getPixelForValue(o)){const y=Jn(m)*t.getLineWidthForValue(o)/2;b+=y,m-=y}return{size:m,base:b,head:h,center:h+m/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=xe(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?ek(e,t,s,u):x2(e,t,s,u),c=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*c+f.chunk/2,a=Math.min(o,f.chunk*f.ratio)}else r=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(o,t.min*t.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let l=0;for(;l<s;++l)this.getParsed(l)[t.axis]!==null&&i[l].draw(this._ctx)}}Ba.id="bar";Ba.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Ba.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ua extends zn{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){const l=super.parsePrimitiveData(e,t,i,s);for(let o=0;o<l.length;o++)l[o]._custom=this.resolveDataElementOptions(o+i).radius;return l}parseArrayData(e,t,i,s){const l=super.parseArrayData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=xe(r[2],this.resolveDataElementOptions(o+i).radius)}return l}parseObjectData(e,t,i,s){const l=super.parseObjectData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=xe(r&&r.r&&+r.r,this.resolveDataElementOptions(o+i).radius)}return l}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;d<t+i;d++){const h=e[d],m=!l&&this.getParsed(d),g={},b=g[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(m[f]),y=g[c]=l?r.getBasePixel():r.getPixelForValue(m[c]);g.skip=isNaN(b)||isNaN(y),u&&(g.options=a||this.resolveDataElementOptions(d,h.active?"active":s),l&&(g.options.radius=0)),this.updateElement(h,d,g,s)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const l=s.radius;return t!=="active"&&(s.radius=0),s.radius+=xe(i&&i._custom,l),s}}Ua.id="bubble";Ua.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Ua.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function rk(n,e,t){let i=1,s=1,l=0,o=0;if(e<ft){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),c=Math.cos(a),d=Math.sin(a),h=($,C,M)=>pl($,r,a,!0)?1:Math.max(C,C*t,M,M*t),m=($,C,M)=>pl($,r,a,!0)?-1:Math.min(C,C*t,M,M*t),g=h(0,u,c),b=h(vt,f,d),y=m(wt,u,c),k=m(wt+vt,f,d);i=(g-y)/2,s=(b-k)/2,l=-(g+y)/2,o=-(b+k)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Al extends zn{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(Ze(i[e])){const{key:a="value"}=this._parsing;l=u=>+ki(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Hn(this.options.rotation-90)}_getCircumference(){return Hn(this.options.circumference)}_getRotationExtents(){let e=ft,t=-ft;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,l=s._getRotation(),o=s._getCircumference();e=Math.min(e,l),t=Math.max(t,l+o)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,s=this._cachedMeta,l=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(l)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min(ey(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:h,offsetX:m,offsetY:g}=rk(c,f,a),b=(i.width-o)/d,y=(i.height-o)/h,k=Math.max(Math.min(b,y)/2,0),$=i_(this.options.radius,k),C=Math.max($*a,0),M=($-C)/this._getVisibleDatasetWeightTotal();this.offsetX=m*$,this.offsetY=g*$,s.total=this.calculateTotal(),this.outerRadius=$-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*u,0),this.updateElements(l,0,l.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,l=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*l/ft)}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,r=o.chartArea,u=o.options.animation,f=(r.left+r.right)/2,c=(r.top+r.bottom)/2,d=l&&u.animateScale,h=d?0:this.innerRadius,m=d?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(t,s);let y=this._getRotation(),k;for(k=0;k<t;++k)y+=this._circumference(k,l);for(k=t;k<t+i;++k){const $=this._circumference(k,l),C=e[k],M={x:f+this.offsetX,y:c+this.offsetY,startAngle:y,endAngle:y+$,circumference:$,outerRadius:m,innerRadius:h};b&&(M.options=g||this.resolveDataElementOptions(k,C.active?"active":s)),y+=$,this.updateElement(C,k,M,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const l=e._parsed[s];l!==null&&!isNaN(l)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(l))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?ft*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=El(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;s<l;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),e=o.data,r=o.controller;break}}if(!e)return 0;for(s=0,l=e.length;s<l;++s)a=r.resolveDataElementOptions(s),a.borderAlign!=="inner"&&(t=Math.max(t,a.borderWidth||0,a.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){const l=this.resolveDataElementOptions(i);t=Math.max(t,l.offset||0,l.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(xe(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Al.id="doughnut";Al.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};Al.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Al.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return ht(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Yo extends zn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=c_(t,s,o);this._drawStart=r,this._drawCount=a,d_(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:m,segment:g}=this.options,b=Ms(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let k=t>0&&this.getParsed(t-1);for(let $=t;$<t+i;++$){const C=e[$],M=this.getParsed($),T=y?C:{},E=ot(M[h]),O=T[d]=o.getPixelForValue(M[d],$),I=T[h]=l||E?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[h],$);T.skip=isNaN(O)||isNaN(I)||E,T.stop=$>0&&Math.abs(M[d]-k[d])>b,g&&(T.parsed=M,T.raw=u.data[$]),c&&(T.options=f||this.resolveDataElementOptions($,C.active?"active":s)),y||this.updateElement(C,$,T,s),k=M}}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()}}Yo.id="line";Yo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Wa extends zn{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=El(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return S_.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(l<t.min&&(t.min=l),l>t.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*wt;let h=d,m;const g=360/this.countVisibleElements();for(m=0;m<t;++m)h+=this._computeAngle(m,s,g);for(m=t;m<t+i;m++){const b=e[m];let y=h,k=h+this._computeAngle(m,s,g),$=o.getDataVisibility(m)?u.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=k,l&&(a.animateScale&&($=0),a.animateRotate&&(y=k=d));const C={x:f,y:c,innerRadius:0,outerRadius:$,startAngle:y,endAngle:k,options:this.resolveDataElementOptions(m,b.active?"active":s)};this.updateElement(b,m,C,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Hn(this.resolveDataElementOptions(e,t).angle||i):0}}Wa.id="polarArea";Wa.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Wa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class I_ extends Al{}I_.id="pie";I_.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ya extends zn{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return S_.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r<t+i;r++){const a=e[r],u=this.resolveDataElementOptions(r,a.active?"active":s),f=l.getPointPositionForValue(r,this.getParsed(r).r),c=o?l.xCenter:f.x,d=o?l.yCenter:f.y,h={x:c,y:d,angle:f.angle,skip:isNaN(c)||isNaN(d),options:u};this.updateElement(a,r,h,s)}}}Ya.id="radar";Ya.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Ya.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};let ai=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Ms(this.x)&&Ms(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}};ai.defaults={};ai.defaultRoutes=void 0;const P_={values(n){return ht(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=ak(n,t)}const o=Tn(Math.abs(l)),r=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),El(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Tn(n)));return i===1||i===2||i===5?P_.numeric.call(this,n,e,t):""}};function ak(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 Ko={formatters:P_};et.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:Ko.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});et.route("scale.ticks","color","","color");et.route("scale.grid","color","","borderColor");et.route("scale.grid","borderColor","","borderColor");et.route("scale.title","color","","color");et.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});et.describe("scales",{_fallback:"scale"});et.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function uk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||fk(n),s=t.major.enabled?dk(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return pk(e,a,s,l/i),a;const u=ck(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Gl(e,a,u,ot(d)?0:o-d,o),f=0,c=l-1;f<c;f++)Gl(e,a,u,s[f],s[f+1]);return Gl(e,a,u,r,ot(d)?e.length:r+d),a}return Gl(e,a,u),a}function fk(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function ck(n,e,t){const i=hk(n),s=e.length/t;if(!i)return Math.max(s,1);const l=ay(i);for(let o=0,r=l.length-1;o<r;o++){const a=l[o];if(a>s)return a}return Math.max(s,1)}function dk(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function pk(n,e,t,i){let s=0,l=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===l&&(e.push(n[o]),s++,l=t[s*i])}function Gl(n,e,t,i,s){const l=xe(i,0),o=Math.min(xe(s,n.length),n.length);let r=0,a,u,f;for(t=Math.ceil(t),s&&(a=s-i,t=a/Math.floor(a/t)),f=l;f<0;)r++,f=Math.round(l+r*t);for(u=Math.max(l,0);u<o;u++)u===f&&(e.push(n[u]),r++,f=Math.round(l+r*t))}function hk(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const mk=n=>n==="left"?"right":n==="right"?"left":n,Nf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Ff(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;l<s;l+=i)t.push(n[Math.floor(l)]);return t}function gk(n,e,t){const i=n.ticks.length,s=Math.min(e,i-1),l=n._startPixel,o=n._endPixel,r=1e-6;let a=n.getPixelForTick(s),u;if(!(t&&(i===1?u=Math.max(a-l,o-a):e===0?u=(n.getPixelForTick(1)-a)/2:u=(a-n.getPixelForTick(s-1))/2,a+=s<e?u:-u,a<l-r||a>o+r)))return a}function _k(n,e){at(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;l<s;++l)delete t.data[i[l]];i.splice(0,s)}})}function Us(n){return n.drawTicks?n.tickLength:0}function Rf(n,e){if(!n.display)return 0;const t=mn(n.font,e),i=An(n.padding);return(ht(n.text)?n.text.length:1)*t.lineHeight+i.height}function bk(n,e){return Ti(n,{scale:e,type:"scale"})}function vk(n,e,t){return Ti(n,{tick:t,index:e,type:"tick"})}function yk(n,e,t){let i=gy(n);return(t&&e!=="right"||!t&&e==="right")&&(i=mk(i)),i}function kk(n,e,t,i){const{top:s,left:l,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,h,m;const g=o-s,b=r-l;if(n.isHorizontal()){if(h=af(i,l,r),Ze(t)){const y=Object.keys(t)[0],k=t[y];m=f[y].getPixelForValue(k)+g-e}else t==="center"?m=(u.bottom+u.top)/2+g-e:m=Nf(n,t,e);d=r-l}else{if(Ze(t)){const y=Object.keys(t)[0],k=t[y];h=f[y].getPixelForValue(k)-b+e}else t==="center"?h=(u.left+u.right)/2-b+e:h=Nf(n,t,e);m=af(i,o,s),c=t==="left"?-vt:vt}return{titleX:h,titleY:m,maxWidth:d,rotation:c}}class xi extends ai{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=wn(e,Number.POSITIVE_INFINITY),t=wn(t,Number.NEGATIVE_INFINITY),i=wn(i,Number.POSITIVE_INFINITY),s=wn(s,Number.NEGATIVE_INFINITY),{min:wn(e,i),max:wn(t,s),minDefined:$t(e),maxDefined:$t(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:l}=this.getUserBounds(),o;if(s&&l)return{min:t,max:i};const r=this.getMatchingVisibleMetas();for(let a=0,u=r.length;a<u;++a)o=r[a].controller.getMinMax(this,e),s||(t=Math.min(t,o.min)),l||(i=Math.max(i,o.max));return t=l&&t>i?i:t,i=s&&t>i?t:i,{min:wn(t,wn(i,t)),max:wn(i,wn(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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){bt(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=Xy(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Ff(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=uk(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){bt(this.options.afterUpdate,[this])}beforeSetDimensions(){bt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){bt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),bt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){bt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,s,l;for(i=0,s=e.length;i<s;i++)l=e[i],l.label=bt(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){bt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){bt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=this.ticks.length,s=t.minRotation||0,l=t.maxRotation;let o=s,r,a,u;if(!this._isVisible()||!t.display||s>=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,h=Ut(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Us(e.grid)-t.padding-Rf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Aa(Math.min(Math.asin(Ut((f.highest.height+6)/r,-1,1)),Math.asin(Ut(a/u,-1,1))-Math.asin(Ut(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){bt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){bt(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=Rf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Us(l)+a):(e.height=this.maxHeight,e.width=Us(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,m=Hn(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(r){const y=i.mirror?0:b*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:g*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,b,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,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-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(){bt(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<i;t++)ot(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=Ff(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){const{ctx:i,_longestTextCache:s}=this,l=[],o=[];let r=0,a=0,u,f,c,d,h,m,g,b,y,k,$;for(u=0;u<t;++u){if(d=e[u].label,h=this._resolveTickFontOptions(u),i.font=m=h.string,g=s[m]=s[m]||{data:{},gc:[]},b=h.lineHeight,y=k=0,!ot(d)&&!ht(d))y=Co(i,g.data,g.gc,y,d),k=b;else if(ht(d))for(f=0,c=d.length;f<c;++f)$=d[f],!ot($)&&!ht($)&&(y=Co(i,g.data,g.gc,y,$),k+=b);l.push(y),o.push(k),r=Math.max(y,r),a=Math.max(k,a)}_k(s,t);const C=l.indexOf(r),M=o.indexOf(a),T=E=>({width:l[E]||0,height:o[E]||0});return{first:T(0),last:T(t-1),widest:T(C),highest:T(M),widths:l,heights:o}}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 cy(this._alignToPixels?Ni(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&&e<t.length){const i=t[e];return i.$context||(i.$context=vk(this.getContext(),e,i))}return this.$context||(this.$context=bk(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Hn(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),l=this._getLabelSizes(),o=e.autoSkipPadding||0,r=l?l.widest.width+o:0,a=l?l.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Us(l),d=[],h=l.setContext(this.getContext()),m=h.drawBorder?h.borderWidth:0,g=m/2,b=function(se){return Ni(i,se,m)};let y,k,$,C,M,T,E,O,I,L,N,F;if(o==="top")y=b(this.bottom),T=this.bottom-c,O=y-g,L=b(e.top)+g,F=e.bottom;else if(o==="bottom")y=b(this.top),L=e.top,F=b(e.bottom)-g,T=y+g,O=this.top+c;else if(o==="left")y=b(this.right),M=this.right-c,E=y-g,I=b(e.left)+g,N=e.right;else if(o==="right")y=b(this.left),I=e.left,N=b(e.right)-g,M=y+g,E=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(Ze(o)){const se=Object.keys(o)[0],K=o[se];y=b(this.chart.scales[se].getPixelForValue(K))}L=e.top,F=e.bottom,T=y+g,O=T+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(Ze(o)){const se=Object.keys(o)[0],K=o[se];y=b(this.chart.scales[se].getPixelForValue(K))}M=y-g,E=M-c,I=e.left,N=e.right}const V=xe(s.ticks.maxTicksLimit,f),G=Math.max(1,Math.ceil(f/V));for(k=0;k<f;k+=G){const se=l.setContext(this.getContext(k)),K=se.lineWidth,te=se.color,ne=se.borderDash||[],z=se.borderDashOffset,Q=se.tickWidth,J=se.tickColor,ae=se.tickBorderDash||[],He=se.tickBorderDashOffset;$=gk(this,k,r),$!==void 0&&(C=Ni(i,$,K),a?M=E=I=N=C:T=O=L=F=C,d.push({tx1:M,ty1:T,tx2:E,ty2:O,x1:I,y1:L,x2:N,y2:F,width:K,color:te,borderDash:ne,borderDashOffset:z,tickWidth:Q,tickColor:J,tickBorderDash:ae,tickBorderDashOffset:He}))}return this._ticksLength=f,this._borderValue=y,d}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:l}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:c}=l,d=Us(i.grid),h=d+f,m=c?-f:h,g=-Hn(this.labelRotation),b=[];let y,k,$,C,M,T,E,O,I,L,N,F,V="middle";if(s==="top")T=this.bottom-m,E=this._getXAxisLabelAlignment();else if(s==="bottom")T=this.top+m,E=this._getXAxisLabelAlignment();else if(s==="left"){const se=this._getYAxisLabelAlignment(d);E=se.textAlign,M=se.x}else if(s==="right"){const se=this._getYAxisLabelAlignment(d);E=se.textAlign,M=se.x}else if(t==="x"){if(s==="center")T=(e.top+e.bottom)/2+h;else if(Ze(s)){const se=Object.keys(s)[0],K=s[se];T=this.chart.scales[se].getPixelForValue(K)+h}E=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")M=(e.left+e.right)/2-h;else if(Ze(s)){const se=Object.keys(s)[0],K=s[se];M=this.chart.scales[se].getPixelForValue(K)}E=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?V="top":a==="end"&&(V="bottom"));const G=this._getLabelSizes();for(y=0,k=r.length;y<k;++y){$=r[y],C=$.label;const se=l.setContext(this.getContext(y));O=this.getPixelForTick(y)+l.labelOffset,I=this._resolveTickFontOptions(y),L=I.lineHeight,N=ht(C)?C.length:1;const K=N/2,te=se.color,ne=se.textStrokeColor,z=se.textStrokeWidth;let Q=E;o?(M=O,E==="inner"&&(y===k-1?Q=this.options.reverse?"left":"right":y===0?Q=this.options.reverse?"right":"left":Q="center"),s==="top"?u==="near"||g!==0?F=-N*L+L/2:u==="center"?F=-G.highest.height/2-K*L+L:F=-G.highest.height+L/2:u==="near"||g!==0?F=L/2:u==="center"?F=G.highest.height/2-K*L:F=G.highest.height-N*L,c&&(F*=-1)):(T=O,F=(1-N)*L/2);let J;if(se.showLabelBackdrop){const ae=An(se.backdropPadding),He=G.heights[y],Fe=G.widths[y];let Ne=T+F-ae.top,Re=M-ae.left;switch(V){case"middle":Ne-=He/2;break;case"bottom":Ne-=He;break}switch(E){case"center":Re-=Fe/2;break;case"right":Re-=Fe;break}J={left:Re,top:Ne,width:Fe+ae.width,height:He+ae.height,color:se.backdropColor}}b.push({rotation:g,label:C,font:I,color:te,strokeColor:ne,strokeWidth:z,textOffset:F,textAlign:Q,textBaseline:V,translation:[M,T],backdrop:J})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Hn(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<o;++l){const a=s[l];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),l=i.drawBorder?s.borderWidth:0;if(!l)return;const o=i.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let a,u,f,c;this.isHorizontal()?(a=Ni(e,this.left,l)-l/2,u=Ni(e,this.right,o)+o/2,f=c=r):(f=Ni(e,this.top,l)-l/2,c=Ni(e,this.bottom,o)+o/2,a=u=r),t.save(),t.lineWidth=s.borderWidth,t.strokeStyle=s.borderColor,t.beginPath(),t.moveTo(a,f),t.lineTo(u,c),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Fa(i,s);const l=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=l.length;o<r;++o){const a=l[o],u=a.font,f=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let c=a.textOffset;To(i,f,0,c,u,a)}s&&Ra(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=mn(i.font),o=An(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||Ze(t)?(a+=o.bottom,ht(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=kk(this,a,t,r);To(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:yk(r,t,s),textBaseline:"middle",translation:[u,f]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=xe(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==xi.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l<o;++l){const r=t[l];r[i]===this.id&&(!e||r.type===e)&&s.push(r)}return s}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return mn(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Xl{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;$k(t)&&(i=this.register(t));const s=this.items,l=e.id,o=this.scope+"."+l;if(!l)throw new Error("class does not have id: "+e);return l in s||(s[l]=e,wk(e,o,i),this.override&&et.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in et[s]&&(delete et[s][i],this.override&&delete Gi[i])}}function wk(n,e,t){const i=dl(Object.create(null),[t?et.get(t):{},et.get(e),n.defaults]);et.set(e,i),n.defaultRoutes&&Sk(e,n.defaultRoutes),n.descriptors&&et.describe(e,n.descriptors)}function Sk(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");et.route(l,s,a,r)})}function $k(n){return"id"in n&&"defaults"in n}class Ck{constructor(){this.controllers=new Xl(zn,"datasets",!0),this.elements=new Xl(ai,"elements"),this.plugins=new Xl(Object,"plugins"),this.scales=new Xl(xi,"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):at(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Ea(e);bt(i["before"+s],[],i),t[e](i),bt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var Kn=new Ck;class Ka extends zn{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=c_(t,i,s);if(this._drawStart=l,this._drawCount=o,d_(t)&&(l=0,o=i.length),this.options.showLine){const{dataset:r,_dataset:a}=t;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},e)}this.updateElements(i,l,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=Kn.getElement("line")),super.addElements()}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(t,s),c=this.getSharedOptions(f),d=this.includeOptions(s,c),h=o.axis,m=r.axis,{spanGaps:g,segment:b}=this.options,y=Ms(g)?g:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let C=t;C<t+i;++C){const M=e[C],T=this.getParsed(C),E=k?M:{},O=ot(T[m]),I=E[h]=o.getPixelForValue(T[h],C),L=E[m]=l||O?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,T,a):T[m],C);E.skip=isNaN(I)||isNaN(L)||O,E.stop=C>0&&Math.abs(T[h]-$[h])>y,b&&(E.parsed=T,E.raw=u.data[C]),d&&(E.options=c||this.resolveDataElementOptions(C,M.active?"active":s)),k||this.updateElement(M,C,E,s),$=T}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Ka.id="scatter";Ka.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ka.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Fi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Qr{constructor(e){this.options=e||{}}init(e){}formats(){return Fi()}parse(e,t){return Fi()}format(e,t){return Fi()}add(e,t,i){return Fi()}diff(e,t,i){return Fi()}startOf(e,t,i){return Fi()}endOf(e,t){return Fi()}}Qr.override=function(n){Object.assign(Qr.prototype,n)};var L_={_date:Qr};function Tk(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?dy:zi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Il(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r<a;++r){const{index:u,data:f}=l[r],{lo:c,hi:d}=Tk(l[r],e,o,s);for(let h=c;h<=d;++h){const m=f[h];m.skip||i(m,u,h)}}}function Mk(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){const l=e?Math.abs(i.x-s.x):0,o=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(l,2)+Math.pow(o,2))}}function gr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Il(n,t,e,function(r,a,u){!s&&!ml(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function Dk(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=o_(o,{x:e.x,y:e.y});pl(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Il(n,t,e,l),s}function Ok(n,e,t,i,s,l){let o=[];const r=Mk(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const h=f.inRange(e.x,e.y,s);if(i&&!h)return;const m=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(m))&&!h)return;const b=r(e,m);b<a?(o=[{element:f,datasetIndex:c,index:d}],a=b):b===a&&o.push({element:f,datasetIndex:c,index:d})}return Il(n,t,e,u),o}function _r(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?Dk(n,e,t,s):Ok(n,e,t,i,s,l)}function Hf(n,e,t,i,s){const l=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Il(n,t,e,(a,u,f)=>{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 Ek={evaluateInteractionItems:Il,modes:{index(n,e,t,i){const s=ji(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?gr(n,s,l,i,o):_r(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=ji(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?gr(n,s,l,i,o):_r(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;f<u.length;++f)r.push({element:u[f],datasetIndex:a,index:f})}return r},point(n,e,t,i){const s=ji(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return gr(n,s,l,i,o)},nearest(n,e,t,i){const s=ji(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return _r(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=ji(e,n);return Hf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=ji(e,n);return Hf(n,s,"y",t.intersect,i)}}};const N_=["left","top","right","bottom"];function Ws(n,e){return n.filter(t=>t.pos===e)}function jf(n,e){return n.filter(t=>N_.indexOf(t.pos)===-1&&t.box.axis===e)}function Ys(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 Ak(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:l,options:{stack:o,stackWeight:r=1}}=s,e.push({index:t,box:s,pos:l,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&l+o,stackWeight:r});return e}function Ik(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!N_.includes(s))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=l}return e}function Pk(n,e){const t=Ik(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let l,o,r;for(l=0,o=n.length;l<o;++l){r=n[l];const{fullSize:a}=r.box,u=t[r.stack],f=u&&r.stackWeight/u.weight;r.horizontal?(r.width=f?f*i:a&&e.availableWidth,r.height=s):(r.width=i,r.height=f?f*s:a&&e.availableHeight)}return t}function Lk(n){const e=Ak(n),t=Ys(e.filter(u=>u.box.fullSize),!0),i=Ys(Ws(e,"left"),!0),s=Ys(Ws(e,"right")),l=Ys(Ws(e,"top"),!0),o=Ys(Ws(e,"bottom")),r=jf(e,"x"),a=jf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ws(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function qf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function F_(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 Nk(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!Ze(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&&F_(o,l.getPadding());const r=Math.max(0,e.outerWidth-qf(o,n,"left","right")),a=Math.max(0,e.outerHeight-qf(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 Fk(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 Rk(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 Qs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l<o;++l){r=n[l],a=r.box,a.update(r.width||e.w,r.height||e.h,Rk(r.horizontal,e));const{same:c,other:d}=Nk(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&Qs(s,e,t,i)||f}function Ql(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function Vf(n,e,t,i){const s=t.padding;let{x:l,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{count:1,placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const c=e.w*f,d=u.size||a.height;En(u.start)&&(o=u.start),a.fullSize?Ql(a,s.left,o,t.outerWidth-s.right-s.left,d):Ql(a,e.left+u.placed,o,c,d),u.start=o,u.placed+=c,o=a.bottom}else{const c=e.h*f,d=u.size||a.width;En(u.start)&&(l=u.start),a.fullSize?Ql(a,l,s.top,d,t.outerHeight-s.bottom-s.top):Ql(a,l,e.top+u.placed,d,c),u.start=l,u.placed+=c,l=a.right}}e.x=l,e.y=o}et.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var xl={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const s=An(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=Lk(n.boxes),a=r.vertical,u=r.horizontal;at(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,b)=>b.box.options&&b.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);F_(d,An(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),m=Pk(a.concat(u),c);Qs(r.fullSize,h,c,m),Qs(a,h,c,m),Qs(u,h,c,m)&&Qs(a,h,c,m),Fk(h),Vf(r.leftAndTop,h,c,m),h.x+=h.w,h.y+=h.h,Vf(r.rightAndBottom,h,c,m),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},at(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class R_{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 Hk extends R_{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",jk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},zf=n=>n===null||n==="";function qk(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={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",zf(s)){const l=yf(n,"width");l!==void 0&&(n.width=l)}if(zf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=yf(n,"height");l!==void 0&&(n.height=l)}return n}const H_=y2?{passive:!0}:!1;function Vk(n,e,t){n.addEventListener(e,t,H_)}function zk(n,e,t){n.canvas.removeEventListener(e,t,H_)}function Bk(n,e){const t=jk[n.type]||n.type,{x:i,y:s}=ji(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Oo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function Uk(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Oo(r.addedNodes,i),o=o&&!Oo(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function Wk(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Oo(r.removedNodes,i),o=o&&!Oo(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const gl=new Map;let Bf=0;function j_(){const n=window.devicePixelRatio;n!==Bf&&(Bf=n,gl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function Yk(n,e){gl.size||window.addEventListener("resize",j_),gl.set(n,e)}function Kk(n){gl.delete(n),gl.size||window.removeEventListener("resize",j_)}function Jk(n,e,t){const i=n.canvas,s=i&&za(i);if(!s)return;const l=f_((r,a)=>{const u=s.clientWidth;t(r,a),u<s.clientWidth&&t()},window),o=new ResizeObserver(r=>{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),Yk(n,l),o}function br(n,e,t){t&&t.disconnect(),e==="resize"&&Kk(n)}function Zk(n,e,t){const i=n.canvas,s=f_(l=>{n.ctx!==null&&t(Bk(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return Vk(i,e,s),s}class Gk extends R_{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(qk(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];ot(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[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:Uk,detach:Wk,resize:Jk}[t]||Zk;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:br,detach:br,resize:br}[t]||zk)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return v2(e,t,i,s)}isAttached(e){const t=za(e);return!!(t&&t.isConnected)}}function Xk(n){return!C_()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Hk:Gk}class Qk{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(bt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ot(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=xe(i.options&&i.options.plugins,{}),l=xk(i);return s===!1&&!t?[]:tw(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.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 xk(n){const e={},t=[],i=Object.keys(Kn.plugins.items);for(let l=0;l<i.length;l++)t.push(Kn.getPlugin(i[l]));const s=n.plugins||[];for(let l=0;l<s.length;l++){const o=s[l];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function ew(n,e){return!e&&n===!1?null:n===!0?{}:n}function tw(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=ew(i[a],s);u!==null&&l.push({plugin:r,options:nw(n.config,{plugin:r,local:t[a]},u,o)})}return l}function nw(n,{plugin:e,local:t},i,s){const l=n.pluginScopeKeys(e),o=n.getOptionScopes(i,l);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function xr(n,e){const t=et.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function iw(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function sw(n,e){return n===e?"_index_":"_value_"}function lw(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ea(n,e){return n==="x"||n==="y"?n:e.axis||lw(e.position)||n.charAt(0).toLowerCase()}function ow(n,e){const t=Gi[n.type]||{scales:{}},i=e.scales||{},s=xr(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!Ze(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=ea(r,a),f=sw(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=tl(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||xr(a,e),c=(Gi[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=iw(d,u),m=r[h+"AxisID"]||l[h]||h;o[m]=o[m]||Object.create(null),tl(o[m],[{axis:h},i[m],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];tl(a,[et.scales[a.type],et.scale])}),o}function q_(n){const e=n.options||(n.options={});e.plugins=xe(e.plugins,{}),e.scales=ow(n,e)}function V_(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function rw(n){return n=n||{},n.data=V_(n.data),q_(n),n}const Uf=new Map,z_=new Set;function eo(n,e){let t=Uf.get(n);return t||(t=e(),Uf.set(n,t),z_.add(t)),t}const Ks=(n,e,t)=>{const i=ki(e,t);i!==void 0&&n.add(i)};class aw{constructor(e){this._config=rw(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=V_(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(),q_(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return eo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return eo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return eo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return eo(`${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=>Ks(a,e,c))),f.forEach(c=>Ks(a,s,c)),f.forEach(c=>Ks(a,Gi[l]||{},c)),f.forEach(c=>Ks(a,et,c)),f.forEach(c=>Ks(a,Gr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),z_.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Gi[t]||{},et.datasets[t]||{},{type:t},et,Gr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Wf(this._resolverCache,e,s);let a=o;if(fw(o,t)){l.$shared=!1,i=wi(i)?i():i;const u=this.createResolver(e,i,r);a=Ds(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Wf(this._resolverCache,e,i);return Ze(t)?Ds(l,t,void 0,s):l}}function Wf(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:ja(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const uw=n=>Ze(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||wi(n[t]),!1);function fw(n,e){const{isScriptable:t,isIndexable:i}=v_(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(wi(r)||uw(r))||o&&ht(r))return!0}return!1}var cw="3.9.1";const dw=["top","bottom","left","right","chartArea"];function Yf(n,e){return n==="top"||n==="bottom"||dw.indexOf(n)===-1&&e==="x"}function Kf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Jf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),bt(t&&t.onComplete,[n],e)}function pw(n){const e=n.chart,t=e.options.animation;bt(t&&t.onProgress,[n],e)}function B_(n){return C_()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Eo={},U_=n=>{const e=B_(n);return Object.values(Eo).filter(t=>t.canvas===e).pop()};function hw(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 mw(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Ao{constructor(e,t){const i=this.config=new aw(t),s=B_(e),l=U_(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||Xk(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=xv(),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 Qk,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=my(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Eo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ni.listen(this,"complete",Jf),ni.listen(this,"progress",pw),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return ot(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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():vf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return gf(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,vf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),bt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};at(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=ea(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),at(l,o=>{const r=o.options,a=r.id,u=ea(a,r),f=xe(r.type,o.dtype);(r.position===void 0||Yf(r.position,u)!==Yf(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=Kn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),at(s,(o,r)=>{o||delete i[r]}),at(i,o=>{xl.configure(this,o,o.options),xl.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;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Kf("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.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<s;i++){const l=t[i];let o=this.getDatasetMeta(i);const r=l.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=l.indexAxis||xr(r,this.options),o.order=l.order||0,o.index=i,o.label=""+l.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const a=Kn.getController(r),{datasetElementType:u,dataElementType:f}=et.datasets[r];Object.assign(a.prototype,{dataElementType:Kn.getElement(f),datasetElementType:u&&Kn.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){at(this.data.datasets,(e,t)=>{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<f;u++){const{controller:c}=this.getDatasetMeta(u),d=!s&&l.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||at(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Kf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){at(this.scales,e=>{xl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!nf(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;hw(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;l<t;l++)if(!nf(s,i(l)))return;return Array.from(s).map(l=>l.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],at(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<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,wi(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ni.has(this)?this.attached&&!ni.running(this)&&ni.start(this):(this.draw(),Jf({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,l;for(s=0,l=t.length;s<l;++s){const o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Fa(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Ra(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ml(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Ek.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=Ti(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);En(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;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),gf(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Eo[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(l,o)=>{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};at(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(){at(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},at(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<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:l,index:o})=>{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}});!ko(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_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=ly(e),u=mw(e,this._lastEvent,i,a);i&&(this._lastEvent=null,bt(l.onHover,[e,r,this],this),a&&bt(l.onClick,[e,r,this],this));const f=!ko(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)}}const Zf=()=>at(Ao.instances,n=>n._plugins.invalidate()),di=!0;Object.defineProperties(Ao,{defaults:{enumerable:di,value:et},instances:{enumerable:di,value:Eo},overrides:{enumerable:di,value:Gi},registry:{enumerable:di,value:Kn},version:{enumerable:di,value:cw},getChart:{enumerable:di,value:U_},register:{enumerable:di,value:(...n)=>{Kn.add(...n),Zf()}},unregister:{enumerable:di,value:(...n)=>{Kn.remove(...n),Zf()}}});function W_(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+vt,i-vt),n.closePath(),n.clip()}function gw(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function _w(n,e,t,i){const s=gw(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return Ut(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Ut(s.innerStart,0,o),innerEnd:Ut(s.innerEnd,0,o)}}function ps(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function ta(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const m=s-a;if(i){const se=f>0?f-i:0,K=c>0?c-i:0,te=(se+K)/2,ne=te!==0?m*te/(te+i):m;h=(m-ne)/2}const g=Math.max(.001,m*c-t/wt)/c,b=(m-g)/2,y=a+b+h,k=s-b-h,{outerStart:$,outerEnd:C,innerStart:M,innerEnd:T}=_w(e,d,c,k-y),E=c-$,O=c-C,I=y+$/E,L=k-C/O,N=d+M,F=d+T,V=y+M/N,G=k-T/F;if(n.beginPath(),l){if(n.arc(o,r,c,I,L),C>0){const te=ps(O,L,o,r);n.arc(te.x,te.y,C,L,k+vt)}const se=ps(F,k,o,r);if(n.lineTo(se.x,se.y),T>0){const te=ps(F,G,o,r);n.arc(te.x,te.y,T,k+vt,G+Math.PI)}if(n.arc(o,r,d,k-T/d,y+M/d,!0),M>0){const te=ps(N,V,o,r);n.arc(te.x,te.y,M,V+Math.PI,y-vt)}const K=ps(E,y,o,r);if(n.lineTo(K.x,K.y),$>0){const te=ps(E,I,o,r);n.arc(te.x,te.y,$,y-vt,I)}}else{n.moveTo(o,r);const se=Math.cos(I)*c+o,K=Math.sin(I)*c+r;n.lineTo(se,K);const te=Math.cos(L)*c+o,ne=Math.sin(L)*c+r;n.lineTo(te,ne)}n.closePath()}function bw(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){ta(n,e,t,i,o+ft,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%ft,r%ft===0&&(a+=ft))}return ta(n,e,t,i,a,s),n.fill(),a}function vw(n,e,t){const{x:i,y:s,startAngle:l,pixelMargin:o,fullCircles:r}=e,a=Math.max(e.outerRadius-o,0),u=e.innerRadius+o;let f;for(t&&W_(n,e,l+ft),n.beginPath(),n.arc(i,s,u,l+ft,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+ft),f=0;f<r;++f)n.stroke()}function yw(n,e,t,i,s,l){const{options:o}=e,{borderWidth:r,borderJoinStyle:a}=o,u=o.borderAlign==="inner";r&&(u?(n.lineWidth=r*2,n.lineJoin=a||"round"):(n.lineWidth=r,n.lineJoin=a||"bevel"),e.fullCircles&&vw(n,e,u),u&&W_(n,e,s),ta(n,e,t,i,s,l),n.stroke())}class Ja extends ai{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.getProps(["x","y"],i),{angle:l,distance:o}=o_(s,{x:e,y:t}),{startAngle:r,endAngle:a,innerRadius:u,outerRadius:f,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,m=xe(c,a-r)>=ft||pl(l,r,a),g=hl(o,u+d,f+d);return m&&g}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>ft?Math.floor(i/ft):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=wt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=bw(e,this,r,l,o);yw(e,this,r,l,a,o),e.restore()}}Ja.id="arc";Ja.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ja.defaultRoutes={backgroundColor:"backgroundColor"};function Y_(n,e,t=e){n.lineCap=xe(t.borderCapStyle,e.borderCapStyle),n.setLineDash(xe(t.borderDash,e.borderDash)),n.lineDashOffset=xe(t.borderDashOffset,e.borderDashOffset),n.lineJoin=xe(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=xe(t.borderWidth,e.borderWidth),n.strokeStyle=xe(t.borderColor,e.borderColor)}function kw(n,e,t){n.lineTo(t.x,t.y)}function ww(n){return n.stepped?By:n.tension||n.cubicInterpolationMode==="monotone"?Uy:kw}function K_(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=s<o&&l<o||s>r&&l>r;return{count:i,start:a,loop:e.loop,ilen:u<a&&!f?i+u-a:u-a}}function Sw(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=K_(s,t,i),f=ww(l);let{move:c=!0,reverse:d}=i||{},h,m,g;for(h=0;h<=u;++h)m=s[(r+(d?u-h:h))%o],!m.skip&&(c?(n.moveTo(m.x,m.y),c=!1):f(n,g,m,d,l.stepped),g=m);return a&&(m=s[(r+(d?u:0))%o],f(n,g,m,d,l.stepped)),!!a}function $w(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=K_(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,h,m,g,b,y;const k=C=>(o+(u?r-C:C))%l,$=()=>{g!==b&&(n.lineTo(f,b),n.lineTo(f,g),n.lineTo(f,y))};for(a&&(h=s[k(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[k(d)],h.skip)continue;const C=h.x,M=h.y,T=C|0;T===m?(M<g?g=M:M>b&&(b=M),f=(c*f+C)/++c):($(),n.lineTo(C,M),m=T,c=0,g=b=M),y=M}$()}function na(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?$w:Sw}function Cw(n){return n.stepped?k2:n.tension||n.cubicInterpolationMode==="monotone"?w2:qi}function Tw(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),Y_(n,e.options),n.stroke(s)}function Mw(n,e,t,i){const{segments:s,options:l}=e,o=na(e);for(const r of s)Y_(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const Dw=typeof Path2D=="function";function Ow(n,e,t,i){Dw&&!e.options.segment?Tw(n,e,t,i):Mw(n,e,t,i)}class Mi extends ai{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;p2(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=A2(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=D_(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=Cw(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],h=l[c],m=l[d];if(h===m){r.push(h);continue}const g=Math.abs((s-h[t])/(m[t]-h[t])),b=a(h,m,g,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return na(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=na(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const r of s)o&=l(e,this,r,{start:t,end:t+i-1});return!!o}draw(e,t,i,s){const l=this.options||{};(this.points||[]).length&&l.borderWidth&&(e.save(),Ow(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Mi.id="line";Mi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Mi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Mi.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function Gf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class Jo extends ai{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.options,{x:l,y:o}=this.getProps(["x","y"],i);return Math.pow(e-l,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return Gf(this,e,"x",t)}inYRange(e,t){return Gf(this,e,"y",t)}getCenterPoint(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);const i=t&&e.borderWidth||0;return(t+i)*2}draw(e,t){const i=this.options;this.skip||i.radius<.1||!ml(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Xr(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Jo.id="point";Jo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Jo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function J_(n,e){const{x:t,y:i,base:s,width:l,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,c;return n.horizontal?(c=o/2,r=Math.min(t,s),a=Math.max(t,s),u=i-c,f=i+c):(c=l/2,r=t-c,a=t+c,u=Math.min(i,s),f=Math.max(i,s)),{left:r,top:u,right:a,bottom:f}}function gi(n,e,t,i){return n?0:Ut(e,t,i)}function Ew(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=b_(i);return{t:gi(s.top,l.top,0,t),r:gi(s.right,l.right,0,e),b:gi(s.bottom,l.bottom,0,t),l:gi(s.left,l.left,0,e)}}function Aw(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=ys(s),o=Math.min(e,t),r=n.borderSkipped,a=i||Ze(s);return{topLeft:gi(!a||r.top||r.left,l.topLeft,0,o),topRight:gi(!a||r.top||r.right,l.topRight,0,o),bottomLeft:gi(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:gi(!a||r.bottom||r.right,l.bottomRight,0,o)}}function Iw(n){const e=J_(n),t=e.right-e.left,i=e.bottom-e.top,s=Ew(n,t/2,i/2),l=Aw(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:l},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,l.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,l.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,l.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,l.bottomRight-Math.max(s.b,s.r))}}}}function vr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&J_(n,i);return r&&(s||hl(e,r.left,r.right))&&(l||hl(t,r.top,r.bottom))}function Pw(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Lw(n,e){n.rect(e.x,e.y,e.w,e.h)}function yr(n,e,t={}){const i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,l=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+l,h:n.h+o,radius:n.radius}}class Za extends ai{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:l,outer:o}=Iw(this),r=Pw(o.radius)?Mo:Lw;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,yr(o,t,l)),e.clip(),r(e,yr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,yr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return vr(this,e,t,i)}inXRange(e,t){return vr(this,e,null,t)}inYRange(e,t){return vr(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:l}=this.getProps(["x","y","base","horizontal"],e);return{x:l?(t+s)/2:t,y:l?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Za.id="bar";Za.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Za.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function Nw(n,e,t){const i=n.segments,s=n.points,l=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Ga(a,u,s);const f=ia(t,s[a],s[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:s[a],end:s[u]});continue}const c=D_(e,f);for(const d of c){const h=ia(t,l[d.start],l[d.end],d.loop),m=M_(r,s,h);for(const g of m)o.push({source:g,target:d,start:{[t]:Xf(f,h,"start",Math.max)},end:{[t]:Xf(f,h,"end",Math.min)}})}}return o}function ia(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=hn(s),l=hn(l)),{property:n,start:s,end:l}}function Fw(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=Ga(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 Ga(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Xf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Z_(n,e){let t=[],i=!1;return ht(n)?(i=!0,t=n):t=Fw(n,e),t.length?new Mi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Qf(n){return n&&n.fill!==!1}function Rw(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(!$t(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function Hw(n,e,t){const i=zw(n);if(Ze(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return $t(s)&&Math.floor(s)===s?jw(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function jw(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function qw(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:Ze(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Vw(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:Ze(n)?i=n.value:i=e.getBaseValue(),i}function zw(n){const e=n.options,t=e.fill;let i=xe(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Bw(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=Uw(e,t);r.push(Z_({x:null,y:e.bottom},i));for(let a=0;a<l.length;a++){const u=l[a];for(let f=u.start;f<=u.end;f++)Ww(s,o[f],r)}return new Mi({points:s,options:{}})}function Uw(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const l=i[s];if(l.index===e)break;l.hidden||t.unshift(l.dataset)}return t}function Ww(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=Yw(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function Yw(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const s=i[t],l=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<l.length;u++){const f=l[u],c=o[f.start][t],d=o[f.end][t];if(hl(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class G_{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:s,y:l,radius:o}=this;return t=t||{start:0,end:ft},e.arc(s,l,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:s}=this,l=e.angle;return{x:t+Math.cos(l)*s,y:i+Math.sin(l)*s,angle:l}}}function Kw(n){const{chart:e,fill:t,line:i}=n;if($t(t))return Jw(e,t);if(t==="stack")return Bw(n);if(t==="shape")return!0;const s=Zw(n);return s instanceof G_?s:Z_(s,i)}function Jw(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function Zw(n){return(n.scale||{}).getPointPositionForValue?Xw(n):Gw(n)}function Gw(n){const{scale:e={},fill:t}=n,i=qw(t,e);if($t(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Xw(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=Vw(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new G_({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<s;++a)r.push(e.getPointPositionForValue(a,o));return r}function kr(n,e,t){const i=Kw(e),{line:s,scale:l,axis:o}=e,r=s.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:c=u}=a||{};i&&s.points.length&&(Fa(n,t),Qw(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),Ra(n))}function Qw(n,e){const{line:t,target:i,above:s,below:l,area:o,scale:r}=e,a=t._loop?"angle":e.axis;n.save(),a==="x"&&l!==s&&(xf(n,i,o.top),ec(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),xf(n,i,o.bottom)),ec(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function xf(n,e,t){const{segments:i,points:s}=e;let l=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=s[a],c=s[Ga(a,u,s)];l?(n.moveTo(f.x,f.y),l=!1):(n.lineTo(f.x,t),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(c.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function ec(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=Nw(t,i,s);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=l}={}}=a,h=i!==!0;n.save(),n.fillStyle=d,xw(n,o,h&&ia(s,f,c)),n.beginPath();const m=!!t.pathSegment(n,a);let g;if(h){m?n.closePath():tc(n,i,c,s);const b=!!i.pathSegment(n,u,{move:m,reverse:!0});g=m&&b,g||tc(n,i,f,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function xw(n,e,t){const{top:i,bottom:s}=e.chart.chartArea,{property:l,start:o,end:r}=t||{};l==="x"&&(n.beginPath(),n.rect(o,i,r-o,s-i),n.clip())}function tc(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var eS={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,s=[];let l,o,r,a;for(o=0;o<i;++o)l=n.getDatasetMeta(o),r=l.dataset,a=null,r&&r.options&&r instanceof Mi&&(a={visible:n.isDatasetVisible(o),index:o,fill:Hw(r,o,i),chart:n,axis:l.controller.options.indexAxis,scale:l.vScale,line:r}),l.$filler=a,s.push(a);for(o=0;o<i;++o)a=s[o],!(!a||a.fill===!1)&&(a.fill=Rw(s,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),l=n.chartArea;for(let o=s.length-1;o>=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&kr(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;Qf(l)&&kr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Qf(i)||t.drawTime!=="beforeDatasetDraw"||kr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ll={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e<t;++e){const o=n[e].element;if(o&&o.hasValue()){const r=o.tooltipPosition();i+=r.x,s+=r.y,++l}}return{x:i/l,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<o;++l){const a=n[l].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=Jr(e,u);f<s&&(s=f,r=a)}}if(r){const a=r.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function Wn(n,e){return e&&(ht(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function ii(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function tS(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 nc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=mn(e.bodyFont),u=mn(e.titleFont),f=mn(e.footerFont),c=l.length,d=s.length,h=i.length,m=An(e.padding);let g=m.height,b=0,y=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=h*C+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let k=0;const $=function(C){b=Math.max(b,t.measureText(C).width+k)};return t.save(),t.font=u.string,at(n.title,$),t.font=a.string,at(n.beforeBody.concat(n.afterBody),$),k=e.displayColors?o+2+e.boxPadding:0,at(i,C=>{at(C.before,$),at(C.lines,$),at(C.after,$)}),k=0,t.font=f.string,at(n.footer,$),t.restore(),b+=m.width,{width:b,height:g}}function nS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function iS(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 sS(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"),iS(u,n,e,t)&&(u="center"),u}function ic(n,e,t){const i=t.yAlign||e.yAlign||nS(n,t);return{xAlign:t.xAlign||e.xAlign||sS(n,e,t,i),yAlign:i}}function lS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function oS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function sc(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:h}=ys(o);let m=lS(e,r);const g=oS(e,a,u);return a==="center"?r==="left"?m+=u:r==="right"&&(m-=u):r==="left"?m-=Math.max(f,d)+s:r==="right"&&(m+=Math.max(c,h)+s),{x:Ut(m,0,i.width-e.width),y:Ut(g,0,i.height-e.height)}}function to(n,e,t){const i=An(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function lc(n){return Wn([],ii(n))}function rS(n,e,t){return Ti(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function oc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class sa extends ai{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||e._chart,this._chart=this.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 O_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=rS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Wn(r,ii(s)),r=Wn(r,ii(l)),r=Wn(r,ii(o)),r}getBeforeBody(e,t){return lc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return at(e,l=>{const o={before:[],lines:[],after:[]},r=oc(i,l);Wn(o.before,ii(r.beforeLabel.call(this,l))),Wn(o.lines,r.label.call(this,l)),Wn(o.after,ii(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return lc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Wn(r,ii(s)),r=Wn(r,ii(l)),r=Wn(r,ii(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;a<u;++a)r.push(tS(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),at(r,f=>{const c=oc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(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=ll[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=nc(this,i),u=Object.assign({},r,a),f=ic(this.chart,i,u),c=sc(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}=ys(r),{x:d,y:h}=e,{width:m,height:g}=t;let b,y,k,$,C,M;return l==="center"?(C=h+g/2,s==="left"?(b=d,y=b-o,$=C+o,M=C-o):(b=d+m,y=b+o,$=C-o,M=C+o),k=b):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+m-Math.max(u,c)-o:y=this.caretX,l==="top"?($=h,C=$-o,b=y-o,k=y+o):($=h+g,C=$+o,b=y+o,k=y-o),M=$),{x1:b,x2:y,x3:k,y1:$,y2:C,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=dr(i.rtl,this.x,this.width);for(e.x=to(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=mn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<l;++a)t.fillText(s[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===l&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,s,l){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u,boxPadding:f}=l,c=mn(l.bodyFont),d=to(this,"left",l),h=s.x(d),m=a<c.lineHeight?(c.lineHeight-a)/2:0,g=t.y+m;if(l.usePointStyle){const b={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(h,u)+u/2,k=g+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,Xr(e,b,y,k),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Xr(e,b,y,k)}else{e.lineWidth=Ze(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(h,u-f),y=s.leftForLtr(s.xPlus(h,1),u-f-2),k=ys(o.borderRadius);Object.values(k).some($=>$!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Mo(e,{x:b,y:g,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Mo(e,{x:y,y:g+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,g,u,a),e.strokeRect(b,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,g+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=mn(i.bodyFont);let d=c.lineHeight,h=0;const m=dr(i.rtl,this.x,this.width),g=function(O){t.fillText(O,m.x(e.x+h),e.y+d/2),e.y+=d+l},b=m.textAlign(o);let y,k,$,C,M,T,E;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=to(this,b,i),t.fillStyle=i.bodyColor,at(this.beforeBody,g),h=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,T=s.length;C<T;++C){for(y=s[C],k=this.labelTextColors[C],t.fillStyle=k,at(y.before,g),$=y.lines,r&&$.length&&(this._drawColorBox(t,e,C,m,i),d=Math.max(c.lineHeight,a)),M=0,E=$.length;M<E;++M)g($[M]),d=c.lineHeight;at(y.after,g)}h=0,d=c.lineHeight,at(this.afterBody,g),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=dr(i.rtl,this.x,this.width);for(e.x=to(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=mn(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<l;++r)t.fillText(s[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:l,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:m}=ys(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-m),t.quadraticCurveTo(r+u,a+f,r+u-m,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+h,a+f),t.quadraticCurveTo(r,a+f,r,a+f-h),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,a),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ll[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=nc(this,e),a=Object.assign({},o,this._size),u=ic(t,e,a),f=sc(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=An(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),T2(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),M2(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=!ko(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||!ko(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;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=ll[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}sa.positioners=ll;var aS={id:"tooltip",_element:sa,positioners:ll,afterInit(n,e,t){t&&(n.tooltip=new sa({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)===!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:{beforeTitle:ti,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<i)return t[e.dataIndex]}return""},afterTitle:ti,beforeBody:ti,beforeLabel:ti,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return ot(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:ti,afterBody:ti,beforeFooter:ti,footer:ti,afterFooter:ti}},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"]};const uS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function fS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return uS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const cS=(n,e)=>n===null?null:Ut(Math.round(n),0,e);class la extends xi{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(ot(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:fS(i,e,xe(t,e),this._addedLabels),cS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}la.id="category";la.defaults={ticks:{callback:la.prototype.getLabelForValue}};function dS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,m=f-1,{min:g,max:b}=e,y=!ot(o),k=!ot(r),$=!ot(u),C=(b-g)/(c+1);let M=lf((b-g)/m/h)*h,T,E,O,I;if(M<1e-14&&!y&&!k)return[{value:g},{value:b}];I=Math.ceil(b/M)-Math.floor(g/M),I>m&&(M=lf(I*M/m/h)*h),ot(a)||(T=Math.pow(10,a),M=Math.ceil(M*T)/T),s==="ticks"?(E=Math.floor(g/M)*M,O=Math.ceil(b/M)*M):(E=g,O=b),y&&k&&l&&uy((r-o)/l,M/1e3)?(I=Math.round(Math.min((r-o)/M,f)),M=(r-o)/I,E=o,O=r):$?(E=y?o:E,O=k?r:O,I=u-1,M=(O-E)/I):(I=(O-E)/M,nl(I,Math.round(I),M/1e3)?I=Math.round(I):I=Math.ceil(I));const L=Math.max(of(M),of(E));T=Math.pow(10,ot(a)?L:a),E=Math.round(E*T)/T,O=Math.round(O*T)/T;let N=0;for(y&&(d&&E!==o?(t.push({value:o}),E<o&&N++,nl(Math.round((E+N*M)*T)/T,o,rc(o,C,n))&&N++):E<o&&N++);N<I;++N)t.push({value:Math.round((E+N*M)*T)/T});return k&&d&&O!==r?t.length&&nl(t[t.length-1].value,r,rc(r,C,n))?t[t.length-1].value=r:t.push({value:r}):(!k||O===r)&&t.push({value:O}),t}function rc(n,e,{horizontal:t,minRotation:i}){const s=Hn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class Io extends xi{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 ot(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=Jn(s),u=Jn(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=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=dS(s,l);return e.bounds==="ticks"&&l_(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 El(e,this.chart.options.locale,this.options.ticks.format)}}class Xa extends Io{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=$t(e)?e:0,this.max=$t(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Hn(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}}Xa.id="linear";Xa.defaults={ticks:{callback:Ko.formatters.numeric}};function ac(n){return n/Math.pow(10,Math.floor(Tn(n)))===1}function pS(n,e){const t=Math.floor(Tn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=wn(n.min,Math.pow(10,Math.floor(Tn(e.min)))),o=Math.floor(Tn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:ac(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o<t||o===t&&r<i);const u=wn(n.max,l);return s.push({value:u,major:ac(l)}),s}class X_ extends xi{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Io.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return $t(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=$t(e)?Math.max(0,e):null,this.max=$t(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(Tn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=pS(t,this);return e.bounds==="ticks"&&l_(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":El(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Tn(e),this._valueRange=Tn(this.max)-Tn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Tn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}X_.id="logarithmic";X_.defaults={ticks:{callback:Ko.formatters.logarithmic,major:{enabled:!0}}};function oa(n){const e=n.ticks;if(e.display&&n.display){const t=An(e.backdropPadding);return xe(e.font&&e.font.size,et.font.size)+t.height}return 0}function hS(n,e,t){return t=ht(t)?t:[t],{w:Vy(n,e.string,t),h:t.length*e.lineHeight}}function uc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:n<i||n>s?{start:e-t,end:e}:{start:e,end:e+t}}function mS(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?wt/l:0;for(let a=0;a<l;a++){const u=o.setContext(n.getPointLabelContext(a));s[a]=u.padding;const f=n.getPointPosition(a,n.drawingArea+s[a],r),c=mn(u.font),d=hS(n.ctx,c,n._pointLabels[a]);i[a]=d;const h=hn(n.getIndexAngle(a)+r),m=Math.round(Aa(h)),g=uc(m,f.x,d.w,0,180),b=uc(m,f.y,d.h,90,270);gS(t,e,h,g,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=_S(n,i,s)}function gS(n,e,t,i,s){const l=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));let r=0,a=0;i.start<e.l?(r=(e.l-i.start)/l,n.l=Math.min(n.l,e.l-r)):i.end>e.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.start<e.t?(a=(e.t-s.start)/o,n.t=Math.min(n.t,e.t-a)):s.end>e.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function _S(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=oa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?wt/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(Aa(hn(f.angle+vt))),d=e[u],h=yS(f.y,d.h,c),m=bS(c),g=vS(f.x,d.w,m);i.push({x:f.x,y:h,textAlign:m,left:g,top:h,right:g+d.w,bottom:h+d.h})}return i}function bS(n){return n===0||n===180?"center":n<180?"left":"right"}function vS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function yS(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function kS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=mn(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:m}=l;if(!ot(m)){const g=ys(l.borderRadius),b=An(l.backdropPadding);t.fillStyle=m;const y=f-b.left,k=c-b.top,$=d-f+b.width,C=h-c+b.height;Object.values(g).some(M=>M!==0)?(t.beginPath(),Mo(t,{x:y,y:k,w:$,h:C,radius:g}),t.fill()):t.fillRect(y,k,$,C)}To(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function Q_(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,ft);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o<i;o++)l=n.getPointPosition(o,e),s.lineTo(l.x,l.y)}}function wS(n,e,t,i){const s=n.ctx,l=e.circular,{color:o,lineWidth:r}=e;!l&&!i||!o||!r||t<0||(s.save(),s.strokeStyle=o,s.lineWidth=r,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),Q_(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function SS(n,e,t){return Ti(n,{label:t,index:e,type:"pointLabel"})}class Zo extends Io{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=An(oa(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=$t(e)&&!isNaN(e)?e:0,this.max=$t(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/oa(this.options))}generateTickLabels(e){Io.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=bt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?mS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=ft/(this._pointLabels.length||1),i=this.options.startAngle||0;return hn(e*t+Hn(i))}getDistanceFromCenterForValue(e){if(ot(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(ot(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return SS(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-vt+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:s,bottom:l}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:l}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),Q_(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:s}=t,l=this._pointLabels.length;let o,r,a;if(t.pointLabels.display&&kS(this,l),s.display&&this.ticks.forEach((u,f)=>{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));wS(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=mn(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=An(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}To(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Zo.id="radialLinear";Zo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ko.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Zo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Zo.descriptors={angleLines:{_fallback:"grid"}};const Go={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}},rn=Object.keys(Go);function $S(n,e){return n-e}function fc(n,e){if(ot(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)),$t(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ms(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function cc(n,e,t,i){const s=rn.length;for(let l=rn.indexOf(n);l<s-1;++l){const o=Go[rn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return rn[l]}return rn[s-1]}function CS(n,e,t,i,s){for(let l=rn.length-1;l>=rn.indexOf(t);l--){const o=rn[l];if(Go[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return rn[t?rn.indexOf(t):0]}function TS(n){for(let e=rn.indexOf(n)+1,t=rn.length;e<t;++e)if(Go[rn[e]].common)return rn[e]}function dc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Ia(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function MS(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 pc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o<l;++o)r=e[o],s[r]=o,i.push({value:r,major:!1});return l===0||!t?i:MS(n,i,s,t)}class Pl extends xi{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){const i=e.time||(e.time={}),s=this._adapter=new L_._date(e.adapters.date);s.init(t),tl(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:fc(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:s,max:l,minDefined:o,maxDefined:r}=this.getUserBounds();function a(u){!o&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!r&&!isNaN(u.max)&&(l=Math.max(l,u.max))}(!o||!r)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),s=$t(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=$t(l)&&!isNaN(l)?l:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,l-1),this.max=Math.max(s+1,l)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const l=this.min,o=this.max,r=py(s,l,o);return this._unit=t.unit||(i.autoSkip?cc(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):CS(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:TS(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),pc(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+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=Ut(t,0,o),i=Ut(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||cc(l.minUnit,t,i,this._getLabelCapacity(t)),r=xe(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ms(a)||a===!0,f={};let c=t,d,h;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 m=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;d<i;d=+e.add(d,r,o),h++)dc(f,d,m);return(d===i||s.bounds==="ticks"||h===1)&&dc(f,d,m),Object.keys(f).sort((g,b)=>g-b).map(g=>+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)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),m=l.ticks.callback;return m?bt(m,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,s=Hn(this.isHorizontal()?t.maxRotation:t.minRotation),l=Math.cos(s),o=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*l+r*o,h:i*o+r*l}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,l=this._tickFormatFunction(e,0,pc(this,[e],this._majorUnit),s),o=this._getLabelSize(l),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?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<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(fc(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return a_(e.sort($S))}}Pl.id="time";Pl.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function no(n,e,t){let i=0,s=n.length-1,l,o,r,a;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=zi(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}=zi(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 x_ extends Pl{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=no(t,this.min),this._tableRange=no(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<r;++o)u=e[o],u>=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;o<r;++o)f=s[o+1],a=s[o-1],u=s[o],Math.round((f+a)/2)!==u&&l.push({time:u,pos:o/(r-1)});return 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(no(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return no(this._table,i*this._tableRange+this._minPos,!0)}}x_.id="timeseries";x_.defaults=Pl.defaults;/*!
* chartjs-adapter-luxon v1.3.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const DS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};L_._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return DS},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=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.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()}});function hc(n){let e,t,i;return{c(){e=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{t||(t=qe(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,At,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function OS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=D(),s=U(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&re(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&re(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function ES(n){let e;return{c(){e=U("Loading...")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function AS(n){let e,t,i,s,l,o=n[2]&&hc();function r(f,c){return f[2]?ES:OS}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=D(),i=v("canvas"),s=D(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Ar(i,"height","250px"),Ar(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),_(e,t),_(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=hc(),o.c(),A(o,1),o.m(e,t)):o&&(de(),P(o,1,1,()=>{o=null}),pe()),c&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function IS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),he.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let m of h)r.push({x:new Date(m.date),y:m.total}),t(1,a+=m.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),he.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}un(()=>(Ao.register(Mi,Jo,Yo,Xa,Pl,eS,aS),t(6,o=new Ao(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){ie[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class PS extends ke{constructor(e){super(),ye(this,e,IS,AS,be,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var mc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ra={},LS={get exports(){return ra},set exports(n){ra=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function k($){return $ instanceof a?new a($.type,k($.content),$.alias):Array.isArray($)?$.map(k):$.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k($,C){C=C||{};var M,T;switch(r.util.type($)){case"Object":if(T=r.util.objId($),C[T])return C[T];M={},C[T]=M;for(var E in $)$.hasOwnProperty(E)&&(M[E]=k($[E],C));return M;case"Array":return T=r.util.objId($),C[T]?C[T]:(M=[],C[T]=M,$.forEach(function(O,I){M[I]=k(O,C)}),M);default:return $}},getLanguage:function(k){for(;k;){var $=s.exec(k.className);if($)return $[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,$){k.className=k.className.replace(RegExp(s,"gi"),""),k.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(k){var $=document.getElementsByTagName("script");for(var C in $)if($[C].src==k)return $[C]}return null}},isActive:function(k,$,C){for(var M="no-"+$;k;){var T=k.classList;if(T.contains($))return!0;if(T.contains(M))return!1;k=k.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(k,$){var C=r.util.clone(r.languages[k]);for(var M in $)C[M]=$[M];return C},insertBefore:function(k,$,C,M){M=M||r.languages;var T=M[k],E={};for(var O in T)if(T.hasOwnProperty(O)){if(O==$)for(var I in C)C.hasOwnProperty(I)&&(E[I]=C[I]);C.hasOwnProperty(O)||(E[O]=T[O])}var L=M[k];return M[k]=E,r.languages.DFS(r.languages,function(N,F){F===L&&N!=k&&(this[N]=E)}),E},DFS:function k($,C,M,T){T=T||{};var E=r.util.objId;for(var O in $)if($.hasOwnProperty(O)){C.call($,O,$[O],M||O);var I=$[O],L=r.util.type(I);L==="Object"&&!T[E(I)]?(T[E(I)]=!0,k(I,C,null,T)):L==="Array"&&!T[E(I)]&&(T[E(I)]=!0,k(I,C,O,T))}}},plugins:{},highlightAll:function(k,$){r.highlightAllUnder(document,k,$)},highlightAllUnder:function(k,$,C){var M={callback:C,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var T=0,E;E=M.elements[T++];)r.highlightElement(E,$===!0,M.callback)},highlightElement:function(k,$,C){var M=r.util.getLanguage(k),T=r.languages[M];r.util.setLanguage(k,M);var E=k.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=k.textContent,I={element:k,language:M,grammar:T,code:O};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),E=I.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if($&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(k,$,C){var M={code:k,grammar:$,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(k,$){var C=$.rest;if(C){for(var M in C)$[M]=C[M];delete $.rest}var T=new c;return d(T,T.head,k),f(k,T,$,T.head,0),m(T)},hooks:{all:{},add:function(k,$){var C=r.hooks.all;C[k]=C[k]||[],C[k].push($)},run:function(k,$){var C=r.hooks.all[k];if(!(!C||!C.length))for(var M=0,T;T=C[M++];)T($)}},Token:a};i.Prism=r;function a(k,$,C,M){this.type=k,this.content=$,this.alias=C,this.length=(M||"").length|0}a.stringify=function k($,C){if(typeof $=="string")return $;if(Array.isArray($)){var M="";return $.forEach(function(L){M+=k(L,C)}),M}var T={type:$.type,content:k($.content,C),tag:"span",classes:["token",$.type],attributes:{},language:C},E=$.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(T.classes,E):T.classes.push(E)),r.hooks.run("wrap",T);var O="";for(var I in T.attributes)O+=" "+I+'="'+(T.attributes[I]||"").replace(/"/g,"&quot;")+'"';return"<"+T.tag+' class="'+T.classes.join(" ")+'"'+O+">"+T.content+"</"+T.tag+">"};function u(k,$,C,M){k.lastIndex=$;var T=k.exec(C);if(T&&M&&T[1]){var E=T[1].length;T.index+=E,T[0]=T[0].slice(E)}return T}function f(k,$,C,M,T,E){for(var O in C)if(!(!C.hasOwnProperty(O)||!C[O])){var I=C[O];I=Array.isArray(I)?I:[I];for(var L=0;L<I.length;++L){if(E&&E.cause==O+","+L)return;var N=I[L],F=N.inside,V=!!N.lookbehind,G=!!N.greedy,se=N.alias;if(G&&!N.pattern.global){var K=N.pattern.toString().match(/[imsuy]*$/)[0];N.pattern=RegExp(N.pattern.source,K+"g")}for(var te=N.pattern||N,ne=M.next,z=T;ne!==$.tail&&!(E&&z>=E.reach);z+=ne.value.length,ne=ne.next){var Q=ne.value;if($.length>k.length)return;if(!(Q instanceof a)){var J=1,ae;if(G){if(ae=u(te,z,k,V),!ae||ae.index>=k.length)break;var Re=ae.index,He=ae.index+ae[0].length,Fe=z;for(Fe+=ne.value.length;Re>=Fe;)ne=ne.next,Fe+=ne.value.length;if(Fe-=ne.value.length,z=Fe,ne.value instanceof a)continue;for(var Ne=ne;Ne!==$.tail&&(Fe<He||typeof Ne.value=="string");Ne=Ne.next)J++,Fe+=Ne.value.length;J--,Q=k.slice(z,Fe),ae.index-=z}else if(ae=u(te,0,Q,V),!ae)continue;var Re=ae.index,ge=ae[0],Ce=Q.slice(0,Re),$e=Q.slice(Re+ge.length),Ye=z+Q.length;E&&Ye>E.reach&&(E.reach=Ye);var ze=ne.prev;Ce&&(ze=d($,ze,Ce),z+=Ce.length),h($,ze,J);var oe=new a(O,F?r.tokenize(ge,F):ge,se,ge);if(ne=d($,ze,oe),$e&&d($,ne,$e),J>1){var ue={cause:O+","+L,reach:Ye};f(k,$,C,ne.prev,z,ue),E&&ue.reach>E.reach&&(E.reach=ue.reach)}}}}}}function c(){var k={value:null,prev:null,next:null},$={value:null,prev:k,next:null};k.next=$,this.head=k,this.tail=$,this.length=0}function d(k,$,C){var M=$.next,T={value:C,prev:$,next:M};return $.next=T,M.prev=T,k.length++,T}function h(k,$,C){for(var M=$.next,T=0;T<C&&M!==k.tail;T++)M=M.next;$.next=M,M.prev=$,k.length-=T}function m(k){for(var $=[],C=k.head.next;C!==k.tail;)$.push(C.value),C=C.next;return $}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(k){var $=JSON.parse(k.data),C=$.language,M=$.code,T=$.immediateClose;i.postMessage(r.highlight(M,r.languages[C],C)),T&&i.close()},!1)),r;var g=r.util.currentScript();g&&(r.filename=g.src,g.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof mc<"u"&&(mc.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(g,b){return"✖ Error "+g+" while fetching file: "+b},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(g,b,y){var k=new XMLHttpRequest;k.open("GET",g,!0),k.onreadystatechange=function(){k.readyState==4&&(k.status<400&&k.responseText?b(k.responseText):k.status>=400?y(s(k.status,k.statusText)):y(l))},k.send(null)}function h(g){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(b){var y=Number(b[1]),k=b[2],$=b[3];return k?$?[y,Number($)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(g){g.selector+=", "+c}),t.hooks.add("before-sanity-check",function(g){var b=g.element;if(b.matches(c)){g.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var k=b.getAttribute("data-src"),$=g.language;if($==="none"){var C=(/\.(\w+)$/.exec(k)||[,"none"])[1];$=o[C]||C}t.util.setLanguage(y,$),t.util.setLanguage(b,$);var M=t.plugins.autoloader;M&&M.loadLanguages($),d(k,function(T){b.setAttribute(r,u);var E=h(b.getAttribute("data-range"));if(E){var O=T.split(/\r\n?|\n/g),I=E[0],L=E[1]==null?O.length:E[1];I<0&&(I+=O.length),I=Math.max(0,Math.min(I-1,O.length)),L<0&&(L+=O.length),L=Math.max(0,Math.min(L,O.length)),T=O.slice(I,L).join(`
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(I+1))}y.textContent=T,t.highlightElement(y)},function(T){b.setAttribute(r,f),y.textContent=T})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),k=0,$;$=y[k++];)t.highlightElement($)}};var m=!1;t.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(LS);const Js=ra;var gc={},NS={get exports(){return gc},set exports(n){gc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var h=s(f[d]);c+=h,c>r&&(f[d]=`
`+f[d],c=h)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",m="",g=!1,b=0;b<d.length;++b){var y=d[b];y==o.element?g=!0:y.nodeName==="#text"&&(g?m+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+m,o.code=r.normalize(o.code,o.settings);else{var k=h+o.element.innerHTML+m;o.element.innerHTML=r.normalize(k,o.settings),o.code=o.element.textContent}}}})})()})(NS);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function FS(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),_(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-10s5tkd")&&p(e,"class",i)},i:X,o:X,d(s){s&&w(e)}}}function RS(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class eb extends ke{constructor(e){super(),ye(this,e,RS,FS,be,{class:0,content:2,language:3})}}const HS=n=>({}),_c=n=>({}),jS=n=>({}),bc=n=>({});function vc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$=n[4]&&!n[2]&&yc(n);const C=n[19].header,M=Nt(C,n,n[18],bc);let T=n[4]&&n[2]&&kc(n);const E=n[19].default,O=Nt(E,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],_c);return{c(){e=v("div"),t=v("div"),s=D(),l=v("div"),o=v("div"),$&&$.c(),r=D(),M&&M.c(),a=D(),T&&T.c(),u=D(),f=v("div"),O&&O.c(),c=D(),d=v("div"),L&&L.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",h="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,F){S(N,e,F),_(e,t),_(e,s),_(e,l),_(l,o),$&&$.m(o,null),_(o,r),M&&M.m(o,null),_(o,a),T&&T.m(o,null),_(l,u),_(l,f),O&&O.m(f,null),n[21](f),_(l,c),_(l,d),L&&L.m(d,null),b=!0,y||(k=[Y(t,"click",ct(n[20])),Y(f,"scroll",n[22])],y=!0)},p(N,F){n=N,n[4]&&!n[2]?$?$.p(n,F):($=yc(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!b||F&262144)&&Rt(M,C,n,n[18],b?Ft(C,n[18],F,jS):Ht(n[18]),bc),n[4]&&n[2]?T?T.p(n,F):(T=kc(n),T.c(),T.m(o,null)):T&&(T.d(1),T=null),O&&O.p&&(!b||F&262144)&&Rt(O,E,n,n[18],b?Ft(E,n[18],F,null):Ht(n[18]),null),L&&L.p&&(!b||F&262144)&&Rt(L,I,n,n[18],b?Ft(I,n[18],F,HS):Ht(n[18]),_c),(!b||F&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),(!b||F&262)&&x(l,"popup",n[2]),(!b||F&4)&&x(e,"padded",n[2]),(!b||F&1)&&x(e,"active",n[0])},i(N){b||(tt(()=>{i||(i=qe(t,yo,{duration:hs,opacity:0},!0)),i.run(1)}),A(M,N),A(O,N),A(L,N),tt(()=>{g&&g.end(1),m=Ym(l,On,n[2]?{duration:hs,y:-10}:{duration:hs,x:50}),m.start()}),b=!0)},o(N){i||(i=qe(t,yo,{duration:hs,opacity:0},!1)),i.run(0),P(M,N),P(O,N),P(L,N),m&&m.invalidate(),g=Km(l,On,n[2]?{duration:hs,y:10}:{duration:hs,x:50}),b=!1},d(N){N&&w(e),N&&i&&i.end(),$&&$.d(),M&&M.d(N),T&&T.d(),O&&O.d(N),n[21](null),L&&L.d(N),N&&g&&g.end(),y=!1,Le(k)}}}function yc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=Y(e,"click",ct(n[5])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function kc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){S(s,e,l),t||(i=Y(e,"click",ct(n[5])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function qS(n){let e,t,i,s,l=n[0]&&vc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(o,r){S(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&1&&A(l,1)):(l=vc(o),l.c(),A(l,1),l.m(e,null)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,Le(s)}}}let Ri;function aa(){return Ri=Ri||document.querySelector(".overlays"),Ri||(Ri=document.createElement("div"),Ri.classList.add("overlays"),document.body.appendChild(Ri)),Ri}let hs=150;function wc(){return 1e3+aa().querySelectorAll(".overlay-panel-container.active").length}function VS(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 h=Ct();let m,g,b,y,k="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function M(){typeof d=="function"&&d()===!1||t(0,o=!1)}function T(){return o}async function E(K){t(17,$=K),K?(b=document.activeElement,m==null||m.focus(),h("show"),document.body.classList.add("overlay-active")):(clearTimeout(y),b==null||b.focus(),h("hide"),aa().querySelectorAll(".overlay-panel-container.active").length<=1&&document.body.classList.remove("overlay-active")),await In(),O()}function O(){m&&(o?t(6,m.style.zIndex=wc(),m):t(6,m.style="",m))}function I(K){o&&f&&K.code=="Escape"&&!B.isInput(K.target)&&m&&m.style.zIndex==wc()&&(K.preventDefault(),M())}function L(K){o&&N(g)}function N(K,te){te&&t(8,k=""),K&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!K)return;if(K.scrollHeight-K.offsetHeight>0)t(8,k="scrollable");else{t(8,k="");return}K.scrollTop==0?t(8,k+=" scroll-top-reached"):K.scrollTop+K.offsetHeight==K.scrollHeight&&t(8,k+=" scroll-bottom-reached")},100)))}un(()=>(aa().appendChild(m),()=>{var K;clearTimeout(y),(K=m==null?void 0:m.classList)==null||K.add("hidden"),setTimeout(()=>{m==null||m.remove()},0)}));const F=()=>a?M():!0;function V(K){ie[K?"unshift":"push"](()=>{g=K,t(7,g)})}const G=K=>N(K.target);function se(K){ie[K?"unshift":"push"](()=>{m=K,t(6,m)})}return n.$$set=K=>{"class"in K&&t(1,l=K.class),"active"in K&&t(0,o=K.active),"popup"in K&&t(2,r=K.popup),"overlayClose"in K&&t(3,a=K.overlayClose),"btnClose"in K&&t(4,u=K.btnClose),"escClose"in K&&t(12,f=K.escClose),"beforeOpen"in K&&t(13,c=K.beforeOpen),"beforeHide"in K&&t(14,d=K.beforeHide),"$$scope"in K&&t(18,s=K.$$scope)},n.$$.update=()=>{n.$$.dirty&131073&&$!=o&&E(o),n.$$.dirty&128&&N(g,!0),n.$$.dirty&64&&m&&O()},[o,l,r,a,u,M,m,g,k,I,L,N,f,c,d,C,T,$,s,i,F,V,G,se]}class Bn extends ke{constructor(e){super(),ye(this,e,VS,qS,be,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16})}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function zS(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function BS(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=U(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),_(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&re(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&w(e)}}}function US(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function WS(n){let e,t;return e=new eb({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.content=JSON.stringify(i[2].meta,null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function YS(n){var Ee;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,m,g=n[2].status+"",b,y,k,$,C,M,T=((Ee=n[2].method)==null?void 0:Ee.toUpperCase())+"",E,O,I,L,N,F,V=n[2].auth+"",G,se,K,te,ne,z,Q=n[2].url+"",J,ae,He,Fe,Ne,Re,ge,Ce,$e,Ye,ze,oe=n[2].remoteIp+"",ue,Z,ce,Se,_e,Je,nt=n[2].userIp+"",St,It,Vt,ut,xn,ui,ns=n[2].userAgent+"",is,Ll,fi,ss,Nl,Oi,ls,sn,Xe,os,ei,rs,Ei,Ai,jt,Gt;function Fl(Ae,Me){return Ae[2].referer?BS:zS}let R=Fl(n),W=R(n);const ee=[WS,US],le=[];function Te(Ae,Me){return Me&4&&(ls=null),ls==null&&(ls=!B.isEmpty(Ae[2].meta)),ls?0:1}return sn=Te(n,-1),Xe=le[sn]=ee[sn](n),jt=new Zi({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=D(),o=v("td"),a=U(r),u=D(),f=v("tr"),c=v("td"),c.textContent="Status",d=D(),h=v("td"),m=v("span"),b=U(g),y=D(),k=v("tr"),$=v("td"),$.textContent="Method",C=D(),M=v("td"),E=U(T),O=D(),I=v("tr"),L=v("td"),L.textContent="Auth",N=D(),F=v("td"),G=U(V),se=D(),K=v("tr"),te=v("td"),te.textContent="URL",ne=D(),z=v("td"),J=U(Q),ae=D(),He=v("tr"),Fe=v("td"),Fe.textContent="Referer",Ne=D(),Re=v("td"),W.c(),ge=D(),Ce=v("tr"),$e=v("td"),$e.textContent="Remote IP",Ye=D(),ze=v("td"),ue=U(oe),Z=D(),ce=v("tr"),Se=v("td"),Se.textContent="User IP",_e=D(),Je=v("td"),St=U(nt),It=D(),Vt=v("tr"),ut=v("td"),ut.textContent="UserAgent",xn=D(),ui=v("td"),is=U(ns),Ll=D(),fi=v("tr"),ss=v("td"),ss.textContent="Meta",Nl=D(),Oi=v("td"),Xe.c(),os=D(),ei=v("tr"),rs=v("td"),rs.textContent="Created",Ei=D(),Ai=v("td"),q(jt.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(m,"class","label"),x(m,"label-danger",n[2].status>=400),p($,"class","min-width txt-hint txt-bold"),p(L,"class","min-width txt-hint txt-bold"),p(te,"class","min-width txt-hint txt-bold"),p(Fe,"class","min-width txt-hint txt-bold"),p($e,"class","min-width txt-hint txt-bold"),p(Se,"class","min-width txt-hint txt-bold"),p(ut,"class","min-width txt-hint txt-bold"),p(ss,"class","min-width txt-hint txt-bold"),p(rs,"class","min-width txt-hint txt-bold"),p(e,"class","table-compact table-border")},m(Ae,Me){S(Ae,e,Me),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o),_(o,a),_(t,u),_(t,f),_(f,c),_(f,d),_(f,h),_(h,m),_(m,b),_(t,y),_(t,k),_(k,$),_(k,C),_(k,M),_(M,E),_(t,O),_(t,I),_(I,L),_(I,N),_(I,F),_(F,G),_(t,se),_(t,K),_(K,te),_(K,ne),_(K,z),_(z,J),_(t,ae),_(t,He),_(He,Fe),_(He,Ne),_(He,Re),W.m(Re,null),_(t,ge),_(t,Ce),_(Ce,$e),_(Ce,Ye),_(Ce,ze),_(ze,ue),_(t,Z),_(t,ce),_(ce,Se),_(ce,_e),_(ce,Je),_(Je,St),_(t,It),_(t,Vt),_(Vt,ut),_(Vt,xn),_(Vt,ui),_(ui,is),_(t,Ll),_(t,fi),_(fi,ss),_(fi,Nl),_(fi,Oi),le[sn].m(Oi,null),_(t,os),_(t,ei),_(ei,rs),_(ei,Ei),_(ei,Ai),H(jt,Ai,null),Gt=!0},p(Ae,Me){var Ve;(!Gt||Me&4)&&r!==(r=Ae[2].id+"")&&re(a,r),(!Gt||Me&4)&&g!==(g=Ae[2].status+"")&&re(b,g),(!Gt||Me&4)&&x(m,"label-danger",Ae[2].status>=400),(!Gt||Me&4)&&T!==(T=((Ve=Ae[2].method)==null?void 0:Ve.toUpperCase())+"")&&re(E,T),(!Gt||Me&4)&&V!==(V=Ae[2].auth+"")&&re(G,V),(!Gt||Me&4)&&Q!==(Q=Ae[2].url+"")&&re(J,Q),R===(R=Fl(Ae))&&W?W.p(Ae,Me):(W.d(1),W=R(Ae),W&&(W.c(),W.m(Re,null))),(!Gt||Me&4)&&oe!==(oe=Ae[2].remoteIp+"")&&re(ue,oe),(!Gt||Me&4)&&nt!==(nt=Ae[2].userIp+"")&&re(St,nt),(!Gt||Me&4)&&ns!==(ns=Ae[2].userAgent+"")&&re(is,ns);let Ue=sn;sn=Te(Ae,Me),sn===Ue?le[sn].p(Ae,Me):(de(),P(le[Ue],1,1,()=>{le[Ue]=null}),pe(),Xe=le[sn],Xe?Xe.p(Ae,Me):(Xe=le[sn]=ee[sn](Ae),Xe.c()),A(Xe,1),Xe.m(Oi,null));const Pe={};Me&4&&(Pe.date=Ae[2].created),jt.$set(Pe)},i(Ae){Gt||(A(Xe),A(jt.$$.fragment,Ae),Gt=!0)},o(Ae){P(Xe),P(jt.$$.fragment,Ae),Gt=!1},d(Ae){Ae&&w(e),W.d(),le[sn].d(),j(jt)}}}function KS(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function JS(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function ZS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[JS],header:[KS],default:[YS]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),j(e,s)}}}function GS(n,e,t){let i,s=new Fr;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){ie[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Be.call(this,n,c)}function f(c){Be.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class XS extends ke{constructor(e){super(),ye(this,e,GS,ZS,be,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function QS(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){S(u,e,f),e.checked=n[0],S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Sc(n){let e,t,i;function s(o){n[10](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new PS({props:l}),ie.push(()=>ve(e,"filter",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $c(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new Qv({props:l}),ie.push(()=>ve(e,"filter",s)),e.$on("select",n[12]),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k=n[3],$,C=n[3],M,T;r=new Da({}),r.$on("refresh",n[7]),d=new me({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[QS,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),m=new Uo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),m.$on("submit",n[9]);let E=Sc(n),O=$c(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=U(n[5]),o=D(),q(r.$$.fragment),a=D(),u=v("div"),f=D(),c=v("div"),q(d.$$.fragment),h=D(),q(m.$$.fragment),g=D(),b=v("div"),y=D(),E.c(),$=D(),O.c(),M=Oe(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(b,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,L){S(I,e,L),_(e,t),_(t,i),_(i,s),_(s,l),_(t,o),H(r,t,null),_(t,a),_(t,u),_(t,f),_(t,c),H(d,c,null),_(e,h),H(m,e,null),_(e,g),_(e,b),_(e,y),E.m(e,null),S(I,$,L),O.m(I,L),S(I,M,L),T=!0},p(I,L){(!T||L&32)&&re(l,I[5]);const N={};L&49153&&(N.$$scope={dirty:L,ctx:I}),d.$set(N);const F={};L&4&&(F.value=I[2]),m.$set(F),L&8&&be(k,k=I[3])?(de(),P(E,1,1,X),pe(),E=Sc(I),E.c(),A(E,1),E.m(e,null)):E.p(I,L),L&8&&be(C,C=I[3])?(de(),P(O,1,1,X),pe(),O=$c(I),O.c(),A(O,1),O.m(M.parentNode,M)):O.p(I,L)},i(I){T||(A(r.$$.fragment,I),A(d.$$.fragment,I),A(m.$$.fragment,I),A(E),A(O),T=!0)},o(I){P(r.$$.fragment,I),P(d.$$.fragment,I),P(m.$$.fragment,I),P(E),P(O),T=!1},d(I){I&&w(e),j(r),j(d),j(m),E.d(I),I&&w($),I&&w(M),O.d(I)}}}function e4(n){let e,t,i,s;e=new vn({props:{$$slots:{default:[xS]},$$scope:{ctx:n}}});let l={};return i=new XS({props:l}),n[13](i),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(o,r){H(e,o,r),S(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[13](null),j(i,o)}}}const Cc="includeAdminLogs";function t4(n,e,t){var y;let i,s;Ke(n,kt,k=>t(5,s=k)),Wt(kt,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem(Cc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=k=>t(2,o=k.detail);function h(k){o=k,t(2,o)}function m(k){o=k,t(2,o)}const g=k=>l==null?void 0:l.show(k==null?void 0:k.detail);function b(k){ie[k?"unshift":"push"](()=>{l=k,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(Cc,r<<0)},[r,l,o,a,i,s,u,f,c,d,h,m,g,b]}class n4 extends ke{constructor(e){super(),ye(this,e,t4,e4,be,{})}}const es=Pn([]),Si=Pn({}),Po=Pn(!1);function i4(n){es.update(e=>{const t=B.findByKey(e,"id",n);return t?Si.set(t):e.length&&Si.set(e[0]),e})}function s4(n){es.update(e=>(B.removeByKey(e,"id",n.id),Si.update(t=>t.id===n.id?e[0]:t),e))}async function tb(n=null){Po.set(!0);try{let e=await he.collections.getFullList(200,{sort:"+created"});e=B.sortCollections(e),es.set(e);const t=n&&B.findByKey(e,"id",n);t?Si.set(t):e.length&&Si.set(e[0])}catch(e){he.errorResponseHandler(e)}Po.set(!1)}const Qa=Pn({});function Dn(n,e,t){Qa.set({text:n,yesCallback:e,noCallback:t})}function nb(){Qa.set({})}function Tc(n){let e,t,i,s;const l=n[14].default,o=Nt(l,n,n[13],null);return{c(){e=v("div"),o&&o.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(r,a){S(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&8192)&&Rt(o,l,r,r[13],s?Ft(l,r[13],a,null):Ht(r[13]),null),(!s||a&2)&&p(e,"class",r[1]),(!s||a&3)&&x(e,"active",r[0])},i(r){s||(A(o,r),r&&tt(()=>{i&&i.end(1),t=Ym(e,On,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=Km(e,On,{duration:150,y:2})),s=!1},d(r){r&&w(e),o&&o.d(r),r&&i&&i.end()}}}function l4(n){let e,t,i,s,l=n[0]&&Tc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container")},m(o,r){S(o,e,r),l&&l.m(e,null),n[15](e),t=!0,i||(s=[Y(window,"click",n[3]),Y(window,"keydown",n[4]),Y(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Tc(o),l.c(),A(l,1),l.m(e,null)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[15](null),i=!1,Le(s)}}}function o4(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f,c;const d=Ct();function h(){t(0,o=!1)}function m(){t(0,o=!0)}function g(){o?h():m()}function b(I){return!f||I.classList.contains(a)||(c==null?void 0:c.contains(I))&&!f.contains(I)||f.contains(I)&&I.closest&&I.closest("."+a)}function y(I){(!o||b(I.target))&&(I.preventDefault(),I.stopPropagation(),g())}function k(I){(I.code==="Enter"||I.code==="Space")&&(!o||b(I.target))&&(I.preventDefault(),I.stopPropagation(),g())}function $(I){o&&!(f!=null&&f.contains(I.target))&&!(c!=null&&c.contains(I.target))&&h()}function C(I){o&&r&&I.code==="Escape"&&(I.preventDefault(),h())}function M(I){return $(I)}function T(I){E(),t(12,c=I||(f==null?void 0:f.parentNode)),c&&(f==null||f.addEventListener("click",y),c.addEventListener("click",y),c.addEventListener("keydown",k))}function E(){c&&(f==null||f.removeEventListener("click",y),c.removeEventListener("click",y),c.removeEventListener("keydown",k))}un(()=>(T(),()=>E()));function O(I){ie[I?"unshift":"push"](()=>{f=I,t(2,f)})}return n.$$set=I=>{"trigger"in I&&t(6,l=I.trigger),"active"in I&&t(0,o=I.active),"escClose"in I&&t(7,r=I.escClose),"closableClass"in I&&t(8,a=I.closableClass),"class"in I&&t(1,u=I.class),"$$scope"in I&&t(13,s=I.$$scope)},n.$$.update=()=>{var I,L;n.$$.dirty&68&&f&&T(l),n.$$.dirty&4097&&(o?((I=c==null?void 0:c.classList)==null||I.add("active"),d("show")):((L=c==null?void 0:c.classList)==null||L.remove("active"),d("hide")))},[o,u,f,$,C,M,l,r,a,h,m,g,c,s,i,O]}class Qn extends ke{constructor(e){super(),ye(this,e,o4,l4,be,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const r4=n=>({active:n&1}),Mc=n=>({active:n[0]});function Dc(n){let e,t,i;const s=n[15].default,l=Nt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Rt(l,s,o,o[14],i?Ft(s,o[14],r,null):Ht(o[14]),null)},i(o){i||(A(l,o),o&&tt(()=>{t||(t=qe(e,Et,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=qe(e,Et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function a4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Nt(a,n,n[14],Mc);let f=n[0]&&Dc(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=D(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),x(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){S(c,e,d),_(e,t),u&&u.m(t,null),_(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",ct(n[17])),Y(t,"drop",ct(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",ct(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Rt(u,a,c,c[14],l?Ft(a,c[14],d,r4):Ht(c[14]),Mc),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Dc(c),f.c(),A(f,1),f.m(e,null)):f&&(de(),P(f,1,1,()=>{f=null}),pe()),(!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||(A(u,c),A(f),l=!0)},o(c){P(u,c),P(f),l=!1},d(c){c&&w(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Le(r)}}}function u4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Ct();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function m(){return!!f}function g(){k(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?b():g()}function k(){if(d&&o.closest(".accordions")){const L=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of L)N.click()}}un(()=>()=>clearTimeout(r));function $(L){Be.call(this,n,L)}const C=()=>c&&y(),M=L=>{u&&(t(7,h=!1),k(),l("drop",L))},T=L=>u&&l("dragstart",L),E=L=>{u&&(t(7,h=!0),l("dragenter",L))},O=L=>{u&&(t(7,h=!1),l("dragleave",L))};function I(L){ie[L?"unshift":"push"](()=>{o=L,t(6,o)})}return n.$$set=L=>{"class"in L&&t(1,a=L.class),"draggable"in L&&t(2,u=L.draggable),"active"in L&&t(0,f=L.active),"interactive"in L&&t(3,c=L.interactive),"single"in L&&t(9,d=L.single),"$$scope"in L&&t(14,s=L.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o==null||o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&(o==null||o.scrollIntoView({behavior:"smooth",block:"nearest"}))},200)))},[f,a,u,c,y,k,o,h,l,d,m,g,b,r,s,i,$,C,M,T,E,O,I]}class ks extends ke{constructor(e){super(),ye(this,e,u4,a4,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]}}const f4=n=>({}),Oc=n=>({});function Ec(n,e,t){const i=n.slice();return i[46]=e[t],i}const c4=n=>({}),Ac=n=>({});function Ic(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function Pc(n){let e,t,i;return{c(){e=v("div"),t=U(n[2]),i=D(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5])},m(s,l){S(s,e,l),_(e,t),_(e,i)},p(s,l){l[0]&4&&re(t,s[2]),l[0]&32&&x(e,"link-hint",!s[5])},d(s){s&&w(e)}}}function d4(n){let e,t=n[46]+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&re(i,t)},i:X,o:X,d(s){s&&w(e)}}}function p4(n){let e,t,i;const s=[{item:n[46]},n[9]];var l=n[8];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Ge(a,s[u]);return{props:a}}return l&&(e=Yt(l,o())),{c(){e&&q(e.$$.fragment),t=Oe()},m(r,a){e&&H(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&513?nn(s,[a[0]&1&&{item:r[46]},a[0]&512&&Xn(r[9])]):{};if(l!==(l=r[8])){if(e){de();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),pe()}l?(e=Yt(l,o()),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Lc(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=v("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[Ie(We.call(null,e,"Clear")),Y(e,"click",bn(ct(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Le(i)}}}function Nc(n){let e,t,i,s,l,o;const r=[p4,d4],a=[];function u(c,d){return c[8]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[7])&&Lc(n);return{c(){e=v("div"),i.c(),s=D(),f&&f.c(),l=D(),p(e,"class","option")},m(c,d){S(c,e,d),a[t].m(e,null),_(e,s),f&&f.m(e,null),_(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(de(),P(a[h],1,1,()=>{a[h]=null}),pe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[7]?f?f.p(c,d):(f=Lc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){P(i),o=!1},d(c){c&&w(e),a[t].d(),f&&f.d()}}}function Fc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[g4]},$$scope:{ctx:n}};return e=new Qn({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&262144&&(o.trigger=s[18]),l[0]&1612874|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[39](null),j(e,s)}}}function Rc(n){let e,t,i,s,l,o,r,a,u=n[15].length&&Hc(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='<i class="ri-search-line"></i>',s=D(),l=v("input"),o=D(),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){S(f,e,c),_(e,t),_(t,i),_(t,s),_(t,l),fe(l,n[15]),_(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[36]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&32768&&l.value!==f[15]&&fe(l,f[15]),f[15].length?u?u.p(f,c):(u=Hc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&w(e),u&&u.d(),r=!1,a()}}}function Hc(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-close-line"></i>',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){S(l,e,o),_(e,t),i||(s=Y(t,"click",bn(ct(n[21]))),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function jc(n){let e,t=n[1]&&qc(n);return{c(){t&&t.c(),e=Oe()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=qc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function qc(n){let e,t;return{c(){e=v("div"),t=U(n[1]),p(e,"class","txt-missing")},m(i,s){S(i,e,s),_(e,t)},p(i,s){s[0]&2&&re(t,i[1])},d(i){i&&w(e)}}}function h4(n){let e=n[46]+"",t;return{c(){t=U(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&re(t,e)},i:X,o:X,d(i){i&&w(t)}}}function m4(n){let e,t,i;const s=[{item:n[46]},n[11]];var l=n[10];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Ge(a,s[u]);return{props:a}}return l&&(e=Yt(l,o())),{c(){e&&q(e.$$.fragment),t=Oe()},m(r,a){e&&H(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&1050624?nn(s,[a[0]&1048576&&{item:r[46]},a[0]&2048&&Xn(r[11])]):{};if(l!==(l=r[10])){if(e){de();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),pe()}l?(e=Yt(l,o()),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Vc(n){let e,t,i,s,l,o,r;const a=[m4,h4],u=[];function f(h,m){return h[10]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[37](n[46],...h)}function d(...h){return n[38](n[46],...h)}return{c(){e=v("div"),i.c(),s=D(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),x(e,"closable",n[6]),x(e,"selected",n[19](n[46]))},m(h,m){S(h,e,m),u[t].m(e,null),_(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(h,m){n=h;let g=t;t=f(n),t===g?u[t].p(n,m):(de(),P(u[g],1,1,()=>{u[g]=null}),pe(),i=u[t],i?i.p(n,m):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||m[0]&64)&&x(e,"closable",n[6]),(!l||m[0]&1572864)&&x(e,"selected",n[19](n[46]))},i(h){l||(A(i),l=!0)},o(h){P(i),l=!1},d(h){h&&w(e),u[t].d(),o=!1,Le(r)}}}function g4(n){let e,t,i,s,l,o=n[12]&&Rc(n);const r=n[33].beforeOptions,a=Nt(r,n,n[42],Ac);let u=n[20],f=[];for(let g=0;g<u.length;g+=1)f[g]=Vc(Ec(n,u,g));const c=g=>P(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=jc(n));const h=n[33].afterOptions,m=Nt(h,n,n[42],Oc);return{c(){o&&o.c(),e=D(),a&&a.c(),t=D(),i=v("div");for(let g=0;g<f.length;g+=1)f[g].c();d&&d.c(),s=D(),m&&m.c(),p(i,"class","options-list")},m(g,b){o&&o.m(g,b),S(g,e,b),a&&a.m(g,b),S(g,t,b),S(g,i,b);for(let y=0;y<f.length;y+=1)f[y].m(i,null);d&&d.m(i,null),S(g,s,b),m&&m.m(g,b),l=!0},p(g,b){if(g[12]?o?o.p(g,b):(o=Rc(g),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&2048)&&Rt(a,r,g,g[42],l?Ft(r,g[42],b,c4):Ht(g[42]),Ac),b[0]&14158914){u=g[20];let y;for(y=0;y<u.length;y+=1){const k=Ec(g,u,y);f[y]?(f[y].p(k,b),A(f[y],1)):(f[y]=Vc(k),f[y].c(),A(f[y],1),f[y].m(i,null))}for(de(),y=u.length;y<f.length;y+=1)c(y);pe(),!u.length&&d?d.p(g,b):u.length?d&&(d.d(1),d=null):(d=jc(g),d.c(),d.m(i,null))}m&&m.p&&(!l||b[1]&2048)&&Rt(m,h,g,g[42],l?Ft(h,g[42],b,f4):Ht(g[42]),Oc)},i(g){if(!l){A(a,g);for(let b=0;b<u.length;b+=1)A(f[b]);A(m,g),l=!0}},o(g){P(a,g),f=f.filter(Boolean);for(let b=0;b<f.length;b+=1)P(f[b]);P(m,g),l=!1},d(g){o&&o.d(g),g&&w(e),a&&a.d(g),g&&w(t),g&&w(i),yt(f,g),d&&d.d(),g&&w(s),m&&m.d(g)}}}function _4(n){let e,t,i,s,l,o,r=B.toArray(n[0]),a=[];for(let d=0;d<r.length;d+=1)a[d]=Nc(Ic(n,r,d));const u=d=>P(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Pc(n));let c=!n[5]&&Fc(n);return{c(){e=v("div"),t=v("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),s=D(),c&&c.c(),p(t,"tabindex",i=n[5]?"-1":"0"),p(t,"class","selected-container"),x(t,"disabled",n[5]),p(e,"class",l="select "+n[13]),x(e,"multiple",n[4]),x(e,"disabled",n[5])},m(d,h){S(d,e,h),_(e,t);for(let m=0;m<a.length;m+=1)a[m].m(t,null);f&&f.m(t,null),n[35](t),_(e,s),c&&c.m(e,null),n[41](e),o=!0},p(d,h){if(h[0]&17333){r=B.toArray(d[0]);let m;for(m=0;m<r.length;m+=1){const g=Ic(d,r,m);a[m]?(a[m].p(g,h),A(a[m],1)):(a[m]=Nc(g),a[m].c(),A(a[m],1),a[m].m(t,null))}for(de(),m=r.length;m<a.length;m+=1)u(m);pe(),!r.length&&f?f.p(d,h):r.length?f&&(f.d(1),f=null):(f=Pc(d),f.c(),f.m(t,null))}(!o||h[0]&32&&i!==(i=d[5]?"-1":"0"))&&p(t,"tabindex",i),(!o||h[0]&32)&&x(t,"disabled",d[5]),d[5]?c&&(de(),P(c,1,1,()=>{c=null}),pe()):c?(c.p(d,h),h[0]&32&&A(c,1)):(c=Fc(d),c.c(),A(c,1),c.m(e,null)),(!o||h[0]&8192&&l!==(l="select "+d[13]))&&p(e,"class",l),(!o||h[0]&8208)&&x(e,"multiple",d[4]),(!o||h[0]&8224)&&x(e,"disabled",d[5])},i(d){if(!o){for(let h=0;h<r.length;h+=1)A(a[h]);A(c),o=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)P(a[h]);P(c),o=!1},d(d){d&&w(e),yt(a,d),f&&f.d(),n[35](null),c&&c.d(),n[41](null)}}}function b4(n,e){let t=(""+e).replace(/\s+/g,"").toLowerCase(),i=n;try{typeof n=="object"&&n!==null&&(i=JSON.stringify(n))}catch{}return(""+i).replace(/\s+/g,"").toLowerCase().includes(t)}function v4(n,e,t){let i,s,{$$slots:l={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:c=[]}=e,{multiple:d=!1}=e,{disabled:h=!1}=e,{closable:m=!0}=e,{selected:g=d?[]:void 0}=e,{toggle:b=d}=e,{labelComponent:y=void 0}=e,{labelComponentProps:k={}}=e,{optionComponent:$=void 0}=e,{optionComponentProps:C={}}=e,{searchable:M=!1}=e,{searchFunc:T=void 0}=e,{class:E=""}=e,O,I="",L,N;function F(ue){if(B.isEmpty(g))return;let Z=B.toArray(g);B.inArray(Z,ue)&&(B.removeByValue(Z,ue),t(0,g=Z)),L==null||L.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function V(ue){if(d){let Z=B.toArray(g);B.inArray(Z,ue)||t(0,g=[...Z,ue])}else t(0,g=ue);L==null||L.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function G(ue){return s(ue)?F(ue):V(ue)}function se(){t(0,g=d?[]:void 0)}function K(){O!=null&&O.show&&(O==null||O.show())}function te(){O!=null&&O.hide&&(O==null||O.hide())}function ne(){if(B.isEmpty(g)||B.isEmpty(c))return;let ue=B.toArray(g),Z=[];for(const ce of ue)B.inArray(c,ce)||Z.push(ce);if(Z.length){for(const ce of Z)B.removeByValue(ue,ce);t(0,g=d?ue:ue[0])}}function z(){t(15,I="")}function Q(ue,Z){ue=ue||[];const ce=T||b4;return ue.filter(Se=>ce(Se,Z))||[]}function J(ue,Z){ue.preventDefault(),b&&d?G(Z):V(Z)}function ae(ue,Z){(ue.code==="Enter"||ue.code==="Space")&&J(ue,Z)}function He(){z(),setTimeout(()=>{const ue=L==null?void 0:L.querySelector(".dropdown-item.option.selected");ue&&(ue.focus(),ue.scrollIntoView({block:"nearest"}))},0)}function Fe(ue){ue.stopPropagation(),!h&&(O==null||O.toggle())}un(()=>{const ue=document.querySelectorAll(`label[for="${r}"]`);for(const Z of ue)Z.addEventListener("click",Fe);return()=>{for(const Z of ue)Z.removeEventListener("click",Fe)}});const Ne=ue=>F(ue);function Re(ue){ie[ue?"unshift":"push"](()=>{N=ue,t(18,N)})}function ge(){I=this.value,t(15,I)}const Ce=(ue,Z)=>J(Z,ue),$e=(ue,Z)=>ae(Z,ue);function Ye(ue){ie[ue?"unshift":"push"](()=>{O=ue,t(16,O)})}function ze(ue){Be.call(this,n,ue)}function oe(ue){ie[ue?"unshift":"push"](()=>{L=ue,t(17,L)})}return n.$$set=ue=>{"id"in ue&&t(25,r=ue.id),"noOptionsText"in ue&&t(1,a=ue.noOptionsText),"selectPlaceholder"in ue&&t(2,u=ue.selectPlaceholder),"searchPlaceholder"in ue&&t(3,f=ue.searchPlaceholder),"items"in ue&&t(26,c=ue.items),"multiple"in ue&&t(4,d=ue.multiple),"disabled"in ue&&t(5,h=ue.disabled),"closable"in ue&&t(6,m=ue.closable),"selected"in ue&&t(0,g=ue.selected),"toggle"in ue&&t(7,b=ue.toggle),"labelComponent"in ue&&t(8,y=ue.labelComponent),"labelComponentProps"in ue&&t(9,k=ue.labelComponentProps),"optionComponent"in ue&&t(10,$=ue.optionComponent),"optionComponentProps"in ue&&t(11,C=ue.optionComponentProps),"searchable"in ue&&t(12,M=ue.searchable),"searchFunc"in ue&&t(27,T=ue.searchFunc),"class"in ue&&t(13,E=ue.class),"$$scope"in ue&&t(42,o=ue.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&c&&(ne(),z()),n.$$.dirty[0]&67141632&&t(20,i=Q(c,I)),n.$$.dirty[0]&1&&t(19,s=function(ue){const Z=B.toArray(g);return B.inArray(Z,ue)})},[g,a,u,f,d,h,m,b,y,k,$,C,M,E,F,I,O,L,N,s,i,z,J,ae,He,r,c,T,V,G,se,K,te,l,Ne,Re,ge,Ce,$e,Ye,ze,oe,o]}class xa extends ke{constructor(e){super(),ye(this,e,v4,_4,be,{id:25,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:26,multiple:4,disabled:5,closable:6,selected:0,toggle:7,labelComponent:8,labelComponentProps:9,optionComponent:10,optionComponentProps:11,searchable:12,searchFunc:27,class:13,deselectItem:14,selectItem:28,toggleItem:29,reset:30,showDropdown:31,hideDropdown:32},null,[-1,-1])}get deselectItem(){return this.$$.ctx[14]}get selectItem(){return this.$$.ctx[28]}get toggleItem(){return this.$$.ctx[29]}get reset(){return this.$$.ctx[30]}get showDropdown(){return this.$$.ctx[31]}get hideDropdown(){return this.$$.ctx[32]}}function zc(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&w(e)}}}function y4(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&&zc(n);return{c(){l&&l.c(),e=D(),t=v("span"),s=U(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),_(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=zc(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)+"")&&re(s,i)},i:X,o:X,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function k4(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Bc extends ke{constructor(e){super(),ye(this,e,k4,y4,be,{item:0})}}const w4=n=>({}),Uc=n=>({});function S4(n){let e;const t=n[8].afterOptions,i=Nt(t,n,n[12],Uc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Rt(i,t,s,s[12],e?Ft(t,s[12],l,w4):Ht(s[12]),Uc)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function $4(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:[S4]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Ge(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new xa({props:o}),ie.push(()=>ve(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){q(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&62?nn(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Xn(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],we(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function C4(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Ot(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Bc}=e,{optionComponent:c=Bc}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function m($){$=B.toArray($,!0);let C=[];for(let M of $){const T=B.findByKey(r,d,M);T&&C.push(T)}$.length&&!C.length||t(0,u=a?C:C[0])}async function g($){let C=B.toArray($,!0).map(M=>M[d]);r.length&&t(6,h=a?C:C[0])}function b($){u=$,t(0,u)}function y($){Be.call(this,n,$)}function k($){Be.call(this,n,$)}return n.$$set=$=>{e=Ge(Ge({},e),Gn($)),t(5,s=Ot(e,i)),"items"in $&&t(1,r=$.items),"multiple"in $&&t(2,a=$.multiple),"selected"in $&&t(0,u=$.selected),"labelComponent"in $&&t(3,f=$.labelComponent),"optionComponent"in $&&t(4,c=$.optionComponent),"selectionKey"in $&&t(7,d=$.selectionKey),"keyOfSelected"in $&&t(6,h=$.keyOfSelected),"$$scope"in $&&t(12,o=$.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&m(h),n.$$.dirty&1&&g(u)},[u,r,a,f,c,s,h,d,l,b,y,k,o]}class Ns extends ke{constructor(e){super(),ye(this,e,C4,$4,be,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function T4(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;r<s.length;r+=1)o=Ge(o,s[r]);return n[0]!==void 0&&(o.keyOfSelected=n[0]),e=new Ns({props:o}),ie.push(()=>ve(e,"keyOfSelected",l)),{c(){q(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&14?nn(s,[a&2&&{class:"field-type-select "+r[1]},a&4&&{items:r[2]},a&8&&Xn(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],we(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function M4(n,e,t){const i=["value","class"];let s=Ot(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Plain text",value:"text",icon:B.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:B.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:B.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:B.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:B.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:B.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:B.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:B.getFieldTypeIcon("select")},{label:"File",value:"file",icon:B.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:B.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:B.getFieldTypeIcon("json")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=Ge(Ge({},e),Gn(u)),t(3,s=Ot(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class D4 extends ke{constructor(e){super(),ye(this,e,M4,T4,be,{value:0,class:1})}}function O4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min length"),s=D(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].min),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].min&&fe(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function E4(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max length"),s=D(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){S(f,e,c),_(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].max),a||(u=Y(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].max&&fe(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function A4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Regex pattern"),s=D(),l=v("input"),r=D(),a=v("div"),a.innerHTML="Valid Go regular expression, eg. <code>^\\w+$</code>.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),fe(l,n[0].pattern),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&fe(l,c[0].pattern)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function I4(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[O4,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[E4,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[A4,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){S(c,e,d),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),H(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&97&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const m={};d&2&&(m.name="schema."+c[1]+".options.max"),d&97&&(m.$$scope={dirty:d,ctx:c}),o.$set(m);const g={};d&2&&(g.name="schema."+c[1]+".options.pattern"),d&97&&(g.$$scope={dirty:d,ctx:c}),u.$set(g)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&w(e),j(i),j(o),j(u)}}}function P4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=dt(this.value),t(0,s)}function o(){s.max=dt(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class L4 extends ke{constructor(e){super(),ye(this,e,P4,I4,be,{key:1,options:0})}}function N4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min"),s=D(),l=v("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].min),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].min&&fe(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function F4(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max"),s=D(),l=v("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){S(f,e,c),_(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].max),a||(u=Y(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].max&&fe(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function R4(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[N4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[F4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function H4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=dt(this.value),t(0,s)}function o(){s.max=dt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class j4 extends ke{constructor(e){super(),ye(this,e,H4,R4,be,{key:1,options:0})}}function q4(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class V4 extends ke{constructor(e){super(),ye(this,e,q4,null,be,{key:0,options:1})}}function z4(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r<l.length;r+=1)o=Ge(o,l[r]);return{c(){e=v("input"),Zn(e,o)},m(r,a){S(r,e,a),e.value=o.value,e.autofocus&&e.focus(),i||(s=Y(e,"input",n[4]),i=!0)},p(r,[a]){Zn(e,o=nn(l,[a&8&&t!==(t=r[3].type||"text")&&{type:t},a&4&&e.value!==r[2]&&{value:r[2]},a&8&&r[3]])),"value"in o&&(e.value=o.value)},i:X,o:X,d(r){r&&w(e),i=!1,s()}}}function B4(n,e,t){let i;const s=["value","separator"];let l=Ot(e,s),{value:o=[]}=e,{separator:r=","}=e;const a=u=>{t(0,o=B.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=Ge(Ge({},e),Gn(u)),t(3,l=Ot(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(", "))},[o,r,i,l,a]}class ts extends ke{constructor(e){super(),ye(this,e,B4,z4,be,{value:0,separator:1})}}function U4(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[2](b)}let g={id:n[4],disabled:!B.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new ts({props:g}),ie.push(()=>ve(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]),p(f,"class","help-block")},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),H(r,b,y),S(b,u,y),S(b,f,y),c=!0,d||(h=Ie(We.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(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const k={};y&16&&(k.id=b[4]),y&1&&(k.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,k.value=b[0].exceptDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function W4(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[3](b)}let g={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ts({props:g}),ie.push(()=>ve(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),H(r,b,y),S(b,u,y),S(b,f,y),c=!0,d||(h=Ie(We.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(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const k={};y&16&&(k.id=b[4]+".options.onlyDomains"),y&1&&(k.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,k.value=b[0].onlyDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function Y4(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[U4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[W4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function K4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class ib extends ke{constructor(e){super(),ye(this,e,K4,Y4,be,{key:1,options:0})}}function J4(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new ib({props:r}),ie.push(()=>ve(e,"key",l)),ie.push(()=>ve(e,"options",o)),{c(){q(e.$$.fragment)},m(a,u){H(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],we(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],we(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function Z4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class G4 extends ke{constructor(e){super(),ye(this,e,Z4,J4,be,{key:0,options:1})}}function X4(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class Q4 extends ke{constructor(e){super(),ye(this,e,X4,null,be,{key:0,options:1})}}var wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},_l={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},ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Sn=function(n){return n===!0?1:0};function Wc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Sr=function(n){return n instanceof Array?n:[n]};function Xt(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function lt(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 io(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function sb(n,e){if(e(n))return n;if(n.parentNode)return sb(n.parentNode,e)}function so(n,e){var t=lt("div","numInputWrapper"),i=lt("input","numInput "+n),s=lt("span","arrowUp"),l=lt("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 dn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var $r=function(){},Lo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},x4={D:$r,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*Sn(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:$r,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:$r,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Vi={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})"},ol={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ol.w(n,e,t)]},F:function(n,e,t){return Lo(ol.n(n,e,t)-1,!1,e)},G:function(n,e,t){return ln(ol.h(n,e,t))},H:function(n){return ln(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[Sn(n.getHours()>11)]},M:function(n,e){return Lo(n.getMonth(),!0,e)},S:function(n){return ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return ln(n.getFullYear(),4)},d:function(n){return ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return ln(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)}},lb=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?_l: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,h){return ol[c]&&h[d-1]!=="\\"?ol[c](r,f,t):c!=="\\"?c:""}).join("")}},ua=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?_l: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||ws).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var m=void 0,g=[],b=0,y=0,k="";b<d.length;b++){var $=d[b],C=$==="\\",M=d[b-1]==="\\"||C;if(Vi[$]&&!M){k+=Vi[$];var T=new RegExp(k).exec(l);T&&(m=!0)&&g[$!=="Y"?"push":"unshift"]({fn:x4[$],val:T[++y]})}else C||(k+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),g.forEach(function(E){var O=E.fn,I=E.val;return f=O(f,I,u)||f}),f=m?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function pn(n,e,t){return t===void 0&&(t=!0),t!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var e$=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Cr=function(n,e,t){return n*3600+e*60+t},t$=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},n$={DAY:864e5};function Tr(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var s=n.minDate.getHours(),l=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<s&&(e=s),e===s&&t<l&&(t=l),e===s&&t===l&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},s=0,l=e;s<l.length;s++){var o=l[s];i(o)}return n});var zt=globalThis&&globalThis.__assign||function(){return zt=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},zt.apply(this,arguments)},Yc=globalThis&&globalThis.__spreadArrays||function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),s=0,e=0;e<t;e++)for(var l=arguments[e],o=0,r=l.length;o<r;o++,s++)i[s]=l[o];return i},i$=300;function s$(n,e){var t={config:zt(zt({},ws),Dt.defaultConfig),l10n:_l};t.parseDate=ua({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=d,t._positionCalendar=nt,t.changeMonth=J,t.changeYear=ge,t.clear=ae,t.close=He,t.onMouseOver=oe,t._createElement=lt,t.createDay=T,t.destroy=Fe,t.isEnabled=Ce,t.jumpToDate=k,t.updateValue=jt,t.open=Z,t.redraw=Vt,t.set=ns,t.setDate=Ll,t.toggle=sn;function i(){t.utils={getDaysInMonth:function(R,W){return R===void 0&&(R=t.currentMonth),W===void 0&&(W=t.currentYear),R===1&&(W%4===0&&W%100!==0||W%400===0)?29:t.l10n.daysInMonth[R]}}}function s(){t.element=t.input=n,t.isOpen=!1,Se(),Je(),Nl(),ss(),i(),t.isMobile||M(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),jt(!1)),r();var R=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&R&&nt(),Xe("onReady")}function l(){var R;return((R=t.calendarContainer)===null||R===void 0?void 0:R.getRootNode()).activeElement||document.activeElement}function o(R){return R.bind(t)}function r(){var R=t.config;R.weekNumbers===!1&&R.showMonths===1||R.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var W=(t.days.offsetWidth+1)*R.showMonths;t.daysContainer.style.width=W+"px",t.calendarContainer.style.width=W+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(R){if(t.selectedDates.length===0){var W=t.config.minDate===void 0||pn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),ee=Tr(t.config);W.setHours(ee.hours,ee.minutes,ee.seconds,W.getMilliseconds()),t.selectedDates=[W],t.latestSelectedDateObj=W}R!==void 0&&R.type!=="blur"&&Fl(R);var le=t._input.value;c(),jt(),t._input.value!==le&&t._debouncedChange()}function u(R,W){return R%12+12*Sn(W===t.l10n.amPM[1])}function f(R){switch(R%24){case 0:case 12:return 12;default:return R%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var R=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,W=(parseInt(t.minuteElement.value,10)||0)%60,ee=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(R=u(R,t.amPM.textContent));var le=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&pn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&pn(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 Ee=Cr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ae=Cr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Me=Cr(R,W,ee);if(Me>Ae&&Me<Ee){var Ue=t$(Ee);R=Ue[0],W=Ue[1],ee=Ue[2]}}else{if(Te){var Pe=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;R=Math.min(R,Pe.getHours()),R===Pe.getHours()&&(W=Math.min(W,Pe.getMinutes())),W===Pe.getMinutes()&&(ee=Math.min(ee,Pe.getSeconds()))}if(le){var Ve=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;R=Math.max(R,Ve.getHours()),R===Ve.getHours()&&W<Ve.getMinutes()&&(W=Ve.getMinutes()),W===Ve.getMinutes()&&(ee=Math.max(ee,Ve.getSeconds()))}}h(R,W,ee)}}function d(R){var W=R||t.latestSelectedDateObj;W&&W instanceof Date&&h(W.getHours(),W.getMinutes(),W.getSeconds())}function h(R,W,ee){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(R%24,W,ee||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=ln(t.config.time_24hr?R:(12+R)%12+12*Sn(R%12===0)),t.minuteElement.value=ln(W),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Sn(R>=12)]),t.secondElement!==void 0&&(t.secondElement.value=ln(ee)))}function m(R){var W=dn(R),ee=parseInt(W.value)+(R.delta||0);(ee/1e3>1||R.key==="Enter"&&!/[^\d]/.test(ee.toString()))&&ge(ee)}function g(R,W,ee,le){if(W instanceof Array)return W.forEach(function(Te){return g(R,Te,ee,le)});if(R instanceof Array)return R.forEach(function(Te){return g(Te,W,ee,le)});R.addEventListener(W,ee,le),t._handlers.push({remove:function(){return R.removeEventListener(W,ee,le)}})}function b(){Xe("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ee){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ee+"]"),function(le){return g(le,"click",t[ee])})}),t.isMobile){ls();return}var R=Wc(ue,50);if(t._debouncedChange=Wc(b,i$),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(ee){t.config.mode==="range"&&oe(dn(ee))}),g(t._input,"keydown",ze),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",ze),!t.config.inline&&!t.config.static&&g(window,"resize",R),window.ontouchstart!==void 0?g(window.document,"touchstart",Re):g(window.document,"mousedown",Re),g(window.document,"focus",Re,{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",Gt),g(t.monthNav,["keyup","increment"],m),g(t.daysContainer,"click",xn)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var W=function(ee){return dn(ee).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",$),g([t.hourElement,t.minuteElement],["focus","click"],W),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(ee){a(ee)})}t.config.allowInput&&g(t._input,"blur",Ye)}function k(R,W){var ee=R!==void 0?t.parseDate(R):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),le=t.currentYear,Te=t.currentMonth;try{ee!==void 0&&(t.currentYear=ee.getFullYear(),t.currentMonth=ee.getMonth())}catch(Ee){Ee.message="Invalid date supplied: "+ee,t.config.errorHandler(Ee)}W&&t.currentYear!==le&&(Xe("onYearChange"),V()),W&&(t.currentYear!==le||t.currentMonth!==Te)&&Xe("onMonthChange"),t.redraw()}function $(R){var W=dn(R);~W.className.indexOf("arrow")&&C(R,W.classList.contains("arrowUp")?1:-1)}function C(R,W,ee){var le=R&&dn(R),Te=ee||le&&le.parentNode&&le.parentNode.firstChild,Ee=os("increment");Ee.delta=W,Te&&Te.dispatchEvent(Ee)}function M(){var R=window.document.createDocumentFragment();if(t.calendarContainer=lt("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(R.appendChild(K()),t.innerContainer=lt("div","flatpickr-innerContainer"),t.config.weekNumbers){var W=Q(),ee=W.weekWrapper,le=W.weekNumbers;t.innerContainer.appendChild(ee),t.weekNumbers=le,t.weekWrapper=ee}t.rContainer=lt("div","flatpickr-rContainer"),t.rContainer.appendChild(ne()),t.daysContainer||(t.daysContainer=lt("div","flatpickr-days"),t.daysContainer.tabIndex=-1),F(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),R.appendChild(t.innerContainer)}t.config.enableTime&&R.appendChild(te()),Xt(t.calendarContainer,"rangeMode",t.config.mode==="range"),Xt(t.calendarContainer,"animate",t.config.animate===!0),Xt(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(R);var Te=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&&(!Te&&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 Ee=lt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ee,t.element),Ee.appendChild(t.element),t.altInput&&Ee.appendChild(t.altInput),Ee.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function T(R,W,ee,le){var Te=Ce(W,!0),Ee=lt("span",R,W.getDate().toString());return Ee.dateObj=W,Ee.$i=le,Ee.setAttribute("aria-label",t.formatDate(W,t.config.ariaDateFormat)),R.indexOf("hidden")===-1&&pn(W,t.now)===0&&(t.todayDateElem=Ee,Ee.classList.add("today"),Ee.setAttribute("aria-current","date")),Te?(Ee.tabIndex=-1,ei(W)&&(Ee.classList.add("selected"),t.selectedDateElem=Ee,t.config.mode==="range"&&(Xt(Ee,"startRange",t.selectedDates[0]&&pn(W,t.selectedDates[0],!0)===0),Xt(Ee,"endRange",t.selectedDates[1]&&pn(W,t.selectedDates[1],!0)===0),R==="nextMonthDay"&&Ee.classList.add("inRange")))):Ee.classList.add("flatpickr-disabled"),t.config.mode==="range"&&rs(W)&&!ei(W)&&Ee.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&R!=="prevMonthDay"&&le%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(W)+"</span>"),Xe("onDayCreate",Ee),Ee}function E(R){R.focus(),t.config.mode==="range"&&oe(R)}function O(R){for(var W=R>0?0:t.config.showMonths-1,ee=R>0?t.config.showMonths:-1,le=W;le!=ee;le+=R)for(var Te=t.daysContainer.children[le],Ee=R>0?0:Te.children.length-1,Ae=R>0?Te.children.length:-1,Me=Ee;Me!=Ae;Me+=R){var Ue=Te.children[Me];if(Ue.className.indexOf("hidden")===-1&&Ce(Ue.dateObj))return Ue}}function I(R,W){for(var ee=R.className.indexOf("Month")===-1?R.dateObj.getMonth():t.currentMonth,le=W>0?t.config.showMonths:-1,Te=W>0?1:-1,Ee=ee-t.currentMonth;Ee!=le;Ee+=Te)for(var Ae=t.daysContainer.children[Ee],Me=ee-t.currentMonth===Ee?R.$i+W:W<0?Ae.children.length-1:0,Ue=Ae.children.length,Pe=Me;Pe>=0&&Pe<Ue&&Pe!=(W>0?Ue:-1);Pe+=Te){var Ve=Ae.children[Pe];if(Ve.className.indexOf("hidden")===-1&&Ce(Ve.dateObj)&&Math.abs(R.$i-Pe)>=Math.abs(W))return E(Ve)}t.changeMonth(Te),L(O(Te),0)}function L(R,W){var ee=l(),le=$e(ee||document.body),Te=R!==void 0?R:le?ee:t.selectedDateElem!==void 0&&$e(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&$e(t.todayDateElem)?t.todayDateElem:O(W>0?1:-1);Te===void 0?t._input.focus():le?I(Te,W):E(Te)}function N(R,W){for(var ee=(new Date(R,W,1).getDay()-t.l10n.firstDayOfWeek+7)%7,le=t.utils.getDaysInMonth((W-1+12)%12,R),Te=t.utils.getDaysInMonth(W,R),Ee=window.document.createDocumentFragment(),Ae=t.config.showMonths>1,Me=Ae?"prevMonthDay hidden":"prevMonthDay",Ue=Ae?"nextMonthDay hidden":"nextMonthDay",Pe=le+1-ee,Ve=0;Pe<=le;Pe++,Ve++)Ee.appendChild(T("flatpickr-day "+Me,new Date(R,W-1,Pe),Pe,Ve));for(Pe=1;Pe<=Te;Pe++,Ve++)Ee.appendChild(T("flatpickr-day",new Date(R,W,Pe),Pe,Ve));for(var pt=Te+1;pt<=42-ee&&(t.config.showMonths===1||Ve%7!==0);pt++,Ve++)Ee.appendChild(T("flatpickr-day "+Ue,new Date(R,W+1,pt%Te),pt,Ve));var Un=lt("div","dayContainer");return Un.appendChild(Ee),Un}function F(){if(t.daysContainer!==void 0){io(t.daysContainer),t.weekNumbers&&io(t.weekNumbers);for(var R=document.createDocumentFragment(),W=0;W<t.config.showMonths;W++){var ee=new Date(t.currentYear,t.currentMonth,1);ee.setMonth(t.currentMonth+W),R.appendChild(N(ee.getFullYear(),ee.getMonth()))}t.daysContainer.appendChild(R),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&oe()}}function V(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var R=function(le){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&le<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&le>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var W=0;W<12;W++)if(R(W)){var ee=lt("option","flatpickr-monthDropdown-month");ee.value=new Date(t.currentYear,W).getMonth().toString(),ee.textContent=Lo(W,t.config.shorthandCurrentMonth,t.l10n),ee.tabIndex=-1,t.currentMonth===W&&(ee.selected=!0),t.monthsDropdownContainer.appendChild(ee)}}}function G(){var R=lt("div","flatpickr-month"),W=window.document.createDocumentFragment(),ee;t.config.showMonths>1||t.config.monthSelectorType==="static"?ee=lt("span","cur-month"):(t.monthsDropdownContainer=lt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Ae){var Me=dn(Ae),Ue=parseInt(Me.value,10);t.changeMonth(Ue-t.currentMonth),Xe("onMonthChange")}),V(),ee=t.monthsDropdownContainer);var le=so("cur-year",{tabindex:"-1"}),Te=le.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ee=lt("div","flatpickr-current-month");return Ee.appendChild(ee),Ee.appendChild(le),W.appendChild(Ee),R.appendChild(W),{container:R,yearElement:Te,monthElement:ee}}function se(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var R=t.config.showMonths;R--;){var W=G();t.yearElements.push(W.yearElement),t.monthElements.push(W.monthElement),t.monthNav.appendChild(W.container)}t.monthNav.appendChild(t.nextMonthNav)}function K(){return t.monthNav=lt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=lt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=lt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,se(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(R){t.__hidePrevMonthArrow!==R&&(Xt(t.prevMonthNav,"flatpickr-disabled",R),t.__hidePrevMonthArrow=R)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(R){t.__hideNextMonthArrow!==R&&(Xt(t.nextMonthNav,"flatpickr-disabled",R),t.__hideNextMonthArrow=R)}}),t.currentYearElement=t.yearElements[0],Ei(),t.monthNav}function te(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var R=Tr(t.config);t.timeContainer=lt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var W=lt("span","flatpickr-time-separator",":"),ee=so("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ee.getElementsByTagName("input")[0];var le=so("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=le.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?R.hours:f(R.hours)),t.minuteElement.value=ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():R.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(ee),t.timeContainer.appendChild(W),t.timeContainer.appendChild(le),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=so("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():R.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(lt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=lt("span","flatpickr-am-pm",t.l10n.amPM[Sn((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 ne(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=lt("div","flatpickr-weekdays");for(var R=t.config.showMonths;R--;){var W=lt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(W)}return z(),t.weekdayContainer}function z(){if(t.weekdayContainer){var R=t.l10n.firstDayOfWeek,W=Yc(t.l10n.weekdays.shorthand);R>0&&R<W.length&&(W=Yc(W.splice(R,W.length),W.splice(0,R)));for(var ee=t.config.showMonths;ee--;)t.weekdayContainer.children[ee].innerHTML=`
<span class='flatpickr-weekday'>
`+W.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function Q(){t.calendarContainer.classList.add("hasWeeks");var R=lt("div","flatpickr-weekwrapper");R.appendChild(lt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=lt("div","flatpickr-weeks");return R.appendChild(W),{weekWrapper:R,weekNumbers:W}}function J(R,W){W===void 0&&(W=!0);var ee=W?R:R-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Xe("onYearChange"),V()),F(),Xe("onMonthChange"),Ei())}function ae(R,W){if(R===void 0&&(R=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Tr(t.config),le=ee.hours,Te=ee.minutes,Ee=ee.seconds;h(le,Te,Ee)}t.redraw(),R&&Xe("onChange")}function He(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Xe("onClose")}function Fe(){t.config!==void 0&&Xe("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].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 W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}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(ee){try{delete t[ee]}catch{}})}function Ne(R){return t.calendarContainer.contains(R)}function Re(R){if(t.isOpen&&!t.config.inline){var W=dn(R),ee=Ne(W),le=W===t.input||W===t.altInput||t.element.contains(W)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Te=!le&&!ee&&!Ne(R.relatedTarget),Ee=!t.config.ignoredFocusElements.some(function(Ae){return Ae.contains(W)});Te&&Ee&&(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 ge(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var W=R,ee=t.currentYear!==W;t.currentYear=W||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)),ee&&(t.redraw(),Xe("onYearChange"),V())}}function Ce(R,W){var ee;W===void 0&&(W=!0);var le=t.parseDate(R,void 0,W);if(t.config.minDate&&le&&pn(le,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&le&&pn(le,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(le===void 0)return!1;for(var Te=!!t.config.enable,Ee=(ee=t.config.enable)!==null&&ee!==void 0?ee:t.config.disable,Ae=0,Me=void 0;Ae<Ee.length;Ae++){if(Me=Ee[Ae],typeof Me=="function"&&Me(le))return Te;if(Me instanceof Date&&le!==void 0&&Me.getTime()===le.getTime())return Te;if(typeof Me=="string"){var Ue=t.parseDate(Me,void 0,!0);return Ue&&Ue.getTime()===le.getTime()?Te:!Te}else if(typeof Me=="object"&&le!==void 0&&Me.from&&Me.to&&le.getTime()>=Me.from.getTime()&&le.getTime()<=Me.to.getTime())return Te}return!Te}function $e(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function Ye(R){var W=R.target===t._input,ee=t._input.value.trimEnd()!==Ai();W&&ee&&!(R.relatedTarget&&Ne(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function ze(R){var W=dn(R),ee=t.config.wrap?n.contains(W):W===t._input,le=t.config.allowInput,Te=t.isOpen&&(!le||!ee),Ee=t.config.inline&&ee&&!le;if(R.keyCode===13&&ee){if(le)return t.setDate(t._input.value,!0,W===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),W.blur();t.open()}else if(Ne(W)||Te||Ee){var Ae=!!t.timeContainer&&t.timeContainer.contains(W);switch(R.keyCode){case 13:Ae?(R.preventDefault(),a(),ut()):xn(R);break;case 27:R.preventDefault(),ut();break;case 8:case 46:ee&&!t.config.allowInput&&(R.preventDefault(),t.clear());break;case 37:case 39:if(!Ae&&!ee){R.preventDefault();var Me=l();if(t.daysContainer!==void 0&&(le===!1||Me&&$e(Me))){var Ue=R.keyCode===39?1:-1;R.ctrlKey?(R.stopPropagation(),J(Ue),L(O(1),0)):L(void 0,Ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:R.preventDefault();var Pe=R.keyCode===40?1:-1;t.daysContainer&&W.$i!==void 0||W===t.input||W===t.altInput?R.ctrlKey?(R.stopPropagation(),ge(t.currentYear-Pe),L(O(1),0)):Ae||L(void 0,Pe*7):W===t.currentYearElement?ge(t.currentYear-Pe):t.config.enableTime&&(!Ae&&t.hourElement&&t.hourElement.focus(),a(R),t._debouncedChange());break;case 9:if(Ae){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(cn){return cn}),pt=Ve.indexOf(W);if(pt!==-1){var Un=Ve[pt+(R.shiftKey?-1:1)];R.preventDefault(),(Un||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(W)&&R.shiftKey&&(R.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&W===t.amPM)switch(R.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),jt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),jt();break}(ee||Ne(W))&&Xe("onKeyDown",R)}function oe(R,W){if(W===void 0&&(W="flatpickr-day"),!(t.selectedDates.length!==1||R&&(!R.classList.contains(W)||R.classList.contains("flatpickr-disabled")))){for(var ee=R?R.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),le=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ee,t.selectedDates[0].getTime()),Ee=Math.max(ee,t.selectedDates[0].getTime()),Ae=!1,Me=0,Ue=0,Pe=Te;Pe<Ee;Pe+=n$.DAY)Ce(new Date(Pe),!0)||(Ae=Ae||Pe>Te&&Pe<Ee,Pe<le&&(!Me||Pe>Me)?Me=Pe:Pe>le&&(!Ue||Pe<Ue)&&(Ue=Pe));var Ve=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+W));Ve.forEach(function(pt){var Un=pt.dateObj,cn=Un.getTime(),Fs=Me>0&&cn<Me||Ue>0&&cn>Ue;if(Fs){pt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(as){pt.classList.remove(as)});return}else if(Ae&&!Fs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(as){pt.classList.remove(as)}),R!==void 0&&(R.classList.add(ee<=t.selectedDates[0].getTime()?"startRange":"endRange"),le<ee&&cn===le?pt.classList.add("startRange"):le>ee&&cn===le&&pt.classList.add("endRange"),cn>=Me&&(Ue===0||cn<=Ue)&&e$(cn,le,ee)&&pt.classList.add("inRange"))})}}function ue(){t.isOpen&&!t.config.static&&!t.config.inline&&nt()}function Z(R,W){if(W===void 0&&(W=t._positionElement),t.isMobile===!0){if(R){R.preventDefault();var ee=dn(R);ee&&ee.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Xe("onOpen");return}else if(t._input.disabled||t.config.inline)return;var le=t.isOpen;t.isOpen=!0,le||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Xe("onOpen"),nt(W)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(R===void 0||!t.timeContainer.contains(R.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ce(R){return function(W){var ee=t.config["_"+R+"Date"]=t.parseDate(W,t.config.dateFormat),le=t.config["_"+(R==="min"?"max":"min")+"Date"];ee!==void 0&&(t[R==="min"?"minDateHasTime":"maxDateHasTime"]=ee.getHours()>0||ee.getMinutes()>0||ee.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return Ce(Te)}),!t.selectedDates.length&&R==="min"&&d(ee),jt()),t.daysContainer&&(Vt(),ee!==void 0?t.currentYearElement[R]=ee.getFullYear().toString():t.currentYearElement.removeAttribute(R),t.currentYearElement.disabled=!!le&&ee!==void 0&&le.getFullYear()===ee.getFullYear())}}function Se(){var R=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],W=zt(zt({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ee={};t.config.parseDate=W.parseDate,t.config.formatDate=W.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=fi(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=fi(Ve)}});var le=W.mode==="time";if(!W.dateFormat&&(W.enableTime||le)){var Te=Dt.defaultConfig.dateFormat||ws.dateFormat;ee.dateFormat=W.noCalendar||le?"H:i"+(W.enableSeconds?":S":""):Te+" H:i"+(W.enableSeconds?":S":"")}if(W.altInput&&(W.enableTime||le)&&!W.altFormat){var Ee=Dt.defaultConfig.altFormat||ws.altFormat;ee.altFormat=W.noCalendar||le?"h:i"+(W.enableSeconds?":S K":" K"):Ee+(" h:i"+(W.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ce("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ce("max")});var Ae=function(Ve){return function(pt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(pt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ae("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ae("max")}),W.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ee,W);for(var Me=0;Me<R.length;Me++)t.config[R[Me]]=t.config[R[Me]]===!0||t.config[R[Me]]==="true";wr.filter(function(Ve){return t.config[Ve]!==void 0}).forEach(function(Ve){t.config[Ve]=Sr(t.config[Ve]||[]).map(o)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Me=0;Me<t.config.plugins.length;Me++){var Ue=t.config.plugins[Me](t)||{};for(var Pe in Ue)wr.indexOf(Pe)>-1?t.config[Pe]=Sr(Ue[Pe]).map(o).concat(t.config[Pe]):typeof W[Pe]>"u"&&(t.config[Pe]=Ue[Pe])}W.altInputClass||(t.config.altInputClass=_e().className+" "+t.config.altInputClass),Xe("onParseConfig")}function _e(){return t.config.wrap?n.querySelector("[data-input]"):n}function Je(){typeof t.config.locale!="object"&&typeof Dt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=zt(zt({},Dt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Dt.l10ns[t.config.locale]:void 0),Vi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Vi.l="("+t.l10n.weekdays.longhand.join("|")+")",Vi.M="("+t.l10n.months.shorthand.join("|")+")",Vi.F="("+t.l10n.months.longhand.join("|")+")",Vi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var R=zt(zt({},e),JSON.parse(JSON.stringify(n.dataset||{})));R.time_24hr===void 0&&Dt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=lb(t),t.parseDate=ua({config:t.config,l10n:t.l10n})}function nt(R){if(typeof t.config.position=="function")return void t.config.position(t,R);if(t.calendarContainer!==void 0){Xe("onPreCalendarPosition");var W=R||t._positionElement,ee=Array.prototype.reduce.call(t.calendarContainer.children,function(gb,_b){return gb+_b.offsetHeight},0),le=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ee=Te[0],Ae=Te.length>1?Te[1]:null,Me=W.getBoundingClientRect(),Ue=window.innerHeight-Me.bottom,Pe=Ee==="above"||Ee!=="below"&&Ue<ee&&Me.top>ee,Ve=window.pageYOffset+Me.top+(Pe?-ee-2:W.offsetHeight+2);if(Xt(t.calendarContainer,"arrowTop",!Pe),Xt(t.calendarContainer,"arrowBottom",Pe),!t.config.inline){var pt=window.pageXOffset+Me.left,Un=!1,cn=!1;Ae==="center"?(pt-=(le-Me.width)/2,Un=!0):Ae==="right"&&(pt-=le-Me.width,cn=!0),Xt(t.calendarContainer,"arrowLeft",!Un&&!cn),Xt(t.calendarContainer,"arrowCenter",Un),Xt(t.calendarContainer,"arrowRight",cn);var Fs=window.document.body.offsetWidth-(window.pageXOffset+Me.right),as=pt+le>window.document.body.offsetWidth,ub=Fs+le>window.document.body.offsetWidth;if(Xt(t.calendarContainer,"rightMost",as),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!as)t.calendarContainer.style.left=pt+"px",t.calendarContainer.style.right="auto";else if(!ub)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Fs+"px";else{var Qo=St();if(Qo===void 0)return;var fb=window.document.body.offsetWidth,cb=Math.max(0,fb/2-le/2),db=".flatpickr-calendar.centerMost:before",pb=".flatpickr-calendar.centerMost:after",hb=Qo.cssRules.length,mb="{left:"+Me.left+"px;right:auto;}";Xt(t.calendarContainer,"rightMost",!1),Xt(t.calendarContainer,"centerMost",!0),Qo.insertRule(db+","+pb+mb,hb),t.calendarContainer.style.left=cb+"px",t.calendarContainer.style.right="auto"}}}}function St(){for(var R=null,W=0;W<document.styleSheets.length;W++){var ee=document.styleSheets[W];if(ee.cssRules){try{ee.cssRules}catch{continue}R=ee;break}}return R??It()}function It(){var R=document.createElement("style");return document.head.appendChild(R),R.sheet}function Vt(){t.config.noCalendar||t.isMobile||(V(),Ei(),F())}function ut(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function xn(R){R.preventDefault(),R.stopPropagation();var W=function(Ve){return Ve.classList&&Ve.classList.contains("flatpickr-day")&&!Ve.classList.contains("flatpickr-disabled")&&!Ve.classList.contains("notAllowed")},ee=sb(dn(R),W);if(ee!==void 0){var le=ee,Te=t.latestSelectedDateObj=new Date(le.dateObj.getTime()),Ee=(Te.getMonth()<t.currentMonth||Te.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=le,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Ae=ei(Te);Ae?t.selectedDates.splice(parseInt(Ae),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),pn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,pt){return Ve.getTime()-pt.getTime()}));if(c(),Ee){var Me=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),Me&&(Xe("onYearChange"),V()),Xe("onMonthChange")}if(Ei(),F(),jt(),!Ee&&t.config.mode!=="range"&&t.config.showMonths===1?E(le):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,Pe=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ue||Pe)&&ut()}b()}}var ui={locale:[Je,z],showMonths:[se,r,ne],minDate:[k],maxDate:[k],positionElement:[Oi],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 ns(R,W){if(R!==null&&typeof R=="object"){Object.assign(t.config,R);for(var ee in R)ui[ee]!==void 0&&ui[ee].forEach(function(le){return le()})}else t.config[R]=W,ui[R]!==void 0?ui[R].forEach(function(le){return le()}):wr.indexOf(R)>-1&&(t.config[R]=Sr(W));t.redraw(),jt(!0)}function is(R,W){var ee=[];if(R instanceof Array)ee=R.map(function(le){return t.parseDate(le,W)});else if(R instanceof Date||typeof R=="number")ee=[t.parseDate(R,W)];else if(typeof R=="string")switch(t.config.mode){case"single":case"time":ee=[t.parseDate(R,W)];break;case"multiple":ee=R.split(t.config.conjunction).map(function(le){return t.parseDate(le,W)});break;case"range":ee=R.split(t.l10n.rangeSeparator).map(function(le){return t.parseDate(le,W)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(R)));t.selectedDates=t.config.allowInvalidPreload?ee:ee.filter(function(le){return le instanceof Date&&Ce(le,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(le,Te){return le.getTime()-Te.getTime()})}function Ll(R,W,ee){if(W===void 0&&(W=!1),ee===void 0&&(ee=t.config.dateFormat),R!==0&&!R||R instanceof Array&&R.length===0)return t.clear(W);is(R,ee),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),k(void 0,W),d(),t.selectedDates.length===0&&t.clear(!1),jt(W),W&&Xe("onChange")}function fi(R){return R.slice().map(function(W){return typeof W=="string"||typeof W=="number"||W instanceof Date?t.parseDate(W,void 0,!0):W&&typeof W=="object"&&W.from&&W.to?{from:t.parseDate(W.from,void 0),to:t.parseDate(W.to,void 0)}:W}).filter(function(W){return W})}function ss(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var R=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);R&&is(R,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()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>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 Nl(){if(t.input=_e(),!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=lt(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"),Oi()}function Oi(){t._positionElement=t.config.positionElement||t._input}function ls(){var R=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=lt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=R,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=R==="datetime-local"?"Y-m-d\\TH:i:S":R==="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(W){t.setDate(dn(W).value,!1,t.mobileFormatStr),Xe("onChange"),Xe("onClose")})}function sn(R){if(t.isOpen===!0)return t.close();t.open(R)}function Xe(R,W){if(t.config!==void 0){var ee=t.config[R];if(ee!==void 0&&ee.length>0)for(var le=0;ee[le]&&le<ee.length;le++)ee[le](t.selectedDates,t.input.value,t,W);R==="onChange"&&(t.input.dispatchEvent(os("change")),t.input.dispatchEvent(os("input")))}}function os(R){var W=document.createEvent("Event");return W.initEvent(R,!0,!0),W}function ei(R){for(var W=0;W<t.selectedDates.length;W++){var ee=t.selectedDates[W];if(ee instanceof Date&&pn(ee,R)===0)return""+W}return!1}function rs(R){return t.config.mode!=="range"||t.selectedDates.length<2?!1:pn(R,t.selectedDates[0])>=0&&pn(R,t.selectedDates[1])<=0}function Ei(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(R,W){var ee=new Date(t.currentYear,t.currentMonth,1);ee.setMonth(t.currentMonth+W),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[W].textContent=Lo(ee.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ee.getMonth().toString(),R.value=ee.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Ai(R){var W=R||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ee){return t.formatDate(ee,W)}).filter(function(ee,le,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ee)===le}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function jt(R){R===void 0&&(R=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ai(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ai(t.config.altFormat)),R!==!1&&Xe("onValueUpdate")}function Gt(R){var W=dn(R),ee=t.prevMonthNav.contains(W),le=t.nextMonthNav.contains(W);ee||le?J(ee?-1:1):t.yearElements.indexOf(W)>=0?W.select():W.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):W.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Fl(R){R.preventDefault();var W=R.type==="keydown",ee=dn(R),le=ee;t.amPM!==void 0&&ee===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Sn(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(le.getAttribute("min")),Ee=parseFloat(le.getAttribute("max")),Ae=parseFloat(le.getAttribute("step")),Me=parseInt(le.value,10),Ue=R.delta||(W?R.which===38?1:-1:0),Pe=Me+Ae*Ue;if(typeof le.value<"u"&&le.value.length===2){var Ve=le===t.hourElement,pt=le===t.minuteElement;Pe<Te?(Pe=Ee+Pe+Sn(!Ve)+(Sn(Ve)&&Sn(!t.amPM)),pt&&C(void 0,-1,t.hourElement)):Pe>Ee&&(Pe=le===t.hourElement?Pe-Ee-Sn(!t.amPM):Te,pt&&C(void 0,1,t.hourElement)),t.amPM&&Ve&&(Ae===1?Pe+Me===23:Math.abs(Pe-Me)>Ae)&&(t.amPM.textContent=t.l10n.amPM[Sn(t.amPM.textContent===t.l10n.amPM[0])]),le.value=ln(Pe)}}return s(),t}function Ss(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s<t.length;s++){var l=t[s];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=s$(l,e||{}),i.push(l._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return Ss(this,n)},HTMLElement.prototype.flatpickr=function(n){return Ss([this],n)});var Dt=function(n,e){return typeof n=="string"?Ss(window.document.querySelectorAll(n),e):n instanceof Node?Ss([n],e):Ss(n,e)};Dt.defaultConfig={};Dt.l10ns={en:zt({},_l),default:zt({},_l)};Dt.localize=function(n){Dt.l10ns.default=zt(zt({},Dt.l10ns.default),n)};Dt.setDefaults=function(n){Dt.defaultConfig=zt(zt({},Dt.defaultConfig),n)};Dt.parseDate=ua({});Dt.formatDate=lb({});Dt.compareDates=pn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Ss(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Dt);function l$(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=Ge(i,t[s]);return{c(){e=v("input"),Zn(e,i)},m(s,l){S(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){Zn(e,i=nn(t,[l&2&&s[1]]))},d(s){s&&w(e),n[11](null)}}}function o$(n){let e;const t=n[10].default,i=Nt(t,n,n[9],null),s=i||l$(n);return{c(){s&&s.c()},m(l,o){s&&s.m(l,o),e=!0},p(l,[o]){i?i.p&&(!e||o&512)&&Rt(i,t,l,l[9],e?Ft(t,l[9],o,null):Ht(l[9]),null):s&&s.p&&(!e||o&3)&&s.p(l,e?o:-1)},i(l){e||(A(s,l),e=!0)},o(l){P(s,l),e=!1},d(l){s&&s.d(l)}}}function r$(n){return n.charAt(2).toLowerCase()+n.substring(3)}function a$(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Ot(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,h=!1,{input:m=void 0,flatpickr:g=void 0}=e;un(()=>{const C=f??m,M=y(d);return M.onReady.push(()=>{t(8,h=!0)}),t(3,g=Dt(C,Object.assign(M,f?{wrap:!0}:{}))),()=>{g.destroy()}});const b=Ct();function y(C={}){C=Object.assign({},C);for(const M of r){const T=(E,O,I)=>{b(r$(M),[E,O,I])};M in C?(Array.isArray(C[M])||(C[M]=[C[M]]),C[M].push(T)):C[M]=[T]}return C.onChange&&!C.onChange.includes(k)&&C.onChange.push(k),C}function k(C,M,T){var O;const E=((O=T==null?void 0:T.config)==null?void 0:O.mode)??"single";t(2,a=E==="single"?C[0]:C),t(4,u=M)}function $(C){ie[C?"unshift":"push"](()=>{m=C,t(0,m)})}return n.$$set=C=>{e=Ge(Ge({},e),Gn(C)),t(1,s=Ot(e,i)),"value"in C&&t(2,a=C.value),"formattedValue"in C&&t(4,u=C.formattedValue),"element"in C&&t(5,f=C.element),"dateFormat"in C&&t(6,c=C.dateFormat),"options"in C&&t(7,d=C.options),"input"in C&&t(0,m=C.input),"flatpickr"in C&&t(3,g=C.flatpickr),"$$scope"in C&&t(9,o=C.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&h&&(a?g.setDate(a,!1,c):a===null&&g.clear(!1)),n.$$.dirty&392&&g&&h)for(const[C,M]of Object.entries(y(d)))g.set(C,M)},[m,s,a,g,u,f,c,d,h,o,l,$]}class eu extends ke{constructor(e){super(),ye(this,e,a$,o$,be,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function u$(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:B.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new eu({props:u}),ie.push(()=>ve(l,"formattedValue",a)),{c(){e=v("label"),t=U("Min date (UTC)"),s=D(),q(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function f$(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:B.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new eu({props:u}),ie.push(()=>ve(l,"formattedValue",a)),{c(){e=v("label"),t=U("Max date (UTC)"),s=D(),q(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function c$(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[u$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[f$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function d$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class p$ extends ke{constructor(e){super(),ye(this,e,d$,c$,be,{key:1,options:0})}}function h$(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new ts({props:c}),ie.push(()=>ve(l,"value",f)),{c(){e=v("label"),t=U("Choices"),s=D(),q(l.$$.fragment),r=D(),a=v("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,h){S(d,e,h),_(e,t),S(d,s,h),H(l,d,h),S(d,r,h),S(d,a,h),u=!0},p(d,h){(!u||h&16&&i!==(i=d[4]))&&p(e,"for",i);const m={};h&16&&(m.id=d[4]),!o&&h&1&&(o=!0,m.value=d[0].values,we(()=>o=!1)),l.$set(m)},i(d){u||(A(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&w(e),d&&w(s),j(l,d),d&&w(r),d&&w(a)}}}function m$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=D(),l=v("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].maxSelect),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].maxSelect&&fe(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function g$(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[h$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[m$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){S(a,e,u),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function _$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=dt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class b$ extends ke{constructor(e){super(),ye(this,e,_$,g$,be,{key:1,options:0})}}function v$(n,e,t){return["",{}]}class y$ extends ke{constructor(e){super(),ye(this,e,v$,null,be,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function k$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max file size (bytes)"),s=D(),l=v("input"),p(e,"for",i=n[11]),p(l,"type","number"),p(l,"id",o=n[11]),p(l,"step","1"),p(l,"min","0")},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].maxSize),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&2048&&i!==(i=u[11])&&p(e,"for",i),f&2048&&o!==(o=u[11])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].maxSize&&fe(l,u[0].maxSize)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function w$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max files"),s=D(),l=v("input"),p(e,"for",i=n[11]),p(l,"type","number"),p(l,"id",o=n[11]),p(l,"step","1"),p(l,"min",""),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].maxSelect),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&2048&&i!==(i=u[11])&&p(e,"for",i),f&2048&&o!==(o=u[11])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].maxSelect&&fe(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function S$(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',s=D(),l=v("button"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=D(),r=v("button"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',a=D(),u=v("a"),u.textContent="List with all supported mimetypes",p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(u,"href","https://github.com/gabriel-vasile/mimetype/blob/master/supported_mimes.md"),p(u,"class","btn btn-sm btn-hint closable"),p(u,"target","_blank"),p(u,"rel","noreferrer noopener")},m(d,h){S(d,e,h),S(d,t,h),S(d,i,h),S(d,s,h),S(d,l,h),S(d,o,h),S(d,r,h),S(d,a,h),S(d,u,h),f||(c=[Y(e,"click",n[6]),Y(i,"click",n[7]),Y(l,"click",n[8]),Y(r,"click",n[9]),Y(u,"click",bn(n[2]))],f=!0)},p:X,d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),d&&w(l),d&&w(o),d&&w(r),d&&w(a),d&&w(u),f=!1,Le(c)}}}function $$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M;function T(O){n[5](O)}let E={id:n[11],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(E.value=n[0].mimeTypes),r=new ts({props:E}),ie.push(()=>ve(r,"value",T)),k=new Qn({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[S$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Mime types",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=D(),h=v("button"),m=v("span"),m.textContent="Choose presets",g=D(),b=v("i"),y=D(),q(k.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[11]),p(c,"class","txt"),p(m,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,I){S(O,e,I),_(e,t),_(e,i),_(e,s),S(O,o,I),H(r,O,I),S(O,u,I),S(O,f,I),_(f,c),_(f,d),_(f,h),_(h,m),_(h,g),_(h,b),_(h,y),H(k,h,null),$=!0,C||(M=Ie(We.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),C=!0)},p(O,I){(!$||I&2048&&l!==(l=O[11]))&&p(e,"for",l);const L={};I&2048&&(L.id=O[11]),!a&&I&1&&(a=!0,L.value=O[0].mimeTypes,we(()=>a=!1)),r.$set(L);const N={};I&4097&&(N.$$scope={dirty:I,ctx:O}),k.$set(N)},i(O){$||(A(r.$$.fragment,O),A(k.$$.fragment,O),$=!0)},o(O){P(r.$$.fragment,O),P(k.$$.fragment,O),$=!1},d(O){O&&w(e),O&&w(o),j(r,O),O&&w(u),O&&w(f),j(k),C=!1,M()}}}function C$(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function T$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M;function T(O){n[10](O)}let E={id:n[11],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(E.value=n[0].thumbs),r=new ts({props:E}),ie.push(()=>ve(r,"value",T)),k=new Qn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[C$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=D(),h=v("button"),m=v("span"),m.textContent="Supported formats",g=D(),b=v("i"),y=D(),q(k.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[11]),p(c,"class","txt"),p(m,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,I){S(O,e,I),_(e,t),_(e,i),_(e,s),S(O,o,I),H(r,O,I),S(O,u,I),S(O,f,I),_(f,c),_(f,d),_(f,h),_(h,m),_(h,g),_(h,b),_(h,y),H(k,h,null),$=!0,C||(M=Ie(We.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"})),C=!0)},p(O,I){(!$||I&2048&&l!==(l=O[11]))&&p(e,"for",l);const L={};I&2048&&(L.id=O[11]),!a&&I&1&&(a=!0,L.value=O[0].thumbs,we(()=>a=!1)),r.$set(L);const N={};I&4096&&(N.$$scope={dirty:I,ctx:O}),k.$set(N)},i(O){$||(A(r.$$.fragment,O),A(k.$$.fragment,O),$=!0)},o(O){P(r.$$.fragment,O),P(k.$$.fragment,O),$=!1},d(O){O&&w(e),O&&w(o),j(r,O),O&&w(u),O&&w(f),j(k),C=!1,M()}}}function M$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[k$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[w$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[$$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[T$,({uniqueId:m})=>({11:m}),({uniqueId:m})=>m?2048:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("div"),q(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(m,g){S(m,e,g),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),H(u,a,null),_(e,f),_(e,c),H(d,c,null),h=!0},p(m,[g]){const b={};g&2&&(b.name="schema."+m[1]+".options.maxSize"),g&6145&&(b.$$scope={dirty:g,ctx:m}),i.$set(b);const y={};g&2&&(y.name="schema."+m[1]+".options.maxSelect"),g&6145&&(y.$$scope={dirty:g,ctx:m}),o.$set(y);const k={};g&2&&(k.name="schema."+m[1]+".options.mimeTypes"),g&6145&&(k.$$scope={dirty:g,ctx:m}),u.$set(k);const $={};g&2&&($.name="schema."+m[1]+".options.thumbs"),g&6145&&($.$$scope={dirty:g,ctx:m}),d.$set($)},i(m){h||(A(i.$$.fragment,m),A(o.$$.fragment,m),A(u.$$.fragment,m),A(d.$$.fragment,m),h=!0)},o(m){P(i.$$.fragment,m),P(o.$$.fragment,m),P(u.$$.fragment,m),P(d.$$.fragment,m),h=!1},d(m){m&&w(e),j(i),j(o),j(u),j(d)}}}function D$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(m){Be.call(this,n,m)}function o(){s.maxSize=dt(this.value),t(0,s)}function r(){s.maxSelect=dt(this.value),t(0,s)}function a(m){n.$$.not_equal(s.mimeTypes,m)&&(s.mimeTypes=m,t(0,s))}const u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},f=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},c=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},d=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function h(m){n.$$.not_equal(s.thumbs,m)&&(s.thumbs=m,t(0,s))}return n.$$set=m=>{"key"in m&&t(1,i=m.key),"options"in m&&t(0,s=m.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d,h]}class O$ extends ke{constructor(e){super(),ye(this,e,D$,M$,be,{key:1,options:0})}}function E$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=D(),i=v("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[7]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function A$(n){let e,t,i,s,l,o,r;function a(f){n[8](f)}let u={searchable:n[2].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[2],$$slots:{afterOptions:[E$]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new Ns({props:u}),ie.push(()=>ve(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("Collection"),s=D(),q(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&4&&(d.searchable=f[2].length>5),c&4&&(d.items=f[2]),c&524296&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function I$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Max select",i=D(),s=v("i"),o=D(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18]),p(r,"type","number"),p(r,"id",a=n[18]),p(r,"step","1"),p(r,"min","1")},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].maxSelect),u||(f=[Ie(We.call(null,s,{text:"Leave empty for no limit.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&262144&&l!==(l=c[18])&&p(e,"for",l),d&262144&&a!==(a=c[18])&&p(r,"id",a),d&1&&dt(r.value)!==c[0].maxSelect&&fe(r,c[0].maxSelect)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,Le(f)}}}function P$(n){let e,t,i,s,l,o,r,a,u,f,c;function d(m){n[10](m)}let h={multiple:!0,searchable:!0,id:n[18],items:n[4]};return n[0].displayFields!==void 0&&(h.selected=n[0].displayFields),r=new xa({props:h}),ie.push(()=>ve(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=D(),s=v("i"),o=D(),q(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18])},m(m,g){S(m,e,g),_(e,t),_(e,i),_(e,s),S(m,o,g),H(r,m,g),u=!0,f||(c=Ie(We.call(null,s,{text:"Optional select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(m,g){(!u||g&262144&&l!==(l=m[18]))&&p(e,"for",l);const b={};g&262144&&(b.id=m[18]),g&16&&(b.items=m[4]),!a&&g&1&&(a=!0,b.selected=m[0].displayFields,we(()=>a=!1)),r.$set(b)},i(m){u||(A(r.$$.fragment,m),u=!0)},o(m){P(r.$$.fragment,m),u=!1},d(m){m&&w(e),m&&w(o),j(r,m),f=!1,c()}}}function L$(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[18],items:n[5]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new Ns({props:u}),ie.push(()=>ve(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("Cascade delete"),s=D(),q(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&262144&&(d.id=f[18]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function N$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[A$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[I$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[P$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[L$,({uniqueId:y})=>({18:y}),({uniqueId:y})=>y?262144:0]},$$scope:{ctx:n}}});let b={};return m=new tu({props:b}),n[12](m),m.$on("save",n[13]),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("div"),q(d.$$.fragment),h=D(),q(m.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(a,"class","col-sm-9"),p(c,"class","col-sm-3"),p(e,"class","grid")},m(y,k){S(y,e,k),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),H(u,a,null),_(e,f),_(e,c),H(d,c,null),S(y,h,k),H(m,y,k),g=!0},p(y,[k]){const $={};k&2&&($.name="schema."+y[1]+".options.collectionId"),k&786445&&($.$$scope={dirty:k,ctx:y}),i.$set($);const C={};k&2&&(C.name="schema."+y[1]+".options.maxSelect"),k&786433&&(C.$$scope={dirty:k,ctx:y}),o.$set(C);const M={};k&2&&(M.name="schema."+y[1]+".options.displayFields"),k&786449&&(M.$$scope={dirty:k,ctx:y}),u.$set(M);const T={};k&2&&(T.name="schema."+y[1]+".options.cascadeDelete"),k&786433&&(T.$$scope={dirty:k,ctx:y}),d.$set(T);const E={};m.$set(E)},i(y){g||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(u.$$.fragment,y),A(d.$$.fragment,y),A(m.$$.fragment,y),g=!0)},o(y){P(i.$$.fragment,y),P(o.$$.fragment,y),P(u.$$.fragment,y),P(d.$$.fragment,y),P(m.$$.fragment,y),g=!1},d(y){y&&w(e),j(i),j(o),j(u),j(d),y&&w(h),n[12](null),j(m,y)}}}function F$(n,e,t){let i,s;Ke(n,es,M=>t(2,s=M));let{key:l=""}=e,{options:o={}}=e;const r=[{label:"False",value:!1},{label:"True",value:!0}],a=["id","created","updated"],u=["username","email","emailVisibility","verified"];let f=null,c=[],d=null;function h(){var M;if(t(4,c=a.slice(0)),!!i){i.isAuth&&t(4,c=c.concat(u));for(const T of i.schema)c.push(T.name);if(((M=o==null?void 0:o.displayFields)==null?void 0:M.length)>0)for(let T=o.displayFields.length-1;T>=0;T--)c.includes(o.displayFields[T])||o.displayFields.splice(T,1)}}const m=()=>f==null?void 0:f.show();function g(M){n.$$.not_equal(o.collectionId,M)&&(o.collectionId=M,t(0,o))}function b(){o.maxSelect=dt(this.value),t(0,o)}function y(M){n.$$.not_equal(o.displayFields,M)&&(o.displayFields=M,t(0,o))}function k(M){n.$$.not_equal(o.cascadeDelete,M)&&(o.cascadeDelete=M,t(0,o))}function $(M){ie[M?"unshift":"push"](()=>{f=M,t(3,f)})}const C=M=>{var T,E;(E=(T=M==null?void 0:M.detail)==null?void 0:T.collection)!=null&&E.id&&t(0,o.collectionId=M.detail.collection.id,o)};return n.$$set=M=>{"key"in M&&t(1,l=M.key),"options"in M&&t(0,o=M.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(o)&&t(0,o={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]}),n.$$.dirty&5&&(i=s.find(M=>M.id==o.collectionId)||null),n.$$.dirty&65&&d!=o.collectionId&&(t(6,d=o.collectionId),h())},[o,l,s,f,c,r,d,m,g,b,y,k,$,C]}class R$ extends ke{constructor(e){super(),ye(this,e,F$,N$,be,{key:1,options:0})}}function H$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=D(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].maxSelect),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].maxSelect&&fe(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function j$(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new Ns({props:u}),ie.push(()=>ve(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("Delete record on user delete"),s=D(),q(l.$$.fragment),p(e,"for",i=n[5])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&p(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function q$(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[H$,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[j$,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.maxSelect"),u&97&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.cascadeDelete"),u&97&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function V$(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=dt(this.value),t(0,l)}function r(a){n.$$.not_equal(l.cascadeDelete,a)&&(l.cascadeDelete=a,t(0,l))}return n.$$set=a=>{"key"in a&&t(1,s=a.key),"options"in a&&t(0,l=a.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(l)&&t(0,l={maxSelect:1,cascadeDelete:!1})},[l,s,i,o,r]}class z$ extends ke{constructor(e){super(),ye(this,e,V$,q$,be,{key:1,options:0})}}function B$(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:n[44],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new D4({props:u}),ie.push(()=>ve(l,"value",a)),{c(){e=v("label"),t=U("Type"),s=D(),q(l.$$.fragment),p(e,"for",i=n[44])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8192&&i!==(i=f[44]))&&p(e,"for",i);const d={};c[1]&8192&&(d.id=f[44]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function Kc(n){let e,t,i;return{c(){e=v("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){S(s,e,l),i=!0},i(s){i||(tt(()=>{t||(t=qe(e,On,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=qe(e,On,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function U$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m=!n[5]&&Kc();return{c(){e=v("label"),t=v("span"),t.textContent="Name",i=D(),m&&m.c(),l=D(),o=v("input"),p(t,"class","txt"),p(e,"for",s=n[44]),p(o,"type","text"),p(o,"id",r=n[44]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(g,b){S(g,e,b),_(e,t),_(e,i),m&&m.m(e,null),S(g,l,b),S(g,o,b),c=!0,n[0].id||o.focus(),d||(h=Y(o,"input",n[18]),d=!0)},p(g,b){g[5]?m&&(de(),P(m,1,1,()=>{m=null}),pe()):m?b[0]&32&&A(m,1):(m=Kc(),m.c(),A(m,1),m.m(e,null)),(!c||b[1]&8192&&s!==(s=g[44]))&&p(e,"for",s),(!c||b[1]&8192&&r!==(r=g[44]))&&p(o,"id",r),(!c||b[0]&1&&a!==(a=g[0].id&&g[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!g[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=g[0].name)&&o.value!==f)&&(o.value=f)},i(g){c||(A(m),c=!0)},o(g){P(m),c=!1},d(g){g&&w(e),m&&m.d(),g&&w(l),g&&w(o),d=!1,h()}}}function W$(n){let e,t,i;function s(o){n[30](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new z$({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Y$(n){let e,t,i;function s(o){n[29](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new R$({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function K$(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new O$({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function J$(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new y$({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Z$(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new b$({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function G$(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new p$({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function X$(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new Q4({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Q$(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new G4({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function x$(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new ib({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function e3(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new V4({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function t3(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new j4({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function n3(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new L4({props:l}),ie.push(()=>ve(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function i3(n){let e,t,i,s,l,o=_s(n[0])+"",r,a,u,f,c,d,h;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),r=U(o),a=D(),u=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[44]),p(l,"class","txt"),p(u,"class","ri-information-line link-hint"),p(s,"for",c=n[44])},m(m,g){S(m,e,g),e.checked=n[0].required,S(m,i,g),S(m,s,g),_(s,l),_(l,r),_(s,a),_(s,u),d||(h=[Y(e,"change",n[31]),Ie(f=We.call(null,u,{text:`Requires the field value to be ${_s(n[0])}
(aka. not ${B.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(m,g){g[1]&8192&&t!==(t=m[44])&&p(e,"id",t),g[0]&1&&(e.checked=m[0].required),g[0]&1&&o!==(o=_s(m[0])+"")&&re(r,o),f&&Zt(f.update)&&g[0]&1&&f.update.call(null,{text:`Requires the field value to be ${_s(m[0])}
(aka. not ${B.zeroDefaultStr(m[0])}).`,position:"right"}),g[1]&8192&&c!==(c=m[44])&&p(s,"for",c)},d(m){m&&w(e),m&&w(i),m&&w(s),d=!1,Le(h)}}}function Jc(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[s3,({uniqueId:i})=>({44:i}),({uniqueId:i})=>[0,i?8192:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&24576&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function s3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[44]),p(s,"for",o=n[44])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[32]),r=!0)},p(u,f){f[1]&8192&&t!==(t=u[44])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&8192&&o!==(o=u[44])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Zc(n){let e,t,i,s,l,o,r,a,u,f;a=new Qn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[l3]},$$scope:{ctx:n}}});let c=n[8]&&Gc(n);return{c(){e=v("div"),t=v("div"),i=D(),s=v("div"),l=v("button"),o=v("i"),r=D(),q(a.$$.fragment),u=D(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,h){S(d,e,h),_(e,t),_(e,i),_(e,s),_(s,l),_(l,o),_(l,r),H(a,l,null),_(s,u),c&&c.m(s,null),f=!0},p(d,h){const m={};h[1]&16384&&(m.$$scope={dirty:h,ctx:d}),a.$set(m),d[8]?c?c.p(d,h):(c=Gc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function l3(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Gc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",bn(n[3])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function o3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T;s=new me({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[B$,({uniqueId:F})=>({44:F}),({uniqueId:F})=>[0,F?8192:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[U$,({uniqueId:F})=>({44:F}),({uniqueId:F})=>[0,F?8192:0]]},$$scope:{ctx:n}}});const E=[n3,t3,e3,x$,Q$,X$,G$,Z$,J$,K$,Y$,W$],O=[];function I(F,V){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:F[0].type==="user"?11:-1}~(f=I(n))&&(c=O[f]=E[f](n)),m=new me({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[i3,({uniqueId:F})=>({44:F}),({uniqueId:F})=>[0,F?8192:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&Jc(n),N=!n[0].toDelete&&Zc(n);return{c(){e=v("form"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),q(r.$$.fragment),a=D(),u=v("div"),c&&c.c(),d=D(),h=v("div"),q(m.$$.fragment),g=D(),b=v("div"),L&&L.c(),y=D(),N&&N.c(),k=D(),$=v("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p($,"type","submit"),p($,"class","hidden"),p($,"tabindex","-1"),p(e,"class","field-form")},m(F,V){S(F,e,V),_(e,t),_(t,i),H(s,i,null),_(t,l),_(t,o),H(r,o,null),_(t,a),_(t,u),~f&&O[f].m(u,null),_(t,d),_(t,h),H(m,h,null),_(t,g),_(t,b),L&&L.m(b,null),_(t,y),N&&N.m(t,null),_(e,k),_(e,$),C=!0,M||(T=[Y(e,"dragstart",u3),Y(e,"submit",ct(n[33]))],M=!0)},p(F,V){const G={};V[0]&1&&(G.class="form-field required "+(F[0].id?"disabled":"")),V[0]&2&&(G.name="schema."+F[1]+".type"),V[0]&1|V[1]&24576&&(G.$$scope={dirty:V,ctx:F}),s.$set(G);const se={};V[0]&33&&(se.class=`
form-field
required
`+(F[5]?"":"invalid")+`
`+(F[0].id&&F[0].system?"disabled":"")+`
`),V[0]&2&&(se.name="schema."+F[1]+".name"),V[0]&33|V[1]&24576&&(se.$$scope={dirty:V,ctx:F}),r.$set(se);let K=f;f=I(F),f===K?~f&&O[f].p(F,V):(c&&(de(),P(O[K],1,1,()=>{O[K]=null}),pe()),~f?(c=O[f],c?c.p(F,V):(c=O[f]=E[f](F),c.c()),A(c,1),c.m(u,null)):c=null);const te={};V[0]&1|V[1]&24576&&(te.$$scope={dirty:V,ctx:F}),m.$set(te),F[0].type!=="file"?L?(L.p(F,V),V[0]&1&&A(L,1)):(L=Jc(F),L.c(),A(L,1),L.m(b,null)):L&&(de(),P(L,1,1,()=>{L=null}),pe()),F[0].toDelete?N&&(de(),P(N,1,1,()=>{N=null}),pe()):N?(N.p(F,V),V[0]&1&&A(N,1)):(N=Zc(F),N.c(),A(N,1),N.m(t,null))},i(F){C||(A(s.$$.fragment,F),A(r.$$.fragment,F),A(c),A(m.$$.fragment,F),A(L),A(N),C=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(m.$$.fragment,F),P(L),P(N),C=!1},d(F){F&&w(e),j(s),j(r),~f&&O[f].d(),j(m),L&&L.d(),N&&N.d(),M=!1,Le(T)}}}function Xc(n){let e,t,i,s,l=n[0].system&&Qc(),o=!n[0].id&&xc(n),r=n[0].required&&ed(n),a=n[0].unique&&td();return{c(){e=v("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),_(e,t),o&&o.m(e,null),_(e,i),r&&r.m(e,null),_(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Qc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=xc(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ed(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=td(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Qc(n){let e;return{c(){e=v("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xc(n){let e;return{c(){e=v("span"),e.textContent="New",p(e,"class","label"),x(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&x(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function ed(n){let e,t=_s(n[0])+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l[0]&1&&t!==(t=_s(s[0])+"")&&re(i,t)},d(s){s&&w(e)}}}function td(n){let e;return{c(){e=v("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function nd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function id(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",bn(n[16])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function r3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,m,g,b,y=!n[0].toDelete&&Xc(n),k=n[7]&&!n[0].system&&nd(),$=n[0].toDelete&&id(n);return{c(){e=v("div"),t=v("span"),i=v("i"),l=D(),o=v("strong"),a=U(r),f=D(),y&&y.c(),c=D(),d=v("div"),h=D(),k&&k.c(),m=D(),$&&$.c(),g=Oe(),p(i,"class",s=yi(B.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),x(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(C,M){S(C,e,M),_(e,t),_(t,i),_(e,l),_(e,o),_(o,a),S(C,f,M),y&&y.m(C,M),S(C,c,M),S(C,d,M),S(C,h,M),k&&k.m(C,M),S(C,m,M),$&&$.m(C,M),S(C,g,M),b=!0},p(C,M){(!b||M[0]&1&&s!==(s=yi(B.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&re(a,r),(!b||M[0]&1&&u!==(u=C[0].name))&&p(o,"title",u),(!b||M[0]&1)&&x(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?y&&(y.d(1),y=null):y?y.p(C,M):(y=Xc(C),y.c(),y.m(c.parentNode,c)),C[7]&&!C[0].system?k?M[0]&129&&A(k,1):(k=nd(),k.c(),A(k,1),k.m(m.parentNode,m)):k&&(de(),P(k,1,1,()=>{k=null}),pe()),C[0].toDelete?$?$.p(C,M):($=id(C),$.c(),$.m(g.parentNode,g)):$&&($.d(1),$=null)},i(C){b||(A(k),b=!0)},o(C){P(k),b=!1},d(C){C&&w(e),C&&w(f),y&&y.d(C),C&&w(c),C&&w(d),C&&w(h),k&&k.d(C),C&&w(m),$&&$.d(C),C&&w(g)}}}function a3(n){let e,t;const i=[{draggable:!0},{single:!0},{interactive:n[8]},{class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion"},n[11]];let s={$$slots:{header:[r3],default:[o3]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Ge(s,i[l]);return e=new ks({props:s}),n[34](e),e.$on("expand",n[35]),e.$on("collapse",n[36]),e.$on("toggle",n[37]),e.$on("dragenter",n[38]),e.$on("dragleave",n[39]),e.$on("dragstart",n[40]),e.$on("drop",n[41]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){const r=o[0]&2309?nn(i,[i[0],i[1],o[0]&256&&{interactive:l[8]},o[0]&5&&{class:l[2]||l[0].toDelete||l[0].system?"field-accordion disabled":"field-accordion"},o[0]&2048&&Xn(l[11])]):{};o[0]&483|o[1]&16384&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[34](null),j(e,l)}}}function _s(n){switch(n==null?void 0:n.type){case"bool":return"Nonfalsey";case"number":return"Nonzero";default:return"Nonempty"}}const u3=n=>{n.stopPropagation(),n.preventDefault(),n.stopImmediatePropagation()};function f3(n,e,t){let i,s,l,o;const r=["key","field","disabled","excludeNames","expand","collapse"];let a=Ot(e,r),u;Ke(n,Ci,oe=>t(15,u=oe));const f=Ct();let{key:c="0"}=e,{field:d=new fn}=e,{disabled:h=!1}=e,{excludeNames:m=[]}=e,g,b=d.type;function y(){g==null||g.expand()}function k(){g==null||g.collapse()}function $(){d.id?t(0,d.toDelete=!0,d):(k(),f("remove"))}function C(oe){if(oe=(""+oe).toLowerCase(),!oe)return!1;for(const ue of m)if(ue.toLowerCase()===oe)return!1;return!0}function M(oe){return B.slugify(oe)}un(()=>{d.id||y()});const T=()=>{t(0,d.toDelete=!1,d)};function E(oe){n.$$.not_equal(d.type,oe)&&(d.type=oe,t(0,d),t(14,b),t(4,g))}const O=oe=>{t(0,d.name=M(oe.target.value),d),oe.target.value=d.name};function I(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function L(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function N(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function F(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function V(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function G(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function se(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function K(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function te(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function ne(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function z(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function Q(oe){n.$$.not_equal(d.options,oe)&&(d.options=oe,t(0,d),t(14,b),t(4,g))}function J(){d.required=this.checked,t(0,d),t(14,b),t(4,g)}function ae(){d.unique=this.checked,t(0,d),t(14,b),t(4,g)}const He=()=>{i&&k()};function Fe(oe){ie[oe?"unshift":"push"](()=>{g=oe,t(4,g)})}function Ne(oe){Be.call(this,n,oe)}function Re(oe){Be.call(this,n,oe)}function ge(oe){Be.call(this,n,oe)}function Ce(oe){Be.call(this,n,oe)}function $e(oe){Be.call(this,n,oe)}function Ye(oe){Be.call(this,n,oe)}function ze(oe){Be.call(this,n,oe)}return n.$$set=oe=>{e=Ge(Ge({},e),Gn(oe)),t(11,a=Ot(e,r)),"key"in oe&&t(1,c=oe.key),"field"in oe&&t(0,d=oe.field),"disabled"in oe&&t(2,h=oe.disabled),"excludeNames"in oe&&t(12,m=oe.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&16385&&b!=d.type&&(t(14,b=d.type),t(0,d.options={},d),t(0,d.unique=!1,d)),n.$$.dirty[0]&17&&d.toDelete&&(g&&k(),d.originalName&&d.name!==d.originalName&&t(0,d.name=d.originalName,d)),n.$$.dirty[0]&1&&!d.originalName&&d.name&&t(0,d.originalName=d.name,d),n.$$.dirty[0]&1&&typeof d.toDelete>"u"&&t(0,d.toDelete=!1,d),n.$$.dirty[0]&1&&d.required&&t(0,d.nullable=!1,d),n.$$.dirty[0]&1&&t(6,i=!B.isEmpty(d.name)&&d.type),n.$$.dirty[0]&80&&(i||g&&y()),n.$$.dirty[0]&69&&t(8,s=!h&&!d.system&&!d.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=C(d.name)),n.$$.dirty[0]&32802&&t(7,o=!l||!B.isEmpty(B.getNestedVal(u,`schema.${c}`)))},[d,c,h,k,g,l,i,o,s,$,M,a,m,y,b,u,T,E,O,I,L,N,F,V,G,se,K,te,ne,z,Q,J,ae,He,Fe,Ne,Re,ge,Ce,$e,Ye,ze]}class c3 extends ke{constructor(e){super(),ye(this,e,f3,a3,be,{key:1,field:0,disabled:2,excludeNames:12,expand:13,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[13]}get collapse(){return this.$$.ctx[3]}}function sd(n,e,t){const i=n.slice();return i[13]=e[t],i[14]=e,i[15]=t,i}function ld(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`,
`),t=v("code"),t.textContent="username",i=U(` ,
`),s=v("code"),s.textContent="email",l=U(` ,
`),o=v("code"),o.textContent="emailVisibility",r=U(` ,
`),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function od(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new c3({props:f}),ie.push(()=>ve(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),H(i,c,d),l=!0},p(c,d){e=c;const h={};d&1&&(h.key=e[15]),d&3&&(h.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,h.field=e[13],we(()=>s=!1)),i.$set(h)},i(c){l||(A(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function d3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],m=new Map,g,b,y,k,$,C,M,T,E,O,I,L=n[0].isAuth&&ld(),N=n[0].schema;const F=V=>V[13];for(let V=0;V<N.length;V+=1){let G=sd(n,N,V),se=F(G);m.set(se,h[V]=od(se,G))}return{c(){e=v("div"),t=v("p"),i=U(`System fields:
`),s=v("code"),s.textContent="id",l=U(` ,
`),o=v("code"),o.textContent="created",r=U(` ,
`),a=v("code"),a.textContent="updated",u=D(),L&&L.c(),f=U(`
.`),c=D(),d=v("div");for(let V=0;V<h.length;V+=1)h[V].c();g=D(),b=v("div"),y=D(),k=v("button"),$=v("i"),C=D(),M=v("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(b,"class","clearfix m-t-xs"),p($,"class","ri-add-line"),p(M,"class","txt"),p(k,"type","button"),p(k,"class",T="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(V,G){S(V,e,G),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),L&&L.m(t,null),_(t,f),S(V,c,G),S(V,d,G);for(let se=0;se<h.length;se+=1)h[se].m(d,null);S(V,g,G),S(V,b,G),S(V,y,G),S(V,k,G),_(k,$),_(k,C),_(k,M),E=!0,O||(I=Y(k,"click",n[3]),O=!0)},p(V,[G]){V[0].isAuth?L||(L=ld(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),G&55&&(N=V[0].schema,de(),h=gt(h,G,F,1,V,N,m,d,Kt,od,null,sd),pe()),(!E||G&1&&T!==(T="btn btn-block "+(V[0].schema.length?"btn-transparent":"btn-secondary")))&&p(k,"class",T)},i(V){if(!E){for(let G=0;G<N.length;G+=1)A(h[G]);E=!0}},o(V){for(let G=0;G<h.length;G+=1)P(h[G]);E=!1},d(V){V&&w(e),L&&L.d(),V&&w(c),V&&w(d);for(let G=0;G<h.length;G+=1)h[G].d();V&&w(g),V&&w(b),V&&w(y),V&&w(k),O=!1,I()}}}function p3(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function h3(n,e,t){let{collection:i=new gn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(b){i.schema[b]&&(i.schema.splice(b,1),t(0,i))}function r(){const b=new fn({name:a()});i.schema.push(b),t(0,i)}function a(b="field"){let y="";for(;u(b+y);)++y;return b+y}function u(b){return!!i.schema.find(y=>y.name===b)}function f(b){let y=[];if(b.toDelete)return y;for(let k of i.schema)k===b||k.toDelete||y.push(k.name);return y}function c(b,y){if(!b)return;b.dataTransfer.dropEffect="move";const k=parseInt(b.dataTransfer.getData("text/plain")),$=i.schema;k<y?($.splice(y+1,0,$[k]),$.splice(k,1)):($.splice(y,0,$[k]),$.splice(k+1,1)),t(0,i.schema=$,i)}function d(b,y,k,$){k[$]=b,t(0,i)}const h=b=>o(b),m=(b,y)=>p3(y==null?void 0:y.detail,b),g=(b,y)=>c(y==null?void 0:y.detail,b);return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new gn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,h,m,g]}class m3 extends ke{constructor(e){super(),ye(this,e,h3,d3,be,{collection:0})}}const g3=n=>({isAdminOnly:n&256}),rd=n=>({isAdminOnly:n[8]});function _3(n){let e,t;return e=new me({props:{class:"form-field rule-field m-0 "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[$3,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field m-0 "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function b3(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function v3(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1walzui")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function y3(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Set custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-1walzui")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function k3(n){let e;return{c(){e=U("Leave empty to grant everyone access.")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function w3(n){let e,t,i,s,l;return{c(){e=U(`Only admins will be able to perform this action (
`),t=v("button"),t.textContent="unlock to change",i=U(`
).`),p(t,"type","button"),p(t,"class","link-hint")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(t,"click",n[9]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function S3(n){let e;function t(l,o){return l[8]?w3:k3}let i=t(n),s=i(n);return{c(){e=v("p"),s.c()},m(l,o){S(l,e,o),s.m(e,null)},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)))},d(l){l&&w(e),s.d()}}}function $3(n){let e,t,i,s,l=n[8]?"Admins only":"Custom rule",o,r,a,u,f,c,d,h,m;function g(O,I){return O[8]?y3:v3}let b=g(n),y=b(n);function k(O){n[13](O)}var $=n[6];function C(O){let I={id:O[17],baseCollection:O[1],disabled:O[8]};return O[0]!==void 0&&(I.value=O[0]),{props:I}}$&&(f=Yt($,C(n)),n[12](f),ie.push(()=>ve(f,"value",k)));const M=n[11].default,T=Nt(M,n,n[14],rd),E=T||S3(n);return{c(){e=v("label"),t=v("span"),i=U(n[2]),s=U(" - "),o=U(l),r=D(),y.c(),u=D(),f&&q(f.$$.fragment),d=D(),h=v("div"),E&&E.c(),p(t,"class","txt"),p(e,"for",a=n[17]),p(h,"class","help-block")},m(O,I){S(O,e,I),_(e,t),_(t,i),_(t,s),_(t,o),_(e,r),y.m(e,null),S(O,u,I),f&&H(f,O,I),S(O,d,I),S(O,h,I),E&&E.m(h,null),m=!0},p(O,I){(!m||I&4)&&re(i,O[2]),(!m||I&256)&&l!==(l=O[8]?"Admins only":"Custom rule")&&re(o,l),b===(b=g(O))&&y?y.p(O,I):(y.d(1),y=b(O),y&&(y.c(),y.m(e,null))),(!m||I&131072&&a!==(a=O[17]))&&p(e,"for",a);const L={};if(I&131072&&(L.id=O[17]),I&2&&(L.baseCollection=O[1]),I&256&&(L.disabled=O[8]),!c&&I&1&&(c=!0,L.value=O[0],we(()=>c=!1)),$!==($=O[6])){if(f){de();const N=f;P(N.$$.fragment,1,0,()=>{j(N,1)}),pe()}$?(f=Yt($,C(O)),O[12](f),ie.push(()=>ve(f,"value",k)),q(f.$$.fragment),A(f.$$.fragment,1),H(f,d.parentNode,d)):f=null}else $&&f.$set(L);T?T.p&&(!m||I&16640)&&Rt(T,M,O,O[14],m?Ft(M,O[14],I,g3):Ht(O[14]),rd):E&&E.p&&(!m||I&256)&&E.p(O,m?I:-1)},i(O){m||(f&&A(f.$$.fragment,O),A(E,O),m=!0)},o(O){f&&P(f.$$.fragment,O),P(E,O),m=!1},d(O){O&&w(e),y.d(),O&&w(u),n[12](null),f&&j(f,O),O&&w(d),O&&w(h),E&&E.d(O)}}}function C3(n){let e,t,i,s;const l=[b3,_3],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Oe()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(de(),P(o[f],1,1,()=>{o[f]=null}),pe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let ad;function T3(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,h=ad,m=!1;g();async function g(){h||m||(t(7,m=!0),t(6,h=(await rt(()=>import("./FilterAutocompleteInput-1e85f96b.js"),["./FilterAutocompleteInput-1e85f96b.js","./index-0935db40.js"],import.meta.url)).default),ad=h,t(7,m=!1))}async function b(){t(0,r=d||""),await In(),c==null||c.focus()}async function y(){d=r,t(0,r=null)}function k(C){ie[C?"unshift":"push"](()=>{c=C,t(5,c)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"$$scope"in C&&t(14,l=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,h,m,i,b,y,s,k,$,l]}class gs extends ke{constructor(e){super(),ye(this,e,T3,C3,be,{collection:1,rule:0,label:2,formKey:3,required:4})}}function ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function fd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I,L,N,F,V,G,se=n[0].schema,K=[];for(let te=0;te<se.length;te+=1)K[te]=cd(ud(n,se,te));return{c(){e=v("div"),t=v("div"),i=v("div"),s=v("p"),s.textContent="The following record fields are available:",l=D(),o=v("div"),r=v("code"),r.textContent="id",a=D(),u=v("code"),u.textContent="created",f=D(),c=v("code"),c.textContent="updated",d=D();for(let te=0;te<K.length;te+=1)K[te].c();h=D(),m=v("hr"),g=D(),b=v("p"),b.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=D(),k=v("div"),k.innerHTML=`<code>@request.method</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,$=D(),C=v("hr"),M=D(),T=v("p"),T.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",E=D(),O=v("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",I=D(),L=v("hr"),N=D(),F=v("p"),F.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(m,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(k,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(T,"class","m-b-0"),p(O,"class","inline-flex flex-gap-5"),p(L,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(te,ne){S(te,e,ne),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o),_(o,r),_(o,a),_(o,u),_(o,f),_(o,c),_(o,d);for(let z=0;z<K.length;z+=1)K[z].m(o,null);_(i,h),_(i,m),_(i,g),_(i,b),_(i,y),_(i,k),_(i,$),_(i,C),_(i,M),_(i,T),_(i,E),_(i,O),_(i,I),_(i,L),_(i,N),_(i,F),G=!0},p(te,ne){if(ne&1){se=te[0].schema;let z;for(z=0;z<se.length;z+=1){const Q=ud(te,se,z);K[z]?K[z].p(Q,ne):(K[z]=cd(Q),K[z].c(),K[z].m(o,null))}for(;z<K.length;z+=1)K[z].d(1);K.length=se.length}},i(te){G||(te&&tt(()=>{V||(V=qe(e,Et,{duration:150},!0)),V.run(1)}),G=!0)},o(te){te&&(V||(V=qe(e,Et,{duration:150},!1)),V.run(0)),G=!1},d(te){te&&w(e),yt(K,te),te&&V&&V.end()}}}function M3(n){let e,t=n[9].name+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&1&&t!==(t=s[9].name+"")&&re(i,t)},d(s){s&&w(e)}}}function D3(n){let e,t=n[9].name+"",i,s;return{c(){e=v("code"),i=U(t),s=U(".*")},m(l,o){S(l,e,o),_(e,i),_(e,s)},p(l,o){o&1&&t!==(t=l[9].name+"")&&re(i,t)},d(l){l&&w(e)}}}function cd(n){let e;function t(l,o){return l[9].type==="relation"||l[9].type==="user"?D3:M3}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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){s.d(l),l&&w(e)}}}function dd(n){let e,t,i,s,l;function o(a){n[8](a)}let r={label:"Manage action",formKey:"options.manageRule",collection:n[0],$$slots:{default:[O3]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new gs({props:r}),ie.push(()=>ve(i,"rule",o)),{c(){e=v("hr"),t=D(),q(i.$$.fragment),p(e,"class","m-t-sm m-b-sm")},m(a,u){S(a,e,u),S(a,t,u),H(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&4096&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,we(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function O3(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=D(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function E3(n){var ue;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I,L,N,F,V,G,se,K,te,ne,z,Q,J=n[1]&&fd(n);function ae(Z){n[3](Z)}let He={label:"List/Search action",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(He.rule=n[0].listRule),f=new gs({props:He}),ie.push(()=>ve(f,"rule",ae));function Fe(Z){n[4](Z)}let Ne={label:"View action",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(Ne.rule=n[0].viewRule),g=new gs({props:Ne}),ie.push(()=>ve(g,"rule",Fe));function Re(Z){n[5](Z)}let ge={label:"Create action",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(ge.rule=n[0].createRule),C=new gs({props:ge}),ie.push(()=>ve(C,"rule",Re));function Ce(Z){n[6](Z)}let $e={label:"Update action",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&($e.rule=n[0].updateRule),I=new gs({props:$e}),ie.push(()=>ve(I,"rule",Ce));function Ye(Z){n[7](Z)}let ze={label:"Delete action",formKey:"deleteRule",collection:n[0]};n[0].deleteRule!==void 0&&(ze.rule=n[0].deleteRule),G=new gs({props:ze}),ie.push(()=>ve(G,"rule",Ye));let oe=((ue=n[0])==null?void 0:ue.isAuth)&&dd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=D(),l=v("button"),r=U(o),a=D(),J&&J.c(),u=D(),q(f.$$.fragment),d=D(),h=v("hr"),m=D(),q(g.$$.fragment),y=D(),k=v("hr"),$=D(),q(C.$$.fragment),T=D(),E=v("hr"),O=D(),q(I.$$.fragment),N=D(),F=v("hr"),V=D(),q(G.$$.fragment),K=D(),oe&&oe.c(),te=Oe(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base"),p(h,"class","m-t-sm m-b-sm"),p(k,"class","m-t-sm m-b-sm"),p(E,"class","m-t-sm m-b-sm"),p(F,"class","m-t-sm m-b-sm")},m(Z,ce){S(Z,e,ce),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),J&&J.m(e,null),S(Z,u,ce),H(f,Z,ce),S(Z,d,ce),S(Z,h,ce),S(Z,m,ce),H(g,Z,ce),S(Z,y,ce),S(Z,k,ce),S(Z,$,ce),H(C,Z,ce),S(Z,T,ce),S(Z,E,ce),S(Z,O,ce),H(I,Z,ce),S(Z,N,ce),S(Z,F,ce),S(Z,V,ce),H(G,Z,ce),S(Z,K,ce),oe&&oe.m(Z,ce),S(Z,te,ce),ne=!0,z||(Q=Y(l,"click",n[2]),z=!0)},p(Z,[ce]){var It;(!ne||ce&2)&&o!==(o=Z[1]?"Hide available fields":"Show available fields")&&re(r,o),Z[1]?J?(J.p(Z,ce),ce&2&&A(J,1)):(J=fd(Z),J.c(),A(J,1),J.m(e,null)):J&&(de(),P(J,1,1,()=>{J=null}),pe());const Se={};ce&1&&(Se.collection=Z[0]),!c&&ce&1&&(c=!0,Se.rule=Z[0].listRule,we(()=>c=!1)),f.$set(Se);const _e={};ce&1&&(_e.collection=Z[0]),!b&&ce&1&&(b=!0,_e.rule=Z[0].viewRule,we(()=>b=!1)),g.$set(_e);const Je={};ce&1&&(Je.collection=Z[0]),!M&&ce&1&&(M=!0,Je.rule=Z[0].createRule,we(()=>M=!1)),C.$set(Je);const nt={};ce&1&&(nt.collection=Z[0]),!L&&ce&1&&(L=!0,nt.rule=Z[0].updateRule,we(()=>L=!1)),I.$set(nt);const St={};ce&1&&(St.collection=Z[0]),!se&&ce&1&&(se=!0,St.rule=Z[0].deleteRule,we(()=>se=!1)),G.$set(St),(It=Z[0])!=null&&It.isAuth?oe?(oe.p(Z,ce),ce&1&&A(oe,1)):(oe=dd(Z),oe.c(),A(oe,1),oe.m(te.parentNode,te)):oe&&(de(),P(oe,1,1,()=>{oe=null}),pe())},i(Z){ne||(A(J),A(f.$$.fragment,Z),A(g.$$.fragment,Z),A(C.$$.fragment,Z),A(I.$$.fragment,Z),A(G.$$.fragment,Z),A(oe),ne=!0)},o(Z){P(J),P(f.$$.fragment,Z),P(g.$$.fragment,Z),P(C.$$.fragment,Z),P(I.$$.fragment,Z),P(G.$$.fragment,Z),P(oe),ne=!1},d(Z){Z&&w(e),J&&J.d(),Z&&w(u),j(f,Z),Z&&w(d),Z&&w(h),Z&&w(m),j(g,Z),Z&&w(y),Z&&w(k),Z&&w($),j(C,Z),Z&&w(T),Z&&w(E),Z&&w(O),j(I,Z),Z&&w(N),Z&&w(F),Z&&w(V),j(G,Z),Z&&w(K),oe&&oe.d(Z),Z&&w(te),z=!1,Q()}}}function A3(n,e,t){let{collection:i=new gn}=e,s=!1;const l=()=>t(1,s=!s);function o(d){n.$$.not_equal(i.listRule,d)&&(i.listRule=d,t(0,i))}function r(d){n.$$.not_equal(i.viewRule,d)&&(i.viewRule=d,t(0,i))}function a(d){n.$$.not_equal(i.createRule,d)&&(i.createRule=d,t(0,i))}function u(d){n.$$.not_equal(i.updateRule,d)&&(i.updateRule=d,t(0,i))}function f(d){n.$$.not_equal(i.deleteRule,d)&&(i.deleteRule=d,t(0,i))}function c(d){n.$$.not_equal(i.options.manageRule,d)&&(i.options.manageRule=d,t(0,i))}return n.$$set=d=>{"collection"in d&&t(0,i=d.collection)},[i,s,l,o,r,a,u,f,c]}class I3 extends ke{constructor(e){super(),ye(this,e,A3,E3,be,{collection:0})}}function P3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function L3(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[P3,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function N3(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function F3(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function pd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function R3(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].options.allowUsernameAuth?F3:N3}let u=a(n),f=u(n),c=n[3]&&pd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Oe(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,h){S(d,e,h),S(d,t,h),S(d,i,h),S(d,s,h),f.m(d,h),S(d,l,h),c&&c.m(d,h),S(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?h&8&&A(c,1):(c=pd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(de(),P(c,1,1,()=>{c=null}),pe())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function H3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function hd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(B.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[j3,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(B.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[q3,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(B.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(B.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&tt(()=>{r||(r=qe(e,Et,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=qe(e,Et,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function j3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[7](b)}let g={id:n[12],disabled:!B.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new ts({props:g}),ie.push(()=>ve(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),H(r,b,y),S(b,u,y),S(b,f,y),c=!0,d||(h=Ie(We.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&4096&&l!==(l=b[12]))&&p(e,"for",l);const k={};y&4096&&(k.id=b[12]),y&1&&(k.disabled=!B.isEmpty(b[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,k.value=b[0].options.exceptEmailDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[8](b)}let g={id:n[12],disabled:!B.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new ts({props:g}),ie.push(()=>ve(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),q(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),H(r,b,y),S(b,u,y),S(b,f,y),c=!0,d||(h=Ie(We.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&4096&&l!==(l=b[12]))&&p(e,"for",l);const k={};y&4096&&(k.id=b[12]),y&1&&(k.disabled=!B.isEmpty(b[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,k.value=b[0].options.onlyEmailDomains,we(()=>a=!1)),r.$set(k)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,h()}}}function V3(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[H3,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&hd(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Oe()},m(o,r){H(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=hd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function z3(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function B3(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function md(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function U3(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].options.allowEmailAuth?B3:z3}let u=a(n),f=u(n),c=n[2]&&md();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Oe(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,h){S(d,e,h),S(d,t,h),S(d,i,h),S(d,s,h),f.m(d,h),S(d,l,h),c&&c.m(d,h),S(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?h&4&&A(c,1):(c=md(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(de(),P(c,1,1,()=>{c=null}),pe())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function W3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function gd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{t||(t=qe(e,Et,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,Et,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Y3(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[W3,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&gd();return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Oe()},m(o,r){H(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=gd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function K3(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function J3(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function _d(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Z3(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].options.allowOAuth2Auth?J3:K3}let u=a(n),f=u(n),c=n[1]&&_d();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Oe(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,h){S(d,e,h),S(d,t,h),S(d,i,h),S(d,s,h),f.m(d,h),S(d,l,h),c&&c.m(d,h),S(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?h&2&&A(c,1):(c=_d(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(de(),P(c,1,1,()=>{c=null}),pe())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function G3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=D(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),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&&dt(l.value)!==u[0].options.minPasswordLength&&fe(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function X3(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Always require email",o=D(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"change",n[11]),Ie(We.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function Q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y;return s=new ks({props:{single:!0,$$slots:{header:[R3],default:[L3]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[U3],default:[V3]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[Z3],default:[Y3]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[G3,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),b=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[X3,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=D(),i=v("div"),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),f=v("hr"),c=D(),d=v("h4"),d.textContent="General",h=D(),q(m.$$.fragment),g=D(),q(b.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(k,$){S(k,e,$),S(k,t,$),S(k,i,$),H(s,i,null),_(i,l),H(o,i,null),_(i,r),H(a,i,null),S(k,u,$),S(k,f,$),S(k,c,$),S(k,d,$),S(k,h,$),H(m,k,$),S(k,g,$),H(b,k,$),y=!0},p(k,[$]){const C={};$&8201&&(C.$$scope={dirty:$,ctx:k}),s.$set(C);const M={};$&8197&&(M.$$scope={dirty:$,ctx:k}),o.$set(M);const T={};$&8195&&(T.$$scope={dirty:$,ctx:k}),a.$set(T);const E={};$&12289&&(E.$$scope={dirty:$,ctx:k}),m.$set(E);const O={};$&12289&&(O.$$scope={dirty:$,ctx:k}),b.$set(O)},i(k){y||(A(s.$$.fragment,k),A(o.$$.fragment,k),A(a.$$.fragment,k),A(m.$$.fragment,k),A(b.$$.fragment,k),y=!0)},o(k){P(s.$$.fragment,k),P(o.$$.fragment,k),P(a.$$.fragment,k),P(m.$$.fragment,k),P(b.$$.fragment,k),y=!1},d(k){k&&w(e),k&&w(t),k&&w(i),j(s),j(o),j(a),k&&w(u),k&&w(f),k&&w(c),k&&w(d),k&&w(h),j(m,k),k&&w(g),j(b,k)}}}function x3(n,e,t){let i,s,l,o;Ke(n,Ci,g=>t(4,o=g));let{collection:r=new gn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=dt(this.value),t(0,r)}function m(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,b,y,k;n.$$.dirty&1&&r.isAuth&&B.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!B.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!B.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!B.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!B.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,m]}class eC extends ke{constructor(e){super(),ye(this,e,x3,Q3,be,{collection:0})}}function bd(n,e,t){const i=n.slice();return i[14]=e[t],i}function vd(n,e,t){const i=n.slice();return i[14]=e[t],i}function yd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function kd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed collection
`),s=v("strong"),o=U(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,m){S(h,e,m),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(f,d)},p(h,m){m&2&&l!==(l=h[1].originalName+"")&&re(o,l),m&2&&c!==(c=h[1].name+"")&&re(d,c)},d(h){h&&w(e)}}}function wd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed field
`),s=v("strong"),o=U(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,m){S(h,e,m),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(f,d)},p(h,m){m&16&&l!==(l=h[14].originalName+"")&&re(o,l),m&16&&c!==(c=h[14].name+"")&&re(d,c)},d(h){h&&w(e)}}}function Sd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=v("li"),t=U("Removed field "),i=v("span"),l=U(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),_(e,t),_(e,i),_(i,l),_(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&re(l,s)},d(r){r&&w(e)}}}function tC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&yd(),m=n[5]&&kd(n),g=n[4],b=[];for(let $=0;$<g.length;$+=1)b[$]=wd(vd(n,g,$));let y=n[3],k=[];for(let $=0;$<y.length;$+=1)k[$]=Sd(bd(n,y,$));return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),l=v("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,o=D(),h&&h.c(),r=D(),a=v("h6"),a.textContent="Changes:",u=D(),f=v("ul"),m&&m.c(),c=D();for(let $=0;$<b.length;$+=1)b[$].c();d=D();for(let $=0;$<k.length;$+=1)k[$].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m($,C){S($,e,C),_(e,t),_(e,i),_(e,s),_(s,l),_(s,o),h&&h.m(s,null),S($,r,C),S($,a,C),S($,u,C),S($,f,C),m&&m.m(f,null),_(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);_(f,d);for(let M=0;M<k.length;M+=1)k[M].m(f,null)},p($,C){if($[3].length?h||(h=yd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),$[5]?m?m.p($,C):(m=kd($),m.c(),m.m(f,c)):m&&(m.d(1),m=null),C&16){g=$[4];let M;for(M=0;M<g.length;M+=1){const T=vd($,g,M);b[M]?b[M].p(T,C):(b[M]=wd(T),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=g.length}if(C&8){y=$[3];let M;for(M=0;M<y.length;M+=1){const T=bd($,y,M);k[M]?k[M].p(T,C):(k[M]=Sd(T),k[M].c(),k[M].m(f,null))}for(;M<k.length;M+=1)k[M].d(1);k.length=y.length}},d($){$&&w(e),h&&h.d(),$&&w(r),$&&w(a),$&&w(u),$&&w(f),m&&m.d(),yt(b,$),yt(k,$)}}}function nC(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function iC(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[8]),Y(i,"click",n[9])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Le(l)}}}function sC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[iC],header:[nC],default:[tC]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function lC(n,e,t){let i,s,l;const o=Ct();let r,a;async function u(y){t(1,a=y),await In(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function m(y){ie[y?"unshift":"push"](()=>{r=y,t(2,r)})}function g(y){Be.call(this,n,y)}function b(y){Be.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,m,g,b]}class oC extends ke{constructor(e){super(),ye(this,e,lC,sC,be,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function $d(n,e,t){const i=n.slice();return i[43]=e[t][0],i[44]=e[t][1],i}function Cd(n){let e,t,i,s;function l(r){n[30](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new I3({props:o}),ie.push(()=>ve(t,"collection",l)),{c(){e=v("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],we(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Td(n){let e,t,i,s;function l(r){n[31](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new eC({props:o}),ie.push(()=>ve(t,"collection",l)),{c(){e=v("div"),q(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Es)},m(r,a){S(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],we(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function rC(n){let e,t,i,s,l,o,r;function a(d){n[29](d)}let u={};n[2]!==void 0&&(u.collection=n[2]),i=new m3({props:u}),ie.push(()=>ve(i,"collection",a));let f=n[3]===bl&&Cd(n),c=n[2].isAuth&&Td(n);return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),l=D(),f&&f.c(),o=D(),c&&c.c(),p(t,"class","tab-item"),x(t,"active",n[3]===_i),p(e,"class","tabs-content svelte-b10vi")},m(d,h){S(d,e,h),_(e,t),H(i,t,null),_(e,l),f&&f.m(e,null),_(e,o),c&&c.m(e,null),r=!0},p(d,h){const m={};!s&&h[0]&4&&(s=!0,m.collection=d[2],we(()=>s=!1)),i.$set(m),(!r||h[0]&8)&&x(t,"active",d[3]===_i),d[3]===bl?f?(f.p(d,h),h[0]&8&&A(f,1)):(f=Cd(d),f.c(),A(f,1),f.m(e,o)):f&&(de(),P(f,1,1,()=>{f=null}),pe()),d[2].isAuth?c?(c.p(d,h),h[0]&4&&A(c,1)):(c=Td(d),c.c(),A(c,1),c.m(e,null)):c&&(de(),P(c,1,1,()=>{c=null}),pe())},i(d){r||(A(i.$$.fragment,d),A(f),A(c),r=!0)},o(d){P(i.$$.fragment,d),P(f),P(c),r=!1},d(d){d&&w(e),j(i),f&&f.d(),c&&c.d()}}}function Md(n){let e,t,i,s,l,o,r;return o=new Qn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[aC]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=D(),i=v("button"),s=v("i"),l=D(),q(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),_(i,s),_(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&65536&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function aC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",bn(ct(n[22]))),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Dd(n){let e,t,i,s;return i=new Qn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[uC]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=D(),q(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&65536&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function Od(n){let e,t,i,s,l,o=n[44]+"",r,a,u,f,c;function d(){return n[24](n[43])}return{c(){e=v("button"),t=v("i"),s=D(),l=v("span"),r=U(o),a=U(" collection"),u=D(),p(t,"class",i=yi(B.getCollectionTypeIcon(n[43]))+" svelte-b10vi"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[43]==n[2].type)},m(h,m){S(h,e,m),_(e,t),_(e,s),_(e,l),_(l,r),_(l,a),_(e,u),f||(c=Y(e,"click",d),f=!0)},p(h,m){n=h,m[0]&64&&i!==(i=yi(B.getCollectionTypeIcon(n[43]))+" svelte-b10vi")&&p(t,"class",i),m[0]&64&&o!==(o=n[44]+"")&&re(r,o),m[0]&68&&x(e,"selected",n[43]==n[2].type)},d(h){h&&w(e),f=!1,c()}}}function uC(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Od($d(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Oe()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=$d(s,t,o);i[o]?i[o].p(r,l):(i[o]=Od(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){yt(i,s),s&&w(e)}}}function Ed(n){let e;return{c(){e=v("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y=(n[6][n[2].type]||"N/A")+"",k,$,C,M,T,E,O,I,L,N=n[2].isNew&&Dd(n),F=n[2].system&&Ed();return{c(){e=v("label"),t=U("Name"),s=D(),l=v("input"),f=D(),c=v("div"),d=v("button"),h=v("span"),m=D(),g=v("span"),b=U("Type: "),k=U(y),$=D(),N&&N.c(),T=D(),F&&F.c(),E=Oe(),p(e,"for",i=n[42]),p(l,"type","text"),p(l,"id",o=n[42]),l.required=!0,l.disabled=n[12],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(g,"class","txt"),p(d,"type","button"),p(d,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-hint":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(V,G){S(V,e,G),_(e,t),S(V,s,G),S(V,l,G),S(V,f,G),S(V,c,G),_(c,d),_(d,h),_(d,m),_(d,g),_(g,b),_(g,k),_(d,$),N&&N.m(d,null),S(V,T,G),F&&F.m(V,G),S(V,E,G),O=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[23]),I=!0)},p(V,G){(!O||G[1]&2048&&i!==(i=V[42]))&&p(e,"for",i),(!O||G[1]&2048&&o!==(o=V[42]))&&p(l,"id",o),(!O||G[0]&4096)&&(l.disabled=V[12]),(!O||G[0]&4&&r!==(r=V[2].isNew))&&(l.autofocus=r),(!O||G[0]&4&&a!==(a=V[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!O||G[0]&4&&u!==(u=V[2].name)&&l.value!==u)&&(l.value=u),(!O||G[0]&68)&&y!==(y=(V[6][V[2].type]||"N/A")+"")&&re(k,y),V[2].isNew?N?(N.p(V,G),G[0]&4&&A(N,1)):(N=Dd(V),N.c(),A(N,1),N.m(d,null)):N&&(de(),P(N,1,1,()=>{N=null}),pe()),(!O||G[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(V[2].isNew?"btn-hint":"btn-transparent")))&&p(d,"class",C),(!O||G[0]&4&&M!==(M=!V[2].isNew))&&(d.disabled=M),V[2].system?F||(F=Ed(),F.c(),F.m(E.parentNode,E)):F&&(F.d(1),F=null)},i(V){O||(A(N),O=!0)},o(V){P(N),O=!1},d(V){V&&w(e),V&&w(s),V&&w(l),V&&w(f),V&&w(c),N&&N.d(),V&&w(T),F&&F.d(V),V&&w(E),I=!1,L()}}}function Ad(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=We.call(null,e,n[13])),l=!0)},p(r,a){t&&Zt(t.update)&&a[0]&8192&&t.update.call(null,r[13])},i(r){s||(r&&tt(()=>{i||(i=qe(e,At,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=qe(e,At,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Id(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Pd(n){var a,u,f;let e,t,i,s=!B.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&Ld();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=D(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Es)},m(c,d){S(c,e,d),_(e,t),_(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[28]),l=!0)},p(c,d){var h,m,g;d[0]&32&&(s=!B.isEmpty((h=c[5])==null?void 0:h.options)&&!((g=(m=c[5])==null?void 0:m.options)!=null&&g.manageRule)),s?r?d[0]&32&&A(r,1):(r=Ld(),r.c(),A(r,1),r.m(e,null)):r&&(de(),P(r,1,1,()=>{r=null}),pe()),d[0]&8&&x(e,"active",c[3]===Es)},d(c){c&&w(e),r&&r.d(),l=!1,o()}}}function Ld(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cC(n){var V,G,se,K,te,ne,z,Q;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,m,g=!B.isEmpty((V=n[5])==null?void 0:V.schema),b,y,k,$,C=!B.isEmpty((G=n[5])==null?void 0:G.listRule)||!B.isEmpty((se=n[5])==null?void 0:se.viewRule)||!B.isEmpty((K=n[5])==null?void 0:K.createRule)||!B.isEmpty((te=n[5])==null?void 0:te.updateRule)||!B.isEmpty((ne=n[5])==null?void 0:ne.deleteRule)||!B.isEmpty((Q=(z=n[5])==null?void 0:z.options)==null?void 0:Q.manageRule),M,T,E,O,I=!n[2].isNew&&!n[2].system&&Md(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[12]?"disabled":""),name:"name",$$slots:{default:[fC,({uniqueId:J})=>({42:J}),({uniqueId:J})=>[0,J?2048:0]]},$$scope:{ctx:n}}});let L=g&&Ad(n),N=C&&Id(),F=n[2].isAuth&&Pd(n);return{c(){e=v("h4"),i=U(t),s=D(),I&&I.c(),l=D(),o=v("form"),q(r.$$.fragment),a=D(),u=v("input"),f=D(),c=v("div"),d=v("button"),h=v("span"),h.textContent="Fields",m=D(),L&&L.c(),b=D(),y=v("button"),k=v("span"),k.textContent="API Rules",$=D(),N&&N.c(),M=D(),F&&F.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===_i),p(k,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),x(y,"active",n[3]===bl),p(c,"class","tabs-header stretched")},m(J,ae){S(J,e,ae),_(e,i),S(J,s,ae),I&&I.m(J,ae),S(J,l,ae),S(J,o,ae),H(r,o,null),_(o,a),_(o,u),S(J,f,ae),S(J,c,ae),_(c,d),_(d,h),_(d,m),L&&L.m(d,null),_(c,b),_(c,y),_(y,k),_(y,$),N&&N.m(y,null),_(c,M),F&&F.m(c,null),T=!0,E||(O=[Y(o,"submit",ct(n[25])),Y(d,"click",n[26]),Y(y,"click",n[27])],E=!0)},p(J,ae){var Fe,Ne,Re,ge,Ce,$e,Ye,ze;(!T||ae[0]&4)&&t!==(t=J[2].isNew?"New collection":"Edit collection")&&re(i,t),!J[2].isNew&&!J[2].system?I?(I.p(J,ae),ae[0]&4&&A(I,1)):(I=Md(J),I.c(),A(I,1),I.m(l.parentNode,l)):I&&(de(),P(I,1,1,()=>{I=null}),pe());const He={};ae[0]&4096&&(He.class="form-field collection-field-name required m-b-0 "+(J[12]?"disabled":"")),ae[0]&4164|ae[1]&67584&&(He.$$scope={dirty:ae,ctx:J}),r.$set(He),ae[0]&32&&(g=!B.isEmpty((Fe=J[5])==null?void 0:Fe.schema)),g?L?(L.p(J,ae),ae[0]&32&&A(L,1)):(L=Ad(J),L.c(),A(L,1),L.m(d,null)):L&&(de(),P(L,1,1,()=>{L=null}),pe()),(!T||ae[0]&8)&&x(d,"active",J[3]===_i),ae[0]&32&&(C=!B.isEmpty((Ne=J[5])==null?void 0:Ne.listRule)||!B.isEmpty((Re=J[5])==null?void 0:Re.viewRule)||!B.isEmpty((ge=J[5])==null?void 0:ge.createRule)||!B.isEmpty((Ce=J[5])==null?void 0:Ce.updateRule)||!B.isEmpty(($e=J[5])==null?void 0:$e.deleteRule)||!B.isEmpty((ze=(Ye=J[5])==null?void 0:Ye.options)==null?void 0:ze.manageRule)),C?N?ae[0]&32&&A(N,1):(N=Id(),N.c(),A(N,1),N.m(y,null)):N&&(de(),P(N,1,1,()=>{N=null}),pe()),(!T||ae[0]&8)&&x(y,"active",J[3]===bl),J[2].isAuth?F?F.p(J,ae):(F=Pd(J),F.c(),F.m(c,null)):F&&(F.d(1),F=null)},i(J){T||(A(I),A(r.$$.fragment,J),A(L),A(N),T=!0)},o(J){P(I),P(r.$$.fragment,J),P(L),P(N),T=!1},d(J){J&&w(e),J&&w(s),I&&I.d(J),J&&w(l),J&&w(o),j(r),J&&w(f),J&&w(c),L&&L.d(),N&&N.d(),F&&F.d(),E=!1,Le(O)}}}function dC(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[9],x(s,"btn-loading",n[9])},m(c,d){S(c,e,d),_(e,t),S(c,i,d),S(c,s,d),_(s,l),_(l,r),u||(f=[Y(e,"click",n[20]),Y(s,"click",n[21])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&re(r,o),d[0]&2560&&a!==(a=!c[11]||c[9])&&(s.disabled=a),d[0]&512&&x(s,"btn-loading",c[9])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function pC(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",beforeHide:n[32],$$slots:{footer:[dC],header:[cC],default:[rC]},$$scope:{ctx:n}};e=new Bn({props:l}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let o={};return i=new oC({props:o}),n[36](i),i.$on("confirm",n[37]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(r,a){H(e,r,a),S(r,t,a),H(i,r,a),s=!0},p(r,a){const u={};a[0]&1040&&(u.beforeHide=r[32]),a[0]&14956|a[1]&65536&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[33](null),j(e,r),r&&w(t),n[36](null),j(i,r)}}}const _i="fields",bl="api_rules",Es="options",hC="base",Nd="auth";function Mr(n){return JSON.stringify(n)}function mC(n,e,t){let i,s,l,o,r;Ke(n,Ci,$e=>t(5,r=$e));const a={};a[hC]="Base",a[Nd]="Auth";const u=Ct();let f,c,d=null,h=new gn,m=!1,g=!1,b=_i,y=Mr(h);function k($e){t(3,b=$e)}function $($e){return M($e),t(10,g=!0),k(_i),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M($e){Vn({}),typeof $e<"u"?(d=$e,t(2,h=$e==null?void 0:$e.clone())):(d=null,t(2,h=new gn)),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await In(),t(19,y=Mr(h))}function T(){if(h.isNew)return E();c==null||c.show(h)}function E(){if(m)return;t(9,m=!0);const $e=O();let Ye;h.isNew?Ye=he.collections.create($e):Ye=he.collections.update(h.id,$e),Ye.then(ze=>{Ca(),tb(ze.id),t(10,g=!1),C(),qt(h.isNew?"Successfully created collection.":"Successfully updated collection."),u("save",{isNew:h.isNew,collection:ze})}).catch(ze=>{he.errorResponseHandler(ze)}).finally(()=>{t(9,m=!1)})}function O(){const $e=h.export();$e.schema=$e.schema.slice(0);for(let Ye=$e.schema.length-1;Ye>=0;Ye--)$e.schema[Ye].toDelete&&$e.schema.splice(Ye,1);return $e}function I(){d!=null&&d.id&&Dn(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>he.collections.delete(d==null?void 0:d.id).then(()=>{C(),qt(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),s4(d)}).catch($e=>{he.errorResponseHandler($e)}))}function L($e){t(2,h.type=$e,h),Cs("schema")}const N=()=>C(),F=()=>T(),V=()=>I(),G=$e=>{t(2,h.name=B.slugify($e.target.value),h),$e.target.value=h.name},se=$e=>L($e),K=()=>{o&&T()},te=()=>k(_i),ne=()=>k(bl),z=()=>k(Es);function Q($e){h=$e,t(2,h)}function J($e){h=$e,t(2,h)}function ae($e){h=$e,t(2,h)}const He=()=>l&&g?(Dn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),C()}),!1):!0;function Fe($e){ie[$e?"unshift":"push"](()=>{f=$e,t(7,f)})}function Ne($e){Be.call(this,n,$e)}function Re($e){Be.call(this,n,$e)}function ge($e){ie[$e?"unshift":"push"](()=>{c=$e,t(8,c)})}const Ce=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&32&&t(13,i=typeof B.getNestedVal(r,"schema.message",null)=="string"?B.getNestedVal(r,"schema.message"):"Has errors"),n.$$.dirty[0]&4&&t(12,s=!h.isNew&&h.system),n.$$.dirty[0]&524292&&t(4,l=y!=Mr(h)),n.$$.dirty[0]&20&&t(11,o=h.isNew||l),n.$$.dirty[0]&12&&b===Es&&h.type!==Nd&&k(_i)},[k,C,h,b,l,r,a,f,c,m,g,o,s,i,T,E,I,L,$,y,N,F,V,G,se,K,te,ne,z,Q,J,ae,He,Fe,Ne,Re,ge,Ce]}class tu extends ke{constructor(e){super(),ye(this,e,mC,pC,be,{changeTab:0,show:18,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[18]}get hide(){return this.$$.ctx[1]}}function Fd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Rd(n){let e,t=n[1].length&&Hd();return{c(){t&&t.c(),e=Oe()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1].length?t||(t=Hd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Hd(n){let e;return{c(){e=v("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function jd(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,c,d;return{key:n,first:null,c(){var h;t=v("a"),i=v("i"),l=D(),o=v("span"),a=U(r),u=D(),p(i,"class",s=B.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",f="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),x(t,"active",((h=e[5])==null?void 0:h.id)===e[15].id),this.first=t},m(h,m){S(h,t,m),_(t,i),_(t,l),_(t,o),_(o,a),_(t,u),c||(d=Ie(Qt.call(null,t)),c=!0)},p(h,m){var g;e=h,m&8&&s!==(s=B.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),m&8&&r!==(r=e[15].name+"")&&re(a,r),m&8&&f!==(f="/collections?collectionId="+e[15].id)&&p(t,"href",f),m&40&&x(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id)},d(h){h&&w(t),c=!1,d()}}}function qd(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),_(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function gC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,m,g,b,y,k,$,C=n[3];const M=I=>I[15].id;for(let I=0;I<C.length;I+=1){let L=Fd(n,C,I),N=M(L);h.set(N,d[I]=jd(N,L))}let T=null;C.length||(T=Rd(n));let E=!n[7]&&qd(n),O={};return b=new tu({props:O}),n[13](b),b.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=v("input"),a=D(),u=v("hr"),f=D(),c=v("div");for(let I=0;I<d.length;I+=1)d[I].c();T&&T.c(),m=D(),E&&E.c(),g=D(),q(b.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),x(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),x(c,"fade",n[6]),x(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),_(e,t),_(t,i),_(i,s),_(s,l),_(i,o),_(i,r),fe(r,n[0]),_(e,a),_(e,u),_(e,f),_(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);T&&T.m(c,null),_(e,m),E&&E.m(e,null),S(I,g,L),H(b,I,L),y=!0,k||($=[Y(l,"click",n[10]),Y(r,"input",n[11])],k=!0)},p(I,[L]){(!y||L&16)&&x(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&fe(r,I[0]),(!y||L&16)&&x(i,"active",I[4]),L&42&&(C=I[3],d=gt(d,L,M,1,I,C,h,c,Xi,jd,null,Fd),!C.length&&T?T.p(I,L):C.length?T&&(T.d(1),T=null):(T=Rd(I),T.c(),T.m(c,null))),(!y||L&64)&&x(c,"fade",I[6]),(!y||L&8)&&x(c,"sidebar-content-compact",I[3].length>20),I[7]?E&&(E.d(1),E=null):E?E.p(I,L):(E=qd(I),E.c(),E.m(e,null));const N={};b.$set(N)},i(I){y||(A(b.$$.fragment,I),y=!0)},o(I){P(b.$$.fragment,I),y=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();T&&T.d(),E&&E.d(),I&&w(g),n[13](null),j(b,I),k=!1,Le($)}}}function _C(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function bC(n,e,t){let i,s,l,o,r,a,u;Ke(n,Si,k=>t(5,o=k)),Ke(n,es,k=>t(9,r=k)),Ke(n,Po,k=>t(6,a=k)),Ke(n,Ts,k=>t(7,u=k));let f,c="";function d(k){Wt(Si,o=k,o)}const h=()=>t(0,c="");function m(){c=this.value,t(0,c)}const g=()=>f==null?void 0:f.show();function b(k){ie[k?"unshift":"push"](()=>{f=k,t(2,f)})}const y=k=>{var $;($=k.detail)!=null&&$.isNew&&k.detail.collection&&d(k.detail.collection)};return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(k=>k.id==c||k.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&512&&r&&_C()},[c,i,f,l,s,o,a,u,d,r,h,m,g,b,y]}class vC extends ke{constructor(e){super(),ye(this,e,bC,gC,be,{})}}function Vd(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function zd(n){n[18]=n[19].default}function Bd(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ud(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wd(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Ud();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Oe(),c&&c.c(),s=D(),l=v("button"),r=U(o),a=D(),p(l,"type","button"),p(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(h,m){S(h,t,m),c&&c.m(h,m),S(h,s,m),S(h,l,m),_(l,r),_(l,a),u||(f=Y(l,"click",d),u=!0)},p(h,m){e=h,m&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Ud(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),m&8&&o!==(o=e[15].label+"")&&re(r,o),m&40&&x(l,"active",e[5]===e[14])},d(h){h&&w(t),c&&c.d(h),h&&w(s),h&&w(l),u=!1,f()}}}function Yd(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:wC,then:kC,catch:yC,value:19,blocks:[,,,]};return lu(t=n[15].component,s),{c(){e=Oe(),s.block.c()},m(l,o){S(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)&&lu(t,s)||Eb(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function yC(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function kC(n){zd(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){q(e.$$.fragment),t=D()},m(s,l){H(e,s,l),S(s,t,l),i=!0},p(s,l){zd(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function wC(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function Kd(n,e){let t,i,s,l=e[5]===e[14]&&Yd(e);return{key:n,first:null,c(){t=Oe(),l&&l.c(),i=Oe(),this.first=t},m(o,r){S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Yd(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function SC(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=Object.entries(n[3]);const d=g=>g[14];for(let g=0;g<c.length;g+=1){let b=Bd(n,c,g),y=d(b);l.set(y,s[g]=Wd(y,b))}let h=Object.entries(n[3]);const m=g=>g[14];for(let g=0;g<h.length;g+=1){let b=Vd(n,h,g),y=m(b);u.set(y,a[g]=Kd(y,b))}return{c(){var g;e=v("div"),t=v("aside"),i=v("nav");for(let b=0;b<s.length;b+=1)s[b].c();o=D(),r=v("div");for(let b=0;b<a.length;b+=1)a[b].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),x(t,"compact",(g=n[2])==null?void 0:g.isAuth),p(r,"class","docs-content"),p(e,"class","docs-content-wrapper")},m(g,b){S(g,e,b),_(e,t),_(t,i);for(let y=0;y<s.length;y+=1)s[y].m(i,null);_(e,o),_(e,r);for(let y=0;y<a.length;y+=1)a[y].m(r,null);f=!0},p(g,b){var y;b&106&&(c=Object.entries(g[3]),s=gt(s,b,d,1,g,c,l,i,Xi,Wd,null,Bd)),(!f||b&4)&&x(t,"compact",(y=g[2])==null?void 0:y.isAuth),b&44&&(h=Object.entries(g[3]),de(),a=gt(a,b,m,1,g,h,u,r,Kt,Kd,null,Vd),pe())},i(g){if(!f){for(let b=0;b<h.length;b+=1)A(a[b]);f=!0}},o(g){for(let b=0;b<a.length;b+=1)P(a[b]);f=!1},d(g){g&&w(e);for(let b=0;b<s.length;b+=1)s[b].d();for(let b=0;b<a.length;b+=1)a[b].d()}}}function $C(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function CC(n){let e,t,i={class:"docs-panel",$$slots:{footer:[$C],default:[SC]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function TC(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-f274707c.js"),["./ListApiDocs-f274707c.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-06f782eb.js"),["./ViewApiDocs-06f782eb.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-5f70f974.js"),["./CreateApiDocs-5f70f974.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-7fd85cc8.js"),["./UpdateApiDocs-7fd85cc8.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-2e5d279c.js"),["./DeleteApiDocs-2e5d279c.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-9e879930.js"),["./RealtimeApiDocs-9e879930.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-aaf5c634.js"),["./AuthWithPasswordDocs-aaf5c634.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-35192747.js"),["./AuthWithOAuth2Docs-35192747.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-16f6be37.js"),["./AuthRefreshDocs-16f6be37.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-305455af.js"),["./RequestVerificationDocs-305455af.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-0da7f219.js"),["./ConfirmVerificationDocs-0da7f219.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-b92156af.js"),["./RequestPasswordResetDocs-b92156af.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-b7fab314.js"),["./ConfirmPasswordResetDocs-b7fab314.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-7ee65c01.js"),["./RequestEmailChangeDocs-7ee65c01.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-5b23032f.js"),["./ConfirmEmailChangeDocs-5b23032f.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-9bc940ca.js"),["./AuthMethodsDocs-9bc940ca.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-2826cf5e.js"),["./ListExternalAuthsDocs-2826cf5e.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-15a06b1d.js"),["./UnlinkExternalAuthDocs-15a06b1d.js","./SdkTabs-a1061d88.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new gn,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),h=y=>c(y);function m(y){ie[y?"unshift":"push"](()=>{l=y,t(4,l)})}function g(y){Be.call(this,n,y)}function b(y){Be.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.isAuth?(t(3,a=Object.assign({},i,s)),!(o!=null&&o.options.allowUsernameAuth)&&!(o!=null&&o.options.allowEmailAuth)&&delete a["auth-with-password"],o!=null&&o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,h,m,g,b]}class MC extends ke{constructor(e){super(),ye(this,e,TC,CC,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]}}function DC(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Username",o=D(),r=v("input"),p(t,"class",B.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","text"),p(r,"requried",a=!n[0].isNew),p(r,"placeholder",u=n[0].isNew?"Leave empty to auto generate...":n[3]),p(r,"id",f=n[12])},m(h,m){S(h,e,m),_(e,t),_(e,i),_(e,s),S(h,o,m),S(h,r,m),fe(r,n[0].username),c||(d=Y(r,"input",n[4]),c=!0)},p(h,m){m&4096&&l!==(l=h[12])&&p(e,"for",l),m&1&&a!==(a=!h[0].isNew)&&p(r,"requried",a),m&1&&u!==(u=h[0].isNew?"Leave empty to auto generate...":h[3])&&p(r,"placeholder",u),m&4096&&f!==(f=h[12])&&p(r,"id",f),m&1&&r.value!==h[0].username&&fe(r,h[0].username)},d(h){h&&w(e),h&&w(o),h&&w(r),c=!1,d()}}}function OC(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,h,m,g,b,y,k,$,C;return{c(){var M;e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("div"),a=v("button"),u=v("span"),f=U("Public: "),d=U(c),m=D(),g=v("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[12]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",h="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(g,"type","email"),g.autofocus=b=n[0].isNew,p(g,"autocomplete","off"),p(g,"id",y=n[12]),g.required=k=(M=n[1].options)==null?void 0:M.requireEmail,p(g,"class","svelte-1751a4d")},m(M,T){S(M,e,T),_(e,t),_(e,i),_(e,s),S(M,o,T),S(M,r,T),_(r,a),_(a,u),_(u,f),_(u,d),S(M,m,T),S(M,g,T),fe(g,n[0].email),n[0].isNew&&g.focus(),$||(C=[Ie(We.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",n[5]),Y(g,"input",n[6])],$=!0)},p(M,T){var E;T&4096&&l!==(l=M[12])&&p(e,"for",l),T&1&&c!==(c=M[0].emailVisibility?"On":"Off")&&re(d,c),T&1&&h!==(h="btn btn-sm btn-transparent "+(M[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",h),T&1&&b!==(b=M[0].isNew)&&(g.autofocus=b),T&4096&&y!==(y=M[12])&&p(g,"id",y),T&2&&k!==(k=(E=M[1].options)==null?void 0:E.requireEmail)&&(g.required=k),T&1&&g.value!==M[0].email&&fe(g,M[0].email)},d(M){M&&w(e),M&&w(o),M&&w(r),M&&w(m),M&&w(g),$=!1,Le(C)}}}function Jd(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[EC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function EC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[2],S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Zd(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[AC,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[IC,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){S(f,e,c),_(e,t),_(t,i),H(s,i,null),_(t,l),_(t,o),H(r,o,null),u=!0},p(f,c){const d={};c&12289&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&12289&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!u||c&4)&&x(t,"p-t-xs",f[2])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&tt(()=>{a||(a=qe(e,Et,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=qe(e,Et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function AC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].password),u||(f=Y(r,"input",n[8]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].password&&fe(r,c[0].password)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function IC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[9]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&fe(r,c[0].passwordConfirm)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function PC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].verified,S(u,i,f),S(u,s,f),_(s,l),r||(a=[Y(e,"change",n[10]),Y(e,"change",ct(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Le(a)}}}function LC(n){var b;let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new me({props:{class:"form-field "+(n[0].isNew?"":"required"),name:"username",$$slots:{default:[DC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((b=n[1].options)!=null&&b.requireEmail?"required":""),name:"email",$$slots:{default:[OC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}});let m=!n[0].isNew&&Jd(n),g=(n[0].isNew||n[2])&&Zd(n);return d=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[PC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),m&&m.c(),u=D(),g&&g.c(),f=D(),c=v("div"),q(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,k){S(y,e,k),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),m&&m.m(a,null),_(a,u),g&&g.m(a,null),_(e,f),_(e,c),H(d,c,null),h=!0},p(y,[k]){var T;const $={};k&1&&($.class="form-field "+(y[0].isNew?"":"required")),k&12289&&($.$$scope={dirty:k,ctx:y}),i.$set($);const C={};k&2&&(C.class="form-field "+((T=y[1].options)!=null&&T.requireEmail?"required":"")),k&12291&&(C.$$scope={dirty:k,ctx:y}),o.$set(C),y[0].isNew?m&&(de(),P(m,1,1,()=>{m=null}),pe()):m?(m.p(y,k),k&1&&A(m,1)):(m=Jd(y),m.c(),A(m,1),m.m(a,u)),y[0].isNew||y[2]?g?(g.p(y,k),k&5&&A(g,1)):(g=Zd(y),g.c(),A(g,1),g.m(a,null)):g&&(de(),P(g,1,1,()=>{g=null}),pe());const M={};k&12289&&(M.$$scope={dirty:k,ctx:y}),d.$set(M)},i(y){h||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(m),A(g),A(d.$$.fragment,y),h=!0)},o(y){P(i.$$.fragment,y),P(o.$$.fragment,y),P(m),P(g),P(d.$$.fragment,y),h=!1},d(y){y&&w(e),j(i),j(o),m&&m.d(),g&&g.d(),j(d)}}}function NC(n,e,t){let{collection:i=new gn}=e,{record:s=new Ki}=e,l=s.username||null,o=!1;function r(){s.username=this.value,t(0,s),t(2,o)}const a=()=>t(0,s.emailVisibility=!s.emailVisibility,s);function u(){s.email=this.value,t(0,s),t(2,o)}function f(){o=this.checked,t(2,o)}function c(){s.password=this.value,t(0,s),t(2,o)}function d(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function h(){s.verified=this.checked,t(0,s),t(2,o)}const m=g=>{s.isNew||Dn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!g.target.checked,s)})};return n.$$set=g=>{"collection"in g&&t(1,i=g.collection),"record"in g&&t(0,s=g.record)},n.$$.update=()=>{n.$$.dirty&1&&!s.username&&s.username!==null&&t(0,s.username=null,s),n.$$.dirty&4&&(o||(t(0,s.password=null,s),t(0,s.passwordConfirm=null,s),Cs("password"),Cs("passwordConfirm")))},[s,i,o,l,r,a,u,f,c,d,h,m]}class FC extends ke{constructor(e){super(),ye(this,e,NC,LC,be,{collection:1,record:0})}}function RC(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=Ge(l,s[o]);return{c(){e=v("textarea"),Zn(e,l),x(e,"svelte-1x1pbts",!0)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[5](e),fe(e,n[0]),t||(i=[Y(e,"input",n[6]),Y(e,"keydown",n[2])],t=!0)},p(o,[r]){Zn(e,l=nn(s,[r&8&&o[3]])),r&1&&fe(e,o[0]),x(e,"svelte-1x1pbts",!0)},i:X,o:X,d(o){o&&w(e),n[5](null),t=!1,Le(i)}}}function HC(n,e,t){const i=["value","maxHeight"];let s=Ot(e,i),{value:l=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)&&!(h!=null&&h.isComposing)){h.preventDefault();const m=r.closest("form");m!=null&&m.requestSubmit&&m.requestSubmit()}}un(()=>(u(),()=>clearTimeout(a)));function c(h){ie[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=Ge(Ge({},e),Gn(h)),t(3,s=Ot(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class jC extends ke{constructor(e){super(),ye(this,e,HC,RC,be,{value:0,maxHeight:4})}}function qC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(g){n[2](g)}let m={id:n[3],required:n[1].required};return n[0]!==void 0&&(m.value=n[0]),f=new jC({props:m}),ie.push(()=>ve(f,"value",h)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),q(f.$$.fragment),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),H(f,g,b),d=!0},p(g,b){(!d||b&2&&i!==(i=B.getFieldTypeIcon(g[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=g[1].name+"")&&re(r,o),(!d||b&8&&a!==(a=g[3]))&&p(e,"for",a);const y={};b&8&&(y.id=g[3]),b&2&&(y.required=g[1].required),!c&&b&1&&(c=!0,y.value=g[0],we(()=>c=!1)),f.$set(y)},i(g){d||(A(f.$$.fragment,g),d=!0)},o(g){P(f.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(u),j(f,g)}}}function VC(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function zC(n,e,t){let{field:i=new fn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class BC extends ke{constructor(e){super(),ye(this,e,zC,VC,be,{field:1,value:0})}}function UC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m,g,b;return{c(){var y,k;e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",m=(k=n[1].options)==null?void 0:k.max),p(f,"step","any")},m(y,k){S(y,e,k),_(e,t),_(e,s),_(e,l),_(l,r),S(y,u,k),S(y,f,k),fe(f,n[0]),g||(b=Y(f,"input",n[2]),g=!0)},p(y,k){var $,C;k&2&&i!==(i=B.getFieldTypeIcon(y[1].type))&&p(t,"class",i),k&2&&o!==(o=y[1].name+"")&&re(r,o),k&8&&a!==(a=y[3])&&p(e,"for",a),k&8&&c!==(c=y[3])&&p(f,"id",c),k&2&&d!==(d=y[1].required)&&(f.required=d),k&2&&h!==(h=($=y[1].options)==null?void 0:$.min)&&p(f,"min",h),k&2&&m!==(m=(C=y[1].options)==null?void 0:C.max)&&p(f,"max",m),k&1&&dt(f.value)!==y[0]&&fe(f,y[0])},d(y){y&&w(e),y&&w(u),y&&w(f),g=!1,b()}}}function WC(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[UC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function YC(n,e,t){let{field:i=new fn}=e,{value:s=void 0}=e;function l(){s=dt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class KC extends ke{constructor(e){super(),ye(this,e,YC,WC,be,{field:1,value:0})}}function JC(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=D(),s=v("label"),o=U(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){S(f,e,c),e.checked=n[0],S(f,i,c),S(f,s,c),_(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&re(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function ZC(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[JC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function GC(n,e,t){let{field:i=new fn}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class XC extends ke{constructor(e){super(),ye(this,e,GC,ZC,be,{field:1,value:0})}}function QC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),S(g,f,b),fe(f,n[0]),h||(m=Y(f,"input",n[2]),h=!0)},p(g,b){b&2&&i!==(i=B.getFieldTypeIcon(g[1].type))&&p(t,"class",i),b&2&&o!==(o=g[1].name+"")&&re(r,o),b&8&&a!==(a=g[3])&&p(e,"for",a),b&8&&c!==(c=g[3])&&p(f,"id",c),b&2&&d!==(d=g[1].required)&&(f.required=d),b&1&&f.value!==g[0]&&fe(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),h=!1,m()}}}function xC(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[QC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eT(n,e,t){let{field:i=new fn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class tT extends ke{constructor(e){super(),ye(this,e,eT,xC,be,{field:1,value:0})}}function nT(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),S(g,f,b),fe(f,n[0]),h||(m=Y(f,"input",n[2]),h=!0)},p(g,b){b&2&&i!==(i=B.getFieldTypeIcon(g[1].type))&&p(t,"class",i),b&2&&o!==(o=g[1].name+"")&&re(r,o),b&8&&a!==(a=g[3])&&p(e,"for",a),b&8&&c!==(c=g[3])&&p(f,"id",c),b&2&&d!==(d=g[1].required)&&(f.required=d),b&1&&fe(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),h=!1,m()}}}function iT(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[nT,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function sT(n,e,t){let{field:i=new fn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class lT extends ke{constructor(e){super(),ye(this,e,sT,iT,be,{field:1,value:0})}}function Gd(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){S(l,e,o),_(e,t),i||(s=[Ie(We.call(null,t,"Clear")),Y(t,"click",n[4])],i=!0)},p:X,d(l){l&&w(e),i=!1,Le(s)}}}function oT(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m,g=n[0]&&!n[1].required&&Gd(n);function b(k){n[5](k)}let y={id:n[6],options:B.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(y.formattedValue=n[0]),d=new eu({props:y}),ie.push(()=>ve(d,"formattedValue",b)),d.$on("close",n[2]),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),a=U(" (UTC)"),f=D(),g&&g.c(),c=D(),q(d.$$.fragment),p(t,"class",i=yi(B.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[6])},m(k,$){S(k,e,$),_(e,t),_(e,s),_(e,l),_(l,r),_(l,a),S(k,f,$),g&&g.m(k,$),S(k,c,$),H(d,k,$),m=!0},p(k,$){(!m||$&2&&i!==(i=yi(B.getFieldTypeIcon(k[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!m||$&2)&&o!==(o=k[1].name+"")&&re(r,o),(!m||$&64&&u!==(u=k[6]))&&p(e,"for",u),k[0]&&!k[1].required?g?g.p(k,$):(g=Gd(k),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const C={};$&64&&(C.id=k[6]),$&1&&(C.value=k[0]),!h&&$&1&&(h=!0,C.formattedValue=k[0],we(()=>h=!1)),d.$set(C)},i(k){m||(A(d.$$.fragment,k),m=!0)},o(k){P(d.$$.fragment,k),m=!1},d(k){k&&w(e),k&&w(f),g&&g.d(k),k&&w(c),j(d,k)}}}function rT(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[oT,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&195&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function aT(n,e,t){let{field:i=new fn}=e,{value:s=void 0}=e;function l(u){u.detail&&u.detail.length==3&&t(0,s=u.detail[1])}function o(){t(0,s="")}const r=()=>o();function a(u){s=u,t(0,s)}return n.$$set=u=>{"field"in u&&t(1,i=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19))},[s,i,l,o,r,a]}class uT extends ke{constructor(e){super(),ye(this,e,aT,rT,be,{field:1,value:0})}}function Xd(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=U("Select up to "),s=U(i),l=U(" items."),p(e,"class","help-block")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&re(s,i)},d(o){o&&w(e)}}}function fT(n){var k,$,C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;function g(M){n[3](M)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(k=n[1].options)==null?void 0:k.values,searchable:(($=n[1].options)==null?void 0:$.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new xa({props:b}),ie.push(()=>ve(f,"selected",g));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&Xd(n);return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),q(f.$$.fragment),d=D(),y&&y.c(),h=Oe(),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(M,T){S(M,e,T),_(e,t),_(e,s),_(e,l),_(l,r),S(M,u,T),H(f,M,T),S(M,d,T),y&&y.m(M,T),S(M,h,T),m=!0},p(M,T){var O,I,L;(!m||T&2&&i!==(i=B.getFieldTypeIcon(M[1].type)))&&p(t,"class",i),(!m||T&2)&&o!==(o=M[1].name+"")&&re(r,o),(!m||T&16&&a!==(a=M[4]))&&p(e,"for",a);const E={};T&16&&(E.id=M[4]),T&6&&(E.toggle=!M[1].required||M[2]),T&4&&(E.multiple=M[2]),T&2&&(E.items=(O=M[1].options)==null?void 0:O.values),T&2&&(E.searchable=((I=M[1].options)==null?void 0:I.values)>5),!c&&T&1&&(c=!0,E.selected=M[0],we(()=>c=!1)),f.$set(E),((L=M[1].options)==null?void 0:L.maxSelect)>1?y?y.p(M,T):(y=Xd(M),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(M){m||(A(f.$$.fragment,M),m=!0)},o(M){P(f.$$.fragment,M),m=!1},d(M){M&&w(e),M&&w(u),j(f,M),M&&w(d),y&&y.d(M),M&&w(h)}}}function cT(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fT,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function dT(n,e,t){let i,{field:s=new fn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class pT extends ke{constructor(e){super(),ye(this,e,dT,cT,be,{field:1,value:0})}}function hT(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("textarea"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"class","txt-mono")},m(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),S(g,f,b),fe(f,n[0]),h||(m=Y(f,"input",n[2]),h=!0)},p(g,b){b&2&&i!==(i=B.getFieldTypeIcon(g[1].type))&&p(t,"class",i),b&2&&o!==(o=g[1].name+"")&&re(r,o),b&8&&a!==(a=g[3])&&p(e,"for",a),b&8&&c!==(c=g[3])&&p(f,"id",c),b&2&&d!==(d=g[1].required)&&(f.required=d),b&1&&fe(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),h=!1,m()}}}function mT(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[hT,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function gT(n,e,t){let{field:i=new fn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&typeof s!="string"&&s!==null&&t(0,s=JSON.stringify(s,null,2))},[s,i,l]}class _T extends ke{constructor(e){super(),ye(this,e,gT,mT,be,{field:1,value:0})}}function bT(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&w(e)}}}function vT(n){let e,t,i;return{c(){e=v("img"),jn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){S(s,e,l)},p(s,l){l&4&&!jn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&w(e)}}}function yT(n){let e;function t(l,o){return l[2]?vT:bT}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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:X,o:X,d(l){s.d(l),l&&w(e)}}}function kT(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),B.hasImageExtension(s==null?void 0:s.name)&&B.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{console.warn("Unable to generate thumb: ",r)})}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class wT extends ke{constructor(e){super(),ye(this,e,kT,yT,be,{file:0,size:1})}}function Qd(n){let e;function t(l,o){return l[4]==="image"?$T:ST}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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){s.d(l),l&&w(e)}}}function ST(n){let e,t;return{c(){e=v("object"),t=U("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){S(i,e,s),_(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&w(e)}}}function $T(n){let e,t,i;return{c(){e=v("img"),jn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){S(s,e,l)},p(s,l){l&2&&!jn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&w(e)}}}function CT(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Qd(n);return{c(){i&&i.c(),t=Oe()},m(l,o){i&&i.m(l,o),S(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Qd(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function TT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=Y(e,"click",ct(n[0])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function MT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=U(n[2]),i=D(),s=v("i"),l=D(),o=v("div"),r=D(),a=v("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,l,d),S(c,o,d),S(c,r,d),S(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&re(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&w(e),c&&w(l),c&&w(o),c&&w(r),c&&w(a),u=!1,f()}}}function DT(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[MT],header:[TT],default:[CT]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[6](e),e.$on("show",n[7]),e.$on("hide",n[8]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&542&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function OT(n,e,t){let i,s,l,o="";function r(d){d!==""&&(t(1,o=d),l==null||l.show())}function a(){return l==null?void 0:l.hide()}function u(d){ie[d?"unshift":"push"](()=>{l=d,t(3,l)})}function f(d){Be.call(this,n,d)}function c(d){Be.call(this,n,d)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=o.substring(o.lastIndexOf("/")+1)),n.$$.dirty&4&&t(4,s=B.getFileType(i))},[a,o,i,l,s,r,u,f,c]}class ET extends ke{constructor(e){super(),ye(this,e,OT,DT,be,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function AT(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function IT(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function PT(n){let e,t,i,s,l;return{c(){e=v("img"),jn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){S(o,e,r),s||(l=Y(e,"error",n[7]),s=!0)},p(o,r){r&16&&!jn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&w(e),s=!1,l()}}}function LT(n){let e,t,i,s,l,o,r,a;function u(h,m){return h[2]==="image"?PT:h[2]==="video"||h[2]==="audio"?IT:AT}let f=u(n),c=f(n),d={};return l=new ET({props:d}),n[10](l),{c(){e=v("a"),c.c(),s=D(),q(l.$$.fragment),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[5]?"Preview":"Download")+" "+n[0])},m(h,m){S(h,e,m),c.m(e,null),S(h,s,m),H(l,h,m),o=!0,r||(a=Y(e,"click",bn(n[9])),r=!0)},p(h,[m]){f===(f=u(h))&&c?c.p(h,m):(c.d(1),c=f(h),c&&(c.c(),c.m(e,null))),(!o||m&2&&t!==(t="thumb "+(h[1]?`thumb-${h[1]}`:"")))&&p(e,"class",t),(!o||m&33&&i!==(i=(h[5]?"Preview":"Download")+" "+h[0]))&&p(e,"title",i);const g={};l.$set(g)},i(h){o||(A(l.$$.fragment,h),o=!0)},o(h){P(l.$$.fragment,h),o=!1},d(h){h&&w(e),c.d(),h&&w(s),n[10](null),j(l,h),r=!1,a()}}}function NT(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f=he.getFileUrl(l,o);function c(){t(4,u="")}const d=m=>{s&&(m.preventDefault(),a==null||a.show(f))};function h(m){ie[m?"unshift":"push"](()=>{a=m,t(3,a)})}return n.$$set=m=>{"record"in m&&t(8,l=m.record),"filename"in m&&t(0,o=m.filename),"size"in m&&t(1,r=m.size)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=B.getFileType(o)),n.$$.dirty&5&&t(5,s=["image","audio","video"].includes(i)||o.endsWith(".pdf"))},t(4,u=f?f+"?thumb=100x100":""),[o,r,i,a,u,s,f,c,l,d,h]}class ob extends ke{constructor(e){super(),ye(this,e,NT,LT,be,{record:8,filename:0,size:1})}}function xd(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function ep(n,e,t){const i=n.slice();i[25]=e[t],i[24]=t;const s=i[1].includes(i[24]);return i[26]=s,i}function FT(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=v("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){S(l,e,o),t||(i=[Ie(We.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Le(i)}}}function RT(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=v("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){S(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function tp(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,h,m,g;s=new ob({props:{record:e[2],filename:e[25]}});function b($,C){return C&18&&(m=null),m==null&&(m=!!$[1].includes($[24])),m?RT:FT}let y=b(e,-1),k=y(e);return{key:n,first:null,c(){t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),r=v("a"),u=U(a),d=D(),h=v("div"),k.c(),x(i,"fade",e[1].includes(e[24])),p(r,"href",f=he.getFileUrl(e[2],e[25])),p(r,"class",c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")),p(r,"title","Download"),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","content"),p(h,"class","actions"),p(t,"class","list-item"),this.first=t},m($,C){S($,t,C),_(t,i),H(s,i,null),_(t,l),_(t,o),_(o,r),_(r,u),_(t,d),_(t,h),k.m(h,null),g=!0},p($,C){e=$;const M={};C&4&&(M.record=e[2]),C&16&&(M.filename=e[25]),s.$set(M),(!g||C&18)&&x(i,"fade",e[1].includes(e[24])),(!g||C&16)&&a!==(a=e[25]+"")&&re(u,a),(!g||C&20&&f!==(f=he.getFileUrl(e[2],e[25])))&&p(r,"href",f),(!g||C&18&&c!==(c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")))&&p(r,"class",c),y===(y=b(e,C))&&k?k.p(e,C):(k.d(1),k=y(e),k&&(k.c(),k.m(h,null)))},i($){g||(A(s.$$.fragment,$),g=!0)},o($){P(s.$$.fragment,$),g=!1},d($){$&&w(t),j(s),k.d()}}}function np(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,h,m,g,b;i=new wT({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=v("div"),t=v("figure"),q(i.$$.fragment),s=D(),l=v("div"),o=v("small"),o.textContent="New",r=D(),a=v("span"),f=U(u),d=D(),h=v("button"),h.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename"),p(l,"title",c=n[22].name),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(k,$){S(k,e,$),_(e,t),H(i,t,null),_(e,s),_(e,l),_(l,o),_(l,r),_(l,a),_(a,f),_(e,d),_(e,h),m=!0,g||(b=[Ie(We.call(null,h,"Remove file")),Y(h,"click",y)],g=!0)},p(k,$){n=k;const C={};$&1&&(C.file=n[22]),i.$set(C),(!m||$&1)&&u!==(u=n[22].name+"")&&re(f,u),(!m||$&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(k){m||(A(i.$$.fragment,k),m=!0)},o(k){P(i.$$.fragment,k),m=!1},d(k){k&&w(e),j(i),g=!1,Le(b)}}}function ip(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("input"),i=D(),s=v("button"),s.innerHTML=`<i class="ri-upload-cloud-line"></i>
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-transparent btn-sm btn-block"),p(e,"class","list-item list-item-btn")},m(r,a){S(r,e,a),_(e,t),n[16](t),_(e,i),_(e,s),l||(o=[Y(t,"change",n[17]),Y(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&w(e),n[16](null),l=!1,Le(o)}}}function HT(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,m,g,b=n[4];const y=T=>T[25];for(let T=0;T<b.length;T+=1){let E=ep(n,b,T),O=y(E);d.set(O,c[T]=tp(O,E))}let k=n[0],$=[];for(let T=0;T<k.length;T+=1)$[T]=np(xd(n,k,T));const C=T=>P($[T],1,1,()=>{$[T]=null});let M=!n[8]&&ip(n);return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("div");for(let T=0;T<c.length;T+=1)c[T].c();h=D();for(let T=0;T<$.length;T+=1)$[T].c();m=D(),M&&M.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","list")},m(T,E){S(T,e,E),_(e,t),_(e,s),_(e,l),_(l,r),S(T,u,E),S(T,f,E);for(let O=0;O<c.length;O+=1)c[O].m(f,null);_(f,h);for(let O=0;O<$.length;O+=1)$[O].m(f,null);_(f,m),M&&M.m(f,null),n[19](f),g=!0},p(T,E){if((!g||E&8&&i!==(i=B.getFieldTypeIcon(T[3].type)))&&p(t,"class",i),(!g||E&8)&&o!==(o=T[3].name+"")&&re(r,o),(!g||E&2097152&&a!==(a=T[21]))&&p(e,"for",a),E&1558&&(b=T[4],de(),c=gt(c,E,y,1,T,b,d,f,Kt,tp,h,ep),pe()),E&2049){k=T[0];let O;for(O=0;O<k.length;O+=1){const I=xd(T,k,O);$[O]?($[O].p(I,E),A($[O],1)):($[O]=np(I),$[O].c(),A($[O],1),$[O].m(f,m))}for(de(),O=k.length;O<$.length;O+=1)C(O);pe()}T[8]?M&&(M.d(1),M=null):M?M.p(T,E):(M=ip(T),M.c(),M.m(f,null))},i(T){if(!g){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<k.length;E+=1)A($[E]);g=!0}},o(T){for(let E=0;E<c.length;E+=1)P(c[E]);$=$.filter(Boolean);for(let E=0;E<$.length;E+=1)P($[E]);g=!1},d(T){T&&w(e),T&&w(u),T&&w(f);for(let E=0;E<c.length;E+=1)c[E].d();yt($,T),M&&M.d(),n[19](null)}}}function jT(n){let e,t;return e=new me({props:{class:"form-field form-field-list form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[HT,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-list form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&270533119&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function qT(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new fn}=e,c,d;function h(O){B.removeByValue(u,O),t(1,u)}function m(O){B.pushUnique(u,O),t(1,u)}function g(O){B.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>h(O),k=O=>m(O),$=O=>g(O);function C(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},T=()=>c==null?void 0:c.click();function E(O){ie[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,I;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=B.toArray(u))),n.$$.dirty&8&&t(5,i=((O=f.options)==null?void 0:O.maxSelect)>1),n.$$.dirty&4128&&B.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=B.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((I=f.options)==null?void 0:I.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,m,g,r,y,k,$,C,M,T,E]}class VT extends ke{constructor(e){super(),ye(this,e,qT,jT,be,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function sp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function zT(n,e){e=sp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=sp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const BT=n=>({dragging:n&2,dragover:n&4}),lp=n=>({dragging:n[1],dragover:n[2]});function UT(n){let e,t,i,s;const l=n[8].default,o=Nt(l,n,n[7],lp);return{c(){e=v("div"),o&&o.c(),p(e,"draggable",!0),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[1]),x(e,"dragover",n[2])},m(r,a){S(r,e,a),o&&o.m(e,null),t=!0,i||(s=[Y(e,"dragover",ct(n[9])),Y(e,"dragleave",ct(n[10])),Y(e,"dragend",n[11]),Y(e,"dragstart",n[12]),Y(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Rt(o,l,r,r[7],t?Ft(l,r[7],a,BT):Ht(r[7]),lp),(!t||a&2)&&x(e,"dragging",r[1]),(!t||a&4)&&x(e,"dragover",r[2])},i(r){t||(A(o,r),t=!0)},o(r){P(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,Le(s)}}}function WT(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Ct();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function c(k,$){!k&&!a||(t(1,u=!0),k.dataTransfer.effectAllowed="move",k.dataTransfer.dropEffect="move",k.dataTransfer.setData("text/plain",$))}function d(k,$){if(!k&&!a)return;t(2,f=!1),t(1,u=!1),k.dataTransfer.dropEffect="move";const C=parseInt(k.dataTransfer.getData("text/plain"));C<$?(r.splice($+1,0,r[C]),r.splice(C,1)):(r.splice($,0,r[C]),r.splice(C+1,1)),t(5,r),l("sort",r)}const h=()=>{t(2,f=!0)},m=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},b=k=>c(k,o),y=k=>d(k,o);return n.$$set=k=>{"index"in k&&t(0,o=k.index),"list"in k&&t(5,r=k.list),"disabled"in k&&t(6,a=k.disabled),"$$scope"in k&&t(7,s=k.$$scope)},[o,u,f,c,d,r,a,s,i,h,m,g,b,y]}class YT extends ke{constructor(e){super(),ye(this,e,WT,UT,be,{index:0,list:5,disabled:6})}}function KT(n){let e,t,i,s,l,o=B.truncate(n[1],150)+"",r,a,u;return{c(){e=v("div"),t=v("i"),s=D(),l=v("span"),r=U(o),p(t,"class","link-hint txt-sm ri-information-line"),p(l,"class","txt txt-ellipsis"),p(e,"class","record-info svelte-1jc3ebb")},m(f,c){S(f,e,c),_(e,t),_(e,s),_(e,l),_(l,r),a||(u=Ie(i=We.call(null,t,{text:B.truncate(JSON.stringify(B.truncateObject(n[0]),null,2),800,!0),class:"code",position:"left"})),a=!0)},p(f,[c]){i&&Zt(i.update)&&c&1&&i.update.call(null,{text:B.truncate(JSON.stringify(B.truncateObject(f[0]),null,2),800,!0),class:"code",position:"left"}),c&2&&o!==(o=B.truncate(f[1],150)+"")&&re(r,o)},i:X,o:X,d(f){f&&w(e),a=!1,u()}}}function JT(n,e,t){let i,{record:s}=e,{displayFields:l=[]}=e;return n.$$set=o=>{"record"in o&&t(0,s=o.record),"displayFields"in o&&t(2,l=o.displayFields)},n.$$.update=()=>{n.$$.dirty&5&&t(1,i=B.displayValue(s,l))},[s,i,l]}class Xo extends ke{constructor(e){super(),ye(this,e,JT,KT,be,{record:0,displayFields:2})}}function op(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function rp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function ap(n){let e,t;function i(o,r){return o[11]?GT:ZT}let s=i(n),l=s(n);return{c(){e=v("div"),l.c(),t=D(),p(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),_(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function ZT(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&up(n);return{c(){e=v("span"),e.textContent="No records found.",t=D(),s&&s.c(),i=Oe(),p(e,"class","txt txt-hint")},m(o,r){S(o,e,r),S(o,t,r),s&&s.m(o,r),S(o,i,r)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=up(o),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(o){o&&w(e),o&&w(t),s&&s.d(o),o&&w(i)}}}function GT(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function up(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[34]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function XT(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function QT(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fp(n,e){let t,i,s,l,o,r,a,u,f,c,d;function h($,C){return $[6]?QT:XT}let m=h(e),g=m(e);l=new Xo({props:{record:e[49],displayFields:e[13]}});function b(){return e[31](e[49])}function y(){return e[32](e[49])}function k(...$){return e[33](e[49],...$)}return{key:n,first:null,c(){t=v("div"),g.c(),i=D(),s=v("div"),q(l.$$.fragment),o=D(),r=v("div"),a=v("button"),a.innerHTML='<i class="ri-pencil-line"></i>',u=D(),p(s,"class","content"),p(a,"type","button"),p(a,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(r,"class","actions nonintrusive"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m($,C){S($,t,C),g.m(t,null),_(t,i),_(t,s),H(l,s,null),_(t,o),_(t,r),_(r,a),_(t,u),f=!0,c||(d=[Ie(We.call(null,a,"Edit")),Y(a,"keydown",bn(e[26])),Y(a,"click",bn(b)),Y(t,"click",y),Y(t,"keydown",k)],c=!0)},p($,C){e=$,m!==(m=h(e))&&(g.d(1),g=m(e),g&&(g.c(),g.m(t,i)));const M={};C[0]&8&&(M.record=e[49]),C[0]&8192&&(M.displayFields=e[13]),l.$set(M),(!f||C[0]&264)&&x(t,"selected",e[6]),(!f||C[0]&808)&&x(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i($){f||(A(l.$$.fragment,$),f=!0)},o($){P(l.$$.fragment,$),f=!1},d($){$&&w(t),g.d(),j(l),c=!1,Le(d)}}}function cp(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[5]),o=U(")")},m(r,a){S(r,e,a),S(r,i,a),S(r,s,a),S(r,l,a),S(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&re(i,t),a[0]&32&&re(l,r[5])},d(r){r&&w(e),r&&w(i),r&&w(s),r&&w(l),r&&w(o)}}}function xT(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function eM(n){let e,t,i=n[6],s=[];for(let o=0;o<i.length;o+=1)s[o]=dp(op(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o<s.length;o+=1)s[o].c();p(e,"class","selected-list svelte-1u8jhky")},m(o,r){S(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r[0]&41024|r[1]&6291456){i=o[6];let a;for(a=0;a<i.length;a+=1){const u=op(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=dp(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(de(),a=i.length;a<s.length;a+=1)l(a);pe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){o&&w(e),yt(s,o)}}}function tM(n){let e,t,i,s,l,o,r,a;t=new Xo({props:{record:n[49],displayFields:n[13]}});function u(){return n[36](n[49])}return{c(){e=v("span"),q(t.$$.fragment),i=D(),s=v("button"),s.innerHTML='<i class="ri-close-line"></i>',l=D(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,c){S(f,e,c),H(t,e,null),_(e,i),_(e,s),S(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),c[0]&8192&&(d.displayFields=n[13]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){P(t.$$.fragment,f),o=!1},d(f){f&&w(e),j(t),f&&w(l),r=!1,a()}}}function dp(n){let e,t,i;function s(o){n[37](o)}let l={index:n[51],$$slots:{default:[tM,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new YT({props:l}),ie.push(()=>ve(e,"list",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&8256|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function nM(n){let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,h,m,g,b,y,k,$;t=new Uo({props:{value:n[2],autocompleteCollection:n[12]}}),t.$on("submit",n[29]);let C=n[3];const M=N=>N[49].id;for(let N=0;N<C.length;N+=1){let F=rp(n,C,N),V=M(F);a.set(V,r[N]=fp(V,F))}let T=null;C.length||(T=ap(n));let E=n[5]>1&&cp(n);const O=[eM,xT],I=[];function L(N,F){return N[6].length?0:1}return m=L(n),g=I[m]=O[m](n),{c(){e=v("div"),q(t.$$.fragment),i=D(),s=v("button"),s.innerHTML='<div class="txt">New record</div>',l=D(),o=v("div");for(let N=0;N<r.length;N+=1)r[N].c();T&&T.c(),f=D(),c=v("h5"),d=U(`Selected
`),E&&E.c(),h=D(),g.c(),b=Oe(),p(s,"type","button"),p(s,"class","btn btn-transparent btn-hint p-l-sm p-r-sm"),p(e,"class","flex m-b-base flex-gap-10"),p(o,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,F){S(N,e,F),H(t,e,null),_(e,i),_(e,s),S(N,l,F),S(N,o,F);for(let V=0;V<r.length;V+=1)r[V].m(o,null);T&&T.m(o,null),S(N,f,F),S(N,c,F),_(c,d),E&&E.m(c,null),S(N,h,F),I[m].m(N,F),S(N,b,F),y=!0,k||($=[Y(s,"click",n[30]),Ie(u=zT.call(null,o,n[35]))],k=!0)},p(N,F){const V={};F[0]&4&&(V.value=N[2]),F[0]&4096&&(V.autocompleteCollection=N[12]),t.$set(V),F[0]&76716&&(C=N[3],de(),r=gt(r,F,M,1,N,C,a,o,Kt,fp,null,rp),pe(),!C.length&&T?T.p(N,F):C.length?T&&(T.d(1),T=null):(T=ap(N),T.c(),T.m(o,null))),u&&Zt(u.update)&&F[0]&1040&&u.update.call(null,N[35]),N[5]>1?E?E.p(N,F):(E=cp(N),E.c(),E.m(c,null)):E&&(E.d(1),E=null);let G=m;m=L(N),m===G?I[m].p(N,F):(de(),P(I[G],1,1,()=>{I[G]=null}),pe(),g=I[m],g?g.p(N,F):(g=I[m]=O[m](N),g.c()),A(g,1),g.m(b.parentNode,b))},i(N){if(!y){A(t.$$.fragment,N);for(let F=0;F<C.length;F+=1)A(r[F]);A(g),y=!0}},o(N){P(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)P(r[F]);P(g),y=!1},d(N){N&&w(e),j(t),N&&w(l),N&&w(o);for(let F=0;F<r.length;F+=1)r[F].d();T&&T.d(),N&&w(f),N&&w(c),E&&E.d(),N&&w(h),I[m].d(N),N&&w(b),k=!1,Le($)}}}function iM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=U("Select "),i=v("strong"),l=U(s),o=U(" records")},m(a,u){S(a,e,u),_(e,t),_(e,i),_(i,l),_(e,o)},p(a,u){var f;u[0]&4096&&s!==(s=(((f=a[12])==null?void 0:f.name)||"")+"")&&re(l,s)},d(a){a&&w(e)}}}function sM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[27]),Y(i,"click",n[28])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Le(l)}}}function lM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[18]];let o={$$slots:{footer:[sM],header:[iM],default:[nM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Ge(o,l[a]);e=new Bn({props:o}),n[38](e),e.$on("hide",n[39]),e.$on("show",n[40]);let r={collection:n[12]};return i=new ab({props:r}),n[41](i),i.$on("save",n[42]),i.$on("delete",n[43]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(a,u){H(e,a,u),S(a,t,u),H(i,a,u),s=!0},p(a,u){const f=u[0]&262144?nn(l,[l[0],l[1],Xn(a[18])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&4096&&(c.collection=a[12]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[38](null),j(e,a),a&&w(t),n[41](null),j(i,a)}}}const Dr=100;function oM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=Ot(e,c),h;Ke(n,es,_e=>t(25,h=_e));const m=Ct(),g="picker_"+B.randomString(5);let{value:b}=e,{field:y}=e,k,$,C="",M=[],T=[],E=1,O=0,I=!1,L=!1;function N(){return t(2,C=""),t(3,M=[]),t(6,T=[]),V(),G(!0),k==null?void 0:k.show()}function F(){return k==null?void 0:k.hide()}async function V(){const _e=B.toArray(b);if(!s||!_e.length)return;t(23,L=!0);let Je=[];const nt=_e.slice(),St=[];for(;nt.length>0;){const It=[];for(const Vt of nt.splice(0,Dr))It.push(`id="${Vt}"`);St.push(he.collection(s).getFullList(Dr,{filter:It.join("||"),$autoCancel:!1}))}try{await Promise.all(St).then(It=>{Je=Je.concat(...It)}),t(6,T=[]);for(const It of _e){const Vt=B.findByKey(Je,"id",It);Vt&&T.push(Vt)}C.trim()||t(3,M=B.filterDuplicatesByKey(T.concat(M)))}catch(It){he.errorResponseHandler(It)}t(23,L=!1)}async function G(_e=!1){if(s){t(4,I=!0),_e&&(C.trim()?t(3,M=[]):t(3,M=B.toArray(T).slice()));try{const Je=_e?1:E+1,nt=await he.collection(s).getList(Je,Dr,{filter:C,sort:"-created",$cancelKey:g+"loadList"});t(3,M=B.filterDuplicatesByKey(M.concat(nt.items))),E=nt.page,t(22,O=nt.totalItems)}catch(Je){he.errorResponseHandler(Je)}t(4,I=!1)}}function se(_e){i==1?t(6,T=[_e]):u&&(B.pushUnique(T,_e),t(6,T))}function K(_e){B.removeByKey(T,"id",_e.id),t(6,T)}function te(_e){f(_e)?K(_e):se(_e)}function ne(){var _e;i!=1?t(19,b=T.map(Je=>Je.id)):t(19,b=((_e=T==null?void 0:T[0])==null?void 0:_e.id)||""),m("save",T),F()}function z(_e){Be.call(this,n,_e)}const Q=()=>F(),J=()=>ne(),ae=_e=>t(2,C=_e.detail),He=()=>$==null?void 0:$.show(),Fe=_e=>$==null?void 0:$.show(_e),Ne=_e=>te(_e),Re=(_e,Je)=>{(Je.code==="Enter"||Je.code==="Space")&&(Je.preventDefault(),Je.stopPropagation(),te(_e))},ge=()=>t(2,C=""),Ce=()=>{a&&!I&&G()},$e=_e=>K(_e);function Ye(_e){T=_e,t(6,T)}function ze(_e){ie[_e?"unshift":"push"](()=>{k=_e,t(1,k)})}function oe(_e){Be.call(this,n,_e)}function ue(_e){Be.call(this,n,_e)}function Z(_e){ie[_e?"unshift":"push"](()=>{$=_e,t(7,$)})}const ce=_e=>{B.removeByKey(M,"id",_e.detail.id),M.unshift(_e.detail),t(3,M),B.pushOrReplaceByKey(T,_e.detail),t(6,T)},Se=_e=>{B.removeByKey(M,"id",_e.detail.id),t(3,M),B.removeByKey(T,"id",_e.detail.id),t(6,T)};return n.$$set=_e=>{e=Ge(Ge({},e),Gn(_e)),t(18,d=Ot(e,c)),"value"in _e&&t(19,b=_e.value),"field"in _e&&t(20,y=_e.field)},n.$$.update=()=>{var _e,Je,nt;n.$$.dirty[0]&1048576&&t(5,i=((_e=y==null?void 0:y.options)==null?void 0:_e.maxSelect)||null),n.$$.dirty[0]&1048576&&t(24,s=(Je=y==null?void 0:y.options)==null?void 0:Je.collectionId),n.$$.dirty[0]&1048576&&t(13,l=(nt=y==null?void 0:y.options)==null?void 0:nt.displayFields),n.$$.dirty[0]&50331648&&t(12,o=h.find(St=>St.id==s)||null),n.$$.dirty[0]&8388614&&typeof C<"u"&&!L&&k!=null&&k.isActive()&&G(!0),n.$$.dirty[0]&8388624&&t(11,r=I||L),n.$$.dirty[0]&4194312&&t(10,a=O>M.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>T.length),n.$$.dirty[0]&64&&t(8,f=function(St){return B.findByKey(T,"id",St.id)})},[F,k,C,M,I,i,T,$,f,u,a,r,o,l,G,K,te,ne,d,b,y,N,O,L,s,h,z,Q,J,ae,He,Fe,Ne,Re,ge,Ce,$e,Ye,ze,oe,ue,Z,ce,Se]}class rM extends ke{constructor(e){super(),ye(this,e,oM,lM,be,{value:19,field:20,show:21,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[0]}}function pp(n,e,t){const i=n.slice();return i[13]=e[t],i}function hp(n,e,t){const i=n.slice();return i[16]=e[t],i}function mp(n){let e,t=n[4]&&gp(n);return{c(){t&&t.c(),e=Oe()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[4]?t?t.p(i,s):(t=gp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function gp(n){let e,t=B.toArray(n[0]).slice(0,10),i=[];for(let s=0;s<t.length;s+=1)i[s]=_p(hp(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Oe()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l&1){t=B.toArray(s[0]).slice(0,10);let o;for(o=0;o<t.length;o+=1){const r=hp(s,t,o);i[o]?i[o].p(r,l):(i[o]=_p(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){yt(i,s),s&&w(e)}}}function _p(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="skeleton-loader"></div>
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function bp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[13],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[7](n[13])}return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(h,m){S(h,e,m),_(e,t),H(i,t,null),_(e,s),_(e,l),_(l,o),_(e,r),a=!0,u||(f=[Ie(We.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(h,m){var b;n=h;const g={};m&8&&(g.record=n[13]),m&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(h){a||(A(i.$$.fragment,h),a=!0)},o(h){P(i.$$.fragment,h),a=!1},d(h){h&&w(e),j(i),u=!1,Le(f)}}}function aM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,m,g,b,y,k=n[3],$=[];for(let T=0;T<k.length;T+=1)$[T]=bp(pp(n,k,T));const C=T=>P($[T],1,1,()=>{$[T]=null});let M=null;return k.length||(M=mp(n)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),f=v("div"),c=v("div");for(let T=0;T<$.length;T+=1)$[T].c();M&&M.c(),d=D(),h=v("div"),m=v("button"),m.innerHTML=`<i class="ri-layout-line"></i>
<span class="txt">Open picker</span>`,p(t,"class",i=yi(B.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[12]),p(c,"class","relations-list svelte-1ynw0pc"),p(m,"type","button"),p(m,"class","btn btn-transparent btn-sm btn-block"),p(h,"class","list-item list-item-btn"),p(f,"class","list")},m(T,E){S(T,e,E),_(e,t),_(e,s),_(e,l),_(l,r),S(T,u,E),S(T,f,E),_(f,c);for(let O=0;O<$.length;O+=1)$[O].m(c,null);M&&M.m(c,null),_(f,d),_(f,h),_(h,m),g=!0,b||(y=Y(m,"click",n[8]),b=!0)},p(T,E){if((!g||E&4&&i!==(i=yi(B.getFieldTypeIcon(T[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!g||E&4)&&o!==(o=T[2].name+"")&&re(r,o),(!g||E&4096&&a!==(a=T[12]))&&p(e,"for",a),E&93){k=T[3];let O;for(O=0;O<k.length;O+=1){const I=pp(T,k,O);$[O]?($[O].p(I,E),A($[O],1)):($[O]=bp(I),$[O].c(),A($[O],1),$[O].m(c,null))}for(de(),O=k.length;O<$.length;O+=1)C(O);pe(),!k.length&&M?M.p(T,E):k.length?M&&(M.d(1),M=null):(M=mp(T),M.c(),M.m(c,null))}},i(T){if(!g){for(let E=0;E<k.length;E+=1)A($[E]);g=!0}},o(T){$=$.filter(Boolean);for(let E=0;E<$.length;E+=1)P($[E]);g=!1},d(T){T&&w(e),T&&w(u),T&&w(f),yt($,T),M&&M.d(),b=!1,y()}}}function uM(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[aM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l={value:n[0],field:n[2]};return i=new rM({props:l}),n[9](i),i.$on("save",n[10]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(o,r){H(e,o,r),S(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&4&&(a.class="form-field form-field-list "+(o[2].required?"required":"")),r&4&&(a.name=o[2].name),r&528415&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&1&&(u.value=o[0]),r&4&&(u.field=o[2]),i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[9](null),j(i,o)}}}const vp=100;function fM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new fn}=e,r=[],a=!1;u();async function u(){var k,$;const g=B.toArray(s);if(!((k=o==null?void 0:o.options)!=null&&k.collectionId)||!g.length){t(3,r=[]),t(4,a=!1);return}t(4,a=!0);const b=g.slice(),y=[];for(;b.length>0;){const C=[];for(const M of b.splice(0,vp))C.push(`id="${M}"`);y.push(he.collection(($=o==null?void 0:o.options)==null?void 0:$.collectionId).getFullList(vp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all(y).then(M=>{C=C.concat(...M)});for(const M of g){const T=B.findByKey(C,"id",M);T&&r.push(T)}t(3,r)}catch(C){he.errorResponseHandler(C)}t(4,a=!1)}function f(g){var b;B.removeByKey(r,"id",g.id),t(3,r),i?t(0,s=r.map(y=>y.id)):t(0,s=((b=r[0])==null?void 0:b.id)||"")}const c=g=>f(g),d=()=>l==null?void 0:l.show();function h(g){ie[g?"unshift":"push"](()=>{l=g,t(1,l)})}const m=g=>{t(3,r=g.detail||[]),t(0,s=i?r.map(b=>b.id):r[0]||"")};return n.$$set=g=>{"value"in g&&t(0,s=g.value),"picker"in g&&t(1,l=g.picker),"field"in g&&t(2,o=g.field)},n.$$.update=()=>{var g;n.$$.dirty&4&&t(5,i=((g=o.options)==null?void 0:g.maxSelect)!=1)},[s,l,o,r,a,i,f,c,d,h,m]}class cM extends ke{constructor(e){super(),ye(this,e,fM,uM,be,{value:0,picker:1,field:2})}}const dM=["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"],pM=(n,e)=>{dM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function hM(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),Ar(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function mM(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function gM(n){let e;function t(l,o){return l[1]?mM:hM}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](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:X,o:X,d(l){l&&w(e),s.d(),n[19](null)}}}const rb=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),_M=()=>{let n={listeners:[],scriptId:rb("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let bM=_M();function vM(n,e,t){var i;let{id:s=rb("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:h=""}=e,{cssClass:m="tinymce-wrapper"}=e,g,b,y,k="",$=o;const C=Ct(),M=()=>{const N=(()=>typeof window<"u"?window:global)();return N&&N.tinymce?N.tinymce:null},T=()=>{const L=Object.assign(Object.assign({},f),{target:b,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:N=>{t(14,y=N),N.on("init",()=>{N.setContent(d),N.on(c,()=>{t(15,k=N.getContent()),k!==d&&(t(5,d=k),t(6,h=N.getContent({format:"text"})))})}),pM(N,C),typeof f.setup=="function"&&f.setup(N)}});t(4,b.style.visibility="",b),M().init(L)};un(()=>{if(M()!==null)T();else{const L=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;bM.load(g.ownerDocument,L,()=>{T()})}}),Bm(()=>{var L;y&&((L=M())===null||L===void 0||L.remove(y))});function E(L){ie[L?"unshift":"push"](()=>{b=L,t(4,b)})}function O(L){ie[L?"unshift":"push"](()=>{b=L,t(4,b)})}function I(L){ie[L?"unshift":"push"](()=>{g=L,t(3,g)})}return n.$$set=L=>{"id"in L&&t(0,s=L.id),"inline"in L&&t(1,l=L.inline),"disabled"in L&&t(7,o=L.disabled),"apiKey"in L&&t(8,r=L.apiKey),"channel"in L&&t(9,a=L.channel),"scriptSrc"in L&&t(10,u=L.scriptSrc),"conf"in L&&t(11,f=L.conf),"modelEvents"in L&&t(12,c=L.modelEvents),"value"in L&&t(5,d=L.value),"text"in L&&t(6,h=L.text),"cssClass"in L&&t(2,m=L.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&k!==d&&(y.setContent(d),t(6,h=y.getContent({format:"text"}))),y&&o!==$&&(t(16,$=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,m,g,b,d,h,o,r,a,u,f,c,i,y,k,$,E,O,I]}class yM extends ke{constructor(e){super(),ye(this,e,vM,gM,be,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function kM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(g){n[2](g)}let m={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:B.defaultEditorOptions()};return n[0]!==void 0&&(m.value=n[0]),f=new yM({props:m}),ie.push(()=>ve(f,"value",h)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=U(o),u=D(),q(f.$$.fragment),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),H(f,g,b),d=!0},p(g,b){(!d||b&2&&i!==(i=B.getFieldTypeIcon(g[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=g[1].name+"")&&re(r,o),(!d||b&8&&a!==(a=g[3]))&&p(e,"for",a);const y={};b&8&&(y.id=g[3]),!c&&b&1&&(c=!0,y.value=g[0],we(()=>c=!1)),f.$set(y)},i(g){d||(A(f.$$.fragment,g),d=!0)},o(g){P(f.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(u),j(f,g)}}}function wM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[kM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function SM(n,e,t){let{field:i=new fn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class $M extends ke{constructor(e){super(),ye(this,e,SM,wM,be,{field:1,value:0})}}function CM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Auth URL"),s=D(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&fe(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function TM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Token URL"),s=D(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&fe(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function MM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("User API URL"),s=D(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&fe(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function DM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[CM,({uniqueId:h})=>({5:h}),({uniqueId:h})=>h?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[TM,({uniqueId:h})=>({5:h}),({uniqueId:h})=>h?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[MM,({uniqueId:h})=>({5:h}),({uniqueId:h})=>h?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=D(),i=v("div"),s=v("div"),q(l.$$.fragment),o=D(),r=v("div"),q(a.$$.fragment),u=D(),f=v("div"),q(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(h,m){S(h,e,m),S(h,t,m),S(h,i,m),_(i,s),H(l,s,null),_(i,o),_(i,r),H(a,r,null),_(i,u),_(i,f),H(c,f,null),d=!0},p(h,[m]){const g={};m&2&&(g.name=h[1]+".authUrl"),m&97&&(g.$$scope={dirty:m,ctx:h}),l.$set(g);const b={};m&2&&(b.name=h[1]+".tokenUrl"),m&97&&(b.$$scope={dirty:m,ctx:h}),a.$set(b);const y={};m&2&&(y.name=h[1]+".userApiUrl"),m&97&&(y.$$scope={dirty:m,ctx:h}),c.$set(y)},i(h){d||(A(l.$$.fragment,h),A(a.$$.fragment,h),A(c.$$.fragment,h),d=!0)},o(h){P(l.$$.fragment,h),P(a.$$.fragment,h),P(c.$$.fragment,h),d=!1},d(h){h&&w(e),h&&w(t),h&&w(i),j(l),j(a),j(c)}}}function OM(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)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class yp extends ke{constructor(e){super(),ye(this,e,OM,DM,be,{key:1,config:0})}}function EM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Auth URL"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Eg. 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(l,"placeholder","https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize"),p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),fe(l,n[0].authUrl),S(c,r,d),S(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&&fe(l,c[0].authUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function AM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Token URL"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","text"),p(l,"id",o=n[4]),l.required=!0,p(l,"placeholder","https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token"),p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),fe(l,n[0].tokenUrl),S(c,r,d),S(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&&fe(l,c[0].tokenUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function IM(n){let e,t,i,s,l,o,r,a,u;return l=new me({props:{class:"form-field required",name:n[1]+".authUrl",$$slots:{default:[EM,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:n[1]+".tokenUrl",$$slots:{default:[AM,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=D(),i=v("div"),s=v("div"),q(l.$$.fragment),o=D(),r=v("div"),q(a.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(i,"class","grid")},m(f,c){S(f,e,c),S(f,t,c),S(f,i,c),_(i,s),H(l,s,null),_(i,o),_(i,r),H(a,r,null),u=!0},p(f,[c]){const d={};c&2&&(d.name=f[1]+".authUrl"),c&49&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const h={};c&2&&(h.name=f[1]+".tokenUrl"),c&49&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(A(l.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){P(l.$$.fragment,f),P(a.$$.fragment,f),u=!1},d(f){f&&w(e),f&&w(t),f&&w(i),j(l),j(a)}}}function PM(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 LM extends ke{constructor(e){super(),ye(this,e,PM,IM,be,{key:1,config:0})}}function NM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Auth URL"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Eg. https://YOUR_AUTHENTIK_URL/application/o/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),fe(l,n[0].authUrl),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[2]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&fe(l,c[0].authUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function FM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Token URL"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Eg. https://YOUR_AUTHENTIK_URL/application/o/token/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),fe(l,n[0].tokenUrl),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[3]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].tokenUrl&&fe(l,c[0].tokenUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function RM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("User API URL"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Eg. https://YOUR_AUTHENTIK_URL/application/o/userinfo/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),fe(l,n[0].userApiUrl),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].userApiUrl&&fe(l,c[0].userApiUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function HM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field required",name:n[1]+".authUrl",$$slots:{default:[NM,({uniqueId:h})=>({5:h}),({uniqueId:h})=>h?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:n[1]+".tokenUrl",$$slots:{default:[FM,({uniqueId:h})=>({5:h}),({uniqueId:h})=>h?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[RM,({uniqueId:h})=>({5:h}),({uniqueId:h})=>h?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Authentik endpoints",t=D(),i=v("div"),s=v("div"),q(l.$$.fragment),o=D(),r=v("div"),q(a.$$.fragment),u=D(),f=v("div"),q(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(f,"class","col-lg-12"),p(i,"class","grid")},m(h,m){S(h,e,m),S(h,t,m),S(h,i,m),_(i,s),H(l,s,null),_(i,o),_(i,r),H(a,r,null),_(i,u),_(i,f),H(c,f,null),d=!0},p(h,[m]){const g={};m&2&&(g.name=h[1]+".authUrl"),m&97&&(g.$$scope={dirty:m,ctx:h}),l.$set(g);const b={};m&2&&(b.name=h[1]+".tokenUrl"),m&97&&(b.$$scope={dirty:m,ctx:h}),a.$set(b);const y={};m&2&&(y.name=h[1]+".userApiUrl"),m&97&&(y.$$scope={dirty:m,ctx:h}),c.$set(y)},i(h){d||(A(l.$$.fragment,h),A(a.$$.fragment,h),A(c.$$.fragment,h),d=!0)},o(h){P(l.$$.fragment,h),P(a.$$.fragment,h),P(c.$$.fragment,h),d=!1},d(h){h&&w(e),h&&w(t),h&&w(i),j(l),j(a),j(c)}}}function jM(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)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class qM extends ke{constructor(e){super(),ye(this,e,jM,HM,be,{key:1,config:0})}}const vl={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",optionsComponent:yp},discordAuth:{title:"Discord",icon:"ri-discord-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:LM},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:yp},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},authentikAuth:{title:"Authentik",icon:"ri-lock-fill",optionsComponent:qM}};function kp(n,e,t){const i=n.slice();return i[9]=e[t],i}function VM(n){let e;return{c(){e=v("p"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function zM(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=wp(kp(n,t,s));return{c(){e=v("div");for(let s=0;s<i.length;s+=1)i[s].c();p(e,"class","list")},m(s,l){S(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&58){t=s[1];let o;for(o=0;o<t.length;o+=1){const r=kp(s,t,o);i[o]?i[o].p(r,l):(i[o]=wp(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){s&&w(e),yt(i,s)}}}function BM(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function wp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,h,m,g,b,y;function k(){return n[6](n[9])}return{c(){e=v("div"),t=v("i"),s=D(),l=v("span"),r=U(o),a=D(),u=v("div"),f=U("ID: "),d=U(c),h=D(),m=v("button"),m.innerHTML='<i class="ri-close-line"></i>',g=D(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(m,"type","button"),p(m,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){S($,e,C),_(e,t),_(e,s),_(e,l),_(l,r),_(e,a),_(e,u),_(u,f),_(u,d),_(e,h),_(e,m),_(e,g),b||(y=Y(m,"click",k),b=!0)},p($,C){n=$,C&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),C&2&&o!==(o=n[3](n[9].provider)+"")&&re(r,o),C&2&&c!==(c=n[9].providerId+"")&&re(d,c)},d($){$&&w(e),b=!1,y()}}}function UM(n){let e;function t(l,o){var r;return l[2]?BM:(r=l[0])!=null&&r.id&&l[1].length?zM:VM}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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:X,o:X,d(l){s.d(l),l&&w(e)}}}function WM(n,e,t){const i=Ct();let{record:s}=e,l=[],o=!1;function r(d){var h;return((h=vl[d+"Auth"])==null?void 0:h.title)||B.sentenize(d,!1)}function a(d){var h;return((h=vl[d+"Auth"])==null?void 0:h.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await he.collection(s.collectionId).listExternalAuths(s.id))}catch(d){he.errorResponseHandler(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||Dn(`Do you really want to unlink the ${r(d)} provider?`,()=>he.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{qt(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(h=>{he.errorResponseHandler(h)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class YM extends ke{constructor(e){super(),ye(this,e,WM,UM,be,{record:0})}}function Sp(n,e,t){const i=n.slice();return i[47]=e[t],i[48]=e,i[49]=t,i}function $p(n){let e,t;return e=new me({props:{class:"form-field disabled",name:"id",$$slots:{default:[KM,({uniqueId:i})=>({50:i}),({uniqueId:i})=>[0,i?524288:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&1572864&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function KM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="id",l=D(),o=v("span"),a=D(),u=v("div"),f=v("i"),d=D(),h=v("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[50]),p(f,"class","ri-calendar-event-line txt-disabled"),p(u,"class","form-field-addon"),p(h,"type","text"),p(h,"id",m=n[50]),h.value=g=n[2].id,h.readOnly=!0},m(k,$){S(k,e,$),_(e,t),_(e,i),_(e,s),_(e,l),_(e,o),S(k,a,$),S(k,u,$),_(u,f),S(k,d,$),S(k,h,$),b||(y=Ie(c=We.call(null,f,{text:`Created: ${n[2].created}
Updated: ${n[2].updated}`,position:"left"})),b=!0)},p(k,$){$[1]&524288&&r!==(r=k[50])&&p(e,"for",r),c&&Zt(c.update)&&$[0]&4&&c.update.call(null,{text:`Created: ${k[2].created}
Updated: ${k[2].updated}`,position:"left"}),$[1]&524288&&m!==(m=k[50])&&p(h,"id",m),$[0]&4&&g!==(g=k[2].id)&&h.value!==g&&(h.value=g)},d(k){k&&w(e),k&&w(a),k&&w(u),k&&w(d),k&&w(h),b=!1,y()}}}function Cp(n){var u,f;let e,t,i,s,l;function o(c){n[26](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new FC({props:r}),ie.push(()=>ve(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Tp();return{c(){q(e.$$.fragment),i=D(),a&&a.c(),s=Oe()},m(c,d){H(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var m,g;const h={};d[0]&1&&(h.collection=c[0]),!t&&d[0]&4&&(t=!0,h.record=c[2],we(()=>t=!1)),e.$set(h),(g=(m=c[0])==null?void 0:m.schema)!=null&&g.length?a||(a=Tp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Tp(n){let e;return{c(){e=v("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function JM(n){let e,t,i;function s(o){n[39](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new cM({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ZM(n){let e,t,i,s,l;function o(f){n[36](f,n[47])}function r(f){n[37](f,n[47])}function a(f){n[38](f,n[47])}let u={field:n[47],record:n[2]};return n[2][n[47].name]!==void 0&&(u.value=n[2][n[47].name]),n[3][n[47].name]!==void 0&&(u.uploadedFiles=n[3][n[47].name]),n[4][n[47].name]!==void 0&&(u.deletedFileIndexes=n[4][n[47].name]),e=new VT({props:u}),ie.push(()=>ve(e,"value",o)),ie.push(()=>ve(e,"uploadedFiles",r)),ie.push(()=>ve(e,"deletedFileIndexes",a)),{c(){q(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[47]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[47].name],we(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[47].name],we(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[47].name],we(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function GM(n){let e,t,i;function s(o){n[35](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new _T({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function XM(n){let e,t,i;function s(o){n[34](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new pT({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QM(n){let e,t,i;function s(o){n[33](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new uT({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xM(n){let e,t,i;function s(o){n[32](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new $M({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function eD(n){let e,t,i;function s(o){n[31](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new lT({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function tD(n){let e,t,i;function s(o){n[30](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new tT({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function nD(n){let e,t,i;function s(o){n[29](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new XC({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function iD(n){let e,t,i;function s(o){n[28](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new KC({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function sD(n){let e,t,i;function s(o){n[27](o,n[47])}let l={field:n[47]};return n[2][n[47].name]!==void 0&&(l.value=n[2][n[47].name]),e=new BC({props:l}),ie.push(()=>ve(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[47]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[47].name],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Mp(n,e){let t,i,s,l,o;const r=[sD,iD,nD,tD,eD,xM,QM,XM,GM,ZM,JM],a=[];function u(f,c){return f[47].type==="text"?0:f[47].type==="number"?1:f[47].type==="bool"?2:f[47].type==="email"?3:f[47].type==="url"?4:f[47].type==="editor"?5:f[47].type==="date"?6:f[47].type==="select"?7:f[47].type==="json"?8:f[47].type==="file"?9:f[47].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Oe(),s&&s.c(),l=Oe(),this.first=t},m(f,c){S(f,t,c),~i&&a[i].m(f,c),S(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(de(),P(a[d],1,1,()=>{a[d]=null}),pe()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function Dp(n){let e,t,i;return t=new YM({props:{record:n[2]}}),{c(){e=v("div"),q(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[10]===yl)},m(s,l){S(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&4&&(o.record=s[2]),t.$set(o),(!i||l[0]&1024)&&x(e,"active",s[10]===yl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function lD(n){var b,y;let e,t,i,s,l=[],o=new Map,r,a,u,f,c=!n[2].isNew&&$p(n),d=((b=n[0])==null?void 0:b.isAuth)&&Cp(n),h=((y=n[0])==null?void 0:y.schema)||[];const m=k=>k[47].name;for(let k=0;k<h.length;k+=1){let $=Sp(n,h,k),C=m($);o.set(C,l[k]=Mp(C,$))}let g=n[0].isAuth&&!n[2].isNew&&Dp(n);return{c(){e=v("div"),t=v("form"),c&&c.c(),i=D(),d&&d.c(),s=D();for(let k=0;k<l.length;k+=1)l[k].c();r=D(),g&&g.c(),p(t,"id",n[12]),p(t,"class","tab-item"),x(t,"active",n[10]===Yi),p(e,"class","tabs-content")},m(k,$){S(k,e,$),_(e,t),c&&c.m(t,null),_(t,i),d&&d.m(t,null),_(t,s);for(let C=0;C<l.length;C+=1)l[C].m(t,null);_(e,r),g&&g.m(e,null),a=!0,u||(f=Y(t,"submit",ct(n[13])),u=!0)},p(k,$){var C,M;k[2].isNew?c&&(de(),P(c,1,1,()=>{c=null}),pe()):c?(c.p(k,$),$[0]&4&&A(c,1)):(c=$p(k),c.c(),A(c,1),c.m(t,i)),(C=k[0])!=null&&C.isAuth?d?(d.p(k,$),$[0]&1&&A(d,1)):(d=Cp(k),d.c(),A(d,1),d.m(t,s)):d&&(de(),P(d,1,1,()=>{d=null}),pe()),$[0]&29&&(h=((M=k[0])==null?void 0:M.schema)||[],de(),l=gt(l,$,m,1,k,h,o,t,Kt,Mp,null,Sp),pe()),(!a||$[0]&1024)&&x(t,"active",k[10]===Yi),k[0].isAuth&&!k[2].isNew?g?(g.p(k,$),$[0]&5&&A(g,1)):(g=Dp(k),g.c(),A(g,1),g.m(e,null)):g&&(de(),P(g,1,1,()=>{g=null}),pe())},i(k){if(!a){A(c),A(d);for(let $=0;$<h.length;$+=1)A(l[$]);A(g),a=!0}},o(k){P(c),P(d);for(let $=0;$<l.length;$+=1)P(l[$]);P(g),a=!1},d(k){k&&w(e),c&&c.d(),d&&d.d();for(let $=0;$<l.length;$+=1)l[$].d();g&&g.d(),u=!1,f()}}}function Op(n){let e,t,i,s,l,o,r,a;return r=new Qn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[oD]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=D(),i=v("button"),s=v("div"),l=v("i"),o=D(),q(r.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(s,"class","content"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-transparent")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),_(i,s),_(s,l),_(s,o),H(r,s,null),a=!0},p(u,f){const c={};f[0]&129|f[1]&1048576&&(c.$$scope={dirty:f,ctx:u}),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),u&&w(t),u&&w(i),j(r)}}}function Ep(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[21]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Ap(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[22]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function oD(n){let e,t,i,s,l,o=n[0].isAuth&&!n[7].verified&&n[7].email&&Ep(n),r=n[0].isAuth&&n[7].email&&Ap(n);return{c(){o&&o.c(),e=D(),r&&r.c(),t=D(),i=v("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(a,u){o&&o.m(a,u),S(a,e,u),r&&r.m(a,u),S(a,t,u),S(a,i,u),s||(l=Y(i,"click",bn(ct(n[23]))),s=!0)},p(a,u){a[0].isAuth&&!a[7].verified&&a[7].email?o?o.p(a,u):(o=Ep(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a[0].isAuth&&a[7].email?r?r.p(a,u):(r=Ap(a),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(a){o&&o.d(a),a&&w(e),r&&r.d(a),a&&w(t),a&&w(i),s=!1,l()}}}function Ip(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=D(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[10]===Yi),p(s,"type","button"),p(s,"class","tab-item"),x(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),_(e,t),_(e,i),_(e,s),l||(o=[Y(t,"click",n[24]),Y(s,"click",n[25])],l=!0)},p(r,a){a[0]&1024&&x(t,"active",r[10]===Yi),a[0]&1024&&x(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Le(o)}}}function rD(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,h=!n[2].isNew&&Op(n),m=n[0].isAuth&&!n[2].isNew&&Ip(n);return{c(){e=v("h4"),i=U(t),s=D(),l=v("strong"),r=U(o),a=U(" record"),u=D(),h&&h.c(),f=D(),m&&m.c(),c=Oe()},m(b,y){S(b,e,y),_(e,i),_(e,s),_(e,l),_(l,r),_(e,a),S(b,u,y),h&&h.m(b,y),S(b,f,y),m&&m.m(b,y),S(b,c,y),d=!0},p(b,y){var k;(!d||y[0]&4)&&t!==(t=b[2].isNew?"New":"Edit")&&re(i,t),(!d||y[0]&1)&&o!==(o=((k=b[0])==null?void 0:k.name)+"")&&re(r,o),b[2].isNew?h&&(de(),P(h,1,1,()=>{h=null}),pe()):h?(h.p(b,y),y[0]&4&&A(h,1)):(h=Op(b),h.c(),A(h,1),h.m(f.parentNode,f)),b[0].isAuth&&!b[2].isNew?m?m.p(b,y):(m=Ip(b),m.c(),m.m(c.parentNode,c)):m&&(m.d(1),m=null)},i(b){d||(A(h),d=!0)},o(b){P(h),d=!1},d(b){b&&w(e),b&&w(u),h&&h.d(b),b&&w(f),m&&m.d(b),b&&w(c)}}}function aD(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],x(s,"btn-loading",n[8])},m(c,d){S(c,e,d),_(e,t),S(c,i,d),S(c,s,d),_(s,l),_(l,r),u||(f=Y(e,"click",n[20]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&re(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&x(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function uD(n){var s;let e,t,i={class:"overlay-panel-lg record-panel "+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":""),beforeHide:n[40],$$slots:{footer:[aD],header:[rD],default:[lD]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[41](e),e.$on("hide",n[42]),e.$on("show",n[43]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&5&&(r.class="overlay-panel-lg record-panel "+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")),o[0]&544&&(r.beforeHide=l[40]),o[0]&3485|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[41](null),j(e,l)}}}const Yi="form",yl="providers";function Pp(n){return JSON.stringify(n)}function fD(n,e,t){let i,s,l;const o=Ct(),r="record_"+B.randomString(5);let{collection:a}=e,u,f=null,c=new Ki,d=!1,h=!1,m={},g={},b="",y=Yi;function k(Z){return C(Z),t(9,h=!0),t(10,y=Yi),u==null?void 0:u.show()}function $(){return u==null?void 0:u.hide()}async function C(Z){Vn({}),t(7,f=Z||{}),Z!=null&&Z.clone?t(2,c=Z.clone()):t(2,c=new Ki),t(3,m={}),t(4,g={}),await In(),t(18,b=Pp(c))}function M(){if(d||!l||!(a!=null&&a.id))return;t(8,d=!0);const Z=E();let ce;c.isNew?ce=he.collection(a.id).create(Z):ce=he.collection(a.id).update(c.id,Z),ce.then(Se=>{qt(c.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),$(),o("save",Se)}).catch(Se=>{he.errorResponseHandler(Se)}).finally(()=>{t(8,d=!1)})}function T(){f!=null&&f.id&&Dn("Do you really want to delete the selected record?",()=>he.collection(f.collectionId).delete(f.id).then(()=>{$(),qt("Successfully deleted record."),o("delete",f)}).catch(Z=>{he.errorResponseHandler(Z)}))}function E(){const Z=(c==null?void 0:c.export())||{},ce=new FormData,Se={};for(const _e of(a==null?void 0:a.schema)||[])Se[_e.name]=!0;a!=null&&a.isAuth&&(Se.username=!0,Se.email=!0,Se.emailVisibility=!0,Se.password=!0,Se.passwordConfirm=!0,Se.verified=!0);for(const _e in Z)Se[_e]&&(typeof Z[_e]>"u"&&(Z[_e]=null),B.addValueToFormData(ce,_e,Z[_e]));for(const _e in m){const Je=B.toArray(m[_e]);for(const nt of Je)ce.append(_e,nt)}for(const _e in g){const Je=B.toArray(g[_e]);for(const nt of Je)ce.append(_e+"."+nt,"")}return ce}function O(){!(a!=null&&a.id)||!(f!=null&&f.email)||Dn(`Do you really want to sent verification email to ${f.email}?`,()=>he.collection(a.id).requestVerification(f.email).then(()=>{qt(`Successfully sent verification email to ${f.email}.`)}).catch(Z=>{he.errorResponseHandler(Z)}))}function I(){!(a!=null&&a.id)||!(f!=null&&f.email)||Dn(`Do you really want to sent password reset email to ${f.email}?`,()=>he.collection(a.id).requestPasswordReset(f.email).then(()=>{qt(`Successfully sent password reset email to ${f.email}.`)}).catch(Z=>{he.errorResponseHandler(Z)}))}const L=()=>$(),N=()=>O(),F=()=>I(),V=()=>T(),G=()=>t(10,y=Yi),se=()=>t(10,y=yl);function K(Z){c=Z,t(2,c)}function te(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function ne(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function z(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function Q(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function J(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function ae(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function He(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function Fe(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function Ne(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function Re(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}function ge(Z,ce){n.$$.not_equal(m[ce.name],Z)&&(m[ce.name]=Z,t(3,m))}function Ce(Z,ce){n.$$.not_equal(g[ce.name],Z)&&(g[ce.name]=Z,t(4,g))}function $e(Z,ce){n.$$.not_equal(c[ce.name],Z)&&(c[ce.name]=Z,t(2,c))}const Ye=()=>s&&h?(Dn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),$()}),!1):(Vn({}),!0);function ze(Z){ie[Z?"unshift":"push"](()=>{u=Z,t(6,u)})}function oe(Z){Be.call(this,n,Z)}function ue(Z){Be.call(this,n,Z)}return n.$$set=Z=>{"collection"in Z&&t(0,a=Z.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(19,i=B.hasNonEmptyProps(m)||B.hasNonEmptyProps(g)),n.$$.dirty[0]&786436&&t(5,s=i||b!=Pp(c)),n.$$.dirty[0]&36&&t(11,l=c.isNew||s)},[a,$,c,m,g,s,u,f,d,h,y,l,r,M,T,O,I,k,b,i,L,N,F,V,G,se,K,te,ne,z,Q,J,ae,He,Fe,Ne,Re,ge,Ce,$e,Ye,ze,oe,ue]}class ab extends ke{constructor(e){super(),ye(this,e,fD,uD,be,{collection:0,show:17,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[17]}get hide(){return this.$$.ctx[1]}}function cD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function dD(n){let e,t;return{c(){e=v("span"),t=U(n[1]),p(e,"class","label txt-base txt-mono"),p(e,"title",n[0])},m(i,s){S(i,e,s),_(e,t)},p(i,s){s&2&&re(t,i[1]),s&1&&p(e,"title",i[0])},d(i){i&&w(e)}}}function pD(n){let e;function t(l,o){return l[0]?dD:cD}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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:X,o:X,d(l){s.d(l),l&&w(e)}}}function hD(n,e,t){let{id:i=""}=e,s=i;return n.$$set=l=>{"id"in l&&t(0,i=l.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,s=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,s]}class nu extends ke{constructor(e){super(),ye(this,e,hD,pD,be,{id:0})}}function Lp(n,e,t){const i=n.slice();return i[10]=e[t],i[5]=t,i}function Np(n,e,t){const i=n.slice();return i[3]=e[t],i[5]=t,i}function Fp(n,e,t){const i=n.slice();return i[3]=e[t],i[5]=t,i}function Rp(n,e,t){const i=n.slice();return i[3]=e[t],i[5]=t,i}function mD(n){const e=n.slice(),t=B.toArray(e[0][e[1].name]);e[6]=t;const i=B.toArray(e[0].expand[e[1].name]);return e[7]=i,e}function gD(n){let e,t=B.truncate(n[0][n[1].name])+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=B.truncate(n[0][n[1].name]))},m(l,o){S(l,e,o),_(e,i)},p(l,o){o&3&&t!==(t=B.truncate(l[0][l[1].name])+"")&&re(i,t),o&3&&s!==(s=B.truncate(l[0][l[1].name]))&&p(e,"title",s)},i:X,o:X,d(l){l&&w(e)}}}function _D(n){let e,t=[],i=new Map,s,l=B.toArray(n[0][n[1].name]);const o=r=>r[5]+r[10];for(let r=0;r<l.length;r+=1){let a=Lp(n,l,r),u=o(a);i.set(u,t[r]=Hp(u,a))}return{c(){e=v("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","inline-flex")},m(r,a){S(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&3&&(l=B.toArray(r[0][r[1].name]),de(),t=gt(t,a,o,1,r,l,i,e,Kt,Hp,null,Lp),pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function bD(n){let e,t,i,s,l;const o=[DD,MD],r=[];function a(f,c){return f[7].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[6].length>20&&Vp();return{c(){e=v("div"),i.c(),s=D(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){S(f,e,c),r[t].m(e,null),_(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(de(),P(r[d],1,1,()=>{r[d]=null}),pe(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[6].length>20?u||(u=Vp(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function vD(n){let e,t=[],i=new Map,s=B.toArray(n[0][n[1].name]);const l=o=>o[5]+o[3];for(let o=0;o<s.length;o+=1){let r=Rp(n,s,o),a=l(r);i.set(a,t[o]=zp(a,r))}return{c(){e=v("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","inline-flex")},m(o,r){S(o,e,r);for(let a=0;a<t.length;a+=1)t[a].m(e,null)},p(o,r){r&3&&(s=B.toArray(o[0][o[1].name]),t=gt(t,r,l,1,o,s,i,e,Xi,zp,null,Rp))},i:X,o:X,d(o){o&&w(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function yD(n){let e,t=B.truncate(JSON.stringify(n[0][n[1].name]))+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&3&&t!==(t=B.truncate(JSON.stringify(s[0][s[1].name]))+"")&&re(i,t)},i:X,o:X,d(s){s&&w(e)}}}function kD(n){let e,t;return e=new Zi({props:{date:n[0][n[1].name]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&3&&(l.date=i[0][i[1].name]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function wD(n){let e,t=B.truncate(B.plainText(n[0][n[1].name]),300,!0)+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&3&&t!==(t=B.truncate(B.plainText(s[0][s[1].name]),300,!0)+"")&&re(i,t)},i:X,o:X,d(s){s&&w(e)}}}function SD(n){let e,t=B.truncate(n[0][n[1].name])+"",i,s,l,o;return{c(){e=v("a"),i=U(t),p(e,"class","txt-ellipsis"),p(e,"href",s=n[0][n[1].name]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(r,a){S(r,e,a),_(e,i),l||(o=[Ie(We.call(null,e,"Open in new tab")),Y(e,"click",bn(n[2]))],l=!0)},p(r,a){a&3&&t!==(t=B.truncate(r[0][r[1].name])+"")&&re(i,t),a&3&&s!==(s=r[0][r[1].name])&&p(e,"href",s)},i:X,o:X,d(r){r&&w(e),l=!1,Le(o)}}}function $D(n){let e,t=n[0][n[1].name]+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&3&&t!==(t=s[0][s[1].name]+"")&&re(i,t)},i:X,o:X,d(s){s&&w(e)}}}function CD(n){let e,t=n[0][n[1].name]?"True":"False",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&3&&t!==(t=s[0][s[1].name]?"True":"False")&&re(i,t)},i:X,o:X,d(s){s&&w(e)}}}function TD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Hp(n,e){let t,i,s;return i=new ob({props:{record:e[0],filename:e[10],size:"sm"}}),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&3&&(r.filename=e[10]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function MD(n){let e=[],t=new Map,i,s,l=n[6].slice(0,20);const o=r=>r[5]+r[3];for(let r=0;r<l.length;r+=1){let a=Np(n,l,r),u=o(a);t.set(u,e[r]=jp(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Oe()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);S(r,i,a),s=!0},p(r,a){a&3&&(l=r[6].slice(0,20),de(),e=gt(e,a,o,1,r,l,t,i.parentNode,Kt,jp,i,Np),pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&w(i)}}}function DD(n){let e=[],t=new Map,i,s,l=n[7].slice(0,20);const o=r=>r[5]+r[3];for(let r=0;r<l.length;r+=1){let a=Fp(n,l,r),u=o(a);t.set(u,e[r]=qp(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Oe()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);S(r,i,a),s=!0},p(r,a){a&3&&(l=r[7].slice(0,20),de(),e=gt(e,a,o,1,r,l,t,i.parentNode,Kt,qp,i,Fp),pe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&w(i)}}}function jp(n,e){let t,i,s;return i=new nu({props:{id:e[3]}}),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&3&&(r.id=e[3]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function qp(n,e){var o;let t,i,s,l;return i=new Xo({props:{record:e[3],displayFields:(o=e[1].options)==null?void 0:o.displayFields}}),{key:n,first:null,c(){t=v("span"),q(i.$$.fragment),s=D(),p(t,"class","label"),this.first=t},m(r,a){S(r,t,a),H(i,t,null),_(t,s),l=!0},p(r,a){var f;e=r;const u={};a&3&&(u.record=e[3]),a&2&&(u.displayFields=(f=e[1].options)==null?void 0:f.displayFields),i.$set(u)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){P(i.$$.fragment,r),l=!1},d(r){r&&w(t),j(i)}}}function Vp(n){let e;return{c(){e=U("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function zp(n,e){let t,i=e[3]+"",s;return{key:n,first:null,c(){t=v("span"),s=U(i),p(t,"class","label"),this.first=t},m(l,o){S(l,t,o),_(t,s)},p(l,o){e=l,o&3&&i!==(i=e[3]+"")&&re(s,i)},d(l){l&&w(t)}}}function OD(n){let e,t,i,s,l,o;const r=[TD,CD,$D,SD,wD,kD,yD,vD,bD,_D,gD],a=[];function u(c,d){return d&3&&(t=null),t==null&&(t=!!B.isEmpty(c[0][c[1].name])),t?0:c[1].type==="bool"?1:c[1].type==="number"?2:c[1].type==="url"?3:c[1].type==="editor"?4:c[1].type==="date"?5:c[1].type==="json"?6:c[1].type==="select"?7:c[1].type==="relation"||c[1].type==="user"?8:c[1].type==="file"?9:10}function f(c,d){return d===8?mD(c):c}return i=u(n,-1),s=a[i]=r[i](f(n,i)),{c(){e=v("td"),s.c(),p(e,"class",l="col-type-"+n[1].type+" col-field-"+n[1].name+" svelte-4cdww")},m(c,d){S(c,e,d),a[i].m(e,null),o=!0},p(c,[d]){let h=i;i=u(c,d),i===h?a[i].p(f(c,i),d):(de(),P(a[h],1,1,()=>{a[h]=null}),pe(),s=a[i],s?s.p(f(c,i),d):(s=a[i]=r[i](f(c,i)),s.c()),A(s,1),s.m(e,null)),(!o||d&2&&l!==(l="col-type-"+c[1].type+" col-field-"+c[1].name+" svelte-4cdww"))&&p(e,"class",l)},i(c){o||(A(s),o=!0)},o(c){P(s),o=!1},d(c){c&&w(e),a[i].d()}}}function ED(n,e,t){let{record:i}=e,{field:s}=e;function l(o){Be.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record),"field"in o&&t(1,s=o.field)},[i,s,l]}class AD extends ke{constructor(e){super(),ye(this,e,ED,OD,be,{record:0,field:1})}}function Bp(n,e,t){const i=n.slice();return i[54]=e[t],i}function Up(n,e,t){const i=n.slice();return i[57]=e[t],i}function Wp(n,e,t){const i=n.slice();return i[57]=e[t],i}function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i}function ID(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=D(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[14],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){S(a,e,u),_(e,t),_(e,s),_(e,l),o||(r=Y(t,"change",n[26]),o=!0)},p(a,u){u[0]&16&&i!==(i=!a[4].length)&&(t.disabled=i),u[0]&16384&&(t.checked=a[14])},d(a){a&&w(e),o=!1,r()}}}function PD(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Kp(n){let e,t,i;function s(o){n[27](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[LD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Bt({props:l}),ie.push(()=>ve(e,"sort",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function LD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Jp(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&Zp(n),r=i&&Gp(n);return{c(){o&&o.c(),t=D(),r&&r.c(),s=Oe()},m(a,u){o&&o.m(a,u),S(a,t,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,u){u[0]&128&&(e=!a[7].includes("@username")),e?o?(o.p(a,u),u[0]&128&&A(o,1)):(o=Zp(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(de(),P(o,1,1,()=>{o=null}),pe()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&A(r,1)):(r=Gp(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(de(),P(r,1,1,()=>{r=null}),pe())},i(a){l||(A(o),A(r),l=!0)},o(a){P(o),P(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function Zp(n){let e,t,i;function s(o){n[28](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[ND]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Bt({props:l}),ie.push(()=>ve(e,"sort",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ND(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="username",p(t,"class",B.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function Gp(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[FD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Bt({props:l}),ie.push(()=>ve(e,"sort",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function FD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function RD(n){let e,t,i,s,l,o=n[57].name+"",r;return{c(){e=v("div"),t=v("i"),s=D(),l=v("span"),r=U(o),p(t,"class",i=B.getFieldTypeIcon(n[57].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){S(a,e,u),_(e,t),_(e,s),_(e,l),_(l,r)},p(a,u){u[0]&65536&&i!==(i=B.getFieldTypeIcon(a[57].type))&&p(t,"class",i),u[0]&65536&&o!==(o=a[57].name+"")&&re(r,o)},d(a){a&&w(e)}}}function Xp(n,e){let t,i,s,l;function o(a){e[30](a)}let r={class:"col-type-"+e[57].type+" col-field-"+e[57].name,name:e[57].name,$$slots:{default:[RD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Bt({props:r}),ie.push(()=>ve(i,"sort",o)),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&65536&&(f.class="col-type-"+e[57].type+" col-field-"+e[57].name),u[0]&65536&&(f.name=e[57].name),u[0]&65536|u[2]&1&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],we(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),j(i,a)}}}function Qp(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[HD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Bt({props:l}),ie.push(()=>ve(e,"sort",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function HD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function xp(n){let e,t,i;function s(o){n[32](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[jD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Bt({props:l}),ie.push(()=>ve(e,"sort",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],we(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function jD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function eh(n){let e;function t(l,o){return l[10]?VD:qD}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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){s.d(l),l&&w(e)}}}function qD(n){let e,t,i,s,l;function o(u,f){var c;return(c=u[1])!=null&&c.length?BD:zD}let r=o(n),a=r(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=D(),a.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),_(e,t),_(t,i),_(t,s),a.m(t,null),_(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&w(e),a.d()}}}function VD(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function zD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[38]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[37]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function th(n){let e,t,i,s,l;i=new nu({props:{id:n[54].id}});let o=n[2].isAuth&&nh(n);return{c(){e=v("td"),t=v("div"),q(i.$$.fragment),s=D(),o&&o.c(),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(r,a){S(r,e,a),_(e,t),H(i,t,null),_(t,s),o&&o.m(t,null),l=!0},p(r,a){const u={};a[0]&16&&(u.id=r[54].id),i.$set(u),r[2].isAuth?o?o.p(r,a):(o=nh(r),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){P(i.$$.fragment,r),l=!1},d(r){r&&w(e),j(i),o&&o.d()}}}function nh(n){let e;function t(l,o){return l[54].verified?WD:UD}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function UD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(We.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function WD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(We.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function ih(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&sh(n),o=i&&lh(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=Oe()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=sh(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=lh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function sh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!B.isEmpty(o[54].username)),t?KD:YD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function YD(n){let e,t=n[54].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[54].username)},m(l,o){S(l,e,o),_(e,i)},p(l,o){o[0]&16&&t!==(t=l[54].username+"")&&re(i,t),o[0]&16&&s!==(s=l[54].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function KD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function lh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!B.isEmpty(o[54].email)),t?ZD:JD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function JD(n){let e,t=n[54].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[54].email)},m(l,o){S(l,e,o),_(e,i)},p(l,o){o[0]&16&&t!==(t=l[54].email+"")&&re(i,t),o[0]&16&&s!==(s=l[54].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function ZD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function oh(n,e){let t,i,s;return i=new AD({props:{record:e[54],field:e[57]}}),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&16&&(r.record=e[54]),o[0]&65536&&(r.field=e[57]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function rh(n){let e,t,i;return t=new Zi({props:{date:n[54].created}}),{c(){e=v("td"),q(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[54].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function ah(n){let e,t,i;return t=new Zi({props:{date:n[54].updated}}),{c(){e=v("td"),q(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[54].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function uh(n,e){let t,i,s,l,o,r,a,u,f,c,d=!e[7].includes("@id"),h,m,g=[],b=new Map,y,k=!e[7].includes("@created"),$,C=!e[7].includes("@updated"),M,T,E,O,I,L;function N(){return e[34](e[54])}let F=d&&th(e),V=e[2].isAuth&&ih(e),G=e[16];const se=Q=>Q[57].name;for(let Q=0;Q<G.length;Q+=1){let J=Up(e,G,Q),ae=se(J);b.set(ae,g[Q]=oh(ae,J))}let K=k&&rh(e),te=C&&ah(e);function ne(){return e[35](e[54])}function z(...Q){return e[36](e[54],...Q)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("div"),l=v("input"),a=D(),u=v("label"),c=D(),F&&F.c(),h=D(),V&&V.c(),m=D();for(let Q=0;Q<g.length;Q+=1)g[Q].c();y=D(),K&&K.c(),$=D(),te&&te.c(),M=D(),T=v("td"),T.innerHTML='<i class="ri-arrow-right-line"></i>',E=D(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[54].id),l.checked=r=e[6][e[54].id],p(u,"for",f="checkbox_"+e[54].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(T,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Q,J){S(Q,t,J),_(t,i),_(i,s),_(s,l),_(s,a),_(s,u),_(t,c),F&&F.m(t,null),_(t,h),V&&V.m(t,null),_(t,m);for(let ae=0;ae<g.length;ae+=1)g[ae].m(t,null);_(t,y),K&&K.m(t,null),_(t,$),te&&te.m(t,null),_(t,M),_(t,T),_(t,E),O=!0,I||(L=[Y(l,"change",N),Y(s,"click",bn(e[24])),Y(t,"click",ne),Y(t,"keydown",z)],I=!0)},p(Q,J){e=Q,(!O||J[0]&16&&o!==(o="checkbox_"+e[54].id))&&p(l,"id",o),(!O||J[0]&80&&r!==(r=e[6][e[54].id]))&&(l.checked=r),(!O||J[0]&16&&f!==(f="checkbox_"+e[54].id))&&p(u,"for",f),J[0]&128&&(d=!e[7].includes("@id")),d?F?(F.p(e,J),J[0]&128&&A(F,1)):(F=th(e),F.c(),A(F,1),F.m(t,h)):F&&(de(),P(F,1,1,()=>{F=null}),pe()),e[2].isAuth?V?V.p(e,J):(V=ih(e),V.c(),V.m(t,m)):V&&(V.d(1),V=null),J[0]&65552&&(G=e[16],de(),g=gt(g,J,se,1,e,G,b,t,Kt,oh,y,Up),pe()),J[0]&128&&(k=!e[7].includes("@created")),k?K?(K.p(e,J),J[0]&128&&A(K,1)):(K=rh(e),K.c(),A(K,1),K.m(t,$)):K&&(de(),P(K,1,1,()=>{K=null}),pe()),J[0]&128&&(C=!e[7].includes("@updated")),C?te?(te.p(e,J),J[0]&128&&A(te,1)):(te=ah(e),te.c(),A(te,1),te.m(t,M)):te&&(de(),P(te,1,1,()=>{te=null}),pe())},i(Q){if(!O){A(F);for(let J=0;J<G.length;J+=1)A(g[J]);A(K),A(te),O=!0}},o(Q){P(F);for(let J=0;J<g.length;J+=1)P(g[J]);P(K),P(te),O=!1},d(Q){Q&&w(t),F&&F.d(),V&&V.d();for(let J=0;J<g.length;J+=1)g[J].d();K&&K.d(),te&&te.d(),I=!1,Le(L)}}}function GD(n){let e,t,i,s,l,o=!n[7].includes("@id"),r,a,u=[],f=new Map,c,d=!n[7].includes("@created"),h,m=!n[7].includes("@updated"),g,b,y,k,$,C=[],M=new Map,T;function E(z,Q){return z[10]?PD:ID}let O=E(n),I=O(n),L=o&&Kp(n),N=n[2].isAuth&&Jp(n),F=n[16];const V=z=>z[57].name;for(let z=0;z<F.length;z+=1){let Q=Wp(n,F,z),J=V(Q);f.set(J,u[z]=Xp(J,Q))}let G=d&&Qp(n),se=m&&xp(n),K=n[4];const te=z=>z[54].id;for(let z=0;z<K.length;z+=1){let Q=Bp(n,K,z),J=te(Q);M.set(J,C[z]=uh(J,Q))}let ne=null;return K.length||(ne=eh(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),I.c(),l=D(),L&&L.c(),r=D(),N&&N.c(),a=D();for(let z=0;z<u.length;z+=1)u[z].c();c=D(),G&&G.c(),h=D(),se&&se.c(),g=D(),b=v("th"),y=v("button"),y.innerHTML='<i class="ri-more-line"></i>',k=D(),$=v("tbody");for(let z=0;z<C.length;z+=1)C[z].c();ne&&ne.c(),p(s,"class","bulk-select-col min-width"),p(y,"type","button"),p(y,"class","btn btn-sm btn-transparent p-0"),p(b,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[10])},m(z,Q){S(z,e,Q),_(e,t),_(t,i),_(i,s),I.m(s,null),_(i,l),L&&L.m(i,null),_(i,r),N&&N.m(i,null),_(i,a);for(let J=0;J<u.length;J+=1)u[J].m(i,null);_(i,c),G&&G.m(i,null),_(i,h),se&&se.m(i,null),_(i,g),_(i,b),_(b,y),n[33](y),_(e,k),_(e,$);for(let J=0;J<C.length;J+=1)C[J].m($,null);ne&&ne.m($,null),T=!0},p(z,Q){O===(O=E(z))&&I?I.p(z,Q):(I.d(1),I=O(z),I&&(I.c(),I.m(s,null))),Q[0]&128&&(o=!z[7].includes("@id")),o?L?(L.p(z,Q),Q[0]&128&&A(L,1)):(L=Kp(z),L.c(),A(L,1),L.m(i,r)):L&&(de(),P(L,1,1,()=>{L=null}),pe()),z[2].isAuth?N?(N.p(z,Q),Q[0]&4&&A(N,1)):(N=Jp(z),N.c(),A(N,1),N.m(i,a)):N&&(de(),P(N,1,1,()=>{N=null}),pe()),Q[0]&65537&&(F=z[16],de(),u=gt(u,Q,V,1,z,F,f,i,Kt,Xp,c,Wp),pe()),Q[0]&128&&(d=!z[7].includes("@created")),d?G?(G.p(z,Q),Q[0]&128&&A(G,1)):(G=Qp(z),G.c(),A(G,1),G.m(i,h)):G&&(de(),P(G,1,1,()=>{G=null}),pe()),Q[0]&128&&(m=!z[7].includes("@updated")),m?se?(se.p(z,Q),Q[0]&128&&A(se,1)):(se=xp(z),se.c(),A(se,1),se.m(i,g)):se&&(de(),P(se,1,1,()=>{se=null}),pe()),Q[0]&1246422&&(K=z[4],de(),C=gt(C,Q,te,1,z,K,M,$,Kt,uh,null,Bp),pe(),!K.length&&ne?ne.p(z,Q):K.length?ne&&(ne.d(1),ne=null):(ne=eh(z),ne.c(),ne.m($,null))),(!T||Q[0]&1024)&&x(e,"table-loading",z[10])},i(z){if(!T){A(L),A(N);for(let Q=0;Q<F.length;Q+=1)A(u[Q]);A(G),A(se);for(let Q=0;Q<K.length;Q+=1)A(C[Q]);T=!0}},o(z){P(L),P(N);for(let Q=0;Q<u.length;Q+=1)P(u[Q]);P(G),P(se);for(let Q=0;Q<C.length;Q+=1)P(C[Q]);T=!1},d(z){z&&w(e),I.d(),L&&L.d(),N&&N.d();for(let Q=0;Q<u.length;Q+=1)u[Q].d();G&&G.d(),se&&se.d(),n[33](null);for(let Q=0;Q<C.length;Q+=1)C[Q].d();ne&&ne.d()}}}function XD(n){let e,t,i,s,l,o=n[50].name+"",r,a,u,f,c;function d(...h){return n[25](n[50],...h)}return{c(){e=v("input"),s=D(),l=v("label"),r=U(o),u=D(),p(e,"type","checkbox"),p(e,"id",t=n[53]),e.checked=i=!n[7].includes(n[50].id),p(l,"for",a=n[53])},m(h,m){S(h,e,m),S(h,s,m),S(h,l,m),_(l,r),S(h,u,m),f||(c=Y(e,"change",d),f=!0)},p(h,m){n=h,m[1]&4194304&&t!==(t=n[53])&&p(e,"id",t),m[0]&8320&&i!==(i=!n[7].includes(n[50].id))&&(e.checked=i),m[0]&8192&&o!==(o=n[50].name+"")&&re(r,o),m[1]&4194304&&a!==(a=n[53])&&p(l,"for",a)},d(h){h&&w(e),h&&w(s),h&&w(l),h&&w(u),f=!1,c()}}}function fh(n,e){let t,i,s;return i=new me({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[XD,({uniqueId:l})=>({53:l}),({uniqueId:l})=>[0,l?4194304:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8320|o[1]&4194304|o[2]&1&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function QD(n){let e,t,i=[],s=new Map,l,o,r=n[13];const a=u=>u[50].id+u[50].name;for(let u=0;u<r.length;u+=1){let f=Yp(n,r,u),c=a(f);s.set(c,i[u]=fh(c,f))}return{c(){e=v("div"),e.textContent="Toggle columns",t=D();for(let u=0;u<i.length;u+=1)i[u].c();l=Oe(),p(e,"class","txt-hint txt-sm p-5 m-b-5")},m(u,f){S(u,e,f),S(u,t,f);for(let c=0;c<i.length;c+=1)i[c].m(u,f);S(u,l,f),o=!0},p(u,f){f[0]&8320|f[1]&4194304&&(r=u[13],de(),i=gt(i,f,a,1,u,r,s,l.parentNode,Kt,fh,l,Yp),pe())},i(u){if(!o){for(let f=0;f<r.length;f+=1)A(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)P(i[f]);o=!1},d(u){u&&w(e),u&&w(t);for(let f=0;f<i.length;f+=1)i[f].d(u);u&&w(l)}}}function xD(n){let e,t;return e=new Qn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[12],$$slots:{default:[QD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&4096&&(l.trigger=i[12]),s[0]&8320|s[2]&1&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ch(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=v("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[5]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),_(e,t),_(e,s),_(e,l),_(e,o)},p(r,a){a[0]&16&&i!==(i=r[4].length+"")&&re(s,i),a[0]&32&&re(o,r[5])},d(r){r&&w(e)}}}function dh(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=v("div"),t=v("button"),i=v("span"),s=U("Load more ("),o=U(l),r=U(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-transparent btn-expanded"),x(t,"btn-loading",n[10]),x(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),_(e,t),_(t,i),_(i,s),_(i,o),_(i,r),a||(u=Y(t,"click",n[39]),a=!0)},p(f,c){c[0]&48&&l!==(l=f[5]-f[4].length+"")&&re(o,l),c[0]&1024&&x(t,"btn-loading",f[10]),c[0]&1024&&x(t,"btn-disabled",f[10])},d(f){f&&w(e),a=!1,u()}}}function ph(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,c,d,h,m,g,b,y,k;return{c(){e=v("div"),t=v("div"),i=U("Selected "),s=v("strong"),l=U(n[8]),o=D(),a=U(r),u=D(),f=v("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=v("div"),h=D(),m=v("button"),m.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[11]),p(d,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-sm btn-transparent btn-danger"),x(m,"btn-loading",n[11]),x(m,"btn-disabled",n[11]),p(e,"class","bulkbar")},m($,C){S($,e,C),_(e,t),_(t,i),_(t,s),_(s,l),_(t,o),_(t,a),_(e,u),_(e,f),_(e,c),_(e,d),_(e,h),_(e,m),b=!0,y||(k=[Y(f,"click",n[40]),Y(m,"click",n[41])],y=!0)},p($,C){(!b||C[0]&256)&&re(l,$[8]),(!b||C[0]&256)&&r!==(r=$[8]===1?"record":"records")&&re(a,r),(!b||C[0]&2048)&&x(f,"btn-disabled",$[11]),(!b||C[0]&2048)&&x(m,"btn-loading",$[11]),(!b||C[0]&2048)&&x(m,"btn-disabled",$[11])},i($){b||($&&tt(()=>{g||(g=qe(e,On,{duration:150,y:5},!0)),g.run(1)}),b=!0)},o($){$&&(g||(g=qe(e,On,{duration:150,y:5},!1)),g.run(0)),b=!1},d($){$&&w(e),$&&g&&g.end(),y=!1,Le(k)}}}function eO(n){let e,t,i,s,l,o;e=new Oa({props:{class:"table-wrapper",$$slots:{before:[xD],default:[GD]},$$scope:{ctx:n}}});let r=n[4].length&&ch(n),a=n[4].length&&n[15]&&dh(n),u=n[8]&&ph(n);return{c(){q(e.$$.fragment),t=D(),r&&r.c(),i=D(),a&&a.c(),s=D(),u&&u.c(),l=Oe()},m(f,c){H(e,f,c),S(f,t,c),r&&r.m(f,c),S(f,i,c),a&&a.m(f,c),S(f,s,c),u&&u.m(f,c),S(f,l,c),o=!0},p(f,c){const d={};c[0]&95447|c[2]&1&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),f[4].length?r?r.p(f,c):(r=ch(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[15]?a?a.p(f,c):(a=dh(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,c),c[0]&256&&A(u,1)):(u=ph(f),u.c(),A(u,1),u.m(l.parentNode,l)):u&&(de(),P(u,1,1,()=>{u=null}),pe())},i(f){o||(A(e.$$.fragment,f),A(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){j(e,f),f&&w(t),r&&r.d(f),f&&w(i),a&&a.d(f),f&&w(s),u&&u.d(f),f&&w(l)}}}const tO=/^([\+\-])?(\w+)$/;function nO(n,e,t){let i,s,l,o,r,a;const u=Ct();let{collection:f}=e,{sort:c=""}=e,{filter:d=""}=e,h=[],m=1,g=0,b={},y=!0,k=!1,$=0,C,M=[],T=[];function E(){f!=null&&f.id&&localStorage.setItem((f==null?void 0:f.id)+"@hiddenCollumns",JSON.stringify(M))}function O(){if(t(7,M=[]),!!(f!=null&&f.id))try{const Se=localStorage.getItem(f.id+"@hiddenCollumns");Se&&t(7,M=JSON.parse(Se)||[])}catch{}}async function I(){const Se=m;for(let _e=1;_e<=Se;_e++)(_e===1||o)&&await L(_e,!1)}async function L(Se=1,_e=!0){var It,Vt;if(!(f!=null&&f.id))return;t(10,y=!0);let Je=c;const nt=Je.match(tO),St=nt?s.find(ut=>ut.name===nt[2]):null;if(nt&&((Vt=(It=St==null?void 0:St.options)==null?void 0:It.displayFields)==null?void 0:Vt.length)>0){const ut=[];for(const xn of St.options.displayFields)ut.push((nt[1]||"")+nt[2]+"."+xn);Je=ut.join(",")}return he.collection(f.id).getList(Se,30,{sort:Je,filter:d,expand:s.map(ut=>ut.name).join(",")}).then(async ut=>{if(Se<=1&&N(),t(10,y=!1),t(9,m=ut.page),t(5,g=ut.totalItems),u("load",h.concat(ut.items)),_e){const xn=++$;for(;ut.items.length&&$==xn;)t(4,h=h.concat(ut.items.splice(0,15))),await B.yieldToMain()}else t(4,h=h.concat(ut.items))}).catch(ut=>{ut!=null&&ut.isAbort||(t(10,y=!1),console.warn(ut),N(),he.errorResponseHandler(ut,!1))})}function N(){t(4,h=[]),t(9,m=1),t(5,g=0),t(6,b={})}function F(){a?V():G()}function V(){t(6,b={})}function G(){for(const Se of h)t(6,b[Se.id]=Se,b);t(6,b)}function se(Se){b[Se.id]?delete b[Se.id]:t(6,b[Se.id]=Se,b),t(6,b)}function K(){Dn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,te)}async function te(){if(k||!r||!(f!=null&&f.id))return;let Se=[];for(const _e of Object.keys(b))Se.push(he.collection(f.id).delete(_e));return t(11,k=!0),Promise.all(Se).then(()=>{qt(`Successfully deleted the selected ${r===1?"record":"records"}.`),V()}).catch(_e=>{he.errorResponseHandler(_e)}).finally(()=>(t(11,k=!1),I()))}function ne(Se){Be.call(this,n,Se)}const z=(Se,_e)=>{_e.target.checked?B.removeByValue(M,Se.id):B.pushUnique(M,Se.id),t(7,M)},Q=()=>F();function J(Se){c=Se,t(0,c)}function ae(Se){c=Se,t(0,c)}function He(Se){c=Se,t(0,c)}function Fe(Se){c=Se,t(0,c)}function Ne(Se){c=Se,t(0,c)}function Re(Se){c=Se,t(0,c)}function ge(Se){ie[Se?"unshift":"push"](()=>{C=Se,t(12,C)})}const Ce=Se=>se(Se),$e=Se=>u("select",Se),Ye=(Se,_e)=>{_e.code==="Enter"&&(_e.preventDefault(),u("select",Se))},ze=()=>t(1,d=""),oe=()=>u("new"),ue=()=>L(m+1),Z=()=>V(),ce=()=>K();return n.$$set=Se=>{"collection"in Se&&t(2,f=Se.collection),"sort"in Se&&t(0,c=Se.sort),"filter"in Se&&t(1,d=Se.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&t(23,i=(f==null?void 0:f.schema)||[]),n.$$.dirty[0]&8388608&&(s=i.filter(Se=>Se.type==="relation")),n.$$.dirty[0]&8388736&&t(16,l=i.filter(Se=>!M.includes(Se.id))),n.$$.dirty[0]&4&&f!=null&&f.id&&(O(),N()),n.$$.dirty[0]&7&&f!=null&&f.id&&c!==-1&&d!==-1&&L(1),n.$$.dirty[0]&48&&t(15,o=g>h.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(b).length),n.$$.dirty[0]&272&&t(14,a=h.length&&r===h.length),n.$$.dirty[0]&128&&M!==-1&&E(),n.$$.dirty[0]&8388612&&t(13,T=[].concat(f.isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(Se=>({id:Se.id,name:Se.name})),[{id:"@created",name:"created"},{id:"@updated",name:"updated"}]))},[c,d,f,L,h,g,b,M,r,m,y,k,C,T,a,o,l,u,F,V,se,K,I,i,ne,z,Q,J,ae,He,Fe,Ne,Re,ge,Ce,$e,Ye,ze,oe,ue,Z,ce]}class iO extends ke{constructor(e){super(),ye(this,e,nO,eO,be,{collection:2,sort:0,filter:1,reloadLoadedPages:22,load:3},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[22]}get load(){return this.$$.ctx[3]}}function sO(n){let e,t,i,s;return e=new vC({}),i=new vn({props:{$$slots:{default:[rO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&759|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function lO(n){let e,t;return e=new vn({props:{center:!0,$$slots:{default:[fO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&528|s[1]&2&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function oO(n){let e,t;return e=new vn({props:{center:!0,$$slots:{default:[cO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[1]&2&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ie(We.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[14])],t=!0)},p:X,d(s){s&&w(e),t=!1,Le(i)}}}function rO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I,L,N,F=!n[9]&&hh(n);c=new Da({}),c.$on("refresh",n[15]),k=new Uo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[18]);function V(K){n[20](K)}function G(K){n[21](K)}let se={collection:n[2]};return n[0]!==void 0&&(se.filter=n[0]),n[1]!==void 0&&(se.sort=n[1]),T=new iO({props:se}),n[19](T),ie.push(()=>ve(T,"filter",V)),ie.push(()=>ve(T,"sort",G)),T.$on("select",n[22]),T.$on("new",n[23]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=D(),l=v("div"),r=U(o),a=D(),u=v("div"),F&&F.c(),f=D(),q(c.$$.fragment),d=D(),h=v("div"),m=v("button"),m.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=D(),b=v("button"),b.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,y=D(),q(k.$$.fragment),$=D(),C=v("div"),M=D(),q(T.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(m,"type","button"),p(m,"class","btn btn-outline"),p(b,"type","button"),p(b,"class","btn btn-expanded"),p(h,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-base")},m(K,te){S(K,e,te),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),_(e,u),F&&F.m(u,null),_(u,f),H(c,u,null),_(e,d),_(e,h),_(h,m),_(h,g),_(h,b),S(K,y,te),H(k,K,te),S(K,$,te),S(K,C,te),S(K,M,te),H(T,K,te),I=!0,L||(N=[Y(m,"click",n[16]),Y(b,"click",n[17])],L=!0)},p(K,te){(!I||te[0]&4)&&o!==(o=K[2].name+"")&&re(r,o),K[9]?F&&(F.d(1),F=null):F?F.p(K,te):(F=hh(K),F.c(),F.m(u,f));const ne={};te[0]&1&&(ne.value=K[0]),te[0]&4&&(ne.autocompleteCollection=K[2]),k.$set(ne);const z={};te[0]&4&&(z.collection=K[2]),!E&&te[0]&1&&(E=!0,z.filter=K[0],we(()=>E=!1)),!O&&te[0]&2&&(O=!0,z.sort=K[1],we(()=>O=!1)),T.$set(z)},i(K){I||(A(c.$$.fragment,K),A(k.$$.fragment,K),A(T.$$.fragment,K),I=!0)},o(K){P(c.$$.fragment,K),P(k.$$.fragment,K),P(T.$$.fragment,K),I=!1},d(K){K&&w(e),F&&F.d(),j(c),K&&w(y),j(k,K),K&&w($),K&&w(C),K&&w(M),n[19](null),j(T,K),L=!1,Le(N)}}}function aO(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=D(),i=v("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[13]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function uO(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function fO(n){let e,t,i;function s(r,a){return r[9]?uO:aO}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),_(e,t),_(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function cO(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function dO(n){let e,t,i,s,l,o,r,a,u;const f=[oO,lO,sO],c=[];function d(b,y){return b[3]&&!b[8].length?0:b[8].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new tu({props:h}),n[24](s);let m={};o=new MC({props:m}),n[25](o);let g={collection:n[2]};return a=new ab({props:g}),n[26](a),a.$on("save",n[27]),a.$on("delete",n[28]),{c(){t.c(),i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment)},m(b,y){c[e].m(b,y),S(b,i,y),H(s,b,y),S(b,l,y),H(o,b,y),S(b,r,y),H(a,b,y),u=!0},p(b,y){let k=e;e=d(b),e===k?c[e].p(b,y):(de(),P(c[k],1,1,()=>{c[k]=null}),pe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const C={};o.$set(C);const M={};y[0]&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&w(i),n[24](null),j(s,b),b&&w(l),n[25](null),j(o,b),b&&w(r),n[26](null),j(a,b)}}}function pO(n,e,t){let i,s,l,o,r,a,u;Ke(n,Si,z=>t(2,s=z)),Ke(n,Po,z=>t(3,l=z)),Ke(n,ha,z=>t(12,o=z)),Ke(n,kt,z=>t(29,r=z)),Ke(n,es,z=>t(8,a=z)),Ke(n,Ts,z=>t(9,u=z)),Wt(kt,r="Collections",r);const f=new URLSearchParams(o);let c,d,h,m,g=f.get("filter")||"",b=f.get("sort")||"-created",y=f.get("collectionId")||(s==null?void 0:s.id);function k(){t(10,y=s.id),t(1,b="-created"),t(0,g="")}tb(y);const $=()=>c==null?void 0:c.show(),C=()=>c==null?void 0:c.show(s),M=()=>m==null?void 0:m.load(),T=()=>d==null?void 0:d.show(s),E=()=>h==null?void 0:h.show(),O=z=>t(0,g=z.detail);function I(z){ie[z?"unshift":"push"](()=>{m=z,t(7,m)})}function L(z){g=z,t(0,g)}function N(z){b=z,t(1,b)}const F=z=>h==null?void 0:h.show(z==null?void 0:z.detail),V=()=>h==null?void 0:h.show();function G(z){ie[z?"unshift":"push"](()=>{c=z,t(4,c)})}function se(z){ie[z?"unshift":"push"](()=>{d=z,t(5,d)})}function K(z){ie[z?"unshift":"push"](()=>{h=z,t(6,h)})}const te=()=>m==null?void 0:m.reloadLoadedPages(),ne=()=>m==null?void 0:m.reloadLoadedPages();return n.$$.update=()=>{if(n.$$.dirty[0]&4096&&t(11,i=new URLSearchParams(o)),n.$$.dirty[0]&3080&&!l&&i.get("collectionId")&&i.get("collectionId")!=y&&i4(i.get("collectionId")),n.$$.dirty[0]&1028&&s!=null&&s.id&&y!=s.id&&k(),n.$$.dirty[0]&7&&(b||g||s!=null&&s.id)){const z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:b}).toString();$i("/collections?"+z)}},[g,b,s,l,c,d,h,m,a,u,y,i,o,$,C,M,T,E,O,I,L,N,F,V,G,se,K,te,ne]}class hO extends ke{constructor(e){super(),ye(this,e,pO,dO,be,{},null,[-1,-1])}}function mO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=D(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=v("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),h=v("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,m=D(),g=v("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=D(),y=v("div"),y.textContent="Authentication",k=D(),$=v("a"),$.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,C=D(),M=v("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,T=D(),E=v("a"),E.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(g,"href","/settings/import-collections"),p(g,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(E,"href","/settings/admins"),p(E,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),_(t,f),_(t,c),_(t,d),_(t,h),_(t,m),_(t,g),_(t,b),_(t,y),_(t,k),_(t,$),_(t,C),_(t,M),_(t,T),_(t,E),O||(I=[Ie(Fn.call(null,l,{path:"/settings"})),Ie(Qt.call(null,l)),Ie(Fn.call(null,r,{path:"/settings/mail/?.*"})),Ie(Qt.call(null,r)),Ie(Fn.call(null,u,{path:"/settings/storage/?.*"})),Ie(Qt.call(null,u)),Ie(Fn.call(null,h,{path:"/settings/export-collections/?.*"})),Ie(Qt.call(null,h)),Ie(Fn.call(null,g,{path:"/settings/import-collections/?.*"})),Ie(Qt.call(null,g)),Ie(Fn.call(null,$,{path:"/settings/auth-providers/?.*"})),Ie(Qt.call(null,$)),Ie(Fn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(Qt.call(null,M)),Ie(Fn.call(null,E,{path:"/settings/admins/?.*"})),Ie(Qt.call(null,E))],O=!0)},p:X,i:X,o:X,d(L){L&&w(e),O=!1,Le(I)}}}class Di extends ke{constructor(e){super(),ye(this,e,null,mO,be,{})}}function mh(n,e,t){const i=n.slice();return i[30]=e[t],i}function gh(n){let e,t;return e=new me({props:{class:"form-field disabled",name:"id",$$slots:{default:[gO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="ID",o=D(),r=v("div"),a=v("i"),f=D(),c=v("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=h=n[1].id,c.disabled=!0},m(b,y){S(b,e,y),_(e,t),_(e,i),_(e,s),S(b,o,y),S(b,r,y),_(r,a),S(b,f,y),S(b,c,y),m||(g=Ie(u=We.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),m=!0)},p(b,y){y[0]&536870912&&l!==(l=b[29])&&p(e,"for",l),u&&Zt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${b[1].created}
Updated: ${b[1].updated}`,position:"left"}),y[0]&536870912&&d!==(d=b[29])&&p(c,"id",d),y[0]&2&&h!==(h=b[1].id)&&c.value!==h&&(c.value=h)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(c),m=!1,g()}}}function _h(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=D(),jn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),_(e,t),_(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function _O(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&fe(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function bh(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[bO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function bO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function vh(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[vO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[yO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),q(s.$$.fragment),l=D(),o=v("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),_(e,t),_(t,i),H(s,i,null),_(t,l),_(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&536871424|c[1]&4&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&tt(()=>{a||(a=qe(t,Et,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=qe(t,Et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function vO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&fe(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function yO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),fe(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&fe(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function kO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m=!n[1].isNew&&gh(n),g=[0,1,2,3,4,5,6,7,8,9],b=[];for(let $=0;$<10;$+=1)b[$]=_h(mh(n,g,$));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[_O,({uniqueId:$})=>({29:$}),({uniqueId:$})=>[$?536870912:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&bh(n),k=(n[1].isNew||n[4])&&vh(n);return{c(){e=v("form"),m&&m.c(),t=D(),i=v("div"),s=v("p"),s.textContent="Avatar",l=D(),o=v("div");for(let $=0;$<10;$+=1)b[$].c();r=D(),q(a.$$.fragment),u=D(),y&&y.c(),f=D(),k&&k.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m($,C){S($,e,C),m&&m.m(e,null),_(e,t),_(e,i),_(i,s),_(i,l),_(i,o);for(let M=0;M<10;M+=1)b[M].m(o,null);_(e,r),H(a,e,null),_(e,u),y&&y.m(e,null),_(e,f),k&&k.m(e,null),c=!0,d||(h=Y(e,"submit",ct(n[12])),d=!0)},p($,C){if($[1].isNew?m&&(de(),P(m,1,1,()=>{m=null}),pe()):m?(m.p($,C),C[0]&2&&A(m,1)):(m=gh($),m.c(),A(m,1),m.m(e,t)),C[0]&4){g=[0,1,2,3,4,5,6,7,8,9];let T;for(T=0;T<10;T+=1){const E=mh($,g,T);b[T]?b[T].p(E,C):(b[T]=_h(E),b[T].c(),b[T].m(o,null))}for(;T<10;T+=1)b[T].d(1)}const M={};C[0]&536870920|C[1]&4&&(M.$$scope={dirty:C,ctx:$}),a.$set(M),$[1].isNew?y&&(de(),P(y,1,1,()=>{y=null}),pe()):y?(y.p($,C),C[0]&2&&A(y,1)):(y=bh($),y.c(),A(y,1),y.m(e,f)),$[1].isNew||$[4]?k?(k.p($,C),C[0]&18&&A(k,1)):(k=vh($),k.c(),A(k,1),k.m(e,null)):k&&(de(),P(k,1,1,()=>{k=null}),pe())},i($){c||(A(m),A(a.$$.fragment,$),A(y),A(k),c=!0)},o($){P(m),P(a.$$.fragment,$),P(y),P(k),c=!1},d($){$&&w(e),m&&m.d(),yt(b,$),j(a),y&&y.d(),k&&k.d(),d=!1,h()}}}function wO(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=U(t)},m(s,l){S(s,e,l),_(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New admin":"Edit admin")&&re(i,t)},d(s){s&&w(e)}}}function yh(n){let e,t,i,s,l,o,r,a,u;return o=new Qn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[SO]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=D(),s=v("i"),l=D(),q(o.$$.fragment),r=D(),a=v("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){S(f,e,c),_(e,t),_(e,i),_(e,s),_(e,l),H(o,e,null),S(f,r,c),S(f,a,c),u=!0},p(f,c){const d={};c[1]&4&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&w(e),j(o),f&&w(r),f&&w(a)}}}function SO(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $O(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&yh(n);return{c(){h&&h.c(),e=D(),t=v("button"),i=v("span"),i.textContent="Cancel",s=D(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(m,g){h&&h.m(m,g),S(m,e,g),S(m,t,g),_(t,i),S(m,s,g),S(m,l,g),_(l,o),_(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(m,g){m[1].isNew?h&&(de(),P(h,1,1,()=>{h=null}),pe()):h?(h.p(m,g),g[0]&2&&A(h,1)):(h=yh(m),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=m[6]),(!f||g[0]&2)&&r!==(r=m[1].isNew?"Create":"Save changes")&&re(a,r),(!f||g[0]&1088&&u!==(u=!m[10]||m[6]))&&(l.disabled=u),(!f||g[0]&64)&&x(l,"btn-loading",m[6])},i(m){f||(A(h),f=!0)},o(m){P(h),f=!1},d(m){h&&h.d(m),m&&w(e),m&&w(t),m&&w(s),m&&w(l),c=!1,d()}}}function CO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[$O],header:[wO],default:[kO]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function TO(n,e,t){let i;const s=Ct(),l="admin_"+B.randomString(5);let o,r=new Ji,a=!1,u=!1,f=0,c="",d="",h="",m=!1;function g(K){return y(K),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(K){t(1,r=K!=null&&K.clone?K.clone():new Ji),k()}function k(){t(4,m=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,h=""),Vn({})}function $(){if(a||!i)return;t(6,a=!0);const K={email:c,avatar:f};(r.isNew||m)&&(K.password=d,K.passwordConfirm=h);let te;r.isNew?te=he.admins.create(K):te=he.admins.update(r.id,K),te.then(async ne=>{var z;t(7,u=!1),b(),qt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((z=he.authStore.model)==null?void 0:z.id)===ne.id&&he.authStore.save(he.authStore.token,ne)}).catch(ne=>{he.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&Dn("Do you really want to delete the selected admin?",()=>he.admins.delete(r.id).then(()=>{t(7,u=!1),b(),qt("Successfully deleted admin."),s("delete",r)}).catch(K=>{he.errorResponseHandler(K)}))}const M=()=>C(),T=()=>b(),E=K=>t(2,f=K);function O(){c=this.value,t(3,c)}function I(){m=this.checked,t(4,m)}function L(){d=this.value,t(8,d)}function N(){h=this.value,t(9,h)}const F=()=>i&&u?(Dn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function V(K){ie[K?"unshift":"push"](()=>{o=K,t(5,o)})}function G(K){Be.call(this,n,K)}function se(K){Be.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||m||c!==r.email||f!==r.avatar)},[b,r,f,c,m,o,a,u,d,h,i,l,$,C,g,M,T,E,O,I,L,N,F,V,G,se]}class MO extends ke{constructor(e){super(),ye(this,e,TO,CO,be,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function kh(n,e,t){const i=n.slice();return i[24]=e[t],i}function DO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function OO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function EO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function AO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),_(e,t),_(e,i),_(e,s)},p:X,d(l){l&&w(e)}}}function wh(n){let e;function t(l,o){return l[5]?PO:IO}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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){s.d(l),l&&w(e)}}}function IO(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Sh(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),_(e,t),_(t,i),_(t,s),o&&o.m(t,null),_(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Sh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function PO(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Sh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $h(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ch(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,m=e[24].email+"",g,b,y,k,$,C,M,T,E,O,I,L,N,F;u=new nu({props:{id:e[24].id}});let V=e[24].id===e[7].id&&$h();$=new Zi({props:{date:e[24].created}}),T=new Zi({props:{date:e[24].updated}});function G(){return e[15](e[24])}function se(...K){return e[16](e[24],...K)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=D(),a=v("td"),q(u.$$.fragment),f=D(),V&&V.c(),c=D(),d=v("td"),h=v("span"),g=U(m),y=D(),k=v("td"),q($.$$.fragment),C=D(),M=v("td"),q(T.$$.fragment),E=D(),O=v("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',I=D(),jn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p(k,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,te){S(K,t,te),_(t,i),_(i,s),_(s,l),_(t,r),_(t,a),H(u,a,null),_(a,f),V&&V.m(a,null),_(t,c),_(t,d),_(d,h),_(h,g),_(t,y),_(t,k),H($,k,null),_(t,C),_(t,M),H(T,M,null),_(t,E),_(t,O),_(t,I),L=!0,N||(F=[Y(t,"click",G),Y(t,"keydown",se)],N=!0)},p(K,te){e=K,(!L||te&16&&!jn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ne={};te&16&&(ne.id=e[24].id),u.$set(ne),e[24].id===e[7].id?V||(V=$h(),V.c(),V.m(a,null)):V&&(V.d(1),V=null),(!L||te&16)&&m!==(m=e[24].email+"")&&re(g,m),(!L||te&16&&b!==(b=e[24].email))&&p(h,"title",b);const z={};te&16&&(z.date=e[24].created),$.$set(z);const Q={};te&16&&(Q.date=e[24].updated),T.$set(Q)},i(K){L||(A(u.$$.fragment,K),A($.$$.fragment,K),A(T.$$.fragment,K),L=!0)},o(K){P(u.$$.fragment,K),P($.$$.fragment,K),P(T.$$.fragment,K),L=!1},d(K){K&&w(t),j(u),V&&V.d(),j($),j(T),N=!1,Le(F)}}}function LO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M=[],T=new Map,E;function O(z){n[11](z)}let I={class:"col-type-text",name:"id",$$slots:{default:[DO]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Bt({props:I}),ie.push(()=>ve(o,"sort",O));function L(z){n[12](z)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[OO]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Bt({props:N}),ie.push(()=>ve(u,"sort",L));function F(z){n[13](z)}let V={class:"col-type-date col-field-created",name:"created",$$slots:{default:[EO]},$$scope:{ctx:n}};n[2]!==void 0&&(V.sort=n[2]),d=new Bt({props:V}),ie.push(()=>ve(d,"sort",F));function G(z){n[14](z)}let se={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[AO]},$$scope:{ctx:n}};n[2]!==void 0&&(se.sort=n[2]),g=new Bt({props:se}),ie.push(()=>ve(g,"sort",G));let K=n[4];const te=z=>z[24].id;for(let z=0;z<K.length;z+=1){let Q=kh(n,K,z),J=te(Q);T.set(J,M[z]=Ch(J,Q))}let ne=null;return K.length||(ne=wh(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=D(),q(o.$$.fragment),a=D(),q(u.$$.fragment),c=D(),q(d.$$.fragment),m=D(),q(g.$$.fragment),y=D(),k=v("th"),$=D(),C=v("tbody");for(let z=0;z<M.length;z+=1)M[z].c();ne&&ne.c(),p(s,"class","min-width"),p(k,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[5])},m(z,Q){S(z,e,Q),_(e,t),_(t,i),_(i,s),_(i,l),H(o,i,null),_(i,a),H(u,i,null),_(i,c),H(d,i,null),_(i,m),H(g,i,null),_(i,y),_(i,k),_(e,$),_(e,C);for(let J=0;J<M.length;J+=1)M[J].m(C,null);ne&&ne.m(C,null),E=!0},p(z,Q){const J={};Q&134217728&&(J.$$scope={dirty:Q,ctx:z}),!r&&Q&4&&(r=!0,J.sort=z[2],we(()=>r=!1)),o.$set(J);const ae={};Q&134217728&&(ae.$$scope={dirty:Q,ctx:z}),!f&&Q&4&&(f=!0,ae.sort=z[2],we(()=>f=!1)),u.$set(ae);const He={};Q&134217728&&(He.$$scope={dirty:Q,ctx:z}),!h&&Q&4&&(h=!0,He.sort=z[2],we(()=>h=!1)),d.$set(He);const Fe={};Q&134217728&&(Fe.$$scope={dirty:Q,ctx:z}),!b&&Q&4&&(b=!0,Fe.sort=z[2],we(()=>b=!1)),g.$set(Fe),Q&186&&(K=z[4],de(),M=gt(M,Q,te,1,z,K,T,C,Kt,Ch,null,kh),pe(),!K.length&&ne?ne.p(z,Q):K.length?ne&&(ne.d(1),ne=null):(ne=wh(z),ne.c(),ne.m(C,null))),(!E||Q&32)&&x(e,"table-loading",z[5])},i(z){if(!E){A(o.$$.fragment,z),A(u.$$.fragment,z),A(d.$$.fragment,z),A(g.$$.fragment,z);for(let Q=0;Q<K.length;Q+=1)A(M[Q]);E=!0}},o(z){P(o.$$.fragment,z),P(u.$$.fragment,z),P(d.$$.fragment,z),P(g.$$.fragment,z);for(let Q=0;Q<M.length;Q+=1)P(M[Q]);E=!1},d(z){z&&w(e),j(o),j(u),j(d),j(g);for(let Q=0;Q<M.length;Q+=1)M[Q].d();ne&&ne.d()}}}function Th(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=v("small"),t=U("Showing "),s=U(i),l=U(" of "),r=U(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){S(a,e,u),_(e,t),_(e,s),_(e,l),_(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&re(s,i),u&16&&o!==(o=a[4].length+"")&&re(r,o)},d(a){a&&w(e)}}}function NO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E;a=new Da({}),a.$on("refresh",n[8]),m=new Uo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),m.$on("submit",n[10]),k=new Oa({props:{class:"table-wrapper",$$slots:{default:[LO]},$$scope:{ctx:n}}});let O=n[4].length&&Th(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[6]),r=D(),q(a.$$.fragment),u=D(),f=v("div"),c=D(),d=v("button"),d.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,h=D(),q(m.$$.fragment),g=D(),b=v("div"),y=D(),q(k.$$.fragment),$=D(),O&&O.c(),C=Oe(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(b,"class","clearfix m-b-base")},m(I,L){S(I,e,L),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(e,r),H(a,e,null),_(e,u),_(e,f),_(e,c),_(e,d),S(I,h,L),H(m,I,L),S(I,g,L),S(I,b,L),S(I,y,L),H(k,I,L),S(I,$,L),O&&O.m(I,L),S(I,C,L),M=!0,T||(E=Y(d,"click",n[9]),T=!0)},p(I,L){(!M||L&64)&&re(o,I[6]);const N={};L&2&&(N.value=I[1]),m.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),k.$set(F),I[4].length?O?O.p(I,L):(O=Th(I),O.c(),O.m(C.parentNode,C)):O&&(O.d(1),O=null)},i(I){M||(A(a.$$.fragment,I),A(m.$$.fragment,I),A(k.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(m.$$.fragment,I),P(k.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(h),j(m,I),I&&w(g),I&&w(b),I&&w(y),j(k,I),I&&w($),O&&O.d(I),I&&w(C),T=!1,E()}}}function FO(n){let e,t,i,s,l,o;e=new Di({}),i=new vn({props:{$$slots:{default:[NO]},$$scope:{ctx:n}}});let r={};return l=new MO({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),S(a,t,u),H(i,a,u),S(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function RO(n,e,t){let i,s,l;Ke(n,ha,N=>t(21,i=N)),Ke(n,kt,N=>t(6,s=N)),Ke(n,Ma,N=>t(7,l=N)),Wt(kt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),he.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),h(),he.errorResponseHandler(N,!1))})}function h(){t(4,a=[])}const m=()=>d(),g=()=>r==null?void 0:r.show(),b=N=>t(1,f=N.detail);function y(N){c=N,t(2,c)}function k(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),T=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},E=()=>t(1,f="");function O(N){ie[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();$i("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,m,g,b,y,k,$,C,M,T,E,O,I,L]}class HO extends ke{constructor(e){super(),ye(this,e,RO,FO,be,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function jO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=D(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),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&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function qO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=D(),l=v("input"),r=D(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){S(d,e,h),_(e,t),S(d,s,h),S(d,l,h),fe(l,n[1]),S(d,r,h),S(d,a,h),_(a,u),f||(c=[Y(l,"input",n[5]),Ie(Qt.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&fe(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Le(c)}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[jO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[qO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Admin sign in</h4>",i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),a=v("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){S(d,e,h),_(e,t),_(e,i),H(s,e,null),_(e,l),H(o,e,null),_(e,r),_(e,a),u=!0,f||(c=Y(e,"submit",ct(n[3])),f=!0)},p(d,h){const m={};h&769&&(m.$$scope={dirty:h,ctx:d}),s.$set(m);const g={};h&770&&(g.$$scope={dirty:h,ctx:d}),o.$set(g),(!u||h&4)&&x(a,"btn-disabled",d[2]),(!u||h&4)&&x(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function zO(n){let e,t;return e=new t_({props:{$$slots:{default:[VO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function BO(n,e,t){let i;Ke(n,ha,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),he.admins.authWithPassword(l,o).then(()=>{Ca(),$i("/")}).catch(()=>{cl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class UO extends ke{constructor(e){super(),ye(this,e,BO,zO,be,{})}}function WO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[KO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[JO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[ZO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[GO,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}});let T=n[3]&&Mh(n);return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),c=D(),d=v("div"),h=v("div"),m=D(),T&&T.c(),g=D(),b=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=k=!n[3]||n[2],x(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(E,O){S(E,e,O),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),H(a,e,null),_(e,u),H(f,e,null),_(e,c),_(e,d),_(d,h),_(d,m),T&&T.m(d,null),_(d,g),_(d,b),_(b,y),$=!0,C||(M=Y(b,"click",n[13]),C=!0)},p(E,O){const I={};O&1572865&&(I.$$scope={dirty:O,ctx:E}),i.$set(I);const L={};O&1572865&&(L.$$scope={dirty:O,ctx:E}),o.$set(L);const N={};O&1572865&&(N.$$scope={dirty:O,ctx:E}),a.$set(N);const F={};O&1572865&&(F.$$scope={dirty:O,ctx:E}),f.$set(F),E[3]?T?T.p(E,O):(T=Mh(E),T.c(),T.m(d,g)):T&&(T.d(1),T=null),(!$||O&12&&k!==(k=!E[3]||E[2]))&&(b.disabled=k),(!$||O&4)&&x(b,"btn-loading",E[2])},i(E){$||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(a.$$.fragment,E),A(f.$$.fragment,E),$=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(a.$$.fragment,E),P(f.$$.fragment,E),$=!1},d(E){E&&w(e),j(i),j(o),j(a),j(f),T&&T.d(),C=!1,M()}}}function YO(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=D(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&fe(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application url"),s=D(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&fe(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ZO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Logs max days retention"),s=D(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].logs.maxDays&&fe(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function GO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=D(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){S(c,e,d),e.checked=n[0].meta.hideControls,S(c,i,d),S(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"change",n[11]),Ie(We.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function Mh(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),_(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function XO(n){let e,t,i,s,l,o,r,a,u;const f=[YO,WO],c=[];function d(h,m){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,m){S(h,e,m),S(h,t,m),S(h,i,m),_(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",ct(n[4])),a=!0)},p(h,m){let g=l;l=d(h),l===g?c[l].p(h,m):(de(),P(c[g],1,1,()=>{c[g]=null}),pe(),o=c[l],o?o.p(h,m):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){P(o),r=!1},d(h){h&&w(e),h&&w(t),h&&w(i),c[l].d(),a=!1,u()}}}function QO(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[XO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function xO(n,e,t){let i,s,l,o;Ke(n,Ts,T=>t(14,s=T)),Ke(n,vo,T=>t(15,l=T)),Ke(n,kt,T=>t(16,o=T)),Wt(kt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const T=await he.settings.getAll()||{};m(T)}catch(T){he.errorResponseHandler(T)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const T=await he.settings.update(B.filterRedactedProps(a));m(T),qt("Successfully saved application settings.")}catch(T){he.errorResponseHandler(T)}t(2,f=!1)}}function m(T={}){var E,O;Wt(vo,l=(E=T==null?void 0:T.meta)==null?void 0:E.appName,l),Wt(Ts,s=!!((O=T==null?void 0:T.meta)!=null&&O.hideControls),s),t(0,a={meta:(T==null?void 0:T.meta)||{},logs:(T==null?void 0:T.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function k(){a.logs.maxDays=dt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),M=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,g,r,c,b,y,k,$,C,M]}class eE extends ke{constructor(e){super(),ye(this,e,xO,QO,be,{})}}function tE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Ge(l,s[o]);return{c(){e=v("input"),Zn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),fe(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Zn(e,l=nn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&fe(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function nE(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Ge(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Zn(s,a)},m(u,f){S(u,e,f),_(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(We.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Zn(s,a=nn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Le(o)}}}function iE(n){let e;function t(l,o){return l[3]?nE:tE}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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:X,o:X,d(l){s.d(l),l&&w(e)}}}function sE(n,e,t){const i=["value","mask"];let s=Ot(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await In(),r==null||r.focus()}const f=()=>u();function c(h){ie[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=Ge(Ge({},e),Gn(h)),t(5,s=Ot(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class iu extends ke{constructor(e){super(),ye(this,e,sE,iE,be,{value:0,mask:1})}}function lE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;return{c(){e=v("label"),t=U("Subject"),s=D(),l=v("input"),r=D(),a=v("div"),u=U(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=U(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,h=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){S(b,e,y),_(e,t),S(b,s,y),S(b,l,y),fe(l,n[0].subject),S(b,r,y),S(b,a,y),_(a,u),_(a,f),_(a,c),_(a,d),_(a,h),m||(g=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],m=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&fe(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),m=!1,Le(g)}}}function oE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y;return{c(){e=v("label"),t=U("Action URL"),s=D(),l=v("input"),r=D(),a=v("div"),u=U(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=U(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,h=U(`,
`),m=v("button"),m.textContent=`{TOKEN}
`,g=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(m,"type","button"),p(m,"class","label label-sm link-primary txt-mono"),p(m,"title","Required parameter"),p(a,"class","help-block")},m(k,$){S(k,e,$),_(e,t),S(k,s,$),S(k,l,$),fe(l,n[0].actionUrl),S(k,r,$),S(k,a,$),_(a,u),_(a,f),_(a,c),_(a,d),_(a,h),_(a,m),_(a,g),b||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(m,"click",n[19])],b=!0)},p(k,$){$[1]&1&&i!==(i=k[31])&&p(e,"for",i),$[1]&1&&o!==(o=k[31])&&p(l,"id",o),$[0]&1&&l.value!==k[0].actionUrl&&fe(l,k[0].actionUrl)},d(k){k&&w(e),k&&w(s),k&&w(l),k&&w(r),k&&w(a),b=!1,Le(y)}}}function rE(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),fe(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&fe(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function aE(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Yt(o,r(n)),ie.push(()=>ve(e,"value",l))),{c(){e&&q(e.$$.fragment),i=Oe()},m(a,u){e&&H(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,we(()=>t=!1)),o!==(o=a[4])){if(e){de();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),pe()}o?(e=Yt(o,r(a)),ie.push(()=>ve(e,"value",l)),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function uE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C;const M=[aE,rE],T=[];function E(O,I){return O[4]&&!O[5]?0:1}return l=E(n),o=T[l]=M[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=D(),o.c(),r=D(),a=v("div"),u=U(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=U(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,h=U(`,
`),m=v("button"),m.textContent=`{TOKEN}
`,g=U(`,
`),b=v("button"),b.textContent=`{ACTION_URL}
`,y=U("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(m,"type","button"),p(m,"class","label label-sm link-primary txt-mono"),p(b,"type","button"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(O,I){S(O,e,I),_(e,t),S(O,s,I),T[l].m(O,I),S(O,r,I),S(O,a,I),_(a,u),_(a,f),_(a,c),_(a,d),_(a,h),_(a,m),_(a,g),_(a,b),_(a,y),k=!0,$||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(m,"click",n[24]),Y(b,"click",n[25])],$=!0)},p(O,I){(!k||I[1]&1&&i!==(i=O[31]))&&p(e,"for",i);let L=l;l=E(O),l===L?T[l].p(O,I):(de(),P(T[L],1,1,()=>{T[L]=null}),pe(),o=T[l],o?o.p(O,I):(o=T[l]=M[l](O),o.c()),A(o,1),o.m(r.parentNode,r))},i(O){k||(A(o),k=!0)},o(O){P(o),k=!1},d(O){O&&w(e),O&&w(s),T[l].d(O),O&&w(r),O&&w(a),$=!1,Le(C)}}}function fE(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[lE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[oE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[uE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(r,a){H(e,r,a),S(r,t,a),H(i,r,a),S(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function Dh(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Dh();return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),l=U(n[2]),o=D(),r=v("div"),a=D(),f&&f.c(),u=Oe(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),_(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&re(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Dh(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(de(),P(f,1,1,()=>{f=null}),pe())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function dE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[cE],default:[fE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Ge(s,i[l]);return e=new ks({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){const r=o[0]&256?nn(i,[Xn(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let Oh;function pE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Ot(e,s),o;Ke(n,Ci,z=>t(12,o=z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Oh,d=!1;function h(){f==null||f.expand()}function m(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-835015b3.js"),["./CodeEditor-835015b3.js","./index-0935db40.js"],import.meta.url)).default),Oh=c,t(5,d=!1))}function y(z){B.copyToClipboard(z),xg(`Copied ${z} to clipboard`,2e3)}b();function k(){u.subject=this.value,t(0,u)}const $=()=>y("{APP_NAME}"),C=()=>y("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),E=()=>y("{APP_URL}"),O=()=>y("{TOKEN}");function I(z){n.$$.not_equal(u.body,z)&&(u.body=z,t(0,u))}function L(){u.body=this.value,t(0,u)}const N=()=>y("{APP_NAME}"),F=()=>y("{APP_URL}"),V=()=>y("{TOKEN}"),G=()=>y("{ACTION_URL}");function se(z){ie[z?"unshift":"push"](()=>{f=z,t(3,f)})}function K(z){Be.call(this,n,z)}function te(z){Be.call(this,n,z)}function ne(z){Be.call(this,n,z)}return n.$$set=z=>{e=Ge(Ge({},e),Gn(z)),t(8,l=Ot(e,s)),"key"in z&&t(1,r=z.key),"title"in z&&t(2,a=z.title),"config"in z&&t(0,u=z.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!B.isEmpty(B.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Cs(r))},[u,r,a,f,c,d,i,y,l,h,m,g,o,k,$,C,M,T,E,O,I,L,N,F,V,G,se,K,te,ne]}class Or extends ke{constructor(e){super(),ye(this,e,pE,dE,be,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Eh(n,e,t){const i=n.slice();return i[22]=e[t],i}function Ah(n,e){let t,i,s,l,o,r=e[22].label+"",a,u,f,c,d;return{key:n,first:null,c(){t=v("div"),i=v("input"),l=D(),o=v("label"),a=U(r),f=D(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[21]+e[22].value),i.__value=e[22].value,i.value=i.__value,e[12][0].push(i),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),this.first=t},m(h,m){S(h,t,m),_(t,i),i.checked=i.__value===e[2],_(t,l),_(t,o),_(o,a),_(t,f),c||(d=Y(i,"change",e[11]),c=!0)},p(h,m){e=h,m&2097152&&s!==(s=e[21]+e[22].value)&&p(i,"id",s),m&4&&(i.checked=i.__value===e[2]),m&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&w(t),e[12][0].splice(e[12][0].indexOf(i),1),c=!1,d()}}}function hE(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[22].value;for(let o=0;o<s.length;o+=1){let r=Eh(n,s,o),a=l(r);t.set(a,e[o]=Ah(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Oe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r&2097284&&(s=o[7],e=gt(e,r,l,1,o,s,t,i.parentNode,Xi,Ah,i,Eh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function mE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("To email address"),s=D(),l=v("input"),p(e,"for",i=n[21]),p(l,"type","email"),p(l,"id",o=n[21]),l.autofocus=!0,l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[1]),l.focus(),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1]&&fe(l,u[1])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gE(n){let e,t,i,s,l,o,r;return t=new me({props:{class:"form-field required",name:"template",$$slots:{default:[hE,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[mE,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),q(t.$$.fragment),i=D(),q(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){S(a,e,u),H(t,e,null),_(e,i),H(s,e,null),l=!0,o||(r=Y(e,"submit",ct(n[14])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),j(t),j(s),o=!1,r()}}}function _E(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function bE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=D(),s=v("button"),l=v("i"),o=D(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],x(s,"btn-loading",n[4])},m(c,d){S(c,e,d),_(e,t),S(c,i,d),S(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"click",n[0]),Y(s,"click",n[10])],u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&x(s,"btn-loading",c[4])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function vE(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[15],popup:!0,$$slots:{footer:[bE],header:[_E],default:[gE]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[15]),l&33554486&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}const Er="last_email_test",Ih="email_test_request";function yE(n,e,t){let i;const s=Ct(),l="email_test_"+B.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Er),u=o[0].value,f=!1,c=null;function d(O="",I=""){t(1,a=O||localStorage.getItem(Er)),t(2,u=I||o[0].value),Vn({}),r==null||r.show()}function h(){return clearTimeout(c),r==null?void 0:r.hide()}async function m(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Er,a),clearTimeout(c),c=setTimeout(()=>{he.cancelRequest(Ih),cl("Test email send timeout.")},3e4);try{await he.settings.testEmail(a,u,{$cancelKey:Ih}),qt("Successfully sent test email."),s("submit"),t(4,f=!1),await In(),h()}catch(O){t(4,f=!1),he.errorResponseHandler(O)}clearTimeout(c)}}const g=[[]],b=()=>m();function y(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const $=()=>m(),C=()=>!f;function M(O){ie[O?"unshift":"push"](()=>{r=O,t(3,r)})}function T(O){Be.call(this,n,O)}function E(O){Be.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,m,d,b,y,g,k,$,C,M,T,E]}class kE extends ke{constructor(e){super(),ye(this,e,yE,vE,be,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function wE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E,O,I,L;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[$E,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[CE,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});function N(J){n[14](J)}let F={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(F.config=n[0].meta.verificationTemplate),u=new Or({props:F}),ie.push(()=>ve(u,"config",N));function V(J){n[15](J)}let G={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(G.config=n[0].meta.resetPasswordTemplate),d=new Or({props:G}),ie.push(()=>ve(d,"config",V));function se(J){n[16](J)}let K={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(K.config=n[0].meta.confirmEmailChangeTemplate),g=new Or({props:K}),ie.push(()=>ve(g,"config",se)),C=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[TE,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});let te=n[0].smtp.enabled&&Ph(n);function ne(J,ae){return J[4]?LE:PE}let z=ne(n),Q=z(n);return{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),c=D(),q(d.$$.fragment),m=D(),q(g.$$.fragment),y=D(),k=v("hr"),$=D(),q(C.$$.fragment),M=D(),te&&te.c(),T=D(),E=v("div"),O=v("div"),I=D(),Q.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(O,"class","flex-fill"),p(E,"class","flex")},m(J,ae){S(J,e,ae),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),S(J,r,ae),S(J,a,ae),H(u,a,null),_(a,c),H(d,a,null),_(a,m),H(g,a,null),S(J,y,ae),S(J,k,ae),S(J,$,ae),H(C,J,ae),S(J,M,ae),te&&te.m(J,ae),S(J,T,ae),S(J,E,ae),_(E,O),_(E,I),Q.m(E,null),L=!0},p(J,ae){const He={};ae[0]&1|ae[1]&3&&(He.$$scope={dirty:ae,ctx:J}),i.$set(He);const Fe={};ae[0]&1|ae[1]&3&&(Fe.$$scope={dirty:ae,ctx:J}),o.$set(Fe);const Ne={};!f&&ae[0]&1&&(f=!0,Ne.config=J[0].meta.verificationTemplate,we(()=>f=!1)),u.$set(Ne);const Re={};!h&&ae[0]&1&&(h=!0,Re.config=J[0].meta.resetPasswordTemplate,we(()=>h=!1)),d.$set(Re);const ge={};!b&&ae[0]&1&&(b=!0,ge.config=J[0].meta.confirmEmailChangeTemplate,we(()=>b=!1)),g.$set(ge);const Ce={};ae[0]&1|ae[1]&3&&(Ce.$$scope={dirty:ae,ctx:J}),C.$set(Ce),J[0].smtp.enabled?te?(te.p(J,ae),ae[0]&1&&A(te,1)):(te=Ph(J),te.c(),A(te,1),te.m(T.parentNode,T)):te&&(de(),P(te,1,1,()=>{te=null}),pe()),z===(z=ne(J))&&Q?Q.p(J,ae):(Q.d(1),Q=z(J),Q&&(Q.c(),Q.m(E,null)))},i(J){L||(A(i.$$.fragment,J),A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J),A(g.$$.fragment,J),A(C.$$.fragment,J),A(te),L=!0)},o(J){P(i.$$.fragment,J),P(o.$$.fragment,J),P(u.$$.fragment,J),P(d.$$.fragment,J),P(g.$$.fragment,J),P(C.$$.fragment,J),P(te),L=!1},d(J){J&&w(e),j(i),j(o),J&&w(r),J&&w(a),j(u),j(d),j(g),J&&w(y),J&&w(k),J&&w($),j(C,J),J&&w(M),te&&te.d(J),J&&w(T),J&&w(E),Q.d()}}}function SE(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function $E(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender name"),s=D(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderName),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&fe(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function CE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender address"),s=D(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","email"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&fe(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function TE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=D(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[31])},m(c,d){S(c,e,d),e.checked=n[0].smtp.enabled,S(c,i,d),S(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"change",n[17]),Ie(We.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&1&&t!==(t=c[31])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function Ph(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T;return i=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[ME,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[DE,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[OE,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[EE,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[AE,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),k=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[IE,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("div"),q(d.$$.fragment),h=D(),m=v("div"),q(g.$$.fragment),b=D(),y=v("div"),q(k.$$.fragment),$=D(),C=v("div"),p(t,"class","col-lg-4"),p(l,"class","col-lg-2"),p(a,"class","col-lg-3"),p(c,"class","col-lg-3"),p(m,"class","col-lg-6"),p(y,"class","col-lg-6"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(E,O){S(E,e,O),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),H(u,a,null),_(e,f),_(e,c),H(d,c,null),_(e,h),_(e,m),H(g,m,null),_(e,b),_(e,y),H(k,y,null),_(e,$),_(e,C),T=!0},p(E,O){const I={};O[0]&1|O[1]&3&&(I.$$scope={dirty:O,ctx:E}),i.$set(I);const L={};O[0]&1|O[1]&3&&(L.$$scope={dirty:O,ctx:E}),o.$set(L);const N={};O[0]&1|O[1]&3&&(N.$$scope={dirty:O,ctx:E}),u.$set(N);const F={};O[0]&1|O[1]&3&&(F.$$scope={dirty:O,ctx:E}),d.$set(F);const V={};O[0]&1|O[1]&3&&(V.$$scope={dirty:O,ctx:E}),g.$set(V);const G={};O[0]&1|O[1]&3&&(G.$$scope={dirty:O,ctx:E}),k.$set(G)},i(E){T||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(u.$$.fragment,E),A(d.$$.fragment,E),A(g.$$.fragment,E),A(k.$$.fragment,E),E&&tt(()=>{M||(M=qe(e,Et,{duration:150},!0)),M.run(1)}),T=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(d.$$.fragment,E),P(g.$$.fragment,E),P(k.$$.fragment,E),E&&(M||(M=qe(e,Et,{duration:150},!1)),M.run(0)),T=!1},d(E){E&&w(e),j(i),j(o),j(u),j(d),j(g),j(k),E&&M&&M.end()}}}function ME(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("SMTP server host"),s=D(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.host),r||(a=Y(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&fe(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Port"),s=D(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.port),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&dt(l.value)!==u[0].smtp.port&&fe(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function OE(n){let e,t,i,s,l,o,r;function a(f){n[20](f)}let u={id:n[31],items:n[6]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new Ns({props:u}),ie.push(()=>ve(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("TLS Encryption"),s=D(),q(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function EE(n){let e,t,i,s,l,o,r;function a(f){n[21](f)}let u={id:n[31],items:n[7]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new Ns({props:u}),ie.push(()=>ve(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("AUTH Method"),s=D(),q(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function AE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Username"),s=D(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.username),r||(a=Y(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&fe(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function IE(n){let e,t,i,s,l,o,r;function a(f){n[23](f)}let u={id:n[31]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new iu({props:u}),ie.push(()=>ve(l,"value",a)),{c(){e=v("label"),t=U("Password"),s=D(),q(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function PE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function LE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),_(e,t),S(u,i,f),S(u,s,f),_(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Le(a)}}}function NE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b;const y=[SE,wE],k=[];function $(C,M){return C[2]?0:1}return d=$(n),h=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[5]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(C,r,M),S(C,a,M),_(a,u),_(u,f),_(u,c),k[d].m(u,null),m=!0,g||(b=Y(u,"submit",ct(n[27])),g=!0)},p(C,M){(!m||M[0]&32)&&re(o,C[5]);let T=d;d=$(C),d===T?k[d].p(C,M):(de(),P(k[T],1,1,()=>{k[T]=null}),pe(),h=k[d],h?h.p(C,M):(h=k[d]=y[d](C),h.c()),A(h,1),h.m(u,null))},i(C){m||(A(h),m=!0)},o(C){P(h),m=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,b()}}}function FE(n){let e,t,i,s,l,o;e=new Di({}),i=new vn({props:{$$slots:{default:[NE]},$$scope:{ctx:n}}});let r={};return l=new kE({props:r}),n[28](l),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),S(a,t,u),H(i,a,u),S(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function RE(n,e,t){let i,s,l;Ke(n,kt,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Wt(kt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;h();async function h(){t(2,c=!0);try{const ne=await he.settings.getAll()||{};g(ne)}catch(ne){he.errorResponseHandler(ne)}t(2,c=!1)}async function m(){if(!(d||!s)){t(3,d=!0);try{const ne=await he.settings.update(B.filterRedactedProps(f));g(ne),Vn({}),qt("Successfully saved mail settings.")}catch(ne){he.errorResponseHandler(ne)}t(3,d=!1)}}function g(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function k(){f.meta.senderAddress=this.value,t(0,f)}function $(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function C(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function T(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function O(){f.smtp.port=dt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const V=()=>b(),G=()=>m(),se=()=>a==null?void 0:a.show(),K=()=>m();function te(ne){ie[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,m,b,u,i,y,k,$,C,M,T,E,O,I,L,N,F,V,G,se,K,te]}class HE extends ke{constructor(e){super(),ye(this,e,RE,FE,be,{},null,[-1,-1])}}function jE(n){var C,M;let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[VE,({uniqueId:T})=>({25:T}),({uniqueId:T})=>T?33554432:0]},$$scope:{ctx:n}}});let b=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&Lh(n),y=n[1].s3.enabled&&Nh(n),k=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&Fh(n),$=n[6]&&Rh(n);return{c(){q(e.$$.fragment),t=D(),b&&b.c(),i=D(),y&&y.c(),s=D(),l=v("div"),o=v("div"),r=D(),k&&k.c(),a=D(),$&&$.c(),u=D(),f=v("button"),c=v("span"),c.textContent="Save changes",p(o,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],x(f,"btn-loading",n[3]),p(l,"class","flex")},m(T,E){H(e,T,E),S(T,t,E),b&&b.m(T,E),S(T,i,E),y&&y.m(T,E),S(T,s,E),S(T,l,E),_(l,o),_(l,r),k&&k.m(l,null),_(l,a),$&&$.m(l,null),_(l,u),_(l,f),_(f,c),h=!0,m||(g=Y(f,"click",n[19]),m=!0)},p(T,E){var I,L;const O={};E&100663298&&(O.$$scope={dirty:E,ctx:T}),e.$set(O),((I=T[0].s3)==null?void 0:I.enabled)!=T[1].s3.enabled?b?(b.p(T,E),E&3&&A(b,1)):(b=Lh(T),b.c(),A(b,1),b.m(i.parentNode,i)):b&&(de(),P(b,1,1,()=>{b=null}),pe()),T[1].s3.enabled?y?(y.p(T,E),E&2&&A(y,1)):(y=Nh(T),y.c(),A(y,1),y.m(s.parentNode,s)):y&&(de(),P(y,1,1,()=>{y=null}),pe()),(L=T[1].s3)!=null&&L.enabled&&!T[6]&&!T[3]?k?k.p(T,E):(k=Fh(T),k.c(),k.m(l,a)):k&&(k.d(1),k=null),T[6]?$?$.p(T,E):($=Rh(T),$.c(),$.m(l,u)):$&&($.d(1),$=null),(!h||E&72&&d!==(d=!T[6]||T[3]))&&(f.disabled=d),(!h||E&8)&&x(f,"btn-loading",T[3])},i(T){h||(A(e.$$.fragment,T),A(b),A(y),h=!0)},o(T){P(e.$$.fragment,T),P(b),P(y),h=!1},d(T){j(e,T),T&&w(t),b&&b.d(T),T&&w(i),y&&y.d(T),T&&w(s),T&&w(l),k&&k.d(),$&&$.d(),m=!1,g()}}}function qE(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function VE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[25]),e.required=!0,p(s,"for",o=n[25])},m(u,f){S(u,e,f),e.checked=n[1].s3.enabled,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Lh(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,m,g,b,y,k,$,C,M,T,E,O;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=D(),l=v("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually from
the
`),r=v("strong"),u=U(a),f=U(`
to the
`),c=v("strong"),h=U(d),m=U(`.
`),g=v("br"),b=U(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,k=U(`,
`),$=v("a"),$.textContent=`s5cmd
`,C=U(", etc."),M=D(),T=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(T,"class","clearfix m-t-base")},m(L,N){S(L,e,N),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(l,r),_(r,u),_(l,f),_(l,c),_(c,h),_(l,m),_(l,g),_(l,b),_(l,y),_(l,k),_(l,$),_(l,C),_(e,M),_(e,T),O=!0},p(L,N){var F;(!O||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&re(u,a),(!O||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&re(h,d)},i(L){O||(L&&tt(()=>{E||(E=qe(e,Et,{duration:150},!0)),E.run(1)}),O=!0)},o(L){L&&(E||(E=qe(e,Et,{duration:150},!1)),E.run(0)),O=!1},d(L){L&&w(e),L&&E&&E.end()}}}function Nh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T;return i=new me({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[zE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[BE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"s3.region",$$slots:{default:[UE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[WE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[YE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),k=new me({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[KE,({uniqueId:E})=>({25:E}),({uniqueId:E})=>E?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),q(i.$$.fragment),s=D(),l=v("div"),q(o.$$.fragment),r=D(),a=v("div"),q(u.$$.fragment),f=D(),c=v("div"),q(d.$$.fragment),h=D(),m=v("div"),q(g.$$.fragment),b=D(),y=v("div"),q(k.$$.fragment),$=D(),C=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(m,"class","col-lg-6"),p(y,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(E,O){S(E,e,O),_(e,t),H(i,t,null),_(e,s),_(e,l),H(o,l,null),_(e,r),_(e,a),H(u,a,null),_(e,f),_(e,c),H(d,c,null),_(e,h),_(e,m),H(g,m,null),_(e,b),_(e,y),H(k,y,null),_(e,$),_(e,C),T=!0},p(E,O){const I={};O&100663298&&(I.$$scope={dirty:O,ctx:E}),i.$set(I);const L={};O&100663298&&(L.$$scope={dirty:O,ctx:E}),o.$set(L);const N={};O&100663298&&(N.$$scope={dirty:O,ctx:E}),u.$set(N);const F={};O&100663298&&(F.$$scope={dirty:O,ctx:E}),d.$set(F);const V={};O&100663298&&(V.$$scope={dirty:O,ctx:E}),g.$set(V);const G={};O&100663298&&(G.$$scope={dirty:O,ctx:E}),k.$set(G)},i(E){T||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(u.$$.fragment,E),A(d.$$.fragment,E),A(g.$$.fragment,E),A(k.$$.fragment,E),E&&tt(()=>{M||(M=qe(e,Et,{duration:150},!0)),M.run(1)}),T=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(d.$$.fragment,E),P(g.$$.fragment,E),P(k.$$.fragment,E),E&&(M||(M=qe(e,Et,{duration:150},!1)),M.run(0)),T=!1},d(E){E&&w(e),j(i),j(o),j(u),j(d),j(g),j(k),E&&M&&M.end()}}}function zE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Endpoint"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&fe(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function BE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Bucket"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&fe(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function UE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Region"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.region),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.region&&fe(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function WE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Access key"),s=D(),l=v("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.accessKey),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&fe(l,u[1].s3.accessKey)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function YE(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[25],required:!0};return n[1].s3.secret!==void 0&&(u.value=n[1].s3.secret),l=new iu({props:u}),ie.push(()=>ve(l,"value",a)),{c(){e=v("label"),t=U("Secret"),s=D(),q(l.$$.fragment),p(e,"for",i=n[25])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&33554432&&i!==(i=f[25]))&&p(e,"for",i);const d={};c&33554432&&(d.id=f[25]),!o&&c&2&&(o=!0,d.value=f[1].s3.secret,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function KE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=D(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[25])},m(c,d){S(c,e,d),e.checked=n[1].s3.forcePathStyle,S(c,i,d),S(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"change",n[17]),Ie(We.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&2&&(e.checked=c[1].s3.forcePathStyle),d&33554432&&a!==(a=c[25])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Le(f)}}}function Fh(n){let e;function t(l,o){return l[4]?GE:l[5]?ZE:JE}let i=t(n),s=i(n);return{c(){s.c(),e=Oe()},m(l,o){s.m(l,o),S(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){s.d(l),l&&w(e)}}}function JE(n){let e;return{c(){e=v("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ZE(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=We.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Zt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function GE(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Rh(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),_(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function XE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b;const y=[qE,jE],k=[];function $(C,M){return C[2]?0:1}return d=$(n),h=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[7]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(C,r,M),S(C,a,M),_(a,u),_(u,f),_(u,c),k[d].m(u,null),m=!0,g||(b=Y(u,"submit",ct(n[20])),g=!0)},p(C,M){(!m||M&128)&&re(o,C[7]);let T=d;d=$(C),d===T?k[d].p(C,M):(de(),P(k[T],1,1,()=>{k[T]=null}),pe(),h=k[d],h?h.p(C,M):(h=k[d]=y[d](C),h.c()),A(h,1),h.m(u,null))},i(C){m||(A(h),m=!0)},o(C){P(h),m=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,b()}}}function QE(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[XE]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function xE(n,e,t){let i,s,l;Ke(n,kt,F=>t(7,l=F)),Wt(kt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;h();async function h(){t(2,a=!0);try{const F=await he.settings.getAll()||{};g(F)}catch(F){he.errorResponseHandler(F)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(lo);const F=await he.settings.update(B.filterRedactedProps(r));Vn({}),await g(F),Ca(),c?nv("Successfully saved but failed to establish S3 connection."):qt("Successfully saved files storage settings.")}catch(F){he.errorResponseHandler(F)}t(3,u=!1)}}async function g(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await y()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await y()}async function y(){if(t(5,c=null),!!r.s3.enabled){he.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{he.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await he.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}un(()=>()=>{clearTimeout(d)});function k(){r.s3.enabled=this.checked,t(1,r)}function $(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function T(){r.s3.accessKey=this.value,t(1,r)}function E(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function O(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>b(),L=()=>m(),N=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,m,b,i,k,$,C,M,T,E,O,I,L,N]}class eA extends ke{constructor(e){super(),ye(this,e,xE,QE,be,{})}}function tA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[12]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Hh(n){let e,t,i,s,l,o,r,a,u,f,c;l=new me({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[nA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[iA,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let d=n[4]&&jh(n);return{c(){e=v("div"),t=v("div"),i=D(),s=v("div"),q(l.$$.fragment),o=D(),r=v("div"),q(a.$$.fragment),u=D(),d&&d.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(e,"class","grid")},m(h,m){S(h,e,m),_(e,t),_(e,i),_(e,s),H(l,s,null),_(e,o),_(e,r),H(a,r,null),_(e,u),d&&d.m(e,null),c=!0},p(h,m){const g={};m&2&&(g.name=h[1]+".clientId"),m&3145729&&(g.$$scope={dirty:m,ctx:h}),l.$set(g);const b={};m&2&&(b.name=h[1]+".clientSecret"),m&3145729&&(b.$$scope={dirty:m,ctx:h}),a.$set(b),h[4]?d?(d.p(h,m),m&16&&A(d,1)):(d=jh(h),d.c(),A(d,1),d.m(e,null)):d&&(de(),P(d,1,1,()=>{d=null}),pe())},i(h){c||(A(l.$$.fragment,h),A(a.$$.fragment,h),A(d),h&&tt(()=>{f||(f=qe(e,Et,{duration:200},!0)),f.run(1)}),c=!0)},o(h){P(l.$$.fragment,h),P(a.$$.fragment,h),P(d),h&&(f||(f=qe(e,Et,{duration:200},!1)),f.run(0)),c=!1},d(h){h&&w(e),j(l),j(a),d&&d.d(),h&&f&&f.end()}}}function nA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Client ID"),s=D(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].clientId),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].clientId&&fe(l,u[0].clientId)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iA(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[20],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new iu({props:u}),ie.push(()=>ve(l,"value",a)),{c(){e=v("label"),t=U("Client Secret"),s=D(),q(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,we(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function jh(n){let e,t,i,s;function l(a){n[15](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=Yt(o,r(n)),ie.push(()=>ve(t,"config",l))),{c(){e=v("div"),t&&q(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&H(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],we(()=>i=!1)),o!==(o=a[4])){if(t){de();const c=t;P(c.$$.fragment,1,0,()=>{j(c,1)}),pe()}o?(t=Yt(o,r(a)),ie.push(()=>ve(t,"config",l)),q(t.$$.fragment),A(t.$$.fragment,1),H(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}function sA(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[tA,({uniqueId:o})=>({20:o}),({uniqueId:o})=>o?1048576:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Hh(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=Oe()},m(o,r){H(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&2&&(a.name=o[1]+".enabled"),r&3145729&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Hh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(de(),P(l,1,1,()=>{l=null}),pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function qh(n){let e;return{c(){e=v("i"),p(e,"class",n[3])},m(t,i){S(t,e,i)},p(t,i){i&8&&p(e,"class",t[3])},d(t){t&&w(e)}}}function lA(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function oA(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Vh(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(We.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{t||(t=qe(e,At,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,At,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function rA(n){let e,t,i,s,l,o,r,a,u,f=n[3]&&qh(n);function c(g,b){return g[0].enabled?oA:lA}let d=c(n),h=d(n),m=n[6]&&Vh();return{c(){e=v("div"),f&&f.c(),t=D(),i=v("span"),s=U(n[2]),l=D(),h.c(),o=D(),r=v("div"),a=D(),m&&m.c(),u=Oe(),p(i,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(g,b){S(g,e,b),f&&f.m(e,null),_(e,t),_(e,i),_(i,s),S(g,l,b),h.m(g,b),S(g,o,b),S(g,r,b),S(g,a,b),m&&m.m(g,b),S(g,u,b)},p(g,b){g[3]?f?f.p(g,b):(f=qh(g),f.c(),f.m(e,t)):f&&(f.d(1),f=null),b&4&&re(s,g[2]),d!==(d=c(g))&&(h.d(1),h=d(g),h&&(h.c(),h.m(o.parentNode,o))),g[6]?m?b&64&&A(m,1):(m=Vh(),m.c(),A(m,1),m.m(u.parentNode,u)):m&&(de(),P(m,1,1,()=>{m=null}),pe())},d(g){g&&w(e),f&&f.d(),g&&w(l),h.d(g),g&&w(o),g&&w(r),g&&w(a),m&&m.d(g),g&&w(u)}}}function aA(n){let e,t;const i=[n[7]];let s={$$slots:{header:[rA],default:[sA]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Ge(s,i[l]);return e=new ks({props:s}),n[16](e),e.$on("expand",n[17]),e.$on("collapse",n[18]),e.$on("toggle",n[19]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&128?nn(i,[Xn(l[7])]):{};o&2097247&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[16](null),j(e,l)}}}function uA(n,e,t){let i;const s=["key","title","icon","config","optionsComponent","expand","collapse","collapseSiblings"];let l=Ot(e,s),o;Ke(n,Ci,O=>t(11,o=O));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{optionsComponent:c}=e,d;function h(){d==null||d.expand()}function m(){d==null||d.collapse()}function g(){d==null||d.collapseSiblings()}function b(){f.enabled=this.checked,t(0,f)}function y(){f.clientId=this.value,t(0,f)}function k(O){n.$$.not_equal(f.clientSecret,O)&&(f.clientSecret=O,t(0,f))}function $(O){f=O,t(0,f)}function C(O){ie[O?"unshift":"push"](()=>{d=O,t(5,d)})}function M(O){Be.call(this,n,O)}function T(O){Be.call(this,n,O)}function E(O){Be.call(this,n,O)}return n.$$set=O=>{e=Ge(Ge({},e),Gn(O)),t(7,l=Ot(e,s)),"key"in O&&t(1,r=O.key),"title"in O&&t(2,a=O.title),"icon"in O&&t(3,u=O.icon),"config"in O&&t(0,f=O.config),"optionsComponent"in O&&t(4,c=O.optionsComponent)},n.$$.update=()=>{n.$$.dirty&2050&&t(6,i=!B.isEmpty(B.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||Cs(r))},[f,r,a,u,c,d,i,l,h,m,g,o,b,y,k,$,C,M,T,E]}class fA extends ke{constructor(e){super(),ye(this,e,uA,aA,be,{key:1,title:2,icon:3,config:0,optionsComponent:4,expand:8,collapse:9,collapseSiblings:10})}get expand(){return this.$$.ctx[8]}get collapse(){return this.$$.ctx[9]}get collapseSiblings(){return this.$$.ctx[10]}}function zh(n,e,t){const i=n.slice();return i[16]=e[t][0],i[17]=e[t][1],i[18]=e,i[19]=t,i}function cA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=Object.entries(vl),m=[];for(let y=0;y<h.length;y+=1)m[y]=Bh(zh(n,h,y));const g=y=>P(m[y],1,1,()=>{m[y]=null});let b=n[4]&&Uh(n);return{c(){e=v("div");for(let y=0;y<m.length;y+=1)m[y].c();t=D(),i=v("div"),s=v("div"),l=D(),b&&b.c(),o=D(),r=v("button"),a=v("span"),a.textContent="Save changes",p(e,"class","accordions"),p(s,"class","flex-fill"),p(a,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-expanded"),r.disabled=u=!n[4]||n[3],x(r,"btn-loading",n[3]),p(i,"class","flex m-t-base")},m(y,k){S(y,e,k);for(let $=0;$<m.length;$+=1)m[$].m(e,null);S(y,t,k),S(y,i,k),_(i,s),_(i,l),b&&b.m(i,null),_(i,o),_(i,r),_(r,a),f=!0,c||(d=Y(r,"click",n[13]),c=!0)},p(y,k){if(k&3){h=Object.entries(vl);let $;for($=0;$<h.length;$+=1){const C=zh(y,h,$);m[$]?(m[$].p(C,k),A(m[$],1)):(m[$]=Bh(C),m[$].c(),A(m[$],1),m[$].m(e,null))}for(de(),$=h.length;$<m.length;$+=1)g($);pe()}y[4]?b?b.p(y,k):(b=Uh(y),b.c(),b.m(i,o)):b&&(b.d(1),b=null),(!f||k&24&&u!==(u=!y[4]||y[3]))&&(r.disabled=u),(!f||k&8)&&x(r,"btn-loading",y[3])},i(y){if(!f){for(let k=0;k<h.length;k+=1)A(m[k]);f=!0}},o(y){m=m.filter(Boolean);for(let k=0;k<m.length;k+=1)P(m[k]);f=!1},d(y){y&&w(e),yt(m,y),y&&w(t),y&&w(i),b&&b.d(),c=!1,d()}}}function dA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Bh(n){let e,t=n[16],i,s;const l=()=>n[10](e,t),o=()=>n[10](null,t);function r(u){n[11](u,n[16])}let a={single:!0,key:n[16],title:n[17].title,icon:n[17].icon||"ri-fingerprint-line",optionsComponent:n[17].optionsComponent};return n[0][n[16]]!==void 0&&(a.config=n[0][n[16]]),e=new fA({props:a}),l(),ie.push(()=>ve(e,"config",r)),{c(){q(e.$$.fragment)},m(u,f){H(e,u,f),s=!0},p(u,f){n=u,t!==n[16]&&(o(),t=n[16],l());const c={};!i&&f&1&&(i=!0,c.config=n[0][n[16]],we(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){o(),j(e,u)}}}function Uh(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),_(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function pA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b;const y=[dA,cA],k=[];function $(C,M){return C[2]?0:1}return d=$(n),h=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[5]),r=D(),a=v("div"),u=v("form"),f=v("h6"),f.textContent="Manage the allowed users sign-in/sign-up methods.",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(C,r,M),S(C,a,M),_(a,u),_(u,f),_(u,c),k[d].m(u,null),m=!0,g||(b=Y(u,"submit",ct(n[6])),g=!0)},p(C,M){(!m||M&32)&&re(o,C[5]);let T=d;d=$(C),d===T?k[d].p(C,M):(de(),P(k[T],1,1,()=>{k[T]=null}),pe(),h=k[d],h?h.p(C,M):(h=k[d]=y[d](C),h.c()),A(h,1),h.m(u,null))},i(C){m||(A(h),m=!0)},o(C){P(h),m=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,b()}}}function hA(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[pA]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048639&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function mA(n,e,t){let i,s,l;Ke(n,kt,$=>t(5,l=$)),Wt(kt,l="Auth providers",l);let o={},r={},a={},u=!1,f=!1;c();async function c(){t(2,u=!0);try{const $=await he.settings.getAll()||{};h($)}catch($){he.errorResponseHandler($)}t(2,u=!1)}async function d(){var $;if(!(f||!s)){t(3,f=!0);try{const C=await he.settings.update(B.filterRedactedProps(a));h(C),Vn({}),($=o[Object.keys(o)[0]])==null||$.collapseSiblings(),qt("Successfully updated auth providers.")}catch(C){he.errorResponseHandler(C)}t(3,f=!1)}}function h($){$=$||{},t(0,a={});for(const C in vl)t(0,a[C]=Object.assign({enabled:!1},$[C]),a);t(8,r=JSON.parse(JSON.stringify(a)))}function m(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g($,C){ie[$?"unshift":"push"](()=>{o[C]=$,t(1,o)})}function b($,C){n.$$.not_equal(a[C],$)&&(a[C]=$,t(0,a))}const y=()=>m(),k=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(4,s=i!=JSON.stringify(a))},[a,o,u,f,s,l,d,m,r,i,g,b,y,k]}class gA extends ke{constructor(e){super(),ye(this,e,mA,hA,be,{})}}function Wh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function _A(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,h,m=n[5];const g=y=>y[16].key;for(let y=0;y<m.length;y+=1){let k=Wh(n,m,y),$=g(k);t.set($,e[y]=Yh($,k))}let b=n[3]&&Kh(n);return{c(){for(let y=0;y<e.length;y+=1)e[y].c();i=D(),s=v("div"),l=v("div"),o=D(),b&&b.c(),r=D(),a=v("button"),u=v("span"),u.textContent="Save changes",p(l,"class","flex-fill"),p(u,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-expanded"),a.disabled=f=!n[3]||n[2],x(a,"btn-loading",n[2]),p(s,"class","flex")},m(y,k){for(let $=0;$<e.length;$+=1)e[$].m(y,k);S(y,i,k),S(y,s,k),_(s,l),_(s,o),b&&b.m(s,null),_(s,r),_(s,a),_(a,u),c=!0,d||(h=Y(a,"click",n[13]),d=!0)},p(y,k){k&524321&&(m=y[5],de(),e=gt(e,k,g,1,y,m,t,i.parentNode,Kt,Yh,i,Wh),pe()),y[3]?b?b.p(y,k):(b=Kh(y),b.c(),b.m(s,r)):b&&(b.d(1),b=null),(!c||k&12&&f!==(f=!y[3]||y[2]))&&(a.disabled=f),(!c||k&4)&&x(a,"btn-loading",y[2])},i(y){if(!c){for(let k=0;k<m.length;k+=1)A(e[k]);c=!0}},o(y){for(let k=0;k<e.length;k+=1)P(e[k]);c=!1},d(y){for(let k=0;k<e.length;k+=1)e[k].d(y);y&&w(i),y&&w(s),b&&b.d(),d=!1,h()}}}function bA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function vA(n){let e,t=n[16].label+"",i,s,l,o,r,a,u,f,c,d,h;function m(){n[10].call(r,n[16])}function g(){return n[11](n[16])}return{c(){e=v("label"),i=U(t),s=U(" duration (in seconds)"),o=D(),r=v("input"),u=D(),f=v("div"),c=v("span"),c.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[19]),p(r,"type","number"),p(r,"id",a=n[19]),r.required=!0,p(c,"class","link-primary"),x(c,"txt-success",n[0][n[16].key].secret),p(f,"class","help-block")},m(b,y){S(b,e,y),_(e,i),_(e,s),S(b,o,y),S(b,r,y),fe(r,n[0][n[16].key].duration),S(b,u,y),S(b,f,y),_(f,c),d||(h=[Y(r,"input",m),Y(c,"click",g)],d=!0)},p(b,y){n=b,y&524288&&l!==(l=n[19])&&p(e,"for",l),y&524288&&a!==(a=n[19])&&p(r,"id",a),y&33&&dt(r.value)!==n[0][n[16].key].duration&&fe(r,n[0][n[16].key].duration),y&33&&x(c,"txt-success",n[0][n[16].key].secret)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(u),b&&w(f),d=!1,Le(h)}}}function Yh(n,e){let t,i,s;return i=new me({props:{class:"form-field required",name:e[16].key+".duration",$$slots:{default:[vA,({uniqueId:l})=>({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Oe(),q(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&1572865&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function Kh(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),_(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function yA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b;const y=[bA,_A],k=[];function $(C,M){return C[1]?0:1}return d=$(n),h=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[4]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Adjust common token options.</p>",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(C,r,M),S(C,a,M),_(a,u),_(u,f),_(u,c),k[d].m(u,null),m=!0,g||(b=Y(u,"submit",ct(n[6])),g=!0)},p(C,M){(!m||M&16)&&re(o,C[4]);let T=d;d=$(C),d===T?k[d].p(C,M):(de(),P(k[T],1,1,()=>{k[T]=null}),pe(),h=k[d],h?h.p(C,M):(h=k[d]=y[d](C),h.c()),A(h,1),h.m(u,null))},i(C){m||(A(h),m=!0)},o(C){P(h),m=!1},d(C){C&&w(e),C&&w(r),C&&w(a),k[d].d(),g=!1,b()}}}function kA(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[yA]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function wA(n,e,t){let i,s,l;Ke(n,kt,$=>t(4,l=$));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];Wt(kt,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const $=await he.settings.getAll()||{};h($)}catch($){he.errorResponseHandler($)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const $=await he.settings.update(B.filterRedactedProps(a));h($),qt("Successfully saved tokens options.")}catch($){he.errorResponseHandler($)}t(2,f=!1)}}function h($){var C;$=$||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:((C=$[M.key])==null?void 0:C.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function m(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g($){a[$.key].duration=dt(this.value),t(0,a)}const b=$=>{a[$.key].secret?(delete a[$.key].secret,t(0,a)):t(0,a[$.key].secret=B.randomString(50),a)},y=()=>m(),k=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,m,r,i,g,b,y,k]}class SA extends ke{constructor(e){super(),ye(this,e,wA,kA,be,{})}}function $A(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m;return o=new eb({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=D(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),q(o.$$.fragment),r=D(),a=v("div"),u=v("div"),f=D(),c=v("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(g,b){S(g,e,b),S(g,t,b),S(g,i,b),_(i,s),_(i,l),H(o,i,null),n[8](i),S(g,r,b),S(g,a,b),_(a,u),_(a,f),_(a,c),d=!0,h||(m=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],h=!0)},p(g,b){const y={};b&4&&(y.content=g[2]),o.$set(y)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){P(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),j(o),n[8](null),g&&w(r),g&&w(a),h=!1,Le(m)}}}function CA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function TA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[CA,$A],m=[];function g(b,y){return b[1]?0:1}return f=g(n),c=m[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[3]),r=D(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){S(b,e,y),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(b,r,y),S(b,a,y),_(a,u),m[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&re(o,b[3]);let k=f;f=g(b),f===k?m[f].p(b,y):(de(),P(m[k],1,1,()=>{m[k]=null}),pe(),c=m[f],c?c.p(b,y):(c=m[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&w(e),b&&w(r),b&&w(a),m[f].d()}}}function MA(n){let e,t,i,s;return e=new Di({}),i=new vn({props:{$$slots:{default:[TA]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),S(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function DA(n,e,t){let i,s;Ke(n,kt,b=>t(3,s=b)),Wt(kt,s="Export collections",s);const l="export_"+B.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await he.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){he.errorResponseHandler(b)}t(1,a=!1)}function f(){B.downloadJson(r,"pb_schema")}function c(){B.copyToClipboard(i),xg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){ie[b?"unshift":"push"](()=>{o=b,t(0,o)})}const m=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),k=document.createRange();k.selectNodeContents(o),y.removeAllRanges(),y.addRange(k)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,m,g]}class OA extends ke{constructor(e){super(),ye(this,e,DA,MA,be,{})}}function Jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Gh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Qh(n,e,t){const i=n.slice();return i[14]=e[t],i}function xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function em(n,e,t){const i=n.slice();return i[30]=e[t],i}function EA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&tm(),a=n[0].name!==n[1].name&&nm(n);return{c(){e=v("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),_(e,t),a&&a.m(e,null),_(e,i),_(e,s),_(s,o)},p(u,f){u[9]?r||(r=tm(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=nm(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&re(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function AA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=D(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),_(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&re(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function IA(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=D(),i=v("strong"),l=U(s),p(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),_(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&re(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function tm(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function nm(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=D(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),_(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&re(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function im(n){var b,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+"",f,c,d,h,m=n[12]((y=n[1])==null?void 0:y[n[30]])+"",g;return{c(){var k,$,C,M,T,E;e=v("tr"),t=v("td"),i=v("span"),l=U(s),o=D(),r=v("td"),a=v("pre"),f=U(u),c=D(),d=v("td"),h=v("pre"),g=U(m),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),x(r,"changed-old-col",!n[10]&&on((k=n[0])==null?void 0:k[n[30]],($=n[1])==null?void 0:$[n[30]])),x(r,"changed-none-col",n[10]),p(h,"class","txt"),p(d,"class","svelte-lmkr38"),x(d,"changed-new-col",!n[5]&&on((C=n[0])==null?void 0:C[n[30]],(M=n[1])==null?void 0:M[n[30]])),x(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",on((T=n[0])==null?void 0:T[n[30]],(E=n[1])==null?void 0:E[n[30]]))},m(k,$){S(k,e,$),_(e,t),_(t,i),_(i,l),_(e,o),_(e,r),_(r,a),_(a,f),_(e,c),_(e,d),_(d,h),_(h,g)},p(k,$){var C,M,T,E,O,I,L,N;$[0]&1&&u!==(u=k[12]((C=k[0])==null?void 0:C[k[30]])+"")&&re(f,u),$[0]&3075&&x(r,"changed-old-col",!k[10]&&on((M=k[0])==null?void 0:M[k[30]],(T=k[1])==null?void 0:T[k[30]])),$[0]&1024&&x(r,"changed-none-col",k[10]),$[0]&2&&m!==(m=k[12]((E=k[1])==null?void 0:E[k[30]])+"")&&re(g,m),$[0]&2083&&x(d,"changed-new-col",!k[5]&&on((O=k[0])==null?void 0:O[k[30]],(I=k[1])==null?void 0:I[k[30]])),$[0]&32&&x(d,"changed-none-col",k[5]),$[0]&2051&&x(e,"txt-primary",on((L=k[0])==null?void 0:L[k[30]],(N=k[1])==null?void 0:N[k[30]]))},d(k){k&&w(e)}}}function sm(n){let e,t=n[6],i=[];for(let s=0;s<t.length;s+=1)i[s]=om(Qh(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Oe()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&4160){t=s[6];let o;for(o=0;o<t.length;o+=1){const r=Qh(s,t,o);i[o]?i[o].p(r,l):(i[o]=om(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){yt(i,s),s&&w(e)}}}function lm(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=v("tr"),t=v("td"),s=U(i),l=D(),o=v("td"),r=v("pre"),u=U(a),f=D(),c=v("td"),d=D(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","changed-old-col svelte-lmkr38"),p(c,"class","changed-none-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(h,m){S(h,e,m),_(e,t),_(t,s),_(e,l),_(e,o),_(o,r),_(r,u),_(e,f),_(e,c),_(e,d)},p(h,m){m[0]&64&&i!==(i=h[17]+"")&&re(s,i),m[0]&64&&a!==(a=h[12](h[18])+"")&&re(u,a)},d(h){h&&w(e)}}}function om(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c,d,h=n[14].name+"",m,g,b,y,k=Object.entries(n[14]),$=[];for(let C=0;C<k.length;C+=1)$[C]=lm(xh(n,k,C));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=U("field: "),o=U(l),r=D(),a=v("span"),u=U("Deleted - "),f=v("small"),c=U("All stored data related to "),d=v("strong"),m=U(h),g=U(" will be deleted!"),b=D();for(let C=0;C<$.length;C+=1)$[C].c();y=Oe(),p(i,"class","txt"),p(a,"class","label label-danger m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(C,M){S(C,e,M),_(e,t),_(t,i),_(i,s),_(i,o),_(t,r),_(t,a),_(a,u),_(a,f),_(f,c),_(f,d),_(d,m),_(f,g),S(C,b,M);for(let T=0;T<$.length;T+=1)$[T].m(C,M);S(C,y,M)},p(C,M){if(M[0]&64&&l!==(l=C[14].name+"")&&re(o,l),M[0]&64&&h!==(h=C[14].name+"")&&re(m,h),M[0]&4160){k=Object.entries(C[14]);let T;for(T=0;T<k.length;T+=1){const E=xh(C,k,T);$[T]?$[T].p(E,M):($[T]=lm(E),$[T].c(),$[T].m(y.parentNode,y))}for(;T<$.length;T+=1)$[T].d(1);$.length=k.length}},d(C){C&&w(e),C&&w(b),yt($,C),C&&w(y)}}}function rm(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning m-l-5 svelte-lmkr38")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function am(n){var g;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((g=$n(n[3],n[14].id))==null?void 0:g[n[17]])+"",u,f,c,d,h=n[12](n[23])+"",m;return{c(){var b,y,k;e=v("tr"),t=v("td"),s=U(i),l=D(),o=v("td"),r=v("pre"),u=U(a),f=D(),c=v("td"),d=v("pre"),m=U(h),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","svelte-lmkr38"),x(o,"changed-old-col",on((b=$n(n[3],n[14].id))==null?void 0:b[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-lmkr38"),x(c,"changed-new-col",on((y=$n(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",on((k=$n(n[3],n[14].id))==null?void 0:k[n[17]],n[23]))},m(b,y){S(b,e,y),_(e,t),_(t,s),_(e,l),_(e,o),_(o,r),_(r,u),_(e,f),_(e,c),_(c,d),_(d,m)},p(b,y){var k,$,C,M;y[0]&128&&i!==(i=b[17]+"")&&re(s,i),y[0]&136&&a!==(a=b[12]((k=$n(b[3],b[14].id))==null?void 0:k[b[17]])+"")&&re(u,a),y[0]&136&&x(o,"changed-old-col",on(($=$n(b[3],b[14].id))==null?void 0:$[b[17]],b[23])),y[0]&128&&h!==(h=b[12](b[23])+"")&&re(m,h),y[0]&136&&x(c,"changed-new-col",on((C=$n(b[3],b[14].id))==null?void 0:C[b[17]],b[23])),y[0]&136&&x(e,"txt-primary",on((M=$n(b[3],b[14].id))==null?void 0:M[b[17]],b[23]))},d(b){b&&w(e)}}}function um(n){let e,t,i,s,l=n[14].name+"",o,r,a=on($n(n[3],n[14].id),$n(n[4],n[14].id)),u,f,c=a&&rm(),d=Object.entries(n[14]),h=[];for(let m=0;m<d.length;m+=1)h[m]=am(Xh(n,d,m));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=U("field: "),o=U(l),r=D(),c&&c.c(),u=D();for(let m=0;m<h.length;m+=1)h[m].c();f=Oe(),p(i,"class","txt"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(m,g){S(m,e,g),_(e,t),_(t,i),_(i,s),_(i,o),_(t,r),c&&c.m(t,null),S(m,u,g);for(let b=0;b<h.length;b+=1)h[b].m(m,g);S(m,f,g)},p(m,g){if(g[0]&128&&l!==(l=m[14].name+"")&&re(o,l),g[0]&152&&(a=on($n(m[3],m[14].id),$n(m[4],m[14].id))),a?c||(c=rm(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),g[0]&4232){d=Object.entries(m[14]);let b;for(b=0;b<d.length;b+=1){const y=Xh(m,d,b);h[b]?h[b].p(y,g):(h[b]=am(y),h[b].c(),h[b].m(f.parentNode,f))}for(;b<h.length;b+=1)h[b].d(1);h.length=d.length}},d(m){m&&w(e),c&&c.d(),m&&w(u),yt(h,m),m&&w(f)}}}function fm(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=v("tr"),t=v("td"),s=U(i),l=D(),o=v("td"),r=D(),a=v("td"),u=v("pre"),c=U(f),d=D(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(o,"class","changed-none-col svelte-lmkr38"),p(u,"class","txt"),p(a,"class","changed-new-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(h,m){S(h,e,m),_(e,t),_(t,s),_(e,l),_(e,o),_(e,r),_(e,a),_(a,u),_(u,c),_(e,d)},p(h,m){m[0]&256&&i!==(i=h[17]+"")&&re(s,i),m[0]&256&&f!==(f=h[12](h[18])+"")&&re(c,f)},d(h){h&&w(e)}}}function cm(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c=Object.entries(n[14]),d=[];for(let h=0;h<c.length;h+=1)d[h]=fm(Zh(n,c,h));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=U("field: "),o=U(l),r=D(),a=v("span"),a.textContent="Added",u=D();for(let h=0;h<d.length;h+=1)d[h].c();f=Oe(),p(i,"class","txt"),p(a,"class","label label-success m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(h,m){S(h,e,m),_(e,t),_(t,i),_(i,s),_(i,o),_(t,r),_(t,a),S(h,u,m);for(let g=0;g<d.length;g+=1)d[g].m(h,m);S(h,f,m)},p(h,m){if(m[0]&256&&l!==(l=h[14].name+"")&&re(o,l),m[0]&4352){c=Object.entries(h[14]);let g;for(g=0;g<c.length;g+=1){const b=Zh(h,c,g);d[g]?d[g].p(b,m):(d[g]=fm(b),d[g].c(),d[g].m(f.parentNode,f))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(h){h&&w(e),h&&w(u),yt(d,h),h&&w(f)}}}function PA(n){let e,t,i,s,l,o,r,a,u;function f(C,M){var T,E;return(T=C[0])!=null&&T.id?(E=C[1])!=null&&E.id?EA:AA:IA}let c=f(n),d=c(n),h=n[11],m=[];for(let C=0;C<h.length;C+=1)m[C]=im(em(n,h,C));let g=(n[2]||n[5])&&sm(n),b=n[7],y=[];for(let C=0;C<b.length;C+=1)y[C]=um(Gh(n,b,C));let k=n[8],$=[];for(let C=0;C<k.length;C+=1)$[C]=cm(Jh(n,k,C));return{c(){e=v("div"),d.c(),t=D(),i=v("table"),s=v("thead"),s.innerHTML=`<tr class="svelte-lmkr38"><th class="svelte-lmkr38">Props</th>
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=v("tbody");for(let C=0;C<m.length;C+=1)m[C].c();r=D(),g&&g.c(),a=D();for(let C=0;C<y.length;C+=1)y[C].c();u=D();for(let C=0;C<$.length;C+=1)$[C].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,M){S(C,e,M),d.m(e,null),S(C,t,M),S(C,i,M),_(i,s),_(i,l),_(i,o);for(let T=0;T<m.length;T+=1)m[T].m(o,null);_(o,r),g&&g.m(o,null),_(o,a);for(let T=0;T<y.length;T+=1)y[T].m(o,null);_(o,u);for(let T=0;T<$.length;T+=1)$[T].m(o,null)},p(C,M){if(c===(c=f(C))&&d?d.p(C,M):(d.d(1),d=c(C),d&&(d.c(),d.m(e,null))),M[0]&7203){h=C[11];let T;for(T=0;T<h.length;T+=1){const E=em(C,h,T);m[T]?m[T].p(E,M):(m[T]=im(E),m[T].c(),m[T].m(o,r))}for(;T<m.length;T+=1)m[T].d(1);m.length=h.length}if(C[2]||C[5]?g?g.p(C,M):(g=sm(C),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){b=C[7];let T;for(T=0;T<b.length;T+=1){const E=Gh(C,b,T);y[T]?y[T].p(E,M):(y[T]=um(E),y[T].c(),y[T].m(o,u))}for(;T<y.length;T+=1)y[T].d(1);y.length=b.length}if(M[0]&4352){k=C[8];let T;for(T=0;T<k.length;T+=1){const E=Jh(C,k,T);$[T]?$[T].p(E,M):($[T]=cm(E),$[T].c(),$[T].m(o,null))}for(;T<$.length;T+=1)$[T].d(1);$.length=k.length}},i:X,o:X,d(C){C&&w(e),d.d(),C&&w(t),C&&w(i),yt(m,C),g&&g.d(),yt(y,C),yt($,C)}}}function $n(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function on(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function LA(n,e,t){let i,s,l,{collectionA:o=new gn}=e,{collectionB:r=new gn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const m=Object.keys(new gn().export()).filter(y=>!["schema","created","updated"].includes(y));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(k=>y.id==k.id))))}function b(y){return typeof y>"u"?"":B.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(k=>y.id==k.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(k=>k.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(k=>k.id==y.id))),n.$$.dirty[0]&7&&t(9,l=B.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,m,b]}class NA extends ke{constructor(e){super(),ye(this,e,LA,PA,be,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function dm(n,e,t){const i=n.slice();return i[17]=e[t],i}function pm(n){let e,t;return e=new NA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function FA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=pm(dm(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Oe()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=dm(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=pm(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(de(),a=i.length;a<s.length;a+=1)l(a);pe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){yt(s,o),o&&w(e)}}}function RA(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function HA(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=U("Close"),i=D(),s=v("button"),l=v("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],x(s,"btn-loading",n[4])},m(a,u){S(a,e,u),_(e,t),S(a,i,u),S(a,s,u),_(s,l),o||(r=[Y(e,"click",n[0]),Y(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&x(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Le(r)}}}function jA(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[HA],header:[RA],default:[FA]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function qA(n,e,t){const i=Ct();let s,l=[],o=[],r=[],a=!1,u=!1;function f(C,M,T=!1){t(7,l=C),t(8,o=M),t(3,a=T),s==null||s.show()}function c(){return s==null?void 0:s.hide()}function d(){t(2,r=[]);for(const C of l){const M=B.findByKey(o,"id",C.id)||null;(a&&!(M!=null&&M.id)||M!=null&&M.id&&B.hasCollectionChanges(C,M,a))&&r.push({old:C,new:M})}for(const C of o){const M=B.findByKey(l,"id",C.id)||null;M!=null&&M.id||r.push({old:M,new:C})}}function h(){const C=[];if(a)for(const M of l){const T=B.findByKey(o,"id",M.id);if(!T)C.push(M.name+".*");else{const E=Array.isArray(M.schema)?M.schema:[];for(const O of E)B.findByKey(T.schema,"id",O.id)||C.push(`${M.name}.${O.name} (${O.id})`)}}C.length?Dn(`Do you really want to delete the following collection fields and their related records data:
- ${C.join(`
- `)}`,()=>{m()}):m()}async function m(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),qt("Successfully imported collections configuration."),i("submit")}catch(C){he.errorResponseHandler(C)}t(4,u=!1),c()}}const g=()=>h(),b=()=>!u;function y(C){ie[C?"unshift":"push"](()=>{s=C,t(1,s)})}function k(C){Be.call(this,n,C)}function $(C){Be.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,g,b,y,k,$]}class VA extends ke{constructor(e){super(),ye(this,e,qA,jA,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function hm(n,e,t){const i=n.slice();return i[32]=e[t],i}function mm(n,e,t){const i=n.slice();return i[35]=e[t],i}function gm(n,e,t){const i=n.slice();return i[32]=e[t],i}function zA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k,$,C,M,T,E;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[UA,({uniqueId:V})=>({40:V}),({uniqueId:V})=>[0,V?512:0]]},$$scope:{ctx:n}}});let O=!1,I=n[6]&&n[1].length&&!n[7]&&bm(),L=n[6]&&n[1].length&&n[7]&&vm(n),N=n[13].length&&Em(n),F=!!n[0]&&Am(n);return{c(){e=v("input"),t=D(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),q(a.$$.fragment),u=D(),f=D(),I&&I.c(),c=D(),L&&L.c(),d=D(),N&&N.c(),h=D(),m=v("div"),F&&F.c(),g=D(),b=v("div"),y=D(),k=v("button"),$=v("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p($,"class","txt"),p(k,"type","button"),p(k,"class","btn btn-expanded btn-warning m-l-auto"),k.disabled=C=!n[14],p(m,"class","flex m-t-base")},m(V,G){S(V,e,G),n[19](e),S(V,t,G),S(V,i,G),_(i,s),_(s,l),_(s,o),S(V,r,G),H(a,V,G),S(V,u,G),S(V,f,G),I&&I.m(V,G),S(V,c,G),L&&L.m(V,G),S(V,d,G),N&&N.m(V,G),S(V,h,G),S(V,m,G),F&&F.m(m,null),_(m,g),_(m,b),_(m,y),_(m,k),_(k,$),M=!0,T||(E=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(k,"click",n[26])],T=!0)},p(V,G){(!M||G[0]&4096)&&x(o,"btn-loading",V[12]);const se={};G[0]&64&&(se.class="form-field "+(V[6]?"":"field-error")),G[0]&65|G[1]&1536&&(se.$$scope={dirty:G,ctx:V}),a.$set(se),V[6]&&V[1].length&&!V[7]?I||(I=bm(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),V[6]&&V[1].length&&V[7]?L?L.p(V,G):(L=vm(V),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),V[13].length?N?N.p(V,G):(N=Em(V),N.c(),N.m(h.parentNode,h)):N&&(N.d(1),N=null),V[0]?F?F.p(V,G):(F=Am(V),F.c(),F.m(m,g)):F&&(F.d(1),F=null),(!M||G[0]&16384&&C!==(C=!V[14]))&&(k.disabled=C)},i(V){M||(A(a.$$.fragment,V),A(O),M=!0)},o(V){P(a.$$.fragment,V),P(O),M=!1},d(V){V&&w(e),n[19](null),V&&w(t),V&&w(i),V&&w(r),j(a,V),V&&w(u),V&&w(f),I&&I.d(V),V&&w(c),L&&L.d(V),V&&w(d),N&&N.d(V),V&&w(h),V&&w(m),F&&F.d(),T=!1,Le(E)}}}function BA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function _m(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function UA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&_m();return{c(){e=v("label"),t=U("Collections"),s=D(),l=v("textarea"),r=D(),c&&c.c(),a=Oe(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){S(d,e,h),_(e,t),S(d,s,h),S(d,l,h),fe(l,n[0]),S(d,r,h),c&&c.m(d,h),S(d,a,h),u||(f=Y(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&fe(l,d[0]),d[0]&&!d[6]?c||(c=_m(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function bm(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function vm(n){let e,t,i,s,l,o=n[9].length&&ym(n),r=n[4].length&&Sm(n),a=n[8].length&&Mm(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=D(),i=v("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),_(i,s),r&&r.m(i,null),_(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=ym(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Sm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Mm(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function ym(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=gm(n,s,o),a=l(r);t.set(a,e[o]=wm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Oe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=gt(e,r,l,1,o,s,t,i.parentNode,Xi,wm,i,gm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function km(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&re(s,i)},d(o){o&&w(e)}}}function wm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&km(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=D(),l=v("strong"),r=U(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),_(t,i),_(t,s),_(t,l),_(l,r),_(t,a),f&&f.m(t,null),_(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&re(r,o),e[32].id?f?f.p(e,d):(f=km(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Sm(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=mm(n,s,o),a=l(r);t.set(a,e[o]=Tm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Oe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=gt(e,r,l,1,o,s,t,i.parentNode,Xi,Tm,i,mm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function $m(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=D(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),_(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&re(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Cm(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&re(s,i)},d(o){o&&w(e)}}}function Tm(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&$m(e),h=e[35].new.id&&Cm(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=D(),l=v("div"),d&&d.c(),o=D(),r=v("strong"),u=U(a),f=D(),h&&h.c(),c=D(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(m,g){S(m,t,g),_(t,i),_(t,s),_(t,l),d&&d.m(l,null),_(l,o),_(l,r),_(r,u),_(l,f),h&&h.m(l,null),_(t,c)},p(m,g){e=m,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=$m(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&re(u,a),e[35].new.id?h?h.p(e,g):(h=Cm(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(m){m&&w(t),d&&d.d(),h&&h.d()}}}function Mm(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=hm(n,s,o),a=l(r);t.set(a,e[o]=Om(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Oe()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=gt(e,r,l,1,o,s,t,i.parentNode,Xi,Om,i,hm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Dm(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&re(s,i)},d(o){o&&w(e)}}}function Om(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Dm(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Added",s=D(),l=v("strong"),r=U(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),_(t,i),_(t,s),_(t,l),_(l,r),_(t,a),f&&f.m(t,null),_(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&re(r,o),e[32].id?f?f.p(e,d):(f=Dm(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Em(n){let e,t,i,s,l,o,r,a;return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),s.innerHTML=`<string>Some of the imported collections shares the same name and/or fields but are
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),_(e,t),_(e,i),_(e,s),_(e,l),_(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function Am(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function WA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[BA,zA],m=[];function g(b,y){return b[5]?0:1}return f=g(n),c=m[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=U(n[15]),r=D(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){S(b,e,y),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(b,r,y),S(b,a,y),_(a,u),m[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&re(o,b[15]);let k=f;f=g(b),f===k?m[f].p(b,y):(de(),P(m[k],1,1,()=>{m[k]=null}),pe(),c=m[f],c?c.p(b,y):(c=m[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&w(e),b&&w(r),b&&w(a),m[f].d()}}}function YA(n){let e,t,i,s,l,o;e=new Di({}),i=new vn({props:{$$slots:{default:[WA]},$$scope:{ctx:n}}});let r={};return l=new VA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),S(a,t,u),H(i,a,u),S(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function KA(n,e,t){let i,s,l,o,r,a,u;Ke(n,kt,z=>t(15,u=z)),Wt(kt,u="Import collections",u);let f,c,d="",h=!1,m=[],g=[],b=!0,y=[],k=!1;$();async function $(){t(5,k=!0);try{t(2,g=await he.collections.getFullList(200));for(let z of g)delete z.created,delete z.updated}catch(z){he.errorResponseHandler(z)}t(5,k=!1)}function C(){if(t(4,y=[]),!!i)for(let z of m){const Q=B.findByKey(g,"id",z.id);!(Q!=null&&Q.id)||!B.hasCollectionChanges(Q,z,b)||y.push({new:z,old:Q})}}function M(){t(1,m=[]);try{t(1,m=JSON.parse(d))}catch{}Array.isArray(m)?t(1,m=B.filterDuplicatesByKey(m)):t(1,m=[]);for(let z of m)delete z.created,delete z.updated,z.schema=B.filterDuplicatesByKey(z.schema)}function T(){var z,Q;for(let J of m){const ae=B.findByKey(g,"name",J.name)||B.findByKey(g,"id",J.id);if(!ae)continue;const He=J.id,Fe=ae.id;J.id=Fe;const Ne=Array.isArray(ae.schema)?ae.schema:[],Re=Array.isArray(J.schema)?J.schema:[];for(const ge of Re){const Ce=B.findByKey(Ne,"name",ge.name);Ce&&Ce.id&&(ge.id=Ce.id)}for(let ge of m)if(Array.isArray(ge.schema))for(let Ce of ge.schema)(z=Ce.options)!=null&&z.collectionId&&((Q=Ce.options)==null?void 0:Q.collectionId)===He&&(Ce.options.collectionId=Fe)}t(0,d=JSON.stringify(m,null,4))}function E(z){t(12,h=!0);const Q=new FileReader;Q.onload=async J=>{t(12,h=!1),t(10,f.value="",f),t(0,d=J.target.result),await In(),m.length||(cl("Invalid collections configuration."),O())},Q.onerror=J=>{console.warn(J),cl("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},Q.readAsText(z)}function O(){t(0,d=""),t(10,f.value="",f),Vn({})}function I(z){ie[z?"unshift":"push"](()=>{f=z,t(10,f)})}const L=()=>{f.files.length&&E(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function V(){b=this.checked,t(3,b)}const G=()=>T(),se=()=>O(),K=()=>c==null?void 0:c.show(g,m,b);function te(z){ie[z?"unshift":"push"](()=>{c=z,t(11,c)})}const ne=()=>O();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&m.length&&m.length===m.filter(z=>!!z.id&&!!z.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(z=>i&&b&&!B.findByKey(m,"id",z.id))),n.$$.dirty[0]&70&&t(8,l=m.filter(z=>i&&!B.findByKey(g,"id",z.id))),n.$$.dirty[0]&10&&(typeof m<"u"||typeof b<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!k&&i&&o),n.$$.dirty[0]&6&&t(13,a=m.filter(z=>{let Q=B.findByKey(g,"name",z.name)||B.findByKey(g,"id",z.id);if(!Q)return!1;if(Q.id!=z.id)return!0;const J=Array.isArray(Q.schema)?Q.schema:[],ae=Array.isArray(z.schema)?z.schema:[];for(const He of ae){if(B.findByKey(J,"id",He.id))continue;const Ne=B.findByKey(J,"name",He.name);if(Ne&&He.id!=Ne.id)return!0}return!1}))},[d,m,g,b,y,k,i,o,l,s,f,c,h,a,r,u,T,E,O,I,L,N,F,V,G,se,K,te,ne]}class JA extends ke{constructor(e){super(),ye(this,e,KA,YA,be,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?$i("/"):!0}],ZA={"/login":Tt({component:UO,conditions:Pt.concat([n=>!he.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Tt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-ce8164cc.js"),[],import.meta.url),conditions:Pt.concat([n=>!he.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Tt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-638d8554.js"),[],import.meta.url),conditions:Pt.concat([n=>!he.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Tt({component:hO,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Tt({component:n4,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Tt({component:eE,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Tt({component:HO,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Tt({component:HE,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Tt({component:eA,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Tt({component:gA,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Tt({component:SA,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Tt({component:OA,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Tt({component:JA,conditions:Pt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Tt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-751041a4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Tt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-751041a4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Tt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-3ece61b3.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Tt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-3ece61b3.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Tt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-3237bd62.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Tt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-3237bd62.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":Tt({component:Sv,userData:{showAppSidebar:!1}})};function GA(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=h=>Math.sqrt(h)*120,easing:d=Bo}=i;return{delay:f,duration:Zt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,m)=>{const g=m*a,b=m*u,y=h+m*e.width/t.width,k=h+m*e.height/t.height;return`transform: ${l} translate(${g}px, ${b}px) scale(${y}, ${k});`}}}function Im(n,e,t){const i=n.slice();return i[2]=e[t],i}function XA(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function QA(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xA(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function e5(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Pm(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h=X,m,g,b;function y(M,T){return M[2].type==="info"?e5:M[2].type==="success"?xA:M[2].type==="warning"?QA:XA}let k=y(e),$=k(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),$.c(),s=D(),l=v("div"),r=U(o),a=D(),u=v("button"),u.innerHTML='<i class="ri-close-line"></i>',f=D(),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(M,T){S(M,t,T),_(t,i),$.m(i,null),_(t,s),_(t,l),_(l,r),_(t,a),_(t,u),_(t,f),m=!0,g||(b=Y(u,"click",ct(C)),g=!0)},p(M,T){e=M,k!==(k=y(e))&&($.d(1),$=k(e),$&&($.c(),$.m(i,null))),(!m||T&1)&&o!==(o=e[2].message+"")&&re(r,o),(!m||T&1)&&x(t,"alert-info",e[2].type=="info"),(!m||T&1)&&x(t,"alert-success",e[2].type=="success"),(!m||T&1)&&x(t,"alert-danger",e[2].type=="error"),(!m||T&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){Mb(t),h(),zm(t,d)},a(){h(),h=Tb(t,d,GA,{duration:150})},i(M){m||(tt(()=>{c||(c=qe(t,yo,{duration:150},!0)),c.run(1)}),m=!0)},o(M){c||(c=qe(t,yo,{duration:150},!1)),c.run(0),m=!1},d(M){M&&w(t),$.d(),M&&c&&c.end(),g=!1,b()}}}function t5(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;r<l.length;r+=1){let a=Im(n,l,r),u=o(a);i.set(u,t[r]=Pm(u,a))}return{c(){e=v("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","toasts-wrapper")},m(r,a){S(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,[a]){if(a&1){l=r[0],de();for(let u=0;u<t.length;u+=1)t[u].r();t=gt(t,a,o,1,r,l,i,e,Ab,Pm,null,Im);for(let u=0;u<t.length;u+=1)t[u].a();pe()}},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function n5(n,e,t){let i;return Ke(n,Vo,l=>t(0,i=l)),[i,l=>e_(l)]}class i5 extends ke{constructor(e){super(),ye(this,e,n5,t5,be,{})}}function s5(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=U(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){S(l,e,o),_(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&re(i,t)},d(l){l&&w(e)}}}function l5(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=D(),s=v("button"),l=v("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],x(s,"btn-loading",n[2])},m(a,u){S(a,e,u),_(e,t),S(a,i,u),S(a,s,u),_(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&x(s,"btn-loading",a[2])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Le(r)}}}function o5(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[l5],header:[s5]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function r5(n,e,t){let i;Ke(n,Qa,c=>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){ie[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await In(),t(3,o=!1),nb()};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 a5 extends ke{constructor(e){super(),ye(this,e,r5,o5,be,{})}}function Lm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,b,y,k;return g=new Qn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[u5]},$$scope:{ctx:n}}}),{c(){var $;e=v("aside"),t=v("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=D(),s=v("nav"),l=v("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=D(),r=v("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=D(),u=v("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=D(),c=v("figure"),d=v("img"),m=D(),q(g.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),jn(d.src,h="./images/avatars/avatar"+((($=n[0])==null?void 0:$.avatar)||0)+".svg")||p(d,"src",h),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m($,C){S($,e,C),_(e,t),_(e,i),_(e,s),_(s,l),_(s,o),_(s,r),_(s,a),_(s,u),_(e,f),_(e,c),_(c,d),_(c,m),H(g,c,null),b=!0,y||(k=[Ie(Qt.call(null,t)),Ie(Qt.call(null,l)),Ie(Fn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ie(We.call(null,l,{text:"Collections",position:"right"})),Ie(Qt.call(null,r)),Ie(Fn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ie(We.call(null,r,{text:"Logs",position:"right"})),Ie(Qt.call(null,u)),Ie(Fn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ie(We.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p($,C){var T;(!b||C&1&&!jn(d.src,h="./images/avatars/avatar"+(((T=$[0])==null?void 0:T.avatar)||0)+".svg"))&&p(d,"src",h);const M={};C&1024&&(M.$$scope={dirty:C,ctx:$}),g.$set(M)},i($){b||(A(g.$$.fragment,$),b=!0)},o($){P(g.$$.fragment,$),b=!1},d($){$&&w(e),j(g),y=!1,Le(k)}}}function u5(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=D(),i=v("hr"),s=D(),l=v("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(Qt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Le(r)}}}function f5(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=B.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&Lm(n);return o=new jb({props:{routes:ZA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new i5({}),f=new a5({}),{c(){t=D(),i=v("div"),d&&d.c(),s=D(),l=v("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(m,g){S(m,t,g),S(m,i,g),d&&d.m(i,null),_(i,s),_(i,l),H(o,l,null),_(l,r),H(a,l,null),S(m,u,g),H(f,m,g),c=!0},p(m,[g]){var b;(!c||g&12)&&e!==(e=B.joinNonEmpty([m[3],m[2],"PocketBase"]," - "))&&(document.title=e),(b=m[0])!=null&&b.id&&m[1]?d?(d.p(m,g),g&3&&A(d,1)):(d=Lm(m),d.c(),A(d,1),d.m(i,s)):d&&(de(),P(d,1,1,()=>{d=null}),pe())},i(m){c||(A(d),A(o.$$.fragment,m),A(a.$$.fragment,m),A(f.$$.fragment,m),c=!0)},o(m){P(d),P(o.$$.fragment,m),P(a.$$.fragment,m),P(f.$$.fragment,m),c=!1},d(m){m&&w(t),m&&w(i),d&&d.d(),j(o),j(a),m&&w(u),j(f,m)}}}function c5(n,e,t){let i,s,l,o;Ke(n,Ts,h=>t(8,i=h)),Ke(n,vo,h=>t(2,s=h)),Ke(n,Ma,h=>t(0,l=h)),Ke(n,kt,h=>t(3,o=h));let r,a=!1;function u(h){var m,g,b,y;((m=h==null?void 0:h.detail)==null?void 0:m.location)!==r&&(t(1,a=!!((b=(g=h==null?void 0:h.detail)==null?void 0:g.userData)!=null&&b.showAppSidebar)),r=(y=h==null?void 0:h.detail)==null?void 0:y.location,Wt(kt,o="",o),Vn({}),nb())}function f(){$i("/")}async function c(){var h,m;if(l!=null&&l.id)try{const g=await he.settings.getAll({$cancelKey:"initialAppSettings"});Wt(vo,s=((h=g==null?void 0:g.meta)==null?void 0:h.appName)||"",s),Wt(Ts,i=!!((m=g==null?void 0:g.meta)!=null&&m.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){he.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class d5 extends ke{constructor(e){super(),ye(this,e,c5,f5,be,{})}}new d5({target:document.getElementById("app")});export{Le as A,qt as B,B as C,$i as D,Oe as E,t_ as F,ga as G,pu as H,Ke as I,es as J,Ct as K,un as L,ie as M,eb as N,gt as O,Xi as P,Kt as Q,gn as R,ke as S,Ar as T,P as a,D as b,q as c,j as d,v as e,p as f,S as g,_ as h,ye as i,Ie as j,de as k,Qt as l,H as m,pe as n,w as o,he as p,me as q,x as r,be as s,A as t,Y as u,ct as v,U as w,re as x,X as y,fe as z};