(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 Q(){}const Sl=n=>n;function Fe(n,e){for(const t in e)n[t]=e[t];return n}function fb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function D_(n){return n()}function uu(){return Object.create(null)}function Ie(n){n.forEach(D_)}function Ht(n){return typeof n=="function"}function ge(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let jl;function Yn(n,e){return jl||(jl=document.createElement("a")),jl.href=e,n===jl.href}function cb(n){return Object.keys(n).length===0}function E_(n,...e){if(n==null)return Q;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ke(n,e,t){n.$$.on_destroy.push(E_(e,t))}function Pt(n,e,t,i){if(n){const s=A_(n,e,t,i);return n[0](s)}}function A_(n,e,t,i){return n[1]&&i?Fe(t.ctx.slice(),n[1](i(e))):t.ctx}function Lt(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ma=I_?n=>requestAnimationFrame(n):Q;const vs=new Set;function P_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&ma(P_)}function qo(n){let e;return vs.size===0&&ma(P_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function v(n,e){n.appendChild(e)}function L_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function db(n){const e=y("style");return pb(L_(n),e),e.sheet}function pb(n,e){return v(n.head||n,e),e.sheet}function $(n,e,t){n.insertBefore(e,t||null)}function S(n){n.parentNode&&n.parentNode.removeChild(n)}function ct(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function pt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Cn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ti(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]:h(n,i,e[i])}function mb(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function gt(n){return n===""?null:+n}function hb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function ue(n,e){n.value=e??""}function Fr(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 N_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Ot(n,e){return new n(e)}const ho=new Map;let _o=0;function _b(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function gb(n,e){const t={stylesheet:db(e),rules:{}};return ho.set(n,t),t}function fl(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 k=e+(t-e)*l(b);u+=b*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} }`,d=`__svelte_${_b(f)}_${r}`,p=L_(n),{stylesheet:m,rules:_}=ho.get(p)||gb(p,n);_[d]||(_[d]=!0,m.insertRule(`@keyframes ${d} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${d} ${i}ms linear ${s}ms 1 both`,_o+=1,d}function cl(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(", "),_o-=s,_o||bb())}function bb(){ma(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&S(e)}),ho.clear())})}function vb(n,e,t,i){if(!e)return Q;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return Q;const{delay:l=0,duration:o=300,easing:r=Sl,start:a=Ro()+l,end:u=a+o,tick:f=Q,css:d}=t(n,{from:e,to:s},i);let p=!0,m=!1,_;function g(){d&&(_=fl(n,0,1,o,l,r,d)),l||(m=!0)}function b(){d&&cl(n,_),p=!1}return qo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),b()),!p)return!1;if(m){const w=k-a,T=0+1*r(w/o);f(T,1-T)}return!0}),g(),f(0,1),b}function yb(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,F_(n,s)}}function F_(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 dl;function fi(n){dl=n}function $l(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Zt(n){$l().$$.on_mount.push(n)}function kb(n){$l().$$.after_update.push(n)}function R_(n){$l().$$.on_destroy.push(n)}function St(){const n=$l();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=N_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function de(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bs=[],se=[];let ys=[];const Rr=[],q_=Promise.resolve();let qr=!1;function j_(){qr||(qr=!0,q_.then(ha))}function an(){return j_(),q_}function et(n){ys.push(n)}function ke(n){Rr.push(n)}const nr=new Set;let ds=0;function ha(){if(ds!==0)return;const n=dl;do{try{for(;dsn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let js;function _a(){return js||(js=Promise.resolve(),js.then(()=>{js=null})),js}function Xi(n,e,t){n.dispatchEvent(N_(`${e?"intro":"outro"}${t}`))}const ao=new Set;let Qn;function re(){Qn={r:0,c:[],p:Qn}}function ae(){Qn.r||Ie(Qn.c),Qn=Qn.p}function I(n,e){n&&n.i&&(ao.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(ao.has(n))return;ao.add(n),Qn.c.push(()=>{ao.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ga={duration:0};function $b(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&cl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=Sl,tick:g=Q,css:b}=s||ga;b&&(o=fl(n,0,1,m,p,_,b,a++)),g(0,1);const k=Ro()+p,w=k+m;r&&r.abort(),l=!0,et(()=>Xi(n,!0,"start")),r=qo(T=>{if(l){if(T>=w)return g(1,0),Xi(n,!0,"end"),u(),l=!1;if(T>=k){const C=_((T-k)/m);g(C,1-C)}}return l})}let d=!1;return{start(){d||(d=!0,cl(n),Ht(s)?(s=s(i),_a().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Tb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Qn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=Sl,tick:p=Q,css:m}=s||ga;m&&(o=fl(n,1,0,f,u,d,m));const _=Ro()+u,g=_+f;et(()=>Xi(n,!1,"start")),qo(b=>{if(l){if(b>=g)return p(0,1),Xi(n,!1,"end"),--r.r||Ie(r.c),!1;if(b>=_){const k=d((b-_)/f);p(1-k,k)}}return l})}return Ht(s)?_a().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&cl(n,o),l=!1)}}}function Ve(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&&cl(n,u)}function d(m,_){const g=m.b-o;return _*=Math.abs(g),{a:o,b:m.b,d:g,duration:_,start:m.start,end:m.start+_,group:m.group}}function p(m){const{delay:_=0,duration:g=300,easing:b=Sl,tick:k=Q,css:w}=l||ga,T={start:Ro()+_,b:m};m||(T.group=Qn,Qn.r+=1),r||a?a=T:(w&&(f(),u=fl(n,o,m,g,_,b,w)),m&&k(0,1),r=d(T,g),et(()=>Xi(n,m,"start")),qo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Xi(n,r.b,"start"),w&&(f(),u=fl(n,o,r.b,r.duration,0,b,l.css))),r){if(C>=r.end)k(o=r.b,1-o),Xi(n,r.b,"end"),a||(r.b?f():--r.group.r||Ie(r.group.c)),r=null;else if(C>=r.start){const M=C-r.start;o=r.a+r.d*b(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Ht(l)?_a().then(()=>{l=l(s),p(m)}):p(m)},end(){f(),r=a=null}}}function cu(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((d,p)=>{p!==l&&d&&(re(),L(d,1,1,()=>{e.blocks[p]===d&&(e.blocks[p]=null)}),ae())}):e.block.d(1),u.c(),I(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ha()}if(fb(n)){const s=$l();if(n.then(l=>{fi(s),i(e.then,1,e.value,l),fi(null)},l=>{if(fi(s),i(e.catch,2,e.error,l),fi(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 Cb(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 is(n,e){n.d(1),e.delete(n.key)}function un(n,e){L(n,1,1,()=>{e.delete(n.key)})}function Mb(n,e){n.f(),un(n,e)}function Dt(n,e,t,i,s,l,o,r,a,u,f,d){let p=n.length,m=l.length,_=p;const g={};for(;_--;)g[n[_].key]=_;const b=[],k=new Map,w=new Map,T=[];for(_=m;_--;){const D=d(s,l,_),A=t(D);let P=o.get(A);P?i&&T.push(()=>P.p(D,e)):(P=u(A,D),P.c()),k.set(A,b[_]=P),A in g&&w.set(A,Math.abs(_-g[A]))}const C=new Set,M=new Set;function O(D){I(D,1),D.m(r,f),o.set(D.key,D),f=D.first,m--}for(;p&&m;){const D=b[m-1],A=n[p-1],P=D.key,N=A.key;D===A?(f=D.first,p--,m--):k.has(N)?!o.has(P)||C.has(P)?O(D):M.has(N)?p--:w.get(P)>w.get(N)?(M.add(P),O(D)):(C.add(N),p--):(a(A,o),p--)}for(;p--;){const D=n[p];k.has(D.key)||a(D,o)}for(;m;)O(b[m-1]);return Ie(T),b}function kt(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 Bt(n){return typeof n=="object"&&n!==null?n:{}}function _e(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function V(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||et(()=>{const o=n.$$.on_mount.map(D_).filter(Ht);n.$$.on_destroy?n.$$.on_destroy.push(...o):Ie(o),n.$$.on_mount=[]}),l.forEach(et)}function H(n,e){const t=n.$$;t.fragment!==null&&(Sb(t.after_update),Ie(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ob(n,e){n.$$.dirty[0]===-1&&(bs.push(n),j_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const _=m.length?m[0]:p;return u.ctx&&s(u.ctx[d],u.ctx[d]=_)&&(!u.skip_bound&&u.bound[d]&&u.bound[d](_),f&&Ob(n,d)),p}):[],u.update(),f=!0,Ie(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const d=hb(e.target);u.fragment&&u.fragment.l(d),d.forEach(S)}else u.fragment&&u.fragment.c();e.intro&&I(n.$$.fragment),V(n,e.target,e.anchor,e.customElement),ha()}fi(a)}class ve{$destroy(){H(this,1),this.$destroy=Q}$on(e,t){if(!Ht(t))return Q;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&&!cb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function qt(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{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function H_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return V_(t,o=>{let r=!1;const a=[];let u=0,f=Q;const d=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=Ht(m)?m:Q},p=s.map((m,_)=>E_(m,g=>{a[_]=g,u&=~(1<<_),r&&d()},()=>{u|=1<<_}));return r=!0,d(),function(){Ie(p),f(),r=!1}})}function z_(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 Db(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{H(f,1)}),ae()}l?(e=Ot(l,o()),e.$on("routeEvent",r[7]),z(e.$$.fragment),I(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&S(t),e&&H(e,r)}}}function Eb(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{H(f,1)}),ae()}l?(e=Ot(l,o()),e.$on("routeEvent",r[6]),z(e.$$.fragment),I(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&S(t),e&&H(e,r)}}}function Ab(n){let e,t,i,s;const l=[Eb,Db],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),$(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&S(i)}}}function du(){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 jo=V_(null,function(e){e(du());const t=()=>{e(du())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});H_(jo,n=>n.location);const ba=H_(jo,n=>n.querystring),pu=jn(void 0);async function Ii(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await an();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 sn(n,e){if(e=hu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return mu(n,e),{update(t){t=hu(t),mu(n,t)}}}function Ib(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function mu(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||Pb(i.currentTarget.getAttribute("href"))})}function hu(n){return n&&typeof n=="string"?{href:n}:n||{}}function Pb(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Lb(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._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:D,keys:A}=z_(M);this.path=M,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=A}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 P=M.match(s);if(P&&P[0])M=M.substr(P[0].length)||"/";else return null}}const O=this._pattern.exec(M);if(O===null)return null;if(this._keys===!1)return O;const D={};let A=0;for(;A{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 d=St();async function p(C,M){await an(),d(C,M)}let m=null,_=null;l&&(_=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?m=C.state:m=null},window.addEventListener("popstate",_),kb(()=>{Ib(m)}));let g=null,b=null;const k=jo.subscribe(async C=>{g=C;let M=0;for(;M{pu.set(u)});return}t(0,a=null),b=null,pu.set(void 0)});R_(()=>{k(),_&&window.removeEventListener("popstate",_)});function w(C){de.call(this,n,C)}function T(C){de.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,w,T]}class Nb extends ve{constructor(e){super(),be(this,e,Lb,Ab,ge,{routes:3,prefix:4,restoreScrollState:5})}}const uo=[];let B_;function U_(n){const e=n.pattern.test(B_);_u(n,n.className,e),_u(n,n.inactiveClassName,!e)}function _u(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}jo.subscribe(n=>{B_=n.location+(n.querystring?"?"+n.querystring:""),uo.map(U_)});function Bn(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"?z_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return uo.push(i),U_(i),{destroy(){uo.splice(uo.indexOf(i),1)}}}const Fb="modulepreload",Rb=function(n,e){return new URL(n,e).href},gu={},ft=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=Rb(l,i),l in gu)return;gu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const d=s[f];if(d.href===l&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Fb,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var jr=function(n,e){return jr=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])},jr(n,e)};function en(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}jr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Vr=function(){return Vr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i0&&s[s.length-1])||d[0]!==6&&d[0]!==2)){o=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};var Tl=function(){function n(e){e===void 0&&(e={}),this.$load(e||{})}return n.prototype.load=function(e){return this.$load(e)},n.prototype.$load=function(e){for(var t=0,i=Object.entries(e);t0&&(!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 di(t):new ts(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||qb,f=0;f4096&&(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 di&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=bu(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;e0?e:1,this.perPage=t>=0?t:0,this.totalItems=i>=0?i:0,this.totalPages=s>=0?s:0,this.items=l||[]},va=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return en(e,n),e.prototype.getFullList=function(t,i){if(typeof t=="number")return this._getFullList(this.baseCrudPath,t,i);var s=Object.assign({},t,i);return this._getFullList(this.baseCrudPath,s.batch||200,s)},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 en(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=200),s===void 0&&(s={});var o=[],r=function(a){return ln(l,void 0,void 0,function(){return on(this,function(u){return[2,this._getList(t,a,i||200,s).then(function(f){var d=f,p=d.items,m=d.totalItems;return o=o.concat(p),p.length&&m>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=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 ln(this,void 0,void 0,function(){return on(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];i0?[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 ln(t,void 0,void 0,function(){var l;return on(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;lthis.maxReconnectAttempts){for(var s=0,l=this.pendingConnects;s=400)throw new pl({url:O.url,status:O.status,data:D});return[2,D]}})})}).catch(function(O){throw new pl(O)})]}})})},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.isFormData=function(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)},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"u"}function Qi(n){return typeof n=="number"}function Vo(n){return typeof n=="number"&&n%1===0}function e0(n){return typeof n=="string"}function t0(n){return Object.prototype.toString.call(n)==="[object Date]"}function mg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function n0(n){return Array.isArray(n)?n:[n]}function yu(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 i0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Cs(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ci(n,e,t){return Vo(n)&&n>=e&&n<=t}function s0(n,e){return n-e*Math.floor(n/e)}function jt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function wi(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function Vi(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function ka(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function wa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ml(n){return n%4===0&&(n%100!==0||n%400===0)}function tl(n){return Ml(n)?366:365}function go(n,e){const t=s0(e-1,12)+1,i=n+(e-t)/12;return t===2?Ml(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Sa(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 bo(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 Br(n){return n>99?n:n>60?1900+n:2e3+n}function hg(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 Ho(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 Ln(`Invalid unit value ${n}`);return e}function vo(n,e){const t={};for(const i in n)if(Cs(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=_g(s)}return t}function nl(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}${jt(t,2)}:${jt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${jt(t,2)}${jt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function zo(n){return i0(n,["hour","minute","second","millisecond"])}const gg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,l0=["January","February","March","April","May","June","July","August","September","October","November","December"],bg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o0=["J","F","M","A","M","J","J","A","S","O","N","D"];function vg(n){switch(n){case"narrow":return[...o0];case"short":return[...bg];case"long":return[...l0];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 yg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],kg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],r0=["M","T","W","T","F","S","S"];function wg(n){switch(n){case"narrow":return[...r0];case"short":return[...kg];case"long":return[...yg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Sg=["AM","PM"],a0=["Before Christ","Anno Domini"],u0=["BC","AD"],f0=["B","A"];function $g(n){switch(n){case"narrow":return[...f0];case"short":return[...u0];case"long":return[...a0];default:return null}}function c0(n){return Sg[n.hour<12?0:1]}function d0(n,e){return wg(e)[n.weekday-1]}function p0(n,e){return vg(e)[n.month-1]}function m0(n,e){return $g(e)[n.year<0?0:1]}function h0(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 d=n==="days";switch(e){case 1:return d?"tomorrow":`next ${s[n][0]}`;case-1:return d?"yesterday":`last ${s[n][0]}`;case 0:return d?"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 ku(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const _0={D:zr,DD:Z_,DDD:G_,DDDD:X_,t:Q_,tt:x_,ttt:eg,tttt:tg,T:ng,TT:ig,TTT:sg,TTTT:lg,f:og,ff:ag,fff:fg,ffff:dg,F:rg,FF:ug,FFF:cg,FFFF:pg};class hn{static create(e,t={}){return new hn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&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 _0[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 jt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,_)=>this.loc.extract(e,m,_),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?c0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,_)=>i?p0(e,m):l(_?{month:m}:{month:m,day:"numeric"},"month"),u=(m,_)=>i?d0(e,m):l(_?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const _=hn.macroTokenToFormatOpts(m);return _?this.formatWithSystemDefault(e,_):m},d=m=>i?m0(e,m):l({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("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(m)}};return ku(hn.parseFormat(t),p)}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=hn.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 ku(l,s(r))}}class Un{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ol{get type(){throw new yi}get name(){throw new yi}get ianaName(){return this.name}get isUniversal(){throw new yi}offsetName(e,t){throw new yi}formatOffset(e,t){throw new yi}offset(e){throw new yi}equals(e){throw new yi}get isValid(){throw new yi}}let ir=null;class $a extends Ol{static get instance(){return ir===null&&(ir=new $a),ir}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return hg(e,t,i)}formatOffset(e,t){return nl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let fo={};function g0(n){return fo[n]||(fo[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"})),fo[n]}const b0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function v0(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 y0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?_:1e3+_,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let sr=null;class rn extends Ol{static get utcInstance(){return sr===null&&(sr=new rn(0)),sr}static instance(e){return e===0?rn.utcInstance:new rn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new rn(Ho(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${nl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${nl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return nl(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 k0 extends Ol{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 Si(n,e){if(it(n)||n===null)return e;if(n instanceof Ol)return n;if(e0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?rn.utcInstance:rn.parseSpecifier(t)||pi.create(n)}else return Qi(n)?rn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new k0(n)}let wu=()=>Date.now(),Su="system",$u=null,Tu=null,Cu=null,Mu;class Wt{static get now(){return wu}static set now(e){wu=e}static set defaultZone(e){Su=e}static get defaultZone(){return Si(Su,$a.instance)}static get defaultLocale(){return $u}static set defaultLocale(e){$u=e}static get defaultNumberingSystem(){return Tu}static set defaultNumberingSystem(e){Tu=e}static get defaultOutputCalendar(){return Cu}static set defaultOutputCalendar(e){Cu=e}static get throwOnInvalid(){return Mu}static set throwOnInvalid(e){Mu=e}static resetCaches(){$t.resetCache(),pi.resetCache()}}let Ou={};function w0(n,e={}){const t=JSON.stringify([n,e]);let i=Ou[t];return i||(i=new Intl.ListFormat(n,e),Ou[t]=i),i}let Ur={};function Wr(n,e={}){const t=JSON.stringify([n,e]);let i=Ur[t];return i||(i=new Intl.DateTimeFormat(n,e),Ur[t]=i),i}let Yr={};function S0(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.NumberFormat(n,e),Yr[t]=i),i}let Kr={};function $0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Kr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Kr[s]=l),l}let Qs=null;function T0(){return Qs||(Qs=new Intl.DateTimeFormat().resolvedOptions().locale,Qs)}function C0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Wr(n).resolvedOptions()}catch{t=Wr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function M0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function O0(n){const e=[];for(let t=1;t<=12;t++){const i=ze.utc(2016,t,1);e.push(n(i))}return e}function D0(n){const e=[];for(let t=1;t<=7;t++){const i=ze.utc(2016,11,13+t);e.push(n(i))}return e}function zl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function E0(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 A0{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=S0(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):wa(e,3);return jt(t,this.padTo)}}}class I0{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&&pi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:ze.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=Wr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class P0{constructor(e,t,i){this.opts={style:"long",...i},!t&&mg()&&(this.rtf=$0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):h0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class $t{static fromOpts(e){return $t.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Wt.defaultLocale,o=l||(s?"en-US":T0()),r=t||Wt.defaultNumberingSystem,a=i||Wt.defaultOutputCalendar;return new $t(o,r,a,l)}static resetCache(){Qs=null,Ur={},Yr={},Kr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return $t.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=C0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=M0(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=E0(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:$t.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 zl(this,e,i,vg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=O0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return zl(this,e,i,wg,()=>{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]=D0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return zl(this,void 0,e,()=>Sg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ze.utc(2016,11,13,9),ze.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return zl(this,e,t,$g,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[ze.utc(-40,1,1),ze.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 A0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new I0(e,this.intl,t)}relFormatter(e={}){return new P0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return w0(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 Ps(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ls(...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 Ns(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 Tg(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(_||m&&f)?-m:m;return[{years:p(Vi(t)),months:p(Vi(i)),weeks:p(Vi(s)),days:p(Vi(l)),hours:p(Vi(o)),minutes:p(Vi(r)),seconds:p(Vi(a),a==="-0"),milliseconds:p(ka(u),d)}]}const Y0={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 Ma(n,e,t,i,s,l,o){const r={year:e.length===2?Br(wi(e)):wi(e),month:bg.indexOf(t)+1,day:wi(i),hour:wi(s),minute:wi(l)};return o&&(r.second=wi(o)),n&&(r.weekday=n.length>3?yg.indexOf(n)+1:kg.indexOf(n)+1),r}const K0=/^(?:(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 J0(n){const[,e,t,i,s,l,o,r,a,u,f,d]=n,p=Ma(e,s,i,t,l,o,r);let m;return a?m=Y0[a]:u?m=0:m=Ho(f,d),[p,new rn(m)]}function Z0(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const G0=/^(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$/,X0=/^(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$/,Q0=/^(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 Du(n){const[,e,t,i,s,l,o,r]=n;return[Ma(e,s,i,t,l,o,r),rn.utcInstance]}function x0(n){const[,e,t,i,s,l,o,r]=n;return[Ma(e,r,t,i,s,l,o),rn.utcInstance]}const ev=Ps(N0,Ca),tv=Ps(F0,Ca),nv=Ps(R0,Ca),iv=Ps(Mg),Dg=Ls(z0,Fs,Dl,El),sv=Ls(q0,Fs,Dl,El),lv=Ls(j0,Fs,Dl,El),ov=Ls(Fs,Dl,El);function rv(n){return Ns(n,[ev,Dg],[tv,sv],[nv,lv],[iv,ov])}function av(n){return Ns(Z0(n),[K0,J0])}function uv(n){return Ns(n,[G0,Du],[X0,Du],[Q0,x0])}function fv(n){return Ns(n,[U0,W0])}const cv=Ls(Fs);function dv(n){return Ns(n,[B0,cv])}const pv=Ps(V0,H0),mv=Ps(Og),hv=Ls(Fs,Dl,El);function _v(n){return Ns(n,[pv,Dg],[mv,hv])}const gv="Invalid Duration",Eg={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}},bv={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},...Eg},Dn=146097/400,ms=146097/4800,vv={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:ms/7,days:ms,hours:ms*24,minutes:ms*24*60,seconds:ms*24*60*60,milliseconds:ms*24*60*60*1e3},...Eg},Yi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],yv=Yi.slice(0).reverse();function Hi(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 ot(i)}function kv(n){return n<0?Math.floor(n):Math.ceil(n)}function Ag(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?kv(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function wv(n,e){yv.reduce((t,i)=>it(e[i])?t:(t&&Ag(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||$t.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?vv:bv,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Ln(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:vo(e,ot.normalizeUnit),loc:$t.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Qi(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new Ln(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=fv(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=dv(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Ln("need to specify a reason the Duration is invalid");const i=e instanceof Un?e:new Un(e,t);if(Wt.throwOnInvalid)throw new Xb(i);return new ot({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 J_(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?hn.create(this.loc,i).formatDurationFromString(this,e):gv}toHuman(e={}){const t=Yi.map(i=>{const s=this.values[i];return it(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+=wa(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=ot.fromDurationLike(e),i={};for(const s of Yi)(Cs(t.values,s)||Cs(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Hi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.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 Hi(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...vo(e,ot.normalizeUnit)};return Hi(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),Hi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return wv(this.matrix,e),Hi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ot.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Yi)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;Qi(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)Yi.indexOf(u)>Yi.indexOf(o)&&Ag(this.matrix,s,u,t,o)}else Qi(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 Hi(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 Hi(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 Yi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Vs="Invalid Interval";function Sv(n,e){return!n||!n.isValid?Tt.invalid("missing or invalid start"):!e||!e.isValid?Tt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Tt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Bs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Tt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Tt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Tt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Tt.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(Tt.fromDateTimes(t,a.time)),t=null);return Tt.merge(s)}difference(...e){return Tt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Vs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Vs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Vs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Vs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Tt.fromDateTimes(e(this.s),e(this.e))}}class Bl{static hasDST(e=Wt.defaultZone){const t=ze.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return Si(e,Wt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||$t.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||$t.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||$t.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||$t.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return $t.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return $t.create(t,null,"gregory").eras(e)}static features(){return{relative:mg()}}}function Eu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function $v(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=Eu(r,a);return(u-u%7)/7}],["days",Eu]],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 Tv(n,e,t,i){let[s,l,o,r]=$v(n,e,t);const a=e-s,u=t.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Oa={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Au={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]},Cv=Oa.hanidec.replace(/[\[|\]]/g,"").split("");function Mv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Hn({numberingSystem:n},e=""){return new RegExp(`${Oa[n||"latn"]}${e}`)}const Ov="missing Intl.DateTimeFormat.formatToParts support";function at(n,e=t=>t){return{regex:n,deser:([t])=>e(Mv(t))}}const Dv=String.fromCharCode(160),Ig=`[ ${Dv}]`,Pg=new RegExp(Ig,"g");function Ev(n){return n.replace(/\./g,"\\.?").replace(Pg,Ig)}function Iu(n){return n.replace(/\./g,"").replace(Pg," ").toLowerCase()}function zn(n,e){return n===null?null:{regex:RegExp(n.map(Ev).join("|")),deser:([t])=>n.findIndex(i=>Iu(t)===Iu(i))+e}}function Pu(n,e){return{regex:n,deser:([,t,i])=>Ho(t,i),groups:e}}function lr(n){return{regex:n,deser:([e])=>e}}function Av(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Iv(n,e){const t=Hn(e),i=Hn(e,"{2}"),s=Hn(e,"{3}"),l=Hn(e,"{4}"),o=Hn(e,"{6}"),r=Hn(e,"{1,2}"),a=Hn(e,"{1,3}"),u=Hn(e,"{1,6}"),f=Hn(e,"{1,9}"),d=Hn(e,"{2,4}"),p=Hn(e,"{4,6}"),m=b=>({regex:RegExp(Av(b.val)),deser:([k])=>k,literal:!0}),g=(b=>{if(n.literal)return m(b);switch(b.val){case"G":return zn(e.eras("short",!1),0);case"GG":return zn(e.eras("long",!1),0);case"y":return at(u);case"yy":return at(d,Br);case"yyyy":return at(l);case"yyyyy":return at(p);case"yyyyyy":return at(o);case"M":return at(r);case"MM":return at(i);case"MMM":return zn(e.months("short",!0,!1),1);case"MMMM":return zn(e.months("long",!0,!1),1);case"L":return at(r);case"LL":return at(i);case"LLL":return zn(e.months("short",!1,!1),1);case"LLLL":return zn(e.months("long",!1,!1),1);case"d":return at(r);case"dd":return at(i);case"o":return at(a);case"ooo":return at(s);case"HH":return at(i);case"H":return at(r);case"hh":return at(i);case"h":return at(r);case"mm":return at(i);case"m":return at(r);case"q":return at(r);case"qq":return at(i);case"s":return at(r);case"ss":return at(i);case"S":return at(a);case"SSS":return at(s);case"u":return lr(f);case"uu":return lr(r);case"uuu":return at(t);case"a":return zn(e.meridiems(),0);case"kkkk":return at(l);case"kk":return at(d,Br);case"W":return at(r);case"WW":return at(i);case"E":case"c":return at(t);case"EEE":return zn(e.weekdays("short",!1,!1),1);case"EEEE":return zn(e.weekdays("long",!1,!1),1);case"ccc":return zn(e.weekdays("short",!0,!1),1);case"cccc":return zn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Pu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Pu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return lr(/[a-z_+-/]{1,256}?/i);default:return m(b)}})(n)||{invalidReason:Ov};return g.token=n,g}const Pv={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 Lv(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Pv[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Nv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Fv(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Cs(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 Rv(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 it(n.z)||(t=pi.create(n.z)),it(n.Z)||(t||(t=new rn(n.Z)),i=n.Z),it(n.q)||(n.M=(n.q-1)*3+1),it(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),it(n.u)||(n.S=ka(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let or=null;function qv(){return or||(or=ze.fromMillis(1555555555555)),or}function jv(n,e){if(n.literal)return n;const t=hn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=hn.create(e,t).formatDateTimeParts(qv()).map(o=>Lv(o,e,t));return l.includes(void 0)?n:l}function Vv(n,e){return Array.prototype.concat(...n.map(t=>jv(t,e)))}function Lg(n,e,t){const i=Vv(hn.parseFormat(t),n),s=i.map(o=>Iv(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Nv(s),a=RegExp(o,"i"),[u,f]=Fv(e,a,r),[d,p,m]=f?Rv(f):[null,null,void 0];if(Cs(f,"a")&&Cs(f,"H"))throw new Xs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:d,zone:p,specificOffset:m}}}function Hv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=Lg(n,e,t);return[i,s,l,o]}const Ng=[0,31,59,90,120,151,181,212,243,273,304,334],Fg=[0,31,60,91,121,152,182,213,244,274,305,335];function Fn(n,e){return new Un("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Rg(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 qg(n,e,t){return t+(Ml(n)?Fg:Ng)[e-1]}function jg(n,e){const t=Ml(n)?Fg:Ng,i=t.findIndex(l=>lbo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...zo(n)}}function Lu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Rg(e,1,4),l=tl(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=tl(r)):o>l?(r=e+1,o-=tl(e)):r=e;const{month:a,day:u}=jg(r,o);return{year:r,month:a,day:u,...zo(n)}}function rr(n){const{year:e,month:t,day:i}=n,s=qg(e,t,i);return{year:e,ordinal:s,...zo(n)}}function Nu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=jg(e,t);return{year:e,month:i,day:s,...zo(n)}}function zv(n){const e=Vo(n.weekYear),t=ci(n.weekNumber,1,bo(n.weekYear)),i=ci(n.weekday,1,7);return e?t?i?!1:Fn("weekday",n.weekday):Fn("week",n.week):Fn("weekYear",n.weekYear)}function Bv(n){const e=Vo(n.year),t=ci(n.ordinal,1,tl(n.year));return e?t?!1:Fn("ordinal",n.ordinal):Fn("year",n.year)}function Vg(n){const e=Vo(n.year),t=ci(n.month,1,12),i=ci(n.day,1,go(n.year,n.month));return e?t?i?!1:Fn("day",n.day):Fn("month",n.month):Fn("year",n.year)}function Hg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ci(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ci(t,0,59),r=ci(i,0,59),a=ci(s,0,999);return l?o?r?a?!1:Fn("millisecond",s):Fn("second",i):Fn("minute",t):Fn("hour",e)}const ar="Invalid DateTime",Fu=864e13;function Ul(n){return new Un("unsupported zone",`the zone "${n.name}" is not supported`)}function ur(n){return n.weekData===null&&(n.weekData=Jr(n.c)),n.weekData}function Hs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new ze({...t,...e,old:t})}function zg(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 Ru(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 co(n,e,t){return zg(Sa(n),e,t)}function qu(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,go(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.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=Sa(l);let[a,u]=zg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function zs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=ze.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return ze.invalid(new Un("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Wl(n,e,t=!0){return n.isValid?hn.create($t.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function fr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=jt(n.c.year,t?6:4),e?(i+="-",i+=jt(n.c.month),i+="-",i+=jt(n.c.day)):(i+=jt(n.c.month),i+=jt(n.c.day)),i}function ju(n,e,t,i,s,l){let o=jt(n.c.hour);return e?(o+=":",o+=jt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=jt(n.c.minute),(n.c.second!==0||!t)&&(o+=jt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=jt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=jt(Math.trunc(-n.o/60)),o+=":",o+=jt(Math.trunc(-n.o%60))):(o+="+",o+=jt(Math.trunc(n.o/60)),o+=":",o+=jt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Bg={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Uv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Wv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ug=["year","month","day","hour","minute","second","millisecond"],Yv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Kv=["year","ordinal","hour","minute","second","millisecond"];function Vu(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 J_(n);return e}function Hu(n,e){const t=Si(e.zone,Wt.defaultZone),i=$t.fromObject(e),s=Wt.now();let l,o;if(it(n.year))l=s;else{for(const u of Ug)it(n[u])&&(n[u]=Bg[u]);const r=Vg(n)||Hg(n);if(r)return ze.invalid(r);const a=t.offset(s);[l,o]=co(n,a,t)}return new ze({ts:l,zone:t,loc:i,o})}function zu(n,e,t){const i=it(t.round)?!0:t.round,s=(o,r)=>(o=wa(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 Bu(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 ze{constructor(e){const t=e.zone||Wt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Un("invalid input"):null)||(t.isValid?null:Ul(t));this.ts=it(e.ts)?Wt.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=Ru(this.ts,r),i=Number.isNaN(s.year)?new Un("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||$t.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new ze({})}static local(){const[e,t]=Bu(arguments),[i,s,l,o,r,a,u]=t;return Hu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Bu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=rn.utcInstance,Hu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=t0(e)?e.valueOf():NaN;if(Number.isNaN(i))return ze.invalid("invalid input");const s=Si(t.zone,Wt.defaultZone);return s.isValid?new ze({ts:i,zone:s,loc:$t.fromObject(t)}):ze.invalid(Ul(s))}static fromMillis(e,t={}){if(Qi(e))return e<-Fu||e>Fu?ze.invalid("Timestamp out of range"):new ze({ts:e,zone:Si(t.zone,Wt.defaultZone),loc:$t.fromObject(t)});throw new Ln(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Qi(e))return new ze({ts:e*1e3,zone:Si(t.zone,Wt.defaultZone),loc:$t.fromObject(t)});throw new Ln("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,Wt.defaultZone);if(!i.isValid)return ze.invalid(Ul(i));const s=Wt.now(),l=it(t.specificOffset)?i.offset(s):t.specificOffset,o=vo(e,Vu),r=!it(o.ordinal),a=!it(o.year),u=!it(o.month)||!it(o.day),f=a||u,d=o.weekYear||o.weekNumber,p=$t.fromObject(t);if((f||r)&&d)throw new Xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Xs("Can't mix ordinal dates with month/day");const m=d||o.weekday&&!f;let _,g,b=Ru(s,l);m?(_=Yv,g=Uv,b=Jr(b)):r?(_=Kv,g=Wv,b=rr(b)):(_=Ug,g=Bg);let k=!1;for(const A of _){const P=o[A];it(P)?k?o[A]=g[A]:o[A]=b[A]:k=!0}const w=m?zv(o):r?Bv(o):Vg(o),T=w||Hg(o);if(T)return ze.invalid(T);const C=m?Lu(o):r?Nu(o):o,[M,O]=co(C,l,i),D=new ze({ts:M,zone:i,o:O,loc:p});return o.weekday&&f&&e.weekday!==D.weekday?ze.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${D.toISO()}`):D}static fromISO(e,t={}){const[i,s]=rv(e);return zs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=av(e);return zs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=uv(e);return zs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new Ln("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=$t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Hv(o,e,t);return f?ze.invalid(f):zs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return ze.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=_v(e);return zs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Ln("need to specify a reason the DateTime is invalid");const i=e instanceof Un?e:new Un(e,t);if(Wt.throwOnInvalid)throw new Zb(i);return new ze({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?ur(this).weekYear:NaN}get weekNumber(){return this.isValid?ur(this).weekNumber:NaN}get weekday(){return this.isValid?ur(this).weekday:NaN}get ordinal(){return this.isValid?rr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Bl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Bl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Bl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Bl.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 Ml(this.year)}get daysInMonth(){return go(this.year,this.month)}get daysInYear(){return this.isValid?tl(this.year):NaN}get weeksInWeekYear(){return this.isValid?bo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=hn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(rn.instance(e),t)}toLocal(){return this.setZone(Wt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,Wt.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]=co(o,l,e)}return Hs(this,{ts:s,zone:e})}else return ze.invalid(Ul(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Hs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=vo(e,Vu),i=!it(t.weekYear)||!it(t.weekNumber)||!it(t.weekday),s=!it(t.ordinal),l=!it(t.year),o=!it(t.month)||!it(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Xs("Can't mix ordinal dates with month/day");let u;i?u=Lu({...Jr(this.c),...t}):it(t.ordinal)?(u={...this.toObject(),...t},it(t.day)&&(u.day=Math.min(go(u.year,u.month),u.day))):u=Nu({...rr(this.c),...t});const[f,d]=co(u,this.o,this.zone);return Hs(this,{ts:f,o:d})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return Hs(this,qu(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return Hs(this,qu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.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?hn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ar}toLocaleString(e=zr,t={}){return this.isValid?hn.create(this.loc.clone(t),e).formatDateTime(this):ar}toLocaleParts(e={}){return this.isValid?hn.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=fr(this,o);return r+="T",r+=ju(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?fr(this,e==="extended"):null}toISOWeekDate(){return Wl(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":"")+ju(this,o==="extended",t,e,i,l):null}toRFC2822(){return Wl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Wl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?fr(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")),Wl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ar}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 ot.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=n0(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Tv(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(ze.now(),e,t)}until(e){return this.isValid?Tt.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||ze.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(ze.isDateTime))throw new Ln("max requires all arguments be DateTimes");return yu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=$t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return Lg(o,e,t)}static fromStringExplain(e,t,i={}){return ze.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return zr}static get DATE_MED(){return Z_}static get DATE_MED_WITH_WEEKDAY(){return Qb}static get DATE_FULL(){return G_}static get DATE_HUGE(){return X_}static get TIME_SIMPLE(){return Q_}static get TIME_WITH_SECONDS(){return x_}static get TIME_WITH_SHORT_OFFSET(){return eg}static get TIME_WITH_LONG_OFFSET(){return tg}static get TIME_24_SIMPLE(){return ng}static get TIME_24_WITH_SECONDS(){return ig}static get TIME_24_WITH_SHORT_OFFSET(){return sg}static get TIME_24_WITH_LONG_OFFSET(){return lg}static get DATETIME_SHORT(){return og}static get DATETIME_SHORT_WITH_SECONDS(){return rg}static get DATETIME_MED(){return ag}static get DATETIME_MED_WITH_SECONDS(){return ug}static get DATETIME_MED_WITH_WEEKDAY(){return xb}static get DATETIME_FULL(){return fg}static get DATETIME_FULL_WITH_SECONDS(){return cg}static get DATETIME_HUGE(){return dg}static get DATETIME_HUGE_WITH_SECONDS(){return pg}}function Bs(n){if(ze.isDateTime(n))return n;if(n&&n.valueOf&&Qi(n.valueOf()))return ze.fromJSDate(n);if(n&&typeof n=="object")return ze.fromObject(n);throw new Ln(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Jv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Zv=[".mp4",".avi",".mov",".3gp",".wmv"],Gv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Xv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static 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||j.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 j.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.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){j.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]=j.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(!j.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)(!j.isObject(l)&&!Array.isArray(l)||!j.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)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):j.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||j.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}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 ze.fromFormat(e,i,{zone:"UTC"})}return ze.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.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!!Jv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Zv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Gv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Xv.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.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,d=r.height;return a.width=t,a.height=i,u.drawImage(r,f>d?(f-d)/2:0,0,f>d?d:f,f>d?d: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(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)j.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,d,p;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};e!=null&&e.isAuth&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!(e!=null&&e.$isView)||j.extractColumnsFromQuery((o=e==null?void 0:e.options)==null?void 0:o.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!(e!=null&&e.$isView)||j.extractColumnsFromQuery((r=e==null?void 0:e.options)==null?void 0:r.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const m of t){let _=null;m.type==="number"?_=123:m.type==="date"?_="2022-01-01 10:00:00.123Z":m.type==="bool"?_=!0:m.type==="email"?_="test@example.com":m.type==="url"?_="https://example.com":m.type==="json"?_="JSON":m.type==="file"?(_="filename.jpg",((a=m.options)==null?void 0:a.maxSelect)!==1&&(_=[_])):m.type==="select"?(_=(f=(u=m.options)==null?void 0:u.values)==null?void 0:f[0],((d=m.options)==null?void 0:d.maxSelect)!==1&&(_=[_])):m.type==="relation"?(_="RELATION_RECORD_ID",((p=m.options)==null?void 0:p.maxSelect)!==1&&(_=[_])):_="test",i[m.name]=_}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"view":return"ri-table-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";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":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["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)&&!j.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=j.isObject(u)&&j.findByKey(s,"id",u.id);if(!f)return!1;for(let d in f)if(JSON.stringify(u[d])!=JSON.stringify(f[d]))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==="base"?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_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample"],toolbar:"undo redo | styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample | code 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],d=u.create(a,o,f);u.add(d),e(d.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(j.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?j.plainText(r):r,s.push(j.truncate(r))):s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","email","username","heading","label","key","id"];for(const o of l)if(!j.isEmpty(e[o]))return e[o];return i}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return;let i=[t+"id"];if(e.$isView)for(let l of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+l);else e.$isAuth?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)j.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,d,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s+\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const b=(d=(f=g[1])==null?void 0:f.trim())==null?void 0:d.replace(l,"");b&&t.columns.push({name:b,collate:g[2]||"",sort:((p=g[3])==null?void 0:p.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+=`"${s.name}"`,s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+c.sort.toUpperCase()),l}).join(`, `),i.length>1&&(t+=` `),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}}const Bo=jn([]);function Wg(n,e=4e3){return Uo(n,"info",e)}function Yt(n,e=3e3){return Uo(n,"success",e)}function ml(n,e=4500){return Uo(n,"error",e)}function Qv(n,e=4500){return Uo(n,"warning",e)}function Uo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Yg(i)},t)};Bo.update(s=>(Ea(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function Yg(n){Bo.update(e=>(Ea(e,n),e))}function Da(){Bo.update(n=>{for(let e of n)Ea(n,e);return[]})}function Ea(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const ii=jn({});function gn(n){ii.set(n||{})}function mi(n){ii.update(e=>(j.deleteByPath(e,n),e))}const Aa=jn({});function Zr(n){Aa.set(n||{})}ya.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ii("/login")};ya.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&&ml(l)}if(j.isEmpty(s.data)||gn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ii("/")};class xv extends Y_{save(e,t){super.save(e,t),t instanceof ts&&Zr(t)}clear(){super.clear(),Zr(null)}}const me=new ya("../",new xv("pb_admin_auth"));me.authStore.model instanceof ts&&Zr(me.authStore.model);function ey(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=Pt(m,n,n[2],null);return{c(){e=y("div"),t=y("main"),_&&_.c(),i=E(),s=y("footer"),l=y("a"),l.innerHTML=` Docs`,o=E(),r=y("span"),r.textContent="|",a=E(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.14.0",h(t,"class","page-content"),h(l,"href","https://pocketbase.io/docs/"),h(l,"target","_blank"),h(l,"rel","noopener noreferrer"),h(r,"class","delimiter"),h(f,"class","txt"),h(u,"href","https://github.com/pocketbase/pocketbase/releases"),h(u,"target","_blank"),h(u,"rel","noopener noreferrer"),h(u,"title","Releases"),h(s,"class","page-footer"),h(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(g,b){$(g,e,b),v(e,t),_&&_.m(t,null),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(u,f),p=!0},p(g,[b]){_&&_.p&&(!p||b&4)&&Nt(_,m,g,g[2],p?Lt(m,g[2],b,null):Ft(g[2]),null),(!p||b&2&&d!==(d="page-wrapper "+g[1]))&&h(e,"class",d),(!p||b&3)&&x(e,"center-content",g[0])},i(g){p||(I(_,g),p=!0)},o(g){L(_,g),p=!1},d(g){g&&S(e),_&&_.d(g)}}}function ty(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 Mn extends ve{constructor(e){super(),be(this,e,ty,ey,ge,{center:0,class:1})}}function Uu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=``,t=E(),i=y("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){$(s,e,l),$(s,t,l),$(s,i,l)},d(s){s&&S(e),s&&S(t),s&&S(i)}}}function ny(n){let e,t,i,s=!n[0]&&Uu();const l=n[1].default,o=Pt(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=E(),o&&o.c(),h(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){$(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Uu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Nt(o,l,r,r[2],i?Lt(l,r[2],a,null):Ft(r[2]),null)},i(r){i||(I(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&S(e),s&&s.d(),o&&o.d(r)}}}function iy(n){let e,t;return e=new Mn({props:{class:"full-page",center:!0,$$slots:{default:[ny]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function sy(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 Kg extends ve{constructor(e){super(),be(this,e,sy,iy,ge,{nobranding:0})}}function Wo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ni(n,{delay:e=0,duration:t=400,easing:i=Wo,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),[d,p]=fu(s),[m,_]=fu(l);return{delay:e,duration:t,easing:i,css:(g,b)=>` transform: ${u} translate(${(1-g)*d}${p}, ${(1-g)*m}${_}); opacity: ${a-f*b}`}}function wt(n,{delay:e=0,duration:t=400,easing:i=Wo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${f[0]}`]),p=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),b=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*d}px;padding-${u[1]}: ${k*p}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*_}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*b}px;`}}function Et(n,{delay:e=0,duration:t=400,easing:i=Wo,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:(d,p)=>` transform: ${a} scale(${1-u*p}); opacity: ${r-f*p} `}}let Gr,zi;const Xr="app-tooltip";function Wu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Mi(){return zi=zi||document.querySelector("."+Xr),zi||(zi=document.createElement("div"),zi.classList.add(Xr),document.body.appendChild(zi)),zi}function Jg(n,e){let t=Mi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Qr();return}t.textContent=e.text,t.className=Xr+" 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 Qr(){clearTimeout(Gr),Mi().classList.remove("active"),Mi().activeNode=void 0}function ly(n,e){Mi().activeNode=n,clearTimeout(Gr),Gr=setTimeout(()=>{Mi().classList.add("active"),Jg(n,e)},isNaN(e.delay)?0:e.delay)}function Ue(n,e){let t=Wu(e);function i(){ly(n,t)}function s(){Qr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Mi(),{update(l){var o,r;t=Wu(l),(r=(o=Mi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Jg(n,t)},destroy(){var l,o;(o=(l=Mi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Qr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Yu(n,e,t){const i=n.slice();return i[12]=e[t],i}const oy=n=>({}),Ku=n=>({uniqueId:n[4]});function ry(n){let e,t,i=n[3],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=Ve(t,Et,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Et,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&S(e),a&&s&&s.end(),o=!1,r()}}}function Ju(n){let e,t,i=ko(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=U(i),l=E(),h(e,"class","help-block help-block-error")},m(a,u){$(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=ko(a[12])+"")&&le(s,i)},i(a){r||(a&&et(()=>{r&&(o||(o=Ve(e,wt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,wt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&S(e),a&&o&&o.end()}}}function uy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Pt(a,n,n[8],Ku),f=[ay,ry],d=[];function p(m,_){return m[0]&&m[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=E(),s.c(),h(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){$(m,e,_),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Nt(u,a,m,m[8],l?Lt(a,m[8],_,oy):Ft(m[8]),Ku);let g=i;i=p(m),i===g?d[i].p(m,_):(re(),L(d[g],1,1,()=>{d[g]=null}),ae(),s=d[i],s?s.p(m,_):(s=d[i]=f[i](m),s.c()),I(s,1),s.m(e,null)),(!l||_&2)&&h(e,"class",m[1]),(!l||_&10)&&x(e,"error",m[3].length)},i(m){l||(I(u,m),I(s),l=!0)},o(m){L(u,m),L(s),l=!1},d(m){m&&S(e),u&&u.d(m),d[i].d(),n[11](null),o=!1,r()}}}const Zu="Invalid value";function ko(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Zu:n||Zu}function fy(n,e,t){let i;Ke(n,ii,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){mi(r)}Zt(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function m(g){de.call(this,n,g)}function _(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=j.toArray(j.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,m,_]}class pe extends ve{constructor(e){super(),be(this,e,fy,uy,ge,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function cy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function dy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(d,p){$(d,e,p),v(e,t),$(d,s,p),$(d,l,p),ue(l,n[1]),$(d,r,p),$(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&h(e,"for",i),p&512&&o!==(o=d[9])&&h(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&S(e),d&&S(s),d&&S(l),d&&S(r),d&&S(a),u=!1,f()}}}function py(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Password confirm"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function my(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[cy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[dy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[py,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("button"),f.innerHTML=`Create and login `,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(_,g){$(_,e,g),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),V(a,e,null),v(e,u),v(e,f),d=!0,p||(m=J(e,"submit",pt(n[4])),p=!0)},p(_,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:_}),s.$set(b);const k={};g&1538&&(k.$$scope={dirty:g,ctx:_}),o.$set(k);const w={};g&1540&&(w.$$scope={dirty:g,ctx:_}),a.$set(w),(!d||g&8)&&x(f,"btn-disabled",_[3]),(!d||g&8)&&x(f,"btn-loading",_[3])},i(_){d||(I(s.$$.fragment,_),I(o.$$.fragment,_),I(a.$$.fragment,_),d=!0)},o(_){L(s.$$.fragment,_),L(o.$$.fragment,_),L(a.$$.fragment,_),d=!1},d(_){_&&S(e),H(s),H(o),H(a),p=!1,m()}}}function hy(n,e,t){const i=St();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(p){me.errorResponseHandler(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class _y extends ve{constructor(e){super(),be(this,e,hy,my,ge,{})}}function Gu(n){let e,t;return e=new Kg({props:{$$slots:{default:[gy]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gy(n){let e,t;return e=new _y({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:Q,i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function by(n){let e,t,i=n[0]&&Gu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),$(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&I(i,1)):(i=Gu(s),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(re(),L(i,1,1,()=>{i=null}),ae())},i(s){t||(I(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&S(e)}}}function vy(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Ii("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await an(),window.location.search=""}]}class yy extends ve{constructor(e){super(),be(this,e,vy,by,ge,{})}}const At=jn(""),wo=jn(""),Ms=jn(!1);function ky(n){let e,t,i,s;return{c(){e=y("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){$(l,e,o),n[13](e),ue(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&ue(e,l[7])},i:Q,o:Q,d(l){l&&S(e),n[13](null),i=!1,s()}}}function wy(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=Ot(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),$(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],ke(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Ot(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&S(i),e&&H(e,a)}}}function Xu(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Search',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){$(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=Ve(e,ni,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ni,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&S(e),s&&t&&t.end()}}}function Qu(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='Clear',h(e,"type","button"),h(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){$(o,e,r),i=!0,s||(l=J(e,"click",n[15]),s=!0)},p:Q,i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,ni,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,ni,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function Sy(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[wy,ky],m=[];function _(k,w){return k[4]&&!k[5]?0:1}l=_(n),o=m[l]=p[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&Xu(),b=(n[0].length||n[7].length)&&Qu(n);return{c(){e=y("form"),t=y("label"),i=y("i"),s=E(),o.c(),r=E(),g&&g.c(),a=E(),b&&b.c(),h(i,"class","ri-search-line"),h(t,"for",n[8]),h(t,"class","m-l-10 txt-xl"),h(e,"class","searchbar")},m(k,w){$(k,e,w),v(e,t),v(t,i),v(e,s),m[l].m(e,null),v(e,r),g&&g.m(e,null),v(e,a),b&&b.m(e,null),u=!0,f||(d=[J(e,"click",Cn(n[11])),J(e,"submit",pt(n[10]))],f=!0)},p(k,[w]){let T=l;l=_(k),l===T?m[l].p(k,w):(re(),L(m[T],1,1,()=>{m[T]=null}),ae(),o=m[l],o?o.p(k,w):(o=m[l]=p[l](k),o.c()),I(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?w&129&&I(g,1):(g=Xu(),g.c(),I(g,1),g.m(e,a)):g&&(re(),L(g,1,1,()=>{g=null}),ae()),k[0].length||k[7].length?b?(b.p(k,w),w&129&&I(b,1)):(b=Qu(k),b.c(),I(b,1),b.m(e,null)):b&&(re(),L(b,1,1,()=>{b=null}),ae())},i(k){u||(I(o),I(g),I(b),u=!0)},o(k){L(o),L(g),L(b),u=!1},d(k){k&&S(e),m[l].d(),g&&g.d(),b&&b.d(),f=!1,Ie(d)}}}function $y(n,e,t){const i=St(),s="search_"+j.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new _n}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,d,p="";function m(M=!0){t(7,p=""),M&&(d==null||d.focus()),i("clear")}function _(){t(0,l=p),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await ft(()=>import("./FilterAutocompleteInput-358e5ad3.js"),["./FilterAutocompleteInput-358e5ad3.js","./index-6f704b4c.js"],import.meta.url)).default),t(5,f=!1))}Zt(()=>{g()});function b(M){de.call(this,n,M)}function k(M){p=M,t(7,p),t(0,l)}function w(M){se[M?"unshift":"push"](()=>{d=M,t(6,d)})}function T(){p=this.value,t(7,p),t(0,l)}const C=()=>{m(!1),_()};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,p=l)},[l,o,r,a,u,f,d,p,s,m,_,b,k,w,T,C]}class Yo extends ve{constructor(e){super(),be(this,e,$y,Sy,ge,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Ty(n){let e,t,i,s;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Refresh"),h(e,"class","btn btn-transparent btn-circle svelte-1bvelc2"),x(e,"refreshing",n[1])},m(l,o){$(l,e,o),i||(s=[De(t=Ue.call(null,e,n[0])),J(e,"click",n[2])],i=!0)},p(l,[o]){t&&Ht(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&x(e,"refreshing",l[1])},i:Q,o:Q,d(l){l&&S(e),i=!1,Ie(s)}}}function Cy(n,e,t){const i=St();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 Zt(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Ia extends ve{constructor(e){super(),be(this,e,Cy,Ty,ge,{tooltip:0})}}function My(n){let e,t,i,s,l;const o=n[6].default,r=Pt(o,n,n[5],null);return{c(){e=y("th"),r&&r.c(),h(e,"tabindex","0"),h(e,"title",n[2]),h(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){$(a,e,u),r&&r.m(e,null),i=!0,s||(l=[J(e,"click",n[7]),J(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Nt(r,o,a,a[5],i?Lt(o,a[5],u,null):Ft(a[5]),null),(!i||u&4)&&h(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&h(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||(I(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&S(e),r&&r.d(a),s=!1,Ie(l)}}}function Oy(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(),d=p=>{(p.code==="Enter"||p.code==="Space")&&(p.preventDefault(),u())};return n.$$set=p=>{"class"in p&&t(1,l=p.class),"name"in p&&t(2,o=p.name),"sort"in p&&t(0,r=p.sort),"disable"in p&&t(3,a=p.disable),"$$scope"in p&&t(5,s=p.$$scope)},[r,l,o,a,u,s,i,f,d]}class Xt extends ve{constructor(e){super(),be(this,e,Oy,My,ge,{class:1,name:2,sort:0,disable:3})}}function Dy(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt txt-hint")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Ey(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("div"),i=U(n[2]),s=E(),l=y("div"),o=U(n[1]),r=U(" UTC"),h(t,"class","date"),h(l,"class","time svelte-zdiknu"),h(e,"class","datetime svelte-zdiknu")},m(a,u){$(a,e,u),v(e,t),v(t,i),v(e,s),v(e,l),v(l,o),v(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&S(e)}}}function Ay(n){let e;function t(l,o){return l[0]?Ey:Dy}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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:Q,o:Q,d(l){s.d(l),l&&S(e)}}}function Iy(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 hi extends ve{constructor(e){super(),be(this,e,Iy,Ay,ge,{date:0})}}const Py=n=>({}),xu=n=>({}),Ly=n=>({}),ef=n=>({});function Ny(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Pt(u,n,n[4],ef),d=n[5].default,p=Pt(d,n,n[4],null),m=n[5].after,_=Pt(m,n,n[4],xu);return{c(){e=y("div"),f&&f.c(),t=E(),i=y("div"),p&&p.c(),l=E(),_&&_.c(),h(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),h(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(g,b){$(g,e,b),f&&f.m(e,null),v(e,t),v(e,i),p&&p.m(i,null),n[6](i),v(e,l),_&&_.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(g,[b]){f&&f.p&&(!o||b&16)&&Nt(f,u,g,g[4],o?Lt(u,g[4],b,Ly):Ft(g[4]),ef),p&&p.p&&(!o||b&16)&&Nt(p,d,g,g[4],o?Lt(d,g[4],b,null):Ft(g[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+g[0]+" "+g[3]+" svelte-wc2j9h"))&&h(i,"class",s),_&&_.p&&(!o||b&16)&&Nt(_,m,g,g[4],o?Lt(m,g[4],b,Py):Ft(g[4]),xu)},i(g){o||(I(f,g),I(p,g),I(_,g),o=!0)},o(g){L(f,g),L(p,g),L(_,g),o=!1},d(g){g&&S(e),f&&f.d(g),p&&p.d(g),n[6](null),_&&_.d(g),r=!1,Ie(a)}}}function Fy(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 p=o.offsetWidth,m=o.scrollWidth;m-p?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+p==m&&t(3,r+=" scroll-end")):t(3,r="")},100))}Zt(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function d(p){se[p?"unshift":"push"](()=>{o=p,t(2,o)})}return n.$$set=p=>{"class"in p&&t(0,l=p.class),"$$scope"in p&&t(4,s=p.$$scope)},[l,f,o,r,s,i,d]}class Pa extends ve{constructor(e){super(),be(this,e,Fy,Ny,ge,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function tf(n,e,t){const i=n.slice();return i[23]=e[t],i}function Ry(n){let e;return{c(){e=y("div"),e.innerHTML=` Method`,h(e,"class","col-header-content")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function qy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="URL",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function jy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Referer",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function Vy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="User IP",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function Hy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Status",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function zy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function nf(n){let e;function t(l,o){return l[6]?Uy:By}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function By(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&sf(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){$(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=sf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&S(e),o&&o.d()}}}function Uy(n){let e;return{c(){e=y("tr"),e.innerHTML=` `},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function sf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function lf(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function of(n,e){var Ce,Je,ht;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,m,_,g,b,k,w=(e[23].referer||"N/A")+"",T,C,M,O,D,A=(e[23].userIp||"N/A")+"",P,N,R,F,q,B=e[23].status+"",Y,Z,ee,ie,X,fe,G,ce,he,Me,je=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((ht=e[23].meta)==null?void 0:ht.errorData))&&lf();ie=new hi({props:{date:e[23].created}});function He(){return e[17](e[23])}function we(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=U(l),a=E(),u=y("td"),f=y("span"),p=U(d),_=E(),je&&je.c(),g=E(),b=y("td"),k=y("span"),T=U(w),M=E(),O=y("td"),D=y("span"),P=U(A),R=E(),F=y("td"),q=y("span"),Y=U(B),Z=E(),ee=y("td"),z(ie.$$.fragment),X=E(),fe=y("td"),fe.innerHTML='',G=E(),h(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",m=e[23].url),h(u,"class","col-type-text col-field-url"),h(k,"class","txt txt-ellipsis"),h(k,"title",C=e[23].referer),x(k,"txt-hint",!e[23].referer),h(b,"class","col-type-text col-field-referer"),h(D,"class","txt txt-ellipsis"),h(D,"title",N=e[23].userIp),x(D,"txt-hint",!e[23].userIp),h(O,"class","col-type-number col-field-userIp"),h(q,"class","label"),x(q,"label-danger",e[23].status>=400),h(F,"class","col-type-number col-field-status"),h(ee,"class","col-type-date col-field-created"),h(fe,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Ze,We){$(Ze,t,We),v(t,i),v(i,s),v(s,o),v(t,a),v(t,u),v(u,f),v(f,p),v(u,_),je&&je.m(u,null),v(t,g),v(t,b),v(b,k),v(k,T),v(t,M),v(t,O),v(O,D),v(D,P),v(t,R),v(t,F),v(F,q),v(q,Y),v(t,Z),v(t,ee),V(ie,ee,null),v(t,X),v(t,fe),v(t,G),ce=!0,he||(Me=[J(t,"click",He),J(t,"keydown",we)],he=!0)},p(Ze,We){var qe,Qe,Kt;e=Ze,(!ce||We&8)&&l!==(l=((qe=e[23].method)==null?void 0:qe.toUpperCase())+"")&&le(o,l),(!ce||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&h(s,"class",r),(!ce||We&8)&&d!==(d=e[23].url+"")&&le(p,d),(!ce||We&8&&m!==(m=e[23].url))&&h(f,"title",m),(Qe=e[23].meta)!=null&&Qe.errorMessage||(Kt=e[23].meta)!=null&&Kt.errorData?je||(je=lf(),je.c(),je.m(u,null)):je&&(je.d(1),je=null),(!ce||We&8)&&w!==(w=(e[23].referer||"N/A")+"")&&le(T,w),(!ce||We&8&&C!==(C=e[23].referer))&&h(k,"title",C),(!ce||We&8)&&x(k,"txt-hint",!e[23].referer),(!ce||We&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&le(P,A),(!ce||We&8&&N!==(N=e[23].userIp))&&h(D,"title",N),(!ce||We&8)&&x(D,"txt-hint",!e[23].userIp),(!ce||We&8)&&B!==(B=e[23].status+"")&&le(Y,B),(!ce||We&8)&&x(q,"label-danger",e[23].status>=400);const te={};We&8&&(te.date=e[23].created),ie.$set(te)},i(Ze){ce||(I(ie.$$.fragment,Ze),ce=!0)},o(Ze){L(ie.$$.fragment,Ze),ce=!1},d(Ze){Ze&&S(t),je&&je.d(),H(ie),he=!1,Ie(Me)}}}function Wy(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O,D,A,P=[],N=new Map,R;function F(we){n[11](we)}let q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ry]},$$scope:{ctx:n}};n[1]!==void 0&&(q.sort=n[1]),s=new Xt({props:q}),se.push(()=>_e(s,"sort",F));function B(we){n[12](we)}let Y={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[qy]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),r=new Xt({props:Y}),se.push(()=>_e(r,"sort",B));function Z(we){n[13](we)}let ee={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[jy]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),f=new Xt({props:ee}),se.push(()=>_e(f,"sort",Z));function ie(we){n[14](we)}let X={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Vy]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),m=new Xt({props:X}),se.push(()=>_e(m,"sort",ie));function fe(we){n[15](we)}let G={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Hy]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),b=new Xt({props:G}),se.push(()=>_e(b,"sort",fe));function ce(we){n[16](we)}let he={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[zy]},$$scope:{ctx:n}};n[1]!==void 0&&(he.sort=n[1]),T=new Xt({props:he}),se.push(()=>_e(T,"sort",ce));let Me=n[3];const je=we=>we[23].id;for(let we=0;wel=!1)),s.$set(Je);const ht={};Ce&67108864&&(ht.$$scope={dirty:Ce,ctx:we}),!a&&Ce&2&&(a=!0,ht.sort=we[1],ke(()=>a=!1)),r.$set(ht);const Ze={};Ce&67108864&&(Ze.$$scope={dirty:Ce,ctx:we}),!d&&Ce&2&&(d=!0,Ze.sort=we[1],ke(()=>d=!1)),f.$set(Ze);const We={};Ce&67108864&&(We.$$scope={dirty:Ce,ctx:we}),!_&&Ce&2&&(_=!0,We.sort=we[1],ke(()=>_=!1)),m.$set(We);const te={};Ce&67108864&&(te.$$scope={dirty:Ce,ctx:we}),!k&&Ce&2&&(k=!0,te.sort=we[1],ke(()=>k=!1)),b.$set(te);const qe={};Ce&67108864&&(qe.$$scope={dirty:Ce,ctx:we}),!C&&Ce&2&&(C=!0,qe.sort=we[1],ke(()=>C=!1)),T.$set(qe),Ce&841&&(Me=we[3],re(),P=Dt(P,Ce,je,1,we,Me,N,A,un,of,null,tf),ae(),!Me.length&&He?He.p(we,Ce):Me.length?He&&(He.d(1),He=null):(He=nf(we),He.c(),He.m(A,null))),(!R||Ce&64)&&x(e,"table-loading",we[6])},i(we){if(!R){I(s.$$.fragment,we),I(r.$$.fragment,we),I(f.$$.fragment,we),I(m.$$.fragment,we),I(b.$$.fragment,we),I(T.$$.fragment,we);for(let Ce=0;Ce{if(N<=1&&g(),t(6,p=!1),t(5,f=F.page),t(4,d=F.totalItems),s("load",u.concat(F.items)),R){const q=++m;for(;F.items.length&&m==q;)t(3,u=u.concat(F.items.splice(0,10))),await j.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,p=!1),console.warn(F),g(),me.errorResponseHandler(F,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,d=0)}function b(N){a=N,t(1,a)}function k(N){a=N,t(1,a)}function w(N){a=N,t(1,a)}function T(N){a=N,t(1,a)}function C(N){a=N,t(1,a)}function M(N){a=N,t(1,a)}const O=N=>s("select",N),D=(N,R)=>{R.code==="Enter"&&(R.preventDefault(),s("select",N))},A=()=>t(0,o=""),P=()=>_(f+1);return n.$$set=N=>{"filter"in N&&t(0,o=N.filter),"presets"in N&&t(10,r=N.presets),"sort"in N&&t(1,a=N.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),_(1)),n.$$.dirty&24&&t(7,i=d>u.length)},[o,a,_,u,d,f,p,i,s,l,r,b,k,w,T,C,M,O,D,A,P]}class Jy extends ve{constructor(e){super(),be(this,e,Ky,Yy,ge,{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 oi(){}const Zy=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function yt(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 xe(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Rt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function An(n,e){return Rt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const Gy=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Zg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Ct(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let s,l,o;if(yt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Ei(n,e){return(uf[e]||(uf[e]=xy(e)))(n)}function xy(n){const e=e2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function e2(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 La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Rn=n=>typeof n<"u",Ai=n=>typeof n=="function",ff=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function t2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const It=Math.PI,_t=2*It,n2=_t+It,To=Number.POSITIVE_INFINITY,i2=It/180,Mt=It/2,Us=It/4,cf=It*2/3,Nn=Math.log10,ei=Math.sign;function df(n){const e=Math.round(n);n=sl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Nn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function s2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function sl(n,e,t){return Math.abs(n-e)=n}function Xg(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Fa(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Gi=(n,e,t,i)=>Fa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]Fa(n,t,i=>n[i][e]>=t);function u2(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+La(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 mf(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)&&(xg.forEach(l=>{delete n[l]}),delete n._chartjs)}function e1(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function n1(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,t1.call(window,()=>{s=!1,n.apply(e,l)}))}}function c2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const d2=n=>n==="start"?"left":n==="end"?"right":"center",hf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function i1(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:d,maxDefined:p}=o.getUserBounds();d&&(s=Qt(Math.min(Gi(r,o.axis,u).lo,t?i:Gi(e,a,o.getPixelForValue(u)).lo),0,i-1)),p?l=Qt(Math.max(Gi(r,o.axis,f,!0).hi+1,t?0:Gi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function s1(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 Yl=n=>n===0||n===1,_f=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*_t/t)),gf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*_t/t)+1,ll={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*Mt)+1,easeOutSine:n=>Math.sin(n*Mt),easeInOutSine:n=>-.5*(Math.cos(It*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=>Yl(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=>Yl(n)?n:_f(n,.075,.3),easeOutElastic:n=>Yl(n)?n:gf(n,.075,.3),easeInOutElastic(n){return Yl(n)?n:n<.5?.5*_f(n*2,.1125,.45):.5+.5*gf(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-ll.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?ll.easeInBounce(n*2)*.5:ll.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 Al(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function xs(n){return $i(Al(n*2.55),0,255)}function Oi(n){return $i(Al(n*255),0,255)}function ui(n){return $i(Al(n/2.55)/100,0,1)}function bf(n){return $i(Al(n*100),0,100)}const En={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},ea=[..."0123456789ABCDEF"],p2=n=>ea[n&15],m2=n=>ea[(n&240)>>4]+ea[n&15],Kl=n=>(n&240)>>4===(n&15),h2=n=>Kl(n.r)&&Kl(n.g)&&Kl(n.b)&&Kl(n.a);function _2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&En[n[1]]*17,g:255&En[n[2]]*17,b:255&En[n[3]]*17,a:e===5?En[n[4]]*17:255}:(e===7||e===9)&&(t={r:En[n[1]]<<4|En[n[2]],g:En[n[3]]<<4|En[n[4]],b:En[n[5]]<<4|En[n[6]],a:e===9?En[n[7]]<<4|En[n[8]]:255})),t}const g2=(n,e)=>n<255?e(n):"";function b2(n){var e=h2(n)?p2:m2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+g2(n.a,e):void 0}const v2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function l1(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 y2(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 k2(n,e,t){const i=l1(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 w2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=w2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function qa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Oi)}function ja(n,e,t){return qa(l1,n,e,t)}function S2(n,e,t){return qa(k2,n,e,t)}function $2(n,e,t){return qa(y2,n,e,t)}function o1(n){return(n%360+360)%360}function T2(n){const e=v2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?xs(+e[5]):Oi(+e[5]));const s=o1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=S2(s,l,o):e[1]==="hsv"?i=$2(s,l,o):i=ja(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function C2(n,e){var t=Ra(n);t[0]=o1(t[0]+e),t=ja(t),n.r=t[0],n.g=t[1],n.b=t[2]}function M2(n){if(!n)return;const e=Ra(n),t=e[0],i=bf(e[1]),s=bf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ui(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const vf={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"},yf={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 O2(){const n={},e=Object.keys(yf),t=Object.keys(vf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Jl;function D2(n){Jl||(Jl=O2(),Jl.transparent=[0,0,0,0]);const e=Jl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const E2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function A2(n){const e=E2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?xs(o):$i(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?xs(i):$i(i,0,255)),s=255&(e[4]?xs(s):$i(s,0,255)),l=255&(e[6]?xs(l):$i(l,0,255)),{r:i,g:s,b:l,a:t}}}function I2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ui(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const cr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hs=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function P2(n,e,t){const i=hs(ui(n.r)),s=hs(ui(n.g)),l=hs(ui(n.b));return{r:Oi(cr(i+t*(hs(ui(e.r))-i))),g:Oi(cr(s+t*(hs(ui(e.g))-s))),b:Oi(cr(l+t*(hs(ui(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Zl(n,e,t){if(n){let i=Ra(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=ja(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function r1(n,e){return n&&Object.assign(e||{},n)}function kf(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=Oi(n[3]))):(e=r1(n,{r:0,g:0,b:0,a:1}),e.a=Oi(e.a)),e}function L2(n){return n.charAt(0)==="r"?A2(n):T2(n)}class Co{constructor(e){if(e instanceof Co)return e;const t=typeof e;let i;t==="object"?i=kf(e):t==="string"&&(i=_2(e)||D2(e)||L2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=r1(this._rgb);return e&&(e.a=ui(e.a)),e}set rgb(e){this._rgb=kf(e)}rgbString(){return this._valid?I2(this._rgb):void 0}hexString(){return this._valid?b2(this._rgb):void 0}hslString(){return this._valid?M2(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=P2(this._rgb,e._rgb,t)),this}clone(){return new Co(this.rgb)}alpha(e){return this._rgb.a=Oi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Al(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 Zl(this._rgb,2,e),this}darken(e){return Zl(this._rgb,2,-e),this}saturate(e){return Zl(this._rgb,1,e),this}desaturate(e){return Zl(this._rgb,1,-e),this}rotate(e){return C2(this._rgb,e),this}}function a1(n){return new Co(n)}function u1(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function wf(n){return u1(n)?n:a1(n)}function dr(n){return u1(n)?n:a1(n).saturate(.5).darken(.1).hexString()}const ns=Object.create(null),ta=Object.create(null);function ol(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.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)=>dr(i.backgroundColor),this.hoverBorderColor=(t,i)=>dr(i.borderColor),this.hoverColor=(t,i)=>dr(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 pr(this,e,t)}get(e){return ol(this,e)}describe(e,t){return pr(ta,e,t)}override(e,t){return pr(ns,e,t)}route(e,t,i,s){const l=ol(this,e),o=ol(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 xe(a)?Object.assign({},u,a):st(a,u)},set(a){this[r]=a}}})}}var lt=new N2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function F2(n){return!n||dt(n.size)||dt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Mo(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 R2(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,d,p;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function bl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,H2(n,l),a=0;a+n||0;function za(n,e){const t={},i=xe(e),s=i?Object.keys(e):e,l=xe(n)?i?o=>st(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=Y2(l(o));return t}function f1(n){return za(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ws(n){return za(n,["topLeft","topRight","bottomLeft","bottomRight"])}function qn(n){const e=f1(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $n(n,e){n=n||{},e=e||lt.font;let t=st(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=st(n.style,e.style);i&&!(""+i).match(U2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:st(n.family,e.family),lineHeight:W2(st(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:st(n.weight,e.weight),string:""};return s.string=F2(s),s}function Gl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Pi(n,e){return Object.assign(Object.create(n),e)}function Ba(n,e=[""],t=n,i,s=()=>n[0]){Rn(i)||(i=m1("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ba([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 d1(o,r,()=>tk(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Tf(o).includes(r)},ownKeys(o){return Tf(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:c1(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 d1(l,o,()=>Z2(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 c1(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:Ai(t)?t:()=>t,isIndexable:Ai(i)?i:()=>i}}const J2=(n,e)=>n?n+La(e):e,Ua=(n,e)=>xe(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function d1(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function Z2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Ai(r)&&o.isScriptable(e)&&(r=G2(e,r,n,t)),yt(r)&&r.length&&(r=X2(e,r,n,o.isIndexable)),Ua(e,r)&&(r=Ds(r,s,l&&l[e],o)),r}function G2(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),Ua(n,e)&&(e=Wa(s._scopes,s,n,e)),e}function X2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Rn(l.index)&&i(n))e=e[l.index%e.length];else if(xe(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const d=Wa(u,s,n,f);e.push(Ds(d,l,o&&o[n],r))}}return e}function p1(n,e,t){return Ai(n)?n(e,t):n}const Q2=(n,e)=>n===!0?e:typeof n=="string"?Ei(e,n):void 0;function x2(n,e,t,i,s){for(const l of e){const o=Q2(t,l);if(o){n.add(o);const r=p1(o._fallback,t,s);if(Rn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Rn(i)&&t!==i)return null}return!1}function Wa(n,e,t,i){const s=e._rootScopes,l=p1(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||Rn(l)&&l!==t&&(a=$f(r,o,l,a,i),a===null)?!1:Ba(Array.from(r),[""],s,l,()=>ek(e,t,i))}function $f(n,e,t,i,s){for(;t;)t=x2(n,e,t,i,s);return t}function ek(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return yt(s)&&xe(t)?t:s}function tk(n,e,t,i){let s;for(const l of e)if(s=m1(J2(l,n),t),Rn(s))return Ua(n,s)?Wa(t,i,n,s):s}function m1(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Rn(i))return i}}function Tf(n){let e=n._keys;return e||(e=n._keys=nk(n._scopes)),e}function nk(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 h1(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;ren==="x"?"y":"x";function sk(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=xr(l,s),a=xr(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const d=i*u,p=i*f;return{previous:{x:l.x-d*(o.x-s.x),y:l.y-d*(o.y-s.y)},next:{x:l.x+p*(o.x-s.x),y:l.y+p*(o.y-s.y)}}}function lk(n,e,t){const i=n.length;let s,l,o,r,a,u=Es(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")rk(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function fk(n,e){return Ko(n).getPropertyValue(e)}const ck=["top","right","bottom","left"];function xi(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=ck[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const dk=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function pk(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(dk(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 Ki(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Ko(t),l=s.boxSizing==="border-box",o=xi(s,"padding"),r=xi(s,"border","width"),{x:a,y:u,box:f}=pk(n,t),d=o.left+(f&&r.left),p=o.top+(f&&r.top);let{width:m,height:_}=e;return l&&(m-=o.width+r.width,_-=o.height+r.height),{x:Math.round((a-d)/m*t.width/i),y:Math.round((u-p)/_*t.height/i)}}function mk(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ya(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Ko(l),a=xi(r,"border","width"),u=xi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Eo(r.maxWidth,l,"clientWidth"),s=Eo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||To,maxHeight:s||To}}const mr=n=>Math.round(n*10)/10;function hk(n,e,t,i){const s=Ko(n),l=xi(s,"margin"),o=Eo(s.maxWidth,n,"clientWidth")||To,r=Eo(s.maxHeight,n,"clientHeight")||To,a=mk(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const d=xi(s,"border","width"),p=xi(s,"padding");u-=p.width+d.width,f-=p.height+d.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=mr(Math.min(u,o,a.maxWidth)),f=mr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=mr(u/2)),{width:u,height:f}}function Cf(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 _k=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 Mf(n,e){const t=fk(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ji(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function gk(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 bk(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Ji(n,s,t),r=Ji(s,l,t),a=Ji(l,e,t),u=Ji(o,r,t),f=Ji(r,a,t);return Ji(u,f,t)}const Of=new Map;function vk(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Of.get(t);return i||(i=new Intl.NumberFormat(n,e),Of.set(t,i)),i}function Il(n,e,t){return vk(e,t).format(n)}const yk=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}}},kk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function hr(n,e,t){return n?yk(e,t):kk()}function wk(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 Sk(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function b1(n){return n==="angle"?{between:_l,compare:o2,normalize:Sn}:{between:gl,compare:(e,t)=>e-t,normalize:e=>e}}function Df({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 $k(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=b1(i),a=e.length;let{start:u,end:f,loop:d}=n,p,m;if(d){for(u+=a,f+=a,p=0,m=a;pa(s,T,k)&&r(s,T)!==0,M=()=>r(l,k)===0||a(l,T,k),O=()=>g||C(),D=()=>!g||M();for(let A=f,P=f;A<=d;++A)w=e[A%o],!w.skip&&(k=u(w[i]),k!==T&&(g=a(k,s,l),b===null&&O()&&(b=r(k,s)===0?A:P),b!==null&&D()&&(_.push(Df({start:b,end:A,loop:p,count:o,style:m})),b=null),P=A,T=k));return b!==null&&_.push(Df({start:b,end:d,loop:p,count:o,style:m})),_}function y1(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function Ck(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 Mk(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Tk(t,s,l,i);if(i===!0)return Ef(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=t1.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 ri=new Ek;const If="transparent",Ak={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=wf(n||If),s=i.valid&&wf(e||If);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Ik{constructor(e,t,i,s){const l=t[i];s=Gl([e.to,s,l,e.from]);const o=Gl([e.from,l,s]);this._active=!0,this._fn=e.fn||Ak[e.type||typeof o],this._easing=ll[e.easing]||ll.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=Gl([e.to,t,s,e.from]),this._from=Gl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:Lk},numbers:{type:"number",properties:Pk}});lt.describe("animations",{_fallback:"animation"});lt.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 k1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!xe(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!xe(s))return;const l={};for(const o of Nk)l[o]=s[o];(yt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Rk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Fk(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 d=l[u];const p=i.get(u);if(d)if(p&&d.active()){d.update(p,f,r);continue}else d.cancel();if(!p||!p.duration){e[u]=f;continue}l[u]=d=new Ik(p,e,u,f),s.push(d)}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 ri.add(this._chart,i),!0}}function Fk(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function Rf(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=Hk(l,o,i),d=e.length;let p;for(let m=0;mt[i].axis===e).shift()}function Uk(n,e){return Pi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Wk(n,e,t){return Pi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ws(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 gr=n=>n==="reset"||n==="none",qf=(n,e)=>e?n:Object.assign({},n),Yk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:w1(t,!0),values:null};class Jn{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=Nf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Ws(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(d,p,m,_)=>d==="x"?p:d==="r"?_:m,l=t.xAxisID=st(i.xAxisID,_r(e,"x")),o=t.yAxisID=st(i.yAxisID,_r(e,"y")),r=t.rAxisID=st(i.rAxisID,_r(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&&mf(this._data,this),e._stacked&&Ws(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(xe(t))this._data=Vk(t);else if(i!==t){if(i){mf(i,this);const s=this._cachedMeta;Ws(s),s._parsed=[]}t&&Object.isExtensible(t)&&f2(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=Nf(t.vScale,t),t.stack!==i.stack&&(s=!0,Ws(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Rf(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,d,p;if(this._parsing===!1)i._parsed=s,i._sorted=!0,p=s;else{yt(s[e])?p=this.parseArrayData(i,s,e,t):xe(s[e])?p=this.parseObjectData(i,s,e,t):p=this.parsePrimitiveData(i,s,e,t);const m=()=>d[r]===null||u&&d[r]g||d=0;--p)if(!_()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),g=u.resolveNamedOptions(p,m,_,d);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(qf(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,d=f.datasetAnimationScopeKeys(this._type,t),p=f.getOptionScopes(this.getDataset(),d);a=f.createResolver(p,this.getContext(e,i,t))}const u=new k1(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||gr(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){gr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!gr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function Jk(n){const e=n.iScale,t=Kk(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Rn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.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 S1(n,e,t,i){return yt(n)?Xk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function jf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,d,p;for(u=t,f=t+i;u=t?1:-1)}function xk(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(dt(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=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,d=r.axis;for(let p=t;p_l(T,r,a,!0)?1:Math.max(C,C*t,M,M*t),_=(T,C,M)=>_l(T,r,a,!0)?-1:Math.min(C,C*t,M,M*t),g=m(0,u,d),b=m(Mt,f,p),k=_(It,u,d),w=_(It+Mt,f,p);i=(g-k)/2,s=(b-w)/2,l=-(g+k)/2,o=-(b+w)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Pl extends Jn{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(xe(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ei(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?_t*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(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;sn!=="spacing",_indexable:n=>n!=="spacing"};Pl.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 yt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Jo extends Jn{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}=i1(t,s,o);this._drawStart=r,this._drawCount=a,s1(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:d}=this._getSharedOptions(t,s),p=o.axis,m=r.axis,{spanGaps:_,segment:g}=this.options,b=Os(_)?_:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let w=t>0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs(M[p]-w[p])>b,g&&(O.parsed=M,O.raw=u.data[T]),d&&(O.options=f||this.resolveDataElementOptions(T,C.active?"active":s)),k||this.updateElement(C,T,O,s),w=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()}}Jo.id="line";Jo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Jo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Za extends Jn{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=Il(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return h1.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)&&(lt.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,d=u.yCenter,p=u.getIndexAngle(0)-.5*It;let m=p,_;const g=360/this.countVisibleElements();for(_=0;_{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Wn(this.resolveDataElementOptions(e,t).angle||i):0}}Za.id="polarArea";Za.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Za.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 $1 extends Pl{}$1.id="pie";$1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ga extends Jn{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 h1.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{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};gi.defaults={};gi.defaultRoutes=void 0;const T1={values(n){return yt(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=sw(n,t)}const o=Nn(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),Il(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Nn(n)));return i===1||i===2||i===5?T1.numeric.call(this,n,e,t):""}};function sw(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 Zo={formatters:T1};lt.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:Zo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});lt.route("scale.ticks","color","","color");lt.route("scale.grid","color","","borderColor");lt.route("scale.grid","borderColor","","borderColor");lt.route("scale.title","color","","color");lt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});lt.describe("scales",{_fallback:"scale"});lt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function lw(n,e){const t=n.options.ticks,i=t.maxTicksLimit||ow(n),s=t.major.enabled?aw(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return uw(e,a,s,l/i),a;const u=rw(s,e,i);if(l>0){let f,d;const p=l>1?Math.round((r-o)/(l-1)):null;for(Ql(e,a,u,dt(p)?0:o-p,o),f=0,d=l-1;fs)return a}return Math.max(s,1)}function aw(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,zf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Bf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function pw(n,e){mt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:An(t,An(i,t)),max:An(i,An(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(){Ct(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=K2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),d=f.widest.width,p=f.highest.height,m=Qt(this.chart.width-d,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),d+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ys(e.grid)-t.padding-Uf(e.title,this.chart.options.font),u=Math.sqrt(d*d+p*p),o=Na(Math.min(Math.asin(Qt((f.highest.height+6)/r,-1,1)),Math.asin(Qt(a/u,-1,1))-Math.asin(Qt(p/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ct(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ct(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=Uf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ys(l)+a):(e.height=this.maxHeight,e.width=Ys(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:d,highest:p}=this._getLabelSizes(),m=i.padding*2,_=Wn(this.labelRotation),g=Math.cos(_),b=Math.sin(_);if(r){const k=i.mirror?0:b*d.width+g*p.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*d.width+b*p.height;e.width=Math.min(this.maxWidth,e.width+k+m)}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,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,m=0;a?u?(p=s*e.width,m=i*t.height):(p=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?p=e.width:l!=="inner"&&(p=e.width/2,m=t.width/2),this.paddingLeft=Math.max((p-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-d+o)*this.width/(this.width-d),0)}else{let f=t.height/2,d=e.height/2;l==="start"?(f=0,d=e.height):l==="end"&&(f=t.height,d=0),this.paddingTop=f+o,this.paddingBottom=d+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(){Ct(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[D]||0,height:o[D]||0});return{first:O(0),last:O(t-1),widest:O(C),highest:O(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 r2(this._alignToPixels?Bi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),d=Ys(l),p=[],m=l.setContext(this.getContext()),_=m.drawBorder?m.borderWidth:0,g=_/2,b=function(Y){return Bi(i,Y,_)};let k,w,T,C,M,O,D,A,P,N,R,F;if(o==="top")k=b(this.bottom),O=this.bottom-d,A=k-g,N=b(e.top)+g,F=e.bottom;else if(o==="bottom")k=b(this.top),N=e.top,F=b(e.bottom)-g,O=k+g,A=this.top+d;else if(o==="left")k=b(this.right),M=this.right-d,D=k-g,P=b(e.left)+g,R=e.right;else if(o==="right")k=b(this.left),P=e.left,R=b(e.right)-g,M=k+g,D=this.left+d;else if(t==="x"){if(o==="center")k=b((e.top+e.bottom)/2+.5);else if(xe(o)){const Y=Object.keys(o)[0],Z=o[Y];k=b(this.chart.scales[Y].getPixelForValue(Z))}N=e.top,F=e.bottom,O=k+g,A=O+d}else if(t==="y"){if(o==="center")k=b((e.left+e.right)/2);else if(xe(o)){const Y=Object.keys(o)[0],Z=o[Y];k=b(this.chart.scales[Y].getPixelForValue(Z))}M=k-g,D=M-d,P=e.left,R=e.right}const q=st(s.ticks.maxTicksLimit,f),B=Math.max(1,Math.ceil(f/q));for(w=0;wl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(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{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");lt.route(l,s,a,r)})}function yw(n){return"id"in n&&"defaults"in n}class kw{constructor(){this.controllers=new xl(Jn,"datasets",!0),this.elements=new xl(gi,"elements"),this.plugins=new xl(Object,"plugins"),this.scales=new xl(ls,"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):mt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=La(e);Ct(i["before"+s],[],i),t[e](i),Ct(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs(O[m]-T[m])>k,b&&(D.parsed=O,D.raw=u.data[C]),p&&(D.options=d||this.resolveDataElementOptions(C,M.active?"active":s)),w||this.updateElement(M,C,D,s),T=O}this.updateSharedOptions(d,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}}Xa.id="scatter";Xa.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Xa.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Ui(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ia{constructor(e){this.options=e||{}}init(e){}formats(){return Ui()}parse(e,t){return Ui()}format(e,t){return Ui()}add(e,t,i){return Ui()}diff(e,t,i){return Ui()}startOf(e,t,i){return Ui()}endOf(e,t){return Ui()}}ia.override=function(n){Object.assign(ia.prototype,n)};var C1={_date:ia};function ww(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?a2:Gi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const d=a(l,e,t-f),p=a(l,e,t+f);return{lo:d.lo,hi:p.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Ll(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{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 Cw={evaluateInteractionItems:Ll,modes:{index(n,e,t,i){const s=Ki(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?vr(n,s,l,i,o):yr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,d=u.data[f];d&&!d.skip&&a.push({element:d,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Ki(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?vr(n,s,l,i,o):yr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Yf(n,e){return n.filter(t=>M1.indexOf(t.pos)===-1&&t.box.axis===e)}function Js(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 Mw(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Js(Ks(e,"left"),!0),s=Js(Ks(e,"right")),l=Js(Ks(e,"top"),!0),o=Js(Ks(e,"bottom")),r=Yf(e,"x"),a=Yf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ks(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Kf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function O1(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 Aw(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!xe(s)){t.size&&(n[s]-=t.size);const d=i[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?l.height:l.width),t.size=d.size/d.count,n[s]+=t.size}l.getPadding&&O1(o,l.getPadding());const r=Math.max(0,e.outerWidth-Kf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Kf(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 Iw(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 Pw(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 el(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),p=Object.assign({},s);O1(p,qn(i));const m=Object.assign({maxPadding:p,w:l,h:o,x:s.left,y:s.top},s),_=Dw(a.concat(u),d);el(r.fullSize,m,d,_),el(a,m,d,_),el(u,m,d,_)&&el(a,m,d,_),Iw(m),Jf(r.leftAndTop,m,d,_),m.x+=m.w,m.y+=m.h,Jf(r.rightAndBottom,m,d,_),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},mt(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class D1{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 Lw extends D1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const po="$chartjs",Nw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zf=n=>n===null||n==="";function Fw(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[po]={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=Mf(n,"width");l!==void 0&&(n.width=l)}if(Zf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Mf(n,"height");l!==void 0&&(n.height=l)}return n}const E1=_k?{passive:!0}:!1;function Rw(n,e,t){n.addEventListener(e,t,E1)}function qw(n,e,t){n.canvas.removeEventListener(e,t,E1)}function jw(n,e){const t=Nw[n.type]||n.type,{x:i,y:s}=Ki(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Ao(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function Vw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Ao(r.addedNodes,i),o=o&&!Ao(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function Hw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Ao(r.removedNodes,i),o=o&&!Ao(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const vl=new Map;let Gf=0;function A1(){const n=window.devicePixelRatio;n!==Gf&&(Gf=n,vl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function zw(n,e){vl.size||window.addEventListener("resize",A1),vl.set(n,e)}function Bw(n){vl.delete(n),vl.size||window.removeEventListener("resize",A1)}function Uw(n,e,t){const i=n.canvas,s=i&&Ya(i);if(!s)return;const l=n1((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),zw(n,l),o}function kr(n,e,t){t&&t.disconnect(),e==="resize"&&Bw(n)}function Ww(n,e,t){const i=n.canvas,s=n1(l=>{n.ctx!==null&&t(jw(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return Rw(i,e,s),s}class Yw extends D1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Fw(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[po])return!1;const i=t[po].initial;["height","width"].forEach(l=>{const o=i[l];dt(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[po],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:Vw,detach:Hw,resize:Uw}[t]||Ww;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:kr,detach:kr,resize:kr}[t]||qw)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return hk(e,t,i,s)}isAttached(e){const t=Ya(e);return!!(t&&t.isConnected)}}function Kw(n){return!g1()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Lw:Yw}class Jw{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(Ct(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){dt(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=st(i.options&&i.options.plugins,{}),l=Zw(i);return s===!1&&!t?[]:Xw(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 Zw(n){const e={},t=[],i=Object.keys(xn.plugins.items);for(let l=0;l{const a=i[r];if(!xe(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=la(r,a),f=e3(u,s),d=t.scales||{};l[u]=l[u]||r,o[r]=il(Object.create(null),[{axis:u},a,d[u],d[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||sa(a,e),d=(ns[a]||{}).scales||{};Object.keys(d).forEach(p=>{const m=xw(p,u),_=r[m+"AxisID"]||l[m]||m;o[_]=o[_]||Object.create(null),il(o[_],[{axis:m},i[_],d[p]])})}),Object.keys(o).forEach(r=>{const a=o[r];il(a,[lt.scales[a.type],lt.scale])}),o}function I1(n){const e=n.options||(n.options={});e.plugins=st(e.plugins,{}),e.scales=n3(n,e)}function P1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function i3(n){return n=n||{},n.data=P1(n.data),I1(n),n}const Xf=new Map,L1=new Set;function no(n,e){let t=Xf.get(n);return t||(t=e(),Xf.set(n,t),L1.add(t)),t}const Zs=(n,e,t)=>{const i=Ei(e,t);i!==void 0&&n.add(i)};class s3{constructor(e){this._config=i3(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=P1(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(),I1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return no(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return no(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return no(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return no(`${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(d=>Zs(a,e,d))),f.forEach(d=>Zs(a,s,d)),f.forEach(d=>Zs(a,ns[l]||{},d)),f.forEach(d=>Zs(a,lt,d)),f.forEach(d=>Zs(a,ta,d))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),L1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,ns[t]||{},lt.datasets[t]||{},{type:t},lt,ta]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Qf(this._resolverCache,e,s);let a=o;if(o3(o,t)){l.$shared=!1,i=Ai(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}=Qf(this._resolverCache,e,i);return xe(t)?Ds(l,t,void 0,s):l}}function Qf(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:Ba(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const l3=n=>xe(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Ai(n[t]),!1);function o3(n,e){const{isScriptable:t,isIndexable:i}=c1(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Ai(r)||l3(r))||o&&yt(r))return!0}return!1}var r3="3.9.1";const a3=["top","bottom","left","right","chartArea"];function xf(n,e){return n==="top"||n==="bottom"||a3.indexOf(n)===-1&&e==="x"}function ec(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function tc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ct(t&&t.onComplete,[n],e)}function u3(n){const e=n.chart,t=e.options.animation;Ct(t&&t.onProgress,[n],e)}function N1(n){return g1()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Io={},F1=n=>{const e=N1(n);return Object.values(Io).filter(t=>t.canvas===e).pop()};function f3(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 c3(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Po{constructor(e,t){const i=this.config=new s3(t),s=N1(e),l=F1(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||Kw(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=Zy(),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 Jw,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=c2(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Io[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ri.listen(this,"complete",tc),ri.listen(this,"progress",u3),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return dt(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():Cf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Sf(this.canvas,this.ctx),this}stop(){return ri.stop(this),this}resize(e,t){ri.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,Cf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Ct(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};mt(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=la(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),mt(l,o=>{const r=o.options,a=r.id,u=la(a,r),f=st(r.type,o.dtype);(r.position===void 0||xf(r.position,u)!==xf(o.dposition))&&(r.position=o.dposition),s[a]=!0;let d=null;if(a in i&&i[a].type===f)d=i[a];else{const p=xn.getScale(f);d=new p({id:a,type:f,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(r,e)}),mt(s,(o,r)=>{o||delete i[r]}),mt(i,o=>{to.configure(this,o,o.options),to.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(ec("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){mt(this.scales,e=>{to.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!ff(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;f3(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;to.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],mt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Va(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&&Ha(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return bl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Cw.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=Pi(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);Rn(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(),ri.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};mt(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(){mt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},mt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!So(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(d=>f.datasetIndex===d.datasetIndex&&f.index===d.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=t2(e),u=c3(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Ct(l.onHover,[e,r,this],this),a&&Ct(l.onClick,[e,r,this],this));const f=!So(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 nc=()=>mt(Po.instances,n=>n._plugins.invalidate()),ki=!0;Object.defineProperties(Po,{defaults:{enumerable:ki,value:lt},instances:{enumerable:ki,value:Io},overrides:{enumerable:ki,value:ns},registry:{enumerable:ki,value:xn},version:{enumerable:ki,value:r3},getChart:{enumerable:ki,value:F1},register:{enumerable:ki,value:(...n)=>{xn.add(...n),nc()}},unregister:{enumerable:ki,value:(...n)=>{xn.remove(...n),nc()}}});function R1(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+Mt,i-Mt),n.closePath(),n.clip()}function d3(n){return za(n,["outerStart","outerEnd","innerStart","innerEnd"])}function p3(n,e,t,i){const s=d3(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 Qt(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Qt(s.innerStart,0,o),innerEnd:Qt(s.innerEnd,0,o)}}function _s(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function oa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,d=Math.max(e.outerRadius+i+t-u,0),p=f>0?f+i+t+u:0;let m=0;const _=s-a;if(i){const Y=f>0?f-i:0,Z=d>0?d-i:0,ee=(Y+Z)/2,ie=ee!==0?_*ee/(ee+i):_;m=(_-ie)/2}const g=Math.max(.001,_*d-t/It)/d,b=(_-g)/2,k=a+b+m,w=s-b-m,{outerStart:T,outerEnd:C,innerStart:M,innerEnd:O}=p3(e,p,d,w-k),D=d-T,A=d-C,P=k+T/D,N=w-C/A,R=p+M,F=p+O,q=k+M/R,B=w-O/F;if(n.beginPath(),l){if(n.arc(o,r,d,P,N),C>0){const ee=_s(A,N,o,r);n.arc(ee.x,ee.y,C,N,w+Mt)}const Y=_s(F,w,o,r);if(n.lineTo(Y.x,Y.y),O>0){const ee=_s(F,B,o,r);n.arc(ee.x,ee.y,O,w+Mt,B+Math.PI)}if(n.arc(o,r,p,w-O/p,k+M/p,!0),M>0){const ee=_s(R,q,o,r);n.arc(ee.x,ee.y,M,q+Math.PI,k-Mt)}const Z=_s(D,k,o,r);if(n.lineTo(Z.x,Z.y),T>0){const ee=_s(D,P,o,r);n.arc(ee.x,ee.y,T,k-Mt,P)}}else{n.moveTo(o,r);const Y=Math.cos(P)*d+o,Z=Math.sin(P)*d+r;n.lineTo(Y,Z);const ee=Math.cos(N)*d+o,ie=Math.sin(N)*d+r;n.lineTo(ee,ie)}n.closePath()}function m3(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){oa(n,e,t,i,o+_t,s);for(let u=0;u=_t||_l(l,r,a),g=gl(o,u+p,f+p);return _&&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,d=(o+r+u+a)/2;return{x:t+Math.cos(f)*d,y:i+Math.sin(f)*d}}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>_t?Math.floor(i/_t):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>=It&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=m3(e,this,r,l,o);_3(e,this,r,l,a,o),e.restore()}}Qa.id="arc";Qa.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Qa.defaultRoutes={backgroundColor:"backgroundColor"};function q1(n,e,t=e){n.lineCap=st(t.borderCapStyle,e.borderCapStyle),n.setLineDash(st(t.borderDash,e.borderDash)),n.lineDashOffset=st(t.borderDashOffset,e.borderDashOffset),n.lineJoin=st(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=st(t.borderWidth,e.borderWidth),n.strokeStyle=st(t.borderColor,e.borderColor)}function g3(n,e,t){n.lineTo(t.x,t.y)}function b3(n){return n.stepped?j2:n.tension||n.cubicInterpolationMode==="monotone"?V2:g3}function j1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-C:C))%l,T=()=>{g!==b&&(n.lineTo(f,b),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=s[w(0)],n.moveTo(m.x,m.y)),p=0;p<=r;++p){if(m=s[w(p)],m.skip)continue;const C=m.x,M=m.y,O=C|0;O===_?(Mb&&(b=M),f=(d*f+C)/++d):(T(),n.lineTo(C,M),_=O,d=0,g=b=M),k=M}T()}function ra(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?y3:v3}function k3(n){return n.stepped?gk:n.tension||n.cubicInterpolationMode==="monotone"?bk:Ji}function w3(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),q1(n,e.options),n.stroke(s)}function S3(n,e,t,i){const{segments:s,options:l}=e,o=ra(e);for(const r of s)q1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const $3=typeof Path2D=="function";function T3(n,e,t,i){$3&&!e.options.segment?w3(n,e,t,i):S3(n,e,t,i)}class Li extends gi{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;uk(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=Mk(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=y1(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=k3(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function ic(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=eu(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 eu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function sc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function H1(n,e){let t=[],i=!1;return yt(n)?(i=!0,t=n):t=I3(n,e),t.length?new Li({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function lc(n){return n&&n.fill!==!1}function P3(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(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function L3(n,e,t){const i=q3(n);if(xe(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?N3(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function N3(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function F3(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:xe(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function R3(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:xe(n)?i=n.value:i=e.getBaseValue(),i}function q3(n){const e=n.options,t=e.fill;let i=st(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function j3(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=V3(e,t);r.push(H1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&$r(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;lc(l)&&$r(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!lc(i)||t.drawTime!=="beforeDatasetDraw"||$r(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const rl={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` `):n}function X3(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 uc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=$n(e.bodyFont),u=$n(e.titleFont),f=$n(e.footerFont),d=l.length,p=s.length,m=i.length,_=qn(e.padding);let g=_.height,b=0,k=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}p&&(g+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let w=0;const T=function(C){b=Math.max(b,t.measureText(C).width+w)};return t.save(),t.font=u.string,mt(n.title,T),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),T),w=e.displayColors?o+2+e.boxPadding:0,mt(i,C=>{mt(C.before,T),mt(C.lines,T),mt(C.after,T)}),w=0,t.font=f.string,mt(n.footer,T),t.restore(),b+=_.width,{width:b,height:g}}function Q3(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function x3(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 eS(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"),x3(u,n,e,t)&&(u="center"),u}function fc(n,e,t){const i=t.yAlign||e.yAlign||Q3(n,t);return{xAlign:t.xAlign||e.xAlign||eS(n,e,t,i),yAlign:i}}function tS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function nS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function cc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:m}=ws(o);let _=tS(e,r);const g=nS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,p)+s:r==="right"&&(_+=Math.max(d,m)+s),{x:Qt(_,0,i.width-e.width),y:Qt(g,0,i.height-e.height)}}function io(n,e,t){const i=qn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function dc(n){return Xn([],ai(n))}function iS(n,e,t){return Pi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function pc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ua extends gi{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 k1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=iS(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=Xn(r,ai(s)),r=Xn(r,ai(l)),r=Xn(r,ai(o)),r}getBeforeBody(e,t){return dc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=pc(i,l);Xn(o.before,ai(r.beforeLabel.call(this,l))),Xn(o.lines,r.label.call(this,l)),Xn(o.after,ai(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return dc(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=Xn(r,ai(s)),r=Xn(r,ai(l)),r=Xn(r,ai(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,d,p,i))),e.itemSort&&(r=r.sort((f,d)=>e.itemSort(f,d,i))),mt(r,f=>{const d=pc(e.callbacks,f);s.push(d.labelColor.call(this,f)),l.push(d.labelPointStyle.call(this,f)),o.push(d.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=rl[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=uc(this,i),u=Object.assign({},r,a),f=fc(this.chart,i,u),d=cc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:d.x,y:d.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:d}=ws(r),{x:p,y:m}=e,{width:_,height:g}=t;let b,k,w,T,C,M;return l==="center"?(C=m+g/2,s==="left"?(b=p,k=b-o,T=C+o,M=C-o):(b=p+_,k=b+o,T=C-o,M=C+o),w=b):(s==="left"?k=p+Math.max(a,f)+o:s==="right"?k=p+_-Math.max(u,d)-o:k=this.caretX,l==="top"?(T=m,C=T-o,b=k-o,w=k+o):(T=m+g,C=T+o,b=k+o,w=k-o),M=T),{x1:b,x2:k,x3:w,y1:T,y2:C,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=hr(i.rtl,this.x,this.width);for(e.x=io(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=$n(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aT!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Do(e,{x:b,y:g,w:u,h:a,radius:w}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Do(e,{x:k,y:g+1,w:u-2,h:a-2,radius:w}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,g,u,a),e.strokeRect(b,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(k,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,d=$n(i.bodyFont);let p=d.lineHeight,m=0;const _=hr(i.rtl,this.x,this.width),g=function(A){t.fillText(A,_.x(e.x+m),e.y+p/2),e.y+=p+l},b=_.textAlign(o);let k,w,T,C,M,O,D;for(t.textAlign=o,t.textBaseline="middle",t.font=d.string,e.x=io(this,b,i),t.fillStyle=i.bodyColor,mt(this.beforeBody,g),m=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,O=s.length;C0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=rl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=uc(this,e),a=Object.assign({},o,this._size),u=fc(t,e,a),f=cc(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=qn(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),wk(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),Sk(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=!So(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||!So(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=rl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ua.positioners=rl;var sS={id:"tooltip",_element:ua,positioners:rl,afterInit(n,e,t){t&&(n.tooltip=new ua({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:oi,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.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const lS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function oS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return lS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const rS=(n,e)=>n===null?null:Qt(Math.round(n),0,e);class fa extends ls{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(dt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:oS(i,e,st(t,e),this._addedLabels),rS(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&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}fa.id="category";fa.defaults={ticks:{callback:fa.prototype.getLabelForValue}};function aS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:d,includeBounds:p}=n,m=l||1,_=f-1,{min:g,max:b}=e,k=!dt(o),w=!dt(r),T=!dt(u),C=(b-g)/(d+1);let M=df((b-g)/_/m)*m,O,D,A,P;if(M<1e-14&&!k&&!w)return[{value:g},{value:b}];P=Math.ceil(b/M)-Math.floor(g/M),P>_&&(M=df(P*M/_/m)*m),dt(a)||(O=Math.pow(10,a),M=Math.ceil(M*O)/O),s==="ticks"?(D=Math.floor(g/M)*M,A=Math.ceil(b/M)*M):(D=g,A=b),k&&w&&l&&l2((r-o)/l,M/1e3)?(P=Math.round(Math.min((r-o)/M,f)),M=(r-o)/P,D=o,A=r):T?(D=k?o:D,A=w?r:A,P=u-1,M=(A-D)/P):(P=(A-D)/M,sl(P,Math.round(P),M/1e3)?P=Math.round(P):P=Math.ceil(P));const N=Math.max(pf(M),pf(D));O=Math.pow(10,dt(a)?N:a),D=Math.round(D*O)/O,A=Math.round(A*O)/O;let R=0;for(k&&(p&&D!==o?(t.push({value:o}),Ds=t?s:a,r=a=>l=i?l:a;if(e){const a=ei(s),u=ei(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=aS(s,l);return e.bounds==="ticks"&&Xg(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 Il(e,this.chart.options.locale,this.options.ticks.format)}}class tu extends Lo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Rt(e)?e:0,this.max=Rt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Wn(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}}tu.id="linear";tu.defaults={ticks:{callback:Zo.formatters.numeric}};function hc(n){return n/Math.pow(10,Math.floor(Nn(n)))===1}function uS(n,e){const t=Math.floor(Nn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=An(n.min,Math.pow(10,Math.floor(Nn(e.min)))),o=Math.floor(Nn(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:hc(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Rt(e)?Math.max(0,e):null,this.max=Rt(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(Nn(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=uS(t,this);return e.bounds==="ticks"&&Xg(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":Il(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Nn(e),this._valueRange=Nn(this.max)-Nn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Nn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}B1.id="logarithmic";B1.defaults={ticks:{callback:Zo.formatters.logarithmic,major:{enabled:!0}}};function ca(n){const e=n.ticks;if(e.display&&n.display){const t=qn(e.backdropPadding);return st(e.font&&e.font.size,lt.font.size)+t.height}return 0}function fS(n,e,t){return t=yt(t)?t:[t],{w:R2(n,e.string,t),h:t.length*e.lineHeight}}function _c(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function cS(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?It/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function pS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ca(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?It/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function gS(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=$n(l.font),{x:r,y:a,textAlign:u,left:f,top:d,right:p,bottom:m}=n._pointLabelItems[s],{backdropColor:_}=l;if(!dt(_)){const g=ws(l.borderRadius),b=qn(l.backdropPadding);t.fillStyle=_;const k=f-b.left,w=d-b.top,T=p-f+b.width,C=m-d+b.height;Object.values(g).some(M=>M!==0)?(t.beginPath(),Do(t,{x:k,y:w,w:T,h:C,radius:g}),t.fill()):t.fillRect(k,w,T,C)}Oo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function U1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,_t);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=Ct(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?cS(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=_t/(this._pointLabels.length||1),i=this.options.startAngle||0;return Sn(e*t+Wn(i))}getDistanceFromCenterForValue(e){if(dt(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(dt(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{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const d=s.setContext(this.getContext(f-1));bS(this,d,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:d}=u;!d||!f||(e.lineWidth=d,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=$n(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 d=qn(u.backdropPadding);e.fillRect(-o/2-d.left,-l-f.size/2-d.top,o+d.width,f.size+d.height)}Oo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Xo.id="radialLinear";Xo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Zo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Xo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Xo.descriptors={angleLines:{_fallback:"grid"}};const Qo={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}},pn=Object.keys(Qo);function yS(n,e){return n-e}function gc(n,e){if(dt(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)),Rt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Os(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function bc(n,e,t,i){const s=pn.length;for(let l=pn.indexOf(n);l=pn.indexOf(t);l--){const o=pn[l];if(Qo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return pn[t?pn.indexOf(t):0]}function wS(n){for(let e=pn.indexOf(n)+1,t=pn.length;e=e?t[i]:t[s];n[l]=!0}}function SS(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 yc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Qt(t,0,o),i=Qt(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||bc(l.minUnit,t,i,this._getLabelCapacity(t)),r=st(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Os(a)||a===!0,f={};let d=t,p,m;if(u&&(d=+e.startOf(d,"isoWeek",a)),d=+e.startOf(d,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 _=s.ticks.source==="data"&&this.getDataTimestamps();for(p=d,m=0;pg-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],d=i[t],p=a&&f&&d&&d.major,m=this._adapter.format(e,s||(p?f:u)),_=l.ticks.callback;return _?Ct(_,[m,t,i],this):m}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Gi(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}=Gi(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 W1 extends Nl{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=so(t,this.min),this._tableRange=so(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{i&&(t||(t=Ve(e,Et,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Et,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&S(e),s&&t&&t.end()}}}function TS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){$(l,e,o),$(l,t,o),$(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&S(e),l&&S(t),l&&S(s)}}}function CS(n){let e;return{c(){e=U("Loading...")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function MS(n){let e,t,i,s,l,o=n[2]&&kc();function r(f,d){return f[2]?CS:TS}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=E(),i=y("canvas"),s=E(),l=y("div"),u.c(),h(i,"class","chart-canvas svelte-vh4sl8"),Fr(i,"height","250px"),Fr(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(f,d){$(f,e,d),o&&o.m(e,null),v(e,t),v(e,i),n[8](i),$(f,s,d),$(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&I(o,1):(o=kc(),o.c(),I(o,1),o.m(e,t)):o&&(re(),L(o,1,1,()=>{o=null}),ae()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){I(o)},o(f){L(o)},d(f){f&&S(e),o&&o.d(),n[8](null),f&&S(s),f&&S(l),u.d()}}}function OS(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),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{d();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(d(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}Zt(()=>(Po.register(Li,Go,Jo,tu,Nl,G3,sS),t(6,o=new Po(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:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.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,p]}class DS extends ve{constructor(e){super(),be(this,e,OS,MS,ge,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},da={},ES={get exports(){return da},set exports(n){da=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @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 w(T){return T instanceof a?new a(T.type,w(T.content),T.alias):Array.isArray(T)?T.map(w):T.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var w=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(w){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==w)return T[C]}return null}},isActive:function(w,T,C){for(var M="no-"+T;w;){var O=w.classList;if(O.contains(T))return!0;if(O.contains(M))return!1;w=w.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(w,T){var C=r.util.clone(r.languages[w]);for(var M in T)C[M]=T[M];return C},insertBefore:function(w,T,C,M){M=M||r.languages;var O=M[w],D={};for(var A in O)if(O.hasOwnProperty(A)){if(A==T)for(var P in C)C.hasOwnProperty(P)&&(D[P]=C[P]);C.hasOwnProperty(A)||(D[A]=O[A])}var N=M[w];return M[w]=D,r.languages.DFS(r.languages,function(R,F){F===N&&R!=w&&(this[R]=D)}),D},DFS:function w(T,C,M,O){O=O||{};var D=r.util.objId;for(var A in T)if(T.hasOwnProperty(A)){C.call(T,A,T[A],M||A);var P=T[A],N=r.util.type(P);N==="Object"&&!O[D(P)]?(O[D(P)]=!0,w(P,C,null,O)):N==="Array"&&!O[D(P)]&&(O[D(P)]=!0,w(P,C,A,O))}}},plugins:{},highlightAll:function(w,T){r.highlightAllUnder(document,w,T)},highlightAllUnder:function(w,T,C){var M={callback:C,container:w,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 O=0,D;D=M.elements[O++];)r.highlightElement(D,T===!0,M.callback)},highlightElement:function(w,T,C){var M=r.util.getLanguage(w),O=r.languages[M];r.util.setLanguage(w,M);var D=w.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var A=w.textContent,P={element:w,language:M,grammar:O,code:A};function N(F){P.highlightedCode=F,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),C&&C.call(P.element)}if(r.hooks.run("before-sanity-check",P),D=P.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),C&&C.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){N(r.util.encode(P.code));return}if(T&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(F){N(F.data)},R.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else N(r.highlight(P.code,P.grammar,P.language))},highlight:function(w,T,C){var M={code:w,grammar:T,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(w,T){var C=T.rest;if(C){for(var M in C)T[M]=C[M];delete T.rest}var O=new d;return p(O,O.head,w),f(w,O,T,O.head,0),_(O)},hooks:{all:{},add:function(w,T){var C=r.hooks.all;C[w]=C[w]||[],C[w].push(T)},run:function(w,T){var C=r.hooks.all[w];if(!(!C||!C.length))for(var M=0,O;O=C[M++];)O(T)}},Token:a};i.Prism=r;function a(w,T,C,M){this.type=w,this.content=T,this.alias=C,this.length=(M||"").length|0}a.stringify=function w(T,C){if(typeof T=="string")return T;if(Array.isArray(T)){var M="";return T.forEach(function(N){M+=w(N,C)}),M}var O={type:T.type,content:w(T.content,C),tag:"span",classes:["token",T.type],attributes:{},language:C},D=T.alias;D&&(Array.isArray(D)?Array.prototype.push.apply(O.classes,D):O.classes.push(D)),r.hooks.run("wrap",O);var A="";for(var P in O.attributes)A+=" "+P+'="'+(O.attributes[P]||"").replace(/"/g,""")+'"';return"<"+O.tag+' class="'+O.classes.join(" ")+'"'+A+">"+O.content+""};function u(w,T,C,M){w.lastIndex=T;var O=w.exec(C);if(O&&M&&O[1]){var D=O[1].length;O.index+=D,O[0]=O[0].slice(D)}return O}function f(w,T,C,M,O,D){for(var A in C)if(!(!C.hasOwnProperty(A)||!C[A])){var P=C[A];P=Array.isArray(P)?P:[P];for(var N=0;N=D.reach);X+=ie.value.length,ie=ie.next){var fe=ie.value;if(T.length>w.length)return;if(!(fe instanceof a)){var G=1,ce;if(B){if(ce=u(ee,X,w,q),!ce||ce.index>=w.length)break;var He=ce.index,he=ce.index+ce[0].length,Me=X;for(Me+=ie.value.length;He>=Me;)ie=ie.next,Me+=ie.value.length;if(Me-=ie.value.length,X=Me,ie.value instanceof a)continue;for(var je=ie;je!==T.tail&&(MeD.reach&&(D.reach=ht);var Ze=ie.prev;Ce&&(Ze=p(T,Ze,Ce),X+=Ce.length),m(T,Ze,G);var We=new a(A,F?r.tokenize(we,F):we,Y,we);if(ie=p(T,Ze,We),Je&&p(T,ie,Je),G>1){var te={cause:A+","+N,reach:ht};f(w,T,C,ie.prev,X,te),D&&te.reach>D.reach&&(D.reach=te.reach)}}}}}}function d(){var w={value:null,prev:null,next:null},T={value:null,prev:w,next:null};w.next=T,this.head=w,this.tail=T,this.length=0}function p(w,T,C){var M=T.next,O={value:C,prev:T,next:M};return T.next=O,M.prev=O,w.length++,O}function m(w,T,C){for(var M=T.next,O=0;O/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\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://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(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.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",d="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function p(g,b,k){var w=new XMLHttpRequest;w.open("GET",g,!0),w.onreadystatechange=function(){w.readyState==4&&(w.status<400&&w.responseText?b(w.responseText):w.status>=400?k(s(w.status,w.statusText)):k(l))},w.send(null)}function m(g){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(b){var k=Number(b[1]),w=b[2],T=b[3];return w?T?[k,Number(T)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(g){g.selector+=", "+d}),t.hooks.add("before-sanity-check",function(g){var b=g.element;if(b.matches(d)){g.code="",b.setAttribute(r,a);var k=b.appendChild(document.createElement("CODE"));k.textContent=i;var w=b.getAttribute("data-src"),T=g.language;if(T==="none"){var C=(/\.(\w+)$/.exec(w)||[,"none"])[1];T=o[C]||C}t.util.setLanguage(k,T),t.util.setLanguage(b,T);var M=t.plugins.autoloader;M&&M.loadLanguages(T),p(w,function(O){b.setAttribute(r,u);var D=m(b.getAttribute("data-range"));if(D){var A=O.split(/\r\n?|\n/g),P=D[0],N=D[1]==null?A.length:D[1];P<0&&(P+=A.length),P=Math.max(0,Math.min(P-1,A.length)),N<0&&(N+=A.length),N=Math.max(0,Math.min(N,A.length)),O=A.slice(P,N).join(` `),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}k.textContent=O,t.highlightElement(k)},function(O){b.setAttribute(r,f),k.textContent=O})}}),t.plugins.fileHighlight={highlight:function(b){for(var k=(b||document).querySelectorAll(d),w=0,T;T=k[w++];)t.highlightElement(T)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(ES);const Gs=da;var Sc={},AS={get exports(){return Sc},set exports(n){Sc=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;ar&&(f[p]=` `+f[p],d=m)}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 d=JSON.parse(a.getAttribute("data-"+u)||"true");typeof d===f&&(o.settings[u]=d)}catch{}}for(var p=a.childNodes,m="",_="",g=!1,b=0;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 IS(n){let e,t,i;return{c(){e=y("div"),t=y("code"),h(t,"class","svelte-10s5tkd"),h(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){$(s,e,l),v(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")&&h(e,"class",i)},i:Q,o:Q,d(s){s&&S(e)}}}function PS(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=Gs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Gs.highlight(a,Gs.languages[l]||Gs.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 Gs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class Y1 extends ve{constructor(e){super(),be(this,e,PS,IS,ge,{class:0,content:2,language:3})}}const LS=n=>({}),$c=n=>({}),NS=n=>({}),Tc=n=>({});function Cc(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T=n[4]&&!n[2]&&Mc(n);const C=n[19].header,M=Pt(C,n,n[18],Tc);let O=n[4]&&n[2]&&Oc(n);const D=n[19].default,A=Pt(D,n,n[18],null),P=n[19].footer,N=Pt(P,n,n[18],$c);return{c(){e=y("div"),t=y("div"),s=E(),l=y("div"),o=y("div"),T&&T.c(),r=E(),M&&M.c(),a=E(),O&&O.c(),u=E(),f=y("div"),A&&A.c(),d=E(),p=y("div"),N&&N.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(p,"class","overlay-panel-section panel-footer"),h(l,"class",m="overlay-panel "+n[1]+" "+n[8]),x(l,"popup",n[2]),h(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(R,F){$(R,e,F),v(e,t),v(e,s),v(e,l),v(l,o),T&&T.m(o,null),v(o,r),M&&M.m(o,null),v(o,a),O&&O.m(o,null),v(l,u),v(l,f),A&&A.m(f,null),n[21](f),v(l,d),v(l,p),N&&N.m(p,null),b=!0,k||(w=[J(t,"click",pt(n[20])),J(f,"scroll",n[22])],k=!0)},p(R,F){n=R,n[4]&&!n[2]?T?T.p(n,F):(T=Mc(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),M&&M.p&&(!b||F[0]&262144)&&Nt(M,C,n,n[18],b?Lt(C,n[18],F,NS):Ft(n[18]),Tc),n[4]&&n[2]?O?O.p(n,F):(O=Oc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),A&&A.p&&(!b||F[0]&262144)&&Nt(A,D,n,n[18],b?Lt(D,n[18],F,null):Ft(n[18]),null),N&&N.p&&(!b||F[0]&262144)&&Nt(N,P,n,n[18],b?Lt(P,n[18],F,LS):Ft(n[18]),$c),(!b||F[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",m),(!b||F[0]&262)&&x(l,"popup",n[2]),(!b||F[0]&4)&&x(e,"padded",n[2]),(!b||F[0]&1)&&x(e,"active",n[0])},i(R){b||(R&&et(()=>{b&&(i||(i=Ve(t,yo,{duration:gs,opacity:0},!0)),i.run(1))}),I(M,R),I(A,R),I(N,R),et(()=>{b&&(g&&g.end(1),_=$b(l,ni,n[2]?{duration:gs,y:-10}:{duration:gs,x:50}),_.start())}),b=!0)},o(R){R&&(i||(i=Ve(t,yo,{duration:gs,opacity:0},!1)),i.run(0)),L(M,R),L(A,R),L(N,R),_&&_.invalidate(),g=Tb(l,ni,n[2]?{duration:gs,y:10}:{duration:gs,x:50}),b=!1},d(R){R&&S(e),R&&i&&i.end(),T&&T.d(),M&&M.d(R),O&&O.d(),A&&A.d(R),n[21](null),N&&N.d(R),R&&g&&g.end(),k=!1,Ie(w)}}}function Mc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){$(s,e,l),t||(i=J(e,"click",pt(n[5])),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function Oc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){$(s,e,l),t||(i=J(e,"click",pt(n[5])),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function FS(n){let e,t,i,s,l=n[0]&&Cc(n);return{c(){e=y("div"),l&&l.c(),h(e,"class","overlay-panel-wrapper")},m(o,r){$(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&I(l,1)):(l=Cc(o),l.c(),I(l,1),l.m(e,null)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){t||(I(l),t=!0)},o(o){L(l),t=!1},d(o){o&&S(e),l&&l.d(),n[23](null),i=!1,Ie(s)}}}let Wi,Tr=[];function K1(){return Wi=Wi||document.querySelector(".overlays"),Wi||(Wi=document.createElement("div"),Wi.classList.add("overlays"),document.body.appendChild(Wi)),Wi}let gs=150;function Dc(){return 1e3+K1().querySelectorAll(".overlay-panel-container.active").length}function RS(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:d=void 0}=e,{beforeHide:p=void 0}=e;const m=St(),_="op_"+j.randomString(10);let g,b,k,w,T="",C=o;function M(){typeof d=="function"&&d()===!1||t(0,o=!0)}function O(){typeof p=="function"&&p()===!1||t(0,o=!1)}function D(){return o}async function A(X){t(17,C=X),X?(k=document.activeElement,g==null||g.focus(),m("show")):(clearTimeout(w),k==null||k.focus(),m("hide")),await an(),P()}function P(){g&&(o?t(6,g.style.zIndex=Dc(),g):t(6,g.style="",g))}function N(){j.pushUnique(Tr,_),document.body.classList.add("overlay-active")}function R(){j.removeByValue(Tr,_),Tr.length||document.body.classList.remove("overlay-active")}function F(X){o&&f&&X.code=="Escape"&&!j.isInput(X.target)&&g&&g.style.zIndex==Dc()&&(X.preventDefault(),O())}function q(X){o&&B(b)}function B(X,fe){fe&&t(8,T=""),X&&(w||(w=setTimeout(()=>{if(clearTimeout(w),w=null,!X)return;if(X.scrollHeight-X.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}X.scrollTop==0?t(8,T+=" scroll-top-reached"):X.scrollTop+X.offsetHeight==X.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100)))}Zt(()=>(K1().appendChild(g),()=>{var X;clearTimeout(w),R(),(X=g==null?void 0:g.classList)==null||X.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const Y=()=>a?O():!0;function Z(X){se[X?"unshift":"push"](()=>{b=X,t(7,b)})}const ee=X=>B(X.target);function ie(X){se[X?"unshift":"push"](()=>{g=X,t(6,g)})}return n.$$set=X=>{"class"in X&&t(1,l=X.class),"active"in X&&t(0,o=X.active),"popup"in X&&t(2,r=X.popup),"overlayClose"in X&&t(3,a=X.overlayClose),"btnClose"in X&&t(4,u=X.btnClose),"escClose"in X&&t(12,f=X.escClose),"beforeOpen"in X&&t(13,d=X.beforeOpen),"beforeHide"in X&&t(14,p=X.beforeHide),"$$scope"in X&&t(18,s=X.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&C!=o&&A(o),n.$$.dirty[0]&128&&B(b,!0),n.$$.dirty[0]&64&&g&&P(),n.$$.dirty[0]&1&&(o?N():R())},[o,l,r,a,u,O,g,b,T,F,q,B,f,d,p,M,D,C,s,i,Y,Z,ee,ie]}class vn extends ve{constructor(e){super(),be(this,e,RS,FS,ge,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function qS(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function jS(n){let e,t=n[2].referer+"",i,s;return{c(){e=y("a"),i=U(t),h(e,"href",s=n[2].referer),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(l,o){$(l,e,o),v(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&h(e,"href",s)},d(l){l&&S(e)}}}function VS(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function HS(n){let e,t;return e=new Y1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function zS(n){var Ae;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,d,p,m,_,g=n[2].status+"",b,k,w,T,C,M,O=((Ae=n[2].method)==null?void 0:Ae.toUpperCase())+"",D,A,P,N,R,F,q=n[2].auth+"",B,Y,Z,ee,ie,X,fe=n[2].url+"",G,ce,he,Me,je,He,we,Ce,Je,ht,Ze,We=n[2].remoteIp+"",te,qe,Qe,Kt,Ne,$e,Xe=n[2].userIp+"",ye,Pe,nt,vt,On,rt,Zn=n[2].userAgent+"",os,Fl,vi,rs,Rl,Ri,as,fn,tt,us,li,fs,qi,ji,Jt,tn;function ql(Le,Oe){return Le[2].referer?jS:qS}let W=ql(n),K=W(n);const ne=[HS,VS],oe=[];function Te(Le,Oe){return Oe&4&&(as=null),as==null&&(as=!j.isEmpty(Le[2].meta)),as?0:1}return fn=Te(n,-1),tt=oe[fn]=ne[fn](n),Jt=new hi({props:{date:n[2].created}}),{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="ID",l=E(),o=y("td"),a=U(r),u=E(),f=y("tr"),d=y("td"),d.textContent="Status",p=E(),m=y("td"),_=y("span"),b=U(g),k=E(),w=y("tr"),T=y("td"),T.textContent="Method",C=E(),M=y("td"),D=U(O),A=E(),P=y("tr"),N=y("td"),N.textContent="Auth",R=E(),F=y("td"),B=U(q),Y=E(),Z=y("tr"),ee=y("td"),ee.textContent="URL",ie=E(),X=y("td"),G=U(fe),ce=E(),he=y("tr"),Me=y("td"),Me.textContent="Referer",je=E(),He=y("td"),K.c(),we=E(),Ce=y("tr"),Je=y("td"),Je.textContent="Remote IP",ht=E(),Ze=y("td"),te=U(We),qe=E(),Qe=y("tr"),Kt=y("td"),Kt.textContent="User IP",Ne=E(),$e=y("td"),ye=U(Xe),Pe=E(),nt=y("tr"),vt=y("td"),vt.textContent="UserAgent",On=E(),rt=y("td"),os=U(Zn),Fl=E(),vi=y("tr"),rs=y("td"),rs.textContent="Meta",Rl=E(),Ri=y("td"),tt.c(),us=E(),li=y("tr"),fs=y("td"),fs.textContent="Created",qi=E(),ji=y("td"),z(Jt.$$.fragment),h(s,"class","min-width txt-hint txt-bold"),h(d,"class","min-width txt-hint txt-bold"),h(_,"class","label"),x(_,"label-danger",n[2].status>=400),h(T,"class","min-width txt-hint txt-bold"),h(N,"class","min-width txt-hint txt-bold"),h(ee,"class","min-width txt-hint txt-bold"),h(Me,"class","min-width txt-hint txt-bold"),h(Je,"class","min-width txt-hint txt-bold"),h(Kt,"class","min-width txt-hint txt-bold"),h(vt,"class","min-width txt-hint txt-bold"),h(rs,"class","min-width txt-hint txt-bold"),h(fs,"class","min-width txt-hint txt-bold"),h(e,"class","table-border")},m(Le,Oe){$(Le,e,Oe),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,a),v(t,u),v(t,f),v(f,d),v(f,p),v(f,m),v(m,_),v(_,b),v(t,k),v(t,w),v(w,T),v(w,C),v(w,M),v(M,D),v(t,A),v(t,P),v(P,N),v(P,R),v(P,F),v(F,B),v(t,Y),v(t,Z),v(Z,ee),v(Z,ie),v(Z,X),v(X,G),v(t,ce),v(t,he),v(he,Me),v(he,je),v(he,He),K.m(He,null),v(t,we),v(t,Ce),v(Ce,Je),v(Ce,ht),v(Ce,Ze),v(Ze,te),v(t,qe),v(t,Qe),v(Qe,Kt),v(Qe,Ne),v(Qe,$e),v($e,ye),v(t,Pe),v(t,nt),v(nt,vt),v(nt,On),v(nt,rt),v(rt,os),v(t,Fl),v(t,vi),v(vi,rs),v(vi,Rl),v(vi,Ri),oe[fn].m(Ri,null),v(t,us),v(t,li),v(li,fs),v(li,qi),v(li,ji),V(Jt,ji,null),tn=!0},p(Le,Oe){var Be;(!tn||Oe&4)&&r!==(r=Le[2].id+"")&&le(a,r),(!tn||Oe&4)&&g!==(g=Le[2].status+"")&&le(b,g),(!tn||Oe&4)&&x(_,"label-danger",Le[2].status>=400),(!tn||Oe&4)&&O!==(O=((Be=Le[2].method)==null?void 0:Be.toUpperCase())+"")&&le(D,O),(!tn||Oe&4)&&q!==(q=Le[2].auth+"")&&le(B,q),(!tn||Oe&4)&&fe!==(fe=Le[2].url+"")&&le(G,fe),W===(W=ql(Le))&&K?K.p(Le,Oe):(K.d(1),K=W(Le),K&&(K.c(),K.m(He,null))),(!tn||Oe&4)&&We!==(We=Le[2].remoteIp+"")&&le(te,We),(!tn||Oe&4)&&Xe!==(Xe=Le[2].userIp+"")&&le(ye,Xe),(!tn||Oe&4)&&Zn!==(Zn=Le[2].userAgent+"")&&le(os,Zn);let Ye=fn;fn=Te(Le,Oe),fn===Ye?oe[fn].p(Le,Oe):(re(),L(oe[Ye],1,1,()=>{oe[Ye]=null}),ae(),tt=oe[fn],tt?tt.p(Le,Oe):(tt=oe[fn]=ne[fn](Le),tt.c()),I(tt,1),tt.m(Ri,null));const Re={};Oe&4&&(Re.date=Le[2].created),Jt.$set(Re)},i(Le){tn||(I(tt),I(Jt.$$.fragment,Le),tn=!0)},o(Le){L(tt),L(Jt.$$.fragment,Le),tn=!1},d(Le){Le&&S(e),K.d(),oe[fn].d(),H(Jt)}}}function BS(n){let e;return{c(){e=y("h4"),e.textContent="Request log"},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function US(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Close',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[4]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function WS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[US],header:[BS],default:[zS]},$$scope:{ctx:n}};return e=new vn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[5](null),H(e,s)}}}function YS(n,e,t){let i,s=new Hr;function l(d){return t(2,s=d),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(d){se[d?"unshift":"push"](()=>{i=d,t(1,i)})}function u(d){de.call(this,n,d)}function f(d){de.call(this,n,d)}return[o,i,s,l,r,a,u,f]}class KS extends ve{constructor(e){super(),be(this,e,YS,WS,ge,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function JS(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Include requests by admins"),h(e,"type","checkbox"),h(e,"id",t=n[14]),h(s,"for",o=n[14])},m(u,f){$(u,e,f),e.checked=n[0],$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&h(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function Ec(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 DS({props:l}),se.push(()=>_e(e,"filter",s)),{c(){z(e.$$.fragment)},m(o,r){V(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],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Ac(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 Jy({props:l}),se.push(()=>_e(e,"filter",s)),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(o,r){V(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],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZS(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w=n[3],T,C=n[3],M,O;r=new Ia({}),r.$on("refresh",n[7]),p=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[JS,({uniqueId:P})=>({14:P}),({uniqueId:P})=>P?16384:0]},$$scope:{ctx:n}}}),_=new Yo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),_.$on("submit",n[9]);let D=Ec(n),A=Ac(n);return{c(){e=y("div"),t=y("header"),i=y("nav"),s=y("div"),l=U(n[5]),o=E(),z(r.$$.fragment),a=E(),u=y("div"),f=E(),d=y("div"),z(p.$$.fragment),m=E(),z(_.$$.fragment),g=E(),b=y("div"),k=E(),D.c(),T=E(),A.c(),M=Se(),h(s,"class","breadcrumb-item"),h(i,"class","breadcrumbs"),h(u,"class","flex-fill"),h(d,"class","inline-flex"),h(t,"class","page-header"),h(b,"class","clearfix m-b-base"),h(e,"class","page-header-wrapper m-b-0")},m(P,N){$(P,e,N),v(e,t),v(t,i),v(i,s),v(s,l),v(t,o),V(r,t,null),v(t,a),v(t,u),v(t,f),v(t,d),V(p,d,null),v(e,m),V(_,e,null),v(e,g),v(e,b),v(e,k),D.m(e,null),$(P,T,N),A.m(P,N),$(P,M,N),O=!0},p(P,N){(!O||N&32)&&le(l,P[5]);const R={};N&49153&&(R.$$scope={dirty:N,ctx:P}),p.$set(R);const F={};N&4&&(F.value=P[2]),_.$set(F),N&8&&ge(w,w=P[3])?(re(),L(D,1,1,Q),ae(),D=Ec(P),D.c(),I(D,1),D.m(e,null)):D.p(P,N),N&8&&ge(C,C=P[3])?(re(),L(A,1,1,Q),ae(),A=Ac(P),A.c(),I(A,1),A.m(M.parentNode,M)):A.p(P,N)},i(P){O||(I(r.$$.fragment,P),I(p.$$.fragment,P),I(_.$$.fragment,P),I(D),I(A),O=!0)},o(P){L(r.$$.fragment,P),L(p.$$.fragment,P),L(_.$$.fragment,P),L(D),L(A),O=!1},d(P){P&&S(e),H(r),H(p),H(_),D.d(P),P&&S(T),P&&S(M),A.d(P)}}}function GS(n){let e,t,i,s;e=new Mn({props:{$$slots:{default:[ZS]},$$scope:{ctx:n}}});let l={};return i=new KS({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){V(e,o,r),$(o,t,r),V(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||(I(e.$$.fragment,o),I(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){H(e,o),o&&S(t),n[13](null),H(i,o)}}}const Ic="includeAdminLogs";function XS(n,e,t){var k;let i,s;Ke(n,At,w=>t(5,s=w)),xt(At,s="Request logs",s);let l,o="",r=((k=window.localStorage)==null?void 0:k.getItem(Ic))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function d(){r=this.checked,t(0,r)}const p=w=>t(2,o=w.detail);function m(w){o=w,t(2,o)}function _(w){o=w,t(2,o)}const g=w=>l==null?void 0:l.show(w==null?void 0:w.detail);function b(w){se[w?"unshift":"push"](()=>{l=w,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(Ic,r<<0)},[r,l,o,a,i,s,u,f,d,p,m,_,g,b]}class QS extends ve{constructor(e){super(),be(this,e,XS,GS,ge,{})}}const bi=jn([]),_i=jn({}),No=jn(!1);function xS(n){bi.update(e=>{const t=j.findByKey(e,"id",n);return t?_i.set(t):e.length&&_i.set(e[0]),e})}function e$(n){_i.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),bi.update(e=>(j.pushOrReplaceByKey(e,n,"id"),j.sortCollections(e)))}function t$(n){bi.update(e=>(j.removeByKey(e,"id",n.id),_i.update(t=>t.id===n.id?e[0]:t),e))}async function n$(n=null){No.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),bi.set(e);const t=n&&j.findByKey(e,"id",n);t?_i.set(t):e.length&&_i.set(e[0])}catch(e){me.errorResponseHandler(e)}No.set(!1)}const nu=jn({});function mn(n,e,t){nu.set({text:n,yesCallback:e,noCallback:t})}function J1(){nu.set({})}function Pc(n){let e,t,i;const s=n[17].default,l=Pt(s,n,n[16],null);return{c(){e=y("div"),l&&l.c(),h(e,"class",n[1]),x(e,"active",n[0])},m(o,r){$(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&Nt(l,s,o,o[16],i?Lt(s,o[16],r,null):Ft(o[16]),null),(!i||r&2)&&h(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(I(l,o),o&&et(()=>{i&&(t||(t=Ve(e,ni,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=Ve(e,ni,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&S(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function i$(n){let e,t,i,s,l=n[0]&&Pc(n);return{c(){e=y("div"),l&&l.c(),h(e,"class","toggler-container")},m(o,r){$(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[J(window,"mousedown",n[5]),J(window,"click",n[6]),J(window,"keydown",n[4]),J(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&I(l,1)):(l=Pc(o),l.c(),I(l,1),l.m(e,null)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){t||(I(l),t=!0)},o(o){L(l),t=!1},d(o){o&&S(e),l&&l.d(),n[19](null),i=!1,Ie(s)}}}function s$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,d,p,m,_,g=!1;const b=St();function k(){t(0,o=!1),g=!1,clearTimeout(_)}function w(){t(0,o=!0),clearTimeout(_),_=setTimeout(()=>{a&&(p!=null&&p.scrollIntoViewIfNeeded?p==null||p.scrollIntoViewIfNeeded():p!=null&&p.scrollIntoView&&(p==null||p.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function T(){o?k():w()}function C(Y){return!d||Y.classList.contains(u)||(m==null?void 0:m.contains(Y))&&!d.contains(Y)||d.contains(Y)&&Y.closest&&Y.closest("."+u)}function M(Y){(!o||C(Y.target))&&(Y.preventDefault(),Y.stopPropagation(),T())}function O(Y){(Y.code==="Enter"||Y.code==="Space")&&(!o||C(Y.target))&&(Y.preventDefault(),Y.stopPropagation(),T())}function D(Y){o&&r&&Y.code==="Escape"&&(Y.preventDefault(),k())}function A(Y){o&&!(d!=null&&d.contains(Y.target))?g=!0:g&&(g=!1)}function P(Y){var Z;o&&g&&!(d!=null&&d.contains(Y.target))&&!(m!=null&&m.contains(Y.target))&&!((Z=Y.target)!=null&&Z.closest(".flatpickr-calendar"))&&k()}function N(Y){A(Y),P(Y)}function R(Y){F(),t(15,m=Y||(d==null?void 0:d.parentNode)),m&&(d==null||d.addEventListener("click",M),m.addEventListener("click",M),m.addEventListener("keydown",O))}function F(){clearTimeout(_),m&&(d==null||d.removeEventListener("click",M),m.removeEventListener("click",M),m.removeEventListener("keydown",O))}Zt(()=>(R(),()=>F()));function q(Y){se[Y?"unshift":"push"](()=>{p=Y,t(3,p)})}function B(Y){se[Y?"unshift":"push"](()=>{d=Y,t(2,d)})}return n.$$set=Y=>{"trigger"in Y&&t(8,l=Y.trigger),"active"in Y&&t(0,o=Y.active),"escClose"in Y&&t(9,r=Y.escClose),"autoScroll"in Y&&t(10,a=Y.autoScroll),"closableClass"in Y&&t(11,u=Y.closableClass),"class"in Y&&t(1,f=Y.class),"$$scope"in Y&&t(16,s=Y.$$scope)},n.$$.update=()=>{var Y,Z;n.$$.dirty&260&&d&&R(l),n.$$.dirty&32769&&(o?((Y=m==null?void 0:m.classList)==null||Y.add("active"),b("show")):((Z=m==null?void 0:m.classList)==null||Z.remove("active"),b("hide")))},[o,f,d,p,D,A,P,N,l,r,a,u,k,w,T,m,s,i,q,B]}class Vn extends ve{constructor(e){super(),be(this,e,s$,i$,ge,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Lc(n,e,t){const i=n.slice();return i[27]=e[t],i}function l$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("input"),s=E(),l=y("label"),o=U("Unique"),h(e,"type","checkbox"),h(e,"id",t=n[30]),e.checked=i=n[3].unique,h(l,"for",r=n[30])},m(f,d){$(f,e,d),$(f,s,d),$(f,l,d),v(l,o),a||(u=J(e,"change",n[19]),a=!0)},p(f,d){d[0]&1073741824&&t!==(t=f[30])&&h(e,"id",t),d[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),d[0]&1073741824&&r!==(r=f[30])&&h(l,"for",r)},d(f){f&&S(e),f&&S(s),f&&S(l),a=!1,u()}}}function o$(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a){var f;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Ot(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),$(a,i,u),s=!0},p(a,u){var d;const f={};if(u[0]&1073741824&&(f.id=a[30]),u[0]&1&&(f.placeholder=`eg. CREATE INDEX idx_test on ${(d=a[0])==null?void 0:d.name} (created)`),!t&&u[0]&4&&(t=!0,f.value=a[2],ke(()=>t=!1)),u[0]&128&&o!==(o=a[7])){if(e){re();const p=e;L(p.$$.fragment,1,0,()=>{H(p,1)}),ae()}o?(e=Ot(o,r(a)),se.push(()=>_e(e,"value",l)),z(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&S(i),e&&H(e,a)}}}function r$(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function a$(n){let e,t,i,s;const l=[r$,o$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),$(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&S(i)}}}function Nc(n){let e,t,i,s=n[10],l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[a$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Nc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=Se()},m(a,u){V(e,a,u),$(a,t,u),V(i,a,u),$(a,s,u),r&&r.m(a,u),$(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&64&&(d.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(d.$$scope={dirty:u,ctx:a}),i.$set(d),a[10].length>0?r?r.p(a,u):(r=Nc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),o=!1},d(a){H(e,a),a&&S(t),H(i,a),a&&S(s),r&&r.d(a),a&&S(l)}}}function f$(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=y("h4"),i=U(t),s=U(" index")},m(l,o){$(l,e,o),v(e,i),v(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&S(e)}}}function Rc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){$(s,e,l),t||(i=[De(Ue.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(s){s&&S(e),t=!1,Ie(i)}}}function c$(n){let e,t,i,s,l,o,r=n[5]!=""&&Rc(n);return{c(){r&&r.c(),e=E(),t=y("button"),t.innerHTML='Cancel',i=E(),s=y("button"),s.innerHTML='Set index',h(t,"type","button"),h(t,"class","btn btn-transparent"),h(s,"type","button"),h(s,"class","btn"),x(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),$(a,e,u),$(a,t,u),$(a,i,u),$(a,s,u),l||(o=[J(t,"click",n[17]),J(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Rc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(s,"btn-disabled",a[9].length<=0)},d(a){r&&r.d(a),a&&S(e),a&&S(t),a&&S(i),a&&S(s),l=!1,Ie(o)}}}function d$(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[c$],header:[f$],default:[u$]},$$scope:{ctx:n}};for(let l=0;lie.name==Y);ee?j.removeByValue(Z.columns,ee):j.pushUnique(Z.columns,{name:Y}),t(2,p=j.buildIndex(Z))}Zt(async()=>{t(8,g=!0);try{t(7,_=(await ft(()=>import("./CodeEditor-8054534a.js"),["./CodeEditor-8054534a.js","./index-6f704b4c.js"],import.meta.url)).default)}catch(Y){console.warn(Y)}t(8,g=!1)});const O=()=>T(),D=()=>k(),A=()=>C(),P=Y=>{t(3,s.unique=Y.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,p=j.buildIndex(s))};function N(Y){p=Y,t(2,p)}const R=Y=>M(Y);function F(Y){se[Y?"unshift":"push"](()=>{f=Y,t(4,f)})}function q(Y){de.call(this,n,Y)}function B(Y){de.call(this,n,Y)}return n.$$set=Y=>{e=Fe(Fe({},e),zt(Y)),t(14,r=Ge(e,o)),"collection"in Y&&t(0,u=Y.collection)},n.$$.update=()=>{var Y,Z,ee;n.$$.dirty[0]&1&&t(10,i=(((Z=(Y=u==null?void 0:u.schema)==null?void 0:Y.filter(ie=>!ie.toDelete))==null?void 0:Z.map(ie=>ie.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=j.parseIndex(p)),n.$$.dirty[0]&8&&t(9,l=((ee=s.columns)==null?void 0:ee.map(ie=>ie.name))||[])},[u,k,p,s,f,d,m,_,g,l,i,T,C,M,r,b,O,D,A,P,N,R,F,q,B]}class m$ extends ve{constructor(e){super(),be(this,e,p$,d$,ge,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function qc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=j.parseIndex(i[10]);return i[11]=s,i}function jc(n){let e;return{c(){e=y("strong"),e.textContent="Unique:"},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Vc(n){var p;let e,t,i,s=((p=n[11].columns)==null?void 0:p.map(Hc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&jc();function d(){return n[4](n[10],n[13])}return{c(){var m,_;e=y("button"),f&&f.c(),t=E(),i=y("span"),l=U(s),h(i,"class","txt"),h(e,"type","button"),h(e,"class",o="label link-primary "+((_=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&_.message?"label-danger":"")+" svelte-167lbwu")},m(m,_){var g,b;$(m,e,_),f&&f.m(e,null),v(e,t),v(e,i),v(i,l),a||(u=[De(r=Ue.call(null,e,((b=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:b.message)||"")),J(e,"click",d)],a=!0)},p(m,_){var g,b,k,w,T;n=m,n[11].unique?f||(f=jc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),_&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(Hc).join(", "))+"")&&le(l,s),_&4&&o!==(o="label link-primary "+((k=(b=n[2].indexes)==null?void 0:b[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&h(e,"class",o),r&&Ht(r.update)&&_&4&&r.update.call(null,((T=(w=n[2].indexes)==null?void 0:w[n[13]])==null?void 0:T.message)||"")},d(m){m&&S(e),f&&f.d(),a=!1,Ie(u)}}}function h$(n){var C,M,O;let e,t,i=(((M=(C=n[0])==null?void 0:C.indexes)==null?void 0:M.length)||0)+"",s,l,o,r,a,u,f,d,p,m,_,g,b=((O=n[0])==null?void 0:O.indexes)||[],k=[];for(let D=0;D_e(d,"collection",w)),d.$on("remove",n[8]),d.$on("submit",n[9]),{c(){e=y("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=E(),r=y("div");for(let D=0;D+ New index`,f=E(),z(d.$$.fragment),h(e,"class","section-title"),h(u,"type","button"),h(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),h(r,"class","indexes-list svelte-167lbwu")},m(D,A){$(D,e,A),v(e,t),v(e,s),v(e,l),$(D,o,A),$(D,r,A);for(let P=0;Pp=!1)),d.$set(P)},i(D){m||(I(d.$$.fragment,D),m=!0)},o(D){L(d.$$.fragment,D),m=!1},d(D){D&&S(e),D&&S(o),D&&S(r),ct(k,D),D&&S(f),n[6](null),H(d,D),_=!1,g()}}}const Hc=n=>n.name;function _$(n,e,t){let i;Ke(n,ii,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let g=0;gl==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){se[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const d=m=>{for(let _=0;_{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,d,p]}class g$ extends ve{constructor(e){super(),be(this,e,_$,h$,ge,{collection:0})}}function zc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Bc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),o=U(l),r=E(),h(t,"class","icon "+n[6].icon+" svelte-1p626x7"),h(s,"class","txt"),h(e,"tabindex","0"),h(e,"class","dropdown-item closable svelte-1p626x7")},m(p,m){$(p,e,m),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[J(e,"click",Cn(f)),J(e,"keydown",Cn(d))],a=!0)},p(p,m){n=p},d(p){p&&S(e),a=!1,Ie(u)}}}function b$(n){let e,t=n[2],i=[];for(let s=0;s{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class k$ extends ve{constructor(e){super(),be(this,e,y$,v$,ge,{class:0})}}const w$=n=>({interactive:n&128,hasErrors:n&64}),Uc=n=>({interactive:n[7],hasErrors:n[6]}),S$=n=>({interactive:n&128,hasErrors:n&64}),Wc=n=>({interactive:n[7],hasErrors:n[6]});function Yc(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","drag-handle-wrapper"),h(e,"draggable","true"),h(e,"aria-label","Sort")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Kc(n){let e,t,i,s;return{c(){e=y("span"),h(e,"class","marker marker-required")},m(l,o){$(l,e,o),i||(s=De(t=Ue.call(null,e,n[5])),i=!0)},p(l,o){t&&Ht(t.update)&&o&32&&t.update.call(null,l[5])},d(l){l&&S(e),i=!1,s()}}}function $$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_=n[0].required&&Kc(n);return{c(){e=y("div"),_&&_.c(),t=E(),i=y("div"),s=y("i"),o=E(),r=y("input"),h(e,"class","markers"),h(s,"class",l=j.getFieldTypeIcon(n[0].type)),h(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(i,"txt-disabled",!n[7]),h(r,"type","text"),r.required=!0,r.disabled=a=!n[7],r.readOnly=u=n[0].id&&n[0].system,h(r,"spellcheck","false"),r.autofocus=f=!n[0].id,h(r,"placeholder","Field name"),r.value=d=n[0].name},m(g,b){$(g,e,b),_&&_.m(e,null),$(g,t,b),$(g,i,b),v(i,s),$(g,o,b),$(g,r,b),n[15](r),n[0].id||r.focus(),p||(m=J(r,"input",n[16]),p=!0)},p(g,b){g[0].required?_?_.p(g,b):(_=Kc(g),_.c(),_.m(e,null)):_&&(_.d(1),_=null),b&1&&l!==(l=j.getFieldTypeIcon(g[0].type))&&h(s,"class",l),b&128&&x(i,"txt-disabled",!g[7]),b&128&&a!==(a=!g[7])&&(r.disabled=a),b&1&&u!==(u=g[0].id&&g[0].system)&&(r.readOnly=u),b&1&&f!==(f=!g[0].id)&&(r.autofocus=f),b&1&&d!==(d=g[0].name)&&r.value!==d&&(r.value=d)},d(g){g&&S(e),_&&_.d(),g&&S(t),g&&S(i),g&&S(o),g&&S(r),n[15](null),p=!1,m()}}}function T$(n){let e,t,i;return{c(){e=y("button"),t=y("i"),h(t,"class","ri-settings-3-line"),h(e,"type","button"),h(e,"aria-label","Field options"),h(e,"class",i="btn btn-sm btn-circle btn-transparent options-trigger "+(n[6]?"btn-danger":"btn-hint"))},m(s,l){$(s,e,l),v(e,t),n[17](e)},p(s,l){l&64&&i!==(i="btn btn-sm btn-circle btn-transparent options-trigger "+(s[6]?"btn-danger":"btn-hint"))&&h(e,"class",i)},d(s){s&&S(e),n[17](null)}}}function C$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),h(e,"aria-label","Restore")},m(s,l){$(s,e,l),t||(i=[De(Ue.call(null,e,"Restore")),J(e,"click",n[10])],t=!0)},p:Q,d(s){s&&S(e),t=!1,Ie(i)}}}function Jc(n){let e,t;return e=new Vn({props:{class:"dropdown dropdown-block schema-field-dropdown",trigger:n[3],$$slots:{default:[D$]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.trigger=i[3]),s&8388833&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function M$(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),o=U(n[5]),r=E(),a=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[25]),h(l,"class","txt"),h(a,"class","ri-information-line link-hint"),h(s,"for",f=n[25])},m(m,_){$(m,e,_),e.checked=n[0].required,$(m,i,_),$(m,s,_),v(s,l),v(l,o),v(s,r),v(s,a),d||(p=[J(e,"change",n[18]),De(u=Ue.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`,position:"right"}))],d=!0)},p(m,_){_&33554432&&t!==(t=m[25])&&h(e,"id",t),_&1&&(e.checked=m[0].required),_&32&&le(o,m[5]),u&&Ht(u.update)&&_&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`,position:"right"}),_&33554432&&f!==(f=m[25])&&h(s,"for",f)},d(m){m&&S(e),m&&S(i),m&&S(s),d=!1,Ie(p)}}}function Zc(n){let e,t,i,s,l,o,r,a,u;return a=new Vn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[O$]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=E(),s=y("div"),l=y("button"),o=y("i"),r=E(),z(a.$$.fragment),h(t,"class","flex-fill"),h(o,"class","ri-more-line"),h(l,"type","button"),h(l,"aria-label","More"),h(l,"class","btn btn-circle btn-sm btn-transparent"),h(s,"class","inline-flex flex-gap-sm flex-nowrap"),h(e,"class","col-sm-4 m-l-auto txt-right")},m(f,d){$(f,e,d),v(e,t),v(e,i),v(e,s),v(s,l),v(l,o),v(l,r),V(a,l,null),u=!0},p(f,d){const p={};d&8388608&&(p.$$scope={dirty:d,ctx:f}),a.$set(p)},i(f){u||(I(a.$$.fragment,f),u=!0)},o(f){L(a.$$.fragment,f),u=!1},d(f){f&&S(e),H(a)}}}function O$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Remove',h(e,"type","button"),h(e,"class","dropdown-item txt-right")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[9]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function D$(n){let e,t,i,s,l,o,r;const a=n[13].options,u=Pt(a,n,n[23],Uc);l=new pe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[M$,({uniqueId:d})=>({25:d}),({uniqueId:d})=>d?33554432:0]},$$scope:{ctx:n}}});let f=!n[0].toDelete&&Zc(n);return{c(){e=y("div"),t=y("div"),u&&u.c(),i=E(),s=y("div"),z(l.$$.fragment),o=E(),f&&f.c(),h(t,"class","col-sm-12 hidden-empty"),h(s,"class","col-sm-4 flex"),h(e,"class","grid grid-sm")},m(d,p){$(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),v(e,s),V(l,s,null),v(e,o),f&&f.m(e,null),r=!0},p(d,p){u&&u.p&&(!r||p&8388800)&&Nt(u,a,d,d[23],r?Lt(a,d[23],p,w$):Ft(d[23]),Uc);const m={};p&41943073&&(m.$$scope={dirty:p,ctx:d}),l.$set(m),d[0].toDelete?f&&(re(),L(f,1,1,()=>{f=null}),ae()):f?(f.p(d,p),p&1&&I(f,1)):(f=Zc(d),f.c(),I(f,1),f.m(e,null))},i(d){r||(I(u,d),I(l.$$.fragment,d),I(f),r=!0)},o(d){L(u,d),L(l.$$.fragment,d),L(f),r=!1},d(d){d&&S(e),u&&u.d(d),H(l),f&&f.d()}}}function E$(n){let e,t,i,s,l,o,r,a,u,f,d,p=n[7]&&Yc();s=new pe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[$$]},$$scope:{ctx:n}}});const m=n[13].default,_=Pt(m,n,n[23],Wc);function g(T,C){if(T[0].toDelete)return C$;if(T[7])return T$}let b=g(n),k=b&&b(n),w=n[7]&&Jc(n);return{c(){e=y("div"),t=y("div"),p&&p.c(),i=E(),z(s.$$.fragment),l=E(),_&&_.c(),o=E(),k&&k.c(),r=E(),w&&w.c(),h(t,"class","schema-field-header"),h(e,"draggable",!0),h(e,"class","schema-field"),x(e,"drag-over",n[4])},m(T,C){$(T,e,C),v(e,t),p&&p.m(t,null),v(t,i),V(s,t,null),v(t,l),_&&_.m(t,null),v(t,o),k&&k.m(t,null),v(e,r),w&&w.m(e,null),u=!0,f||(d=[J(e,"dragstart",n[19]),J(e,"dragenter",n[20]),J(e,"drop",pt(n[21])),J(e,"dragleave",n[22]),J(e,"dragover",pt(n[14]))],f=!0)},p(T,[C]){T[7]?p||(p=Yc(),p.c(),p.m(t,i)):p&&(p.d(1),p=null);const M={};C&128&&(M.class="form-field required m-0 "+(T[7]?"":"disabled")),C&2&&(M.name="schema."+T[1]+".name"),C&8388773&&(M.$$scope={dirty:C,ctx:T}),s.$set(M),_&&_.p&&(!u||C&8388800)&&Nt(_,m,T,T[23],u?Lt(m,T[23],C,S$):Ft(T[23]),Wc),b===(b=g(T))&&k?k.p(T,C):(k&&k.d(1),k=b&&b(T),k&&(k.c(),k.m(t,null))),T[7]?w?(w.p(T,C),C&128&&I(w,1)):(w=Jc(T),w.c(),I(w,1),w.m(e,null)):w&&(re(),L(w,1,1,()=>{w=null}),ae()),(!u||C&16)&&x(e,"drag-over",T[4])},i(T){u||(I(s.$$.fragment,T),I(_,T),I(w),T&&et(()=>{u&&(a||(a=Ve(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(T){L(s.$$.fragment,T),L(_,T),L(w),T&&(a||(a=Ve(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(T){T&&S(e),p&&p.d(),H(s),_&&_.d(T),k&&k.d(),w&&w.d(),T&&a&&a.end(),f=!1,Ie(d)}}}function A$(n,e,t){let i,s,l,o;Ke(n,ii,F=>t(12,o=F));let{$$slots:r={},$$scope:a}=e,{key:u=""}=e,{field:f=new bn}=e,d,p,m=!1;const _=St(),g={bool:"Nonfalsey",number:"Nonzero"};function b(){f.id?t(0,f.toDelete=!0,f):_("remove")}function k(){t(0,f.toDelete=!1,f),gn({})}function w(F){return j.slugify(F)}Zt(()=>{f.onMountSelect&&(t(0,f.onMountSelect=!1,f),d==null||d.select())});function T(F){de.call(this,n,F)}function C(F){se[F?"unshift":"push"](()=>{d=F,t(2,d)})}const M=F=>{const q=f.name;t(0,f.name=w(F.target.value),f),F.target.value=f.name,_("rename",{oldName:q,newName:f.name})};function O(F){se[F?"unshift":"push"](()=>{p=F,t(3,p)})}function D(){f.required=this.checked,t(0,f)}const A=F=>{if(!F.target.classList.contains("drag-handle-wrapper")){F.preventDefault();return}const q=document.createElement("div");F.dataTransfer.setDragImage(q,0,0),i&&_("dragstart",F)},P=F=>{i&&(t(4,m=!0),_("dragenter",F))},N=F=>{i&&(t(4,m=!1),_("drop",F))},R=F=>{i&&(t(4,m=!1),_("dragleave",F))};return n.$$set=F=>{"key"in F&&t(1,u=F.key),"field"in F&&t(0,f=F.field),"$$scope"in F&&t(23,a=F.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&f.toDelete&&f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f),n.$$.dirty&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty&1&&t(7,i=!f.toDelete&&!(f.id&&f.system)),n.$$.dirty&4098&&t(6,s=!j.isEmpty(j.getNestedVal(o,`schema.${u}`))),n.$$.dirty&1&&t(5,l=g[f==null?void 0:f.type]||"Nonempty")},[f,u,d,p,m,l,s,i,_,b,k,w,o,r,T,C,M,O,D,A,P,N,R,a]}class si extends ve{constructor(e){super(),be(this,e,A$,E$,ge,{key:1,field:0})}}function I$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min length"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","number"),h(l,"id",o=n[13]),h(l,"step","1"),h(l,"min","0")},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&h(e,"for",i),f&8192&&o!==(o=u[13])&&h(l,"id",o),f&1&>(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function P$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max length"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","number"),h(l,"id",o=n[13]),h(l,"step","1"),h(l,"min",r=n[0].options.min||0)},m(f,d){$(f,e,d),v(e,t),$(f,s,d),$(f,l,d),ue(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&8192&&i!==(i=f[13])&&h(e,"for",i),d&8192&&o!==(o=f[13])&&h(l,"id",o),d&1&&r!==(r=f[0].options.min||0)&&h(l,"min",r),d&1&>(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&S(e),f&&S(s),f&&S(l),a=!1,u()}}}function L$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Regex pattern"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","text"),h(l,"id",o=n[13]),h(l,"placeholder","Valid Go regular expression, eg. ^w+$")},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.pattern),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&h(e,"for",i),f&8192&&o!==(o=u[13])&&h(l,"id",o),f&1&&l.value!==u[0].options.pattern&&ue(l,u[0].options.pattern)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function N$(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[I$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[P$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[L$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),h(t,"class","col-sm-3"),h(l,"class","col-sm-3"),h(a,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(d,p){$(d,e,p),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),f=!0},p(d,p){const m={};p&2&&(m.name="schema."+d[1]+".options.min"),p&24577&&(m.$$scope={dirty:p,ctx:d}),i.$set(m);const _={};p&2&&(_.name="schema."+d[1]+".options.max"),p&24577&&(_.$$scope={dirty:p,ctx:d}),o.$set(_);const g={};p&2&&(g.name="schema."+d[1]+".options.pattern"),p&24577&&(g.$$scope={dirty:p,ctx:d}),u.$set(g)},i(d){f||(I(i.$$.fragment,d),I(o.$$.fragment,d),I(u.$$.fragment,d),f=!0)},o(d){L(i.$$.fragment,d),L(o.$$.fragment,d),L(u.$$.fragment,d),f=!1},d(d){d&&S(e),H(i),H(o),H(u)}}}function F$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[N$]},$$scope:{ctx:n}};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("drop",n[9]),e.$on("dragstart",n[10]),e.$on("dragenter",n[11]),e.$on("dragleave",n[12]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Bt(r[2])]):{};a&16387&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function R$(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=gt(this.value),t(0,l)}function a(){l.options.max=gt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(k){l=k,t(0,l)}function d(k){de.call(this,n,k)}function p(k){de.call(this,n,k)}function m(k){de.call(this,n,k)}function _(k){de.call(this,n,k)}function g(k){de.call(this,n,k)}function b(k){de.call(this,n,k)}return n.$$set=k=>{e=Fe(Fe({},e),zt(k)),t(2,s=Ge(e,i)),"field"in k&&t(0,l=k.field),"key"in k&&t(1,o=k.key)},[l,o,s,r,a,u,f,d,p,m,_,g,b]}class q$ extends ve{constructor(e){super(),be(this,e,R$,F$,ge,{field:0,key:1})}}function j$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12])},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&>(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function V$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),h(l,"min",r=n[0].options.min)},m(f,d){$(f,e,d),v(e,t),$(f,s,d),$(f,l,d),ue(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&4096&&i!==(i=f[12])&&h(e,"for",i),d&4096&&o!==(o=f[12])&&h(l,"id",o),d&1&&r!==(r=f[0].options.min)&&h(l,"min",r),d&1&>(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&S(e),f&&S(s),f&&S(l),a=!1,u()}}}function H$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[j$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[V$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){$(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&S(e),H(i),H(o)}}}function z$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[H$]},$$scope:{ctx:n}};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Bt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function B$(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=gt(this.value),t(0,l)}function a(){l.options.max=gt(this.value),t(0,l)}function u(b){l=b,t(0,l)}function f(b){de.call(this,n,b)}function d(b){de.call(this,n,b)}function p(b){de.call(this,n,b)}function m(b){de.call(this,n,b)}function _(b){de.call(this,n,b)}function g(b){de.call(this,n,b)}return n.$$set=b=>{e=Fe(Fe({},e),zt(b)),t(2,s=Ge(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class U$ extends ve{constructor(e){super(),be(this,e,B$,z$,ge,{field:0,key:1})}}function W$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Bt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function Y$(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){de.call(this,n,_)}function u(_){de.call(this,n,_)}function f(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function m(_){de.call(this,n,_)}return n.$$set=_=>{e=Fe(Fe({},e),zt(_)),t(2,s=Ge(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class K$ extends ve{constructor(e){super(),be(this,e,Y$,W$,ge,{field:0,key:1})}}function J$(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=Fe(Fe({},e),zt(u)),t(3,l=Ge(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 Rs extends ve{constructor(e){super(),be(this,e,Z$,J$,ge,{value:0,separator:1})}}function G$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[3](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(g.value=n[0].options.exceptDomains),r=new Rs({props:g}),se.push(()=>_e(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){$(b,e,k),v(e,t),v(e,i),v(e,s),$(b,o,k),V(r,b,k),$(b,u,k),$(b,f,k),d=!0,p||(m=De(Ue.call(null,s,{text:`List of domains that are NOT allowed. This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const w={};k&4096&&(w.id=b[12]),k&1&&(w.disabled=!j.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,w.value=b[0].options.exceptDomains,ke(()=>a=!1)),r.$set(w)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){L(r.$$.fragment,b),d=!1},d(b){b&&S(e),b&&S(o),H(r,b),b&&S(u),b&&S(f),p=!1,m()}}}function X$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[4](b)}let g={id:n[12]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new Rs({props:g}),se.push(()=>_e(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]+".options.onlyDomains"),h(f,"class","help-block")},m(b,k){$(b,e,k),v(e,t),v(e,i),v(e,s),$(b,o,k),V(r,b,k),$(b,u,k),$(b,f,k),d=!0,p||(m=De(Ue.call(null,s,{text:`List of domains that are ONLY allowed. This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]+".options.onlyDomains"))&&h(e,"for",l);const w={};k&4096&&(w.id=b[12]+".options.onlyDomains"),k&1&&(w.disabled=!j.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,w.value=b[0].options.onlyDomains,ke(()=>a=!1)),r.$set(w)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){L(r.$$.fragment,b),d=!1},d(b){b&&S(e),b&&S(o),H(r,b),b&&S(u),b&&S(f),p=!1,m()}}}function Q$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[G$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[X$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){$(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&S(e),H(i),H(o)}}}function x$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[Q$]},$$scope:{ctx:n}};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Bt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function eT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(b){n.$$.not_equal(l.options.exceptDomains,b)&&(l.options.exceptDomains=b,t(0,l))}function a(b){n.$$.not_equal(l.options.onlyDomains,b)&&(l.options.onlyDomains=b,t(0,l))}function u(b){l=b,t(0,l)}function f(b){de.call(this,n,b)}function d(b){de.call(this,n,b)}function p(b){de.call(this,n,b)}function m(b){de.call(this,n,b)}function _(b){de.call(this,n,b)}function g(b){de.call(this,n,b)}return n.$$set=b=>{e=Fe(Fe({},e),zt(b)),t(2,s=Ge(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class Z1 extends ve{constructor(e){super(),be(this,e,eT,x$,ge,{field:0,key:1})}}function tT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Bt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function nT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){de.call(this,n,_)}function u(_){de.call(this,n,_)}function f(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function m(_){de.call(this,n,_)}return n.$$set=_=>{e=Fe(Fe({},e),zt(_)),t(2,s=Ge(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class iT extends ve{constructor(e){super(),be(this,e,nT,tT,ge,{field:0,key:1})}}function sT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&Bt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function lT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){de.call(this,n,_)}function u(_){de.call(this,n,_)}function f(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function m(_){de.call(this,n,_)}return n.$$set=_=>{e=Fe(Fe({},e),zt(_)),t(2,s=Ge(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class oT extends ve{constructor(e){super(),be(this,e,lT,sT,ge,{field:0,key:1})}}var Cr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Ss={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},yl={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},cn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function Gc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Mr=function(n){return n instanceof Array?n:[n]};function nn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ut(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 lo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function G1(n,e){if(e(n))return n;if(n.parentNode)return G1(n.parentNode,e)}function oo(n,e){var t=ut("div","numInputWrapper"),i=ut("input","numInput "+n),s=ut("span","arrowUp"),l=ut("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 kn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Or=function(){},Fo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},rT={D:Or,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*In(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:Or,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:Or,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Zi={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})"},al={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[al.w(n,e,t)]},F:function(n,e,t){return Fo(al.n(n,e,t)-1,!1,e)},G:function(n,e,t){return cn(al.h(n,e,t))},H:function(n){return cn(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[In(n.getHours()>11)]},M:function(n,e){return Fo(n.getMonth(),!0,e)},S:function(n){return cn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return cn(n.getFullYear(),4)},d:function(n){return cn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return cn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return cn(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)}},X1=function(n){var e=n.config,t=e===void 0?Ss:e,i=n.l10n,s=i===void 0?yl: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(d,p,m){return al[d]&&m[p-1]!=="\\"?al[d](r,f,t):d!=="\\"?d:""}).join("")}},pa=function(n){var e=n.config,t=e===void 0?Ss:e,i=n.l10n,s=i===void 0?yl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,d=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 p=o||(t||Ss).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,p);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var _=void 0,g=[],b=0,k=0,w="";bMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Er(t.config);K.setHours(ne.hours,ne.minutes,ne.seconds,K.getMilliseconds()),t.selectedDates=[K],t.latestSelectedDateObj=K}W!==void 0&&W.type!=="blur"&&ql(W);var oe=t._input.value;d(),Jt(),t._input.value!==oe&&t._debouncedChange()}function u(W,K){return W%12+12*In(K===t.l10n.amPM[1])}function f(W){switch(W%24){case 0:case 12:return 12;default:return W%12}}function d(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var W=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,K=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(W=u(W,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&wn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&wn(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 Ae=Dr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Le=Dr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Oe=Dr(W,K,ne);if(Oe>Le&&Oe=12)]),t.secondElement!==void 0&&(t.secondElement.value=cn(ne)))}function _(W){var K=kn(W),ne=parseInt(K.value)+(W.delta||0);(ne/1e3>1||W.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&we(ne)}function g(W,K,ne,oe){if(K instanceof Array)return K.forEach(function(Te){return g(W,Te,ne,oe)});if(W instanceof Array)return W.forEach(function(Te){return g(Te,K,ne,oe)});W.addEventListener(K,ne,oe),t._handlers.push({remove:function(){return W.removeEventListener(K,ne,oe)}})}function b(){tt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(oe){return g(oe,"click",t[ne])})}),t.isMobile){as();return}var W=Gc(te,50);if(t._debouncedChange=Gc(b,cT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&We(kn(ne))}),g(t._input,"keydown",Ze),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Ze),!t.config.inline&&!t.config.static&&g(window,"resize",W),window.ontouchstart!==void 0?g(window.document,"touchstart",He):g(window.document,"mousedown",He),g(window.document,"focus",He,{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",tn),g(t.monthNav,["keyup","increment"],_),g(t.daysContainer,"click",On)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var K=function(ne){return kn(ne).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",T),g([t.hourElement,t.minuteElement],["focus","click"],K),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&g(t._input,"blur",ht)}function w(W,K){var ne=W!==void 0?t.parseDate(W):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(W);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 Ae=ut("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ae,t.element),Ae.appendChild(t.element),t.altInput&&Ae.appendChild(t.altInput),Ae.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(W,K,ne,oe){var Te=Ce(K,!0),Ae=ut("span",W,K.getDate().toString());return Ae.dateObj=K,Ae.$i=oe,Ae.setAttribute("aria-label",t.formatDate(K,t.config.ariaDateFormat)),W.indexOf("hidden")===-1&&wn(K,t.now)===0&&(t.todayDateElem=Ae,Ae.classList.add("today"),Ae.setAttribute("aria-current","date")),Te?(Ae.tabIndex=-1,li(K)&&(Ae.classList.add("selected"),t.selectedDateElem=Ae,t.config.mode==="range"&&(nn(Ae,"startRange",t.selectedDates[0]&&wn(K,t.selectedDates[0],!0)===0),nn(Ae,"endRange",t.selectedDates[1]&&wn(K,t.selectedDates[1],!0)===0),W==="nextMonthDay"&&Ae.classList.add("inRange")))):Ae.classList.add("flatpickr-disabled"),t.config.mode==="range"&&fs(K)&&!li(K)&&Ae.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&W!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(K)+""),tt("onDayCreate",Ae),Ae}function D(W){W.focus(),t.config.mode==="range"&&We(W)}function A(W){for(var K=W>0?0:t.config.showMonths-1,ne=W>0?t.config.showMonths:-1,oe=K;oe!=ne;oe+=W)for(var Te=t.daysContainer.children[oe],Ae=W>0?0:Te.children.length-1,Le=W>0?Te.children.length:-1,Oe=Ae;Oe!=Le;Oe+=W){var Ye=Te.children[Oe];if(Ye.className.indexOf("hidden")===-1&&Ce(Ye.dateObj))return Ye}}function P(W,K){for(var ne=W.className.indexOf("Month")===-1?W.dateObj.getMonth():t.currentMonth,oe=K>0?t.config.showMonths:-1,Te=K>0?1:-1,Ae=ne-t.currentMonth;Ae!=oe;Ae+=Te)for(var Le=t.daysContainer.children[Ae],Oe=ne-t.currentMonth===Ae?W.$i+K:K<0?Le.children.length-1:0,Ye=Le.children.length,Re=Oe;Re>=0&&Re0?Ye:-1);Re+=Te){var Be=Le.children[Re];if(Be.className.indexOf("hidden")===-1&&Ce(Be.dateObj)&&Math.abs(W.$i-Re)>=Math.abs(K))return D(Be)}t.changeMonth(Te),N(A(Te),0)}function N(W,K){var ne=l(),oe=Je(ne||document.body),Te=W!==void 0?W:oe?ne:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:A(K>0?1:-1);Te===void 0?t._input.focus():oe?P(Te,K):D(Te)}function R(W,K){for(var ne=(new Date(W,K,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((K-1+12)%12,W),Te=t.utils.getDaysInMonth(K,W),Ae=window.document.createDocumentFragment(),Le=t.config.showMonths>1,Oe=Le?"prevMonthDay hidden":"prevMonthDay",Ye=Le?"nextMonthDay hidden":"nextMonthDay",Re=oe+1-ne,Be=0;Re<=oe;Re++,Be++)Ae.appendChild(O("flatpickr-day "+Oe,new Date(W,K-1,Re),Re,Be));for(Re=1;Re<=Te;Re++,Be++)Ae.appendChild(O("flatpickr-day",new Date(W,K,Re),Re,Be));for(var bt=Te+1;bt<=42-ne&&(t.config.showMonths===1||Be%7!==0);bt++,Be++)Ae.appendChild(O("flatpickr-day "+Ye,new Date(W,K+1,bt%Te),bt,Be));var Gn=ut("div","dayContainer");return Gn.appendChild(Ae),Gn}function F(){if(t.daysContainer!==void 0){lo(t.daysContainer),t.weekNumbers&&lo(t.weekNumbers);for(var W=document.createDocumentFragment(),K=0;K1||t.config.monthSelectorType!=="dropdown")){var W=function(oe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&oet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var K=0;K<12;K++)if(W(K)){var ne=ut("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,K).getMonth().toString(),ne.textContent=Fo(K,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===K&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function B(){var W=ut("div","flatpickr-month"),K=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ut("span","cur-month"):(t.monthsDropdownContainer=ut("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Le){var Oe=kn(Le),Ye=parseInt(Oe.value,10);t.changeMonth(Ye-t.currentMonth),tt("onMonthChange")}),q(),ne=t.monthsDropdownContainer);var oe=oo("cur-year",{tabindex:"-1"}),Te=oe.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 Ae=ut("div","flatpickr-current-month");return Ae.appendChild(ne),Ae.appendChild(oe),K.appendChild(Ae),W.appendChild(K),{container:W,yearElement:Te,monthElement:ne}}function Y(){lo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var W=t.config.showMonths;W--;){var K=B();t.yearElements.push(K.yearElement),t.monthElements.push(K.monthElement),t.monthNav.appendChild(K.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ut("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ut("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ut("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,Y(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(W){t.__hidePrevMonthArrow!==W&&(nn(t.prevMonthNav,"flatpickr-disabled",W),t.__hidePrevMonthArrow=W)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(W){t.__hideNextMonthArrow!==W&&(nn(t.nextMonthNav,"flatpickr-disabled",W),t.__hideNextMonthArrow=W)}}),t.currentYearElement=t.yearElements[0],qi(),t.monthNav}function ee(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var W=Er(t.config);t.timeContainer=ut("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var K=ut("span","flatpickr-time-separator",":"),ne=oo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var oe=oo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=cn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?W.hours:f(W.hours)),t.minuteElement.value=cn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():W.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(ne),t.timeContainer.appendChild(K),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=oo("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=cn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():W.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(ut("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=ut("span","flatpickr-am-pm",t.l10n.amPM[In((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 ie(){t.weekdayContainer?lo(t.weekdayContainer):t.weekdayContainer=ut("div","flatpickr-weekdays");for(var W=t.config.showMonths;W--;){var K=ut("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(K)}return X(),t.weekdayContainer}function X(){if(t.weekdayContainer){var W=t.l10n.firstDayOfWeek,K=Xc(t.l10n.weekdays.shorthand);W>0&&W `+K.join("")+` `}}function fe(){t.calendarContainer.classList.add("hasWeeks");var W=ut("div","flatpickr-weekwrapper");W.appendChild(ut("span","flatpickr-weekday",t.l10n.weekAbbreviation));var K=ut("div","flatpickr-weeks");return W.appendChild(K),{weekWrapper:W,weekNumbers:K}}function G(W,K){K===void 0&&(K=!0);var ne=K?W:W-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,tt("onYearChange"),q()),F(),tt("onMonthChange"),qi())}function ce(W,K){if(W===void 0&&(W=!0),K===void 0&&(K=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,K===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Er(t.config),oe=ne.hours,Te=ne.minutes,Ae=ne.seconds;m(oe,Te,Ae)}t.redraw(),W&&tt("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")),tt("onClose")}function Me(){t.config!==void 0&&tt("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].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 K=t.calendarContainer.parentNode;if(K.lastChild&&K.removeChild(K.lastChild),K.parentNode){for(;K.firstChild;)K.parentNode.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}}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(ne){try{delete t[ne]}catch{}})}function je(W){return t.calendarContainer.contains(W)}function He(W){if(t.isOpen&&!t.config.inline){var K=kn(W),ne=je(K),oe=K===t.input||K===t.altInput||t.element.contains(K)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Te=!oe&&!ne&&!je(W.relatedTarget),Ae=!t.config.ignoredFocusElements.some(function(Le){return Le.contains(K)});Te&&Ae&&(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 we(W){if(!(!W||t.config.minDate&&Wt.config.maxDate.getFullYear())){var K=W,ne=t.currentYear!==K;t.currentYear=K||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)),ne&&(t.redraw(),tt("onYearChange"),q())}}function Ce(W,K){var ne;K===void 0&&(K=!0);var oe=t.parseDate(W,void 0,K);if(t.config.minDate&&oe&&wn(oe,t.config.minDate,K!==void 0?K:!t.minDateHasTime)<0||t.config.maxDate&&oe&&wn(oe,t.config.maxDate,K!==void 0?K:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Te=!!t.config.enable,Ae=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Le=0,Oe=void 0;Le=Oe.from.getTime()&&oe.getTime()<=Oe.to.getTime())return Te}return!Te}function Je(W){return t.daysContainer!==void 0?W.className.indexOf("hidden")===-1&&W.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(W):!1}function ht(W){var K=W.target===t._input,ne=t._input.value.trimEnd()!==ji();K&&ne&&!(W.relatedTarget&&je(W.relatedTarget))&&t.setDate(t._input.value,!0,W.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ze(W){var K=kn(W),ne=t.config.wrap?n.contains(K):K===t._input,oe=t.config.allowInput,Te=t.isOpen&&(!oe||!ne),Ae=t.config.inline&&ne&&!oe;if(W.keyCode===13&&ne){if(oe)return t.setDate(t._input.value,!0,K===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),K.blur();t.open()}else if(je(K)||Te||Ae){var Le=!!t.timeContainer&&t.timeContainer.contains(K);switch(W.keyCode){case 13:Le?(W.preventDefault(),a(),vt()):On(W);break;case 27:W.preventDefault(),vt();break;case 8:case 46:ne&&!t.config.allowInput&&(W.preventDefault(),t.clear());break;case 37:case 39:if(!Le&&!ne){W.preventDefault();var Oe=l();if(t.daysContainer!==void 0&&(oe===!1||Oe&&Je(Oe))){var Ye=W.keyCode===39?1:-1;W.ctrlKey?(W.stopPropagation(),G(Ye),N(A(1),0)):N(void 0,Ye)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:W.preventDefault();var Re=W.keyCode===40?1:-1;t.daysContainer&&K.$i!==void 0||K===t.input||K===t.altInput?W.ctrlKey?(W.stopPropagation(),we(t.currentYear-Re),N(A(1),0)):Le||N(void 0,Re*7):K===t.currentYearElement?we(t.currentYear-Re):t.config.enableTime&&(!Le&&t.hourElement&&t.hourElement.focus(),a(W),t._debouncedChange());break;case 9:if(Le){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(yn){return yn}),bt=Be.indexOf(K);if(bt!==-1){var Gn=Be[bt+(W.shiftKey?-1:1)];W.preventDefault(),(Gn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(K)&&W.shiftKey&&(W.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&K===t.amPM)switch(W.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],d(),Jt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),Jt();break}(ne||je(K))&&tt("onKeyDown",W)}function We(W,K){if(K===void 0&&(K="flatpickr-day"),!(t.selectedDates.length!==1||W&&(!W.classList.contains(K)||W.classList.contains("flatpickr-disabled")))){for(var ne=W?W.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Ae=Math.max(ne,t.selectedDates[0].getTime()),Le=!1,Oe=0,Ye=0,Re=Te;ReTe&&ReOe)?Oe=Re:Re>oe&&(!Ye||Re ."+K));Be.forEach(function(bt){var Gn=bt.dateObj,yn=Gn.getTime(),qs=Oe>0&&yn0&&yn>Ye;if(qs){bt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(cs){bt.classList.remove(cs)});return}else if(Le&&!qs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(cs){bt.classList.remove(cs)}),W!==void 0&&(W.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),oene&&yn===oe&&bt.classList.add("endRange"),yn>=Oe&&(Ye===0||yn<=Ye)&&aT(yn,oe,ne)&&bt.classList.add("inRange"))})}}function te(){t.isOpen&&!t.config.static&&!t.config.inline&&Xe()}function qe(W,K){if(K===void 0&&(K=t._positionElement),t.isMobile===!0){if(W){W.preventDefault();var ne=kn(W);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),tt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var oe=t.isOpen;t.isOpen=!0,oe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),tt("onOpen"),Xe(K)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(W===void 0||!t.timeContainer.contains(W.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Qe(W){return function(K){var ne=t.config["_"+W+"Date"]=t.parseDate(K,t.config.dateFormat),oe=t.config["_"+(W==="min"?"max":"min")+"Date"];ne!==void 0&&(t[W==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return Ce(Te)}),!t.selectedDates.length&&W==="min"&&p(ne),Jt()),t.daysContainer&&(nt(),ne!==void 0?t.currentYearElement[W]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(W),t.currentYearElement.disabled=!!oe&&ne!==void 0&&oe.getFullYear()===ne.getFullYear())}}function Kt(){var W=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],K=Gt(Gt({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=K.parseDate,t.config.formatDate=K.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=vi(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=vi(Be)}});var oe=K.mode==="time";if(!K.dateFormat&&(K.enableTime||oe)){var Te=Vt.defaultConfig.dateFormat||Ss.dateFormat;ne.dateFormat=K.noCalendar||oe?"H:i"+(K.enableSeconds?":S":""):Te+" H:i"+(K.enableSeconds?":S":"")}if(K.altInput&&(K.enableTime||oe)&&!K.altFormat){var Ae=Vt.defaultConfig.altFormat||Ss.altFormat;ne.altFormat=K.noCalendar||oe?"h:i"+(K.enableSeconds?":S K":" K"):Ae+(" h:i"+(K.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Qe("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Qe("max")});var Le=function(Be){return function(bt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(bt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Le("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Le("max")}),K.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,K);for(var Oe=0;Oe-1?t.config[Re]=Mr(Ye[Re]).map(o).concat(t.config[Re]):typeof K[Re]>"u"&&(t.config[Re]=Ye[Re])}K.altInputClass||(t.config.altInputClass=Ne().className+" "+t.config.altInputClass),tt("onParseConfig")}function Ne(){return t.config.wrap?n.querySelector("[data-input]"):n}function $e(){typeof t.config.locale!="object"&&typeof Vt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Gt(Gt({},Vt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Vt.l10ns[t.config.locale]:void 0),Zi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Zi.l="("+t.l10n.weekdays.longhand.join("|")+")",Zi.M="("+t.l10n.months.shorthand.join("|")+")",Zi.F="("+t.l10n.months.longhand.join("|")+")",Zi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var W=Gt(Gt({},e),JSON.parse(JSON.stringify(n.dataset||{})));W.time_24hr===void 0&&Vt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=X1(t),t.parseDate=pa({config:t.config,l10n:t.l10n})}function Xe(W){if(typeof t.config.position=="function")return void t.config.position(t,W);if(t.calendarContainer!==void 0){tt("onPreCalendarPosition");var K=W||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(ab,ub){return ab+ub.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ae=Te[0],Le=Te.length>1?Te[1]:null,Oe=K.getBoundingClientRect(),Ye=window.innerHeight-Oe.bottom,Re=Ae==="above"||Ae!=="below"&&Yene,Be=window.pageYOffset+Oe.top+(Re?-ne-2:K.offsetHeight+2);if(nn(t.calendarContainer,"arrowTop",!Re),nn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var bt=window.pageXOffset+Oe.left,Gn=!1,yn=!1;Le==="center"?(bt-=(oe-Oe.width)/2,Gn=!0):Le==="right"&&(bt-=oe-Oe.width,yn=!0),nn(t.calendarContainer,"arrowLeft",!Gn&&!yn),nn(t.calendarContainer,"arrowCenter",Gn),nn(t.calendarContainer,"arrowRight",yn);var qs=window.document.body.offsetWidth-(window.pageXOffset+Oe.right),cs=bt+oe>window.document.body.offsetWidth,tb=qs+oe>window.document.body.offsetWidth;if(nn(t.calendarContainer,"rightMost",cs),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!cs)t.calendarContainer.style.left=bt+"px",t.calendarContainer.style.right="auto";else if(!tb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=qs+"px";else{var tr=ye();if(tr===void 0)return;var nb=window.document.body.offsetWidth,ib=Math.max(0,nb/2-oe/2),sb=".flatpickr-calendar.centerMost:before",lb=".flatpickr-calendar.centerMost:after",ob=tr.cssRules.length,rb="{left:"+Oe.left+"px;right:auto;}";nn(t.calendarContainer,"rightMost",!1),nn(t.calendarContainer,"centerMost",!0),tr.insertRule(sb+","+lb+rb,ob),t.calendarContainer.style.left=ib+"px",t.calendarContainer.style.right="auto"}}}}function ye(){for(var W=null,K=0;Kt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Le=li(Te);Le?t.selectedDates.splice(parseInt(Le),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),wn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,bt){return Be.getTime()-bt.getTime()}));if(d(),Ae){var Oe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),Oe&&(tt("onYearChange"),q()),tt("onMonthChange")}if(qi(),F(),Jt(),!Ae&&t.config.mode!=="range"&&t.config.showMonths===1?D(oe):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 Ye=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ye||Re)&&vt()}b()}}var rt={locale:[$e,X],showMonths:[Y,r,ie],minDate:[w],maxDate:[w],positionElement:[Ri],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 Zn(W,K){if(W!==null&&typeof W=="object"){Object.assign(t.config,W);for(var ne in W)rt[ne]!==void 0&&rt[ne].forEach(function(oe){return oe()})}else t.config[W]=K,rt[W]!==void 0?rt[W].forEach(function(oe){return oe()}):Cr.indexOf(W)>-1&&(t.config[W]=Mr(K));t.redraw(),Jt(!0)}function os(W,K){var ne=[];if(W instanceof Array)ne=W.map(function(oe){return t.parseDate(oe,K)});else if(W instanceof Date||typeof W=="number")ne=[t.parseDate(W,K)];else if(typeof W=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(W,K)];break;case"multiple":ne=W.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,K)});break;case"range":ne=W.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,K)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(W)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(oe){return oe instanceof Date&&Ce(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Te){return oe.getTime()-Te.getTime()})}function Fl(W,K,ne){if(K===void 0&&(K=!1),ne===void 0&&(ne=t.config.dateFormat),W!==0&&!W||W instanceof Array&&W.length===0)return t.clear(K);os(W,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),w(void 0,K),p(),t.selectedDates.length===0&&t.clear(!1),Jt(K),K&&tt("onChange")}function vi(W){return W.slice().map(function(K){return typeof K=="string"||typeof K=="number"||K instanceof Date?t.parseDate(K,void 0,!0):K&&typeof K=="object"&&K.from&&K.to?{from:t.parseDate(K.from,void 0),to:t.parseDate(K.to,void 0)}:K}).filter(function(K){return K})}function rs(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var W=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);W&&os(W,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Rl(){if(t.input=Ne(),!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=ut(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"),Ri()}function Ri(){t._positionElement=t.config.positionElement||t._input}function as(){var W=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ut("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=W,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=W==="datetime-local"?"Y-m-d\\TH:i:S":W==="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(K){t.setDate(kn(K).value,!1,t.mobileFormatStr),tt("onChange"),tt("onClose")})}function fn(W){if(t.isOpen===!0)return t.close();t.open(W)}function tt(W,K){if(t.config!==void 0){var ne=t.config[W];if(ne!==void 0&&ne.length>0)for(var oe=0;ne[oe]&&oe=0&&wn(W,t.selectedDates[1])<=0}function qi(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(W,K){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+K),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[K].textContent=Fo(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),W.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function ji(W){var K=W||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,K)}).filter(function(ne,oe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Jt(W){W===void 0&&(W=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=ji(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=ji(t.config.altFormat)),W!==!1&&tt("onValueUpdate")}function tn(W){var K=kn(W),ne=t.prevMonthNav.contains(K),oe=t.nextMonthNav.contains(K);ne||oe?G(ne?-1:1):t.yearElements.indexOf(K)>=0?K.select():K.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):K.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function ql(W){W.preventDefault();var K=W.type==="keydown",ne=kn(W),oe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(oe.getAttribute("min")),Ae=parseFloat(oe.getAttribute("max")),Le=parseFloat(oe.getAttribute("step")),Oe=parseInt(oe.value,10),Ye=W.delta||(K?W.which===38?1:-1:0),Re=Oe+Le*Ye;if(typeof oe.value<"u"&&oe.value.length===2){var Be=oe===t.hourElement,bt=oe===t.minuteElement;ReAe&&(Re=oe===t.hourElement?Re-Ae-In(!t.amPM):Te,bt&&C(void 0,1,t.hourElement)),t.amPM&&Be&&(Le===1?Re+Oe===23:Math.abs(Re-Oe)>Le)&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=cn(Re)}}return s(),t}function $s(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function _T(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Ge(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:d=void 0}=e,{options:p={}}=e,m=!1,{input:_=void 0,flatpickr:g=void 0}=e;Zt(()=>{const C=f??_,M=k(p);return M.onReady.push((O,D,A)=>{a===void 0&&w(O,D,A),an().then(()=>{t(8,m=!0)})}),t(3,g=Vt(C,Object.assign(M,f?{wrap:!0}:{}))),()=>{g.destroy()}});const b=St();function k(C={}){C=Object.assign({},C);for(const M of r){const O=(D,A,P)=>{b(hT(M),[D,A,P])};M in C?(Array.isArray(C[M])||(C[M]=[C[M]]),C[M].push(O)):C[M]=[O]}return C.onChange&&!C.onChange.includes(w)&&C.onChange.push(w),C}function w(C,M,O){const D=Qc(O,C);!xc(a,D)&&(a||D)&&t(2,a=D),t(4,u=M)}function T(C){se[C?"unshift":"push"](()=>{_=C,t(0,_)})}return n.$$set=C=>{e=Fe(Fe({},e),zt(C)),t(1,s=Ge(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,d=C.dateFormat),"options"in C&&t(7,p=C.options),"input"in C&&t(0,_=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&&m&&(xc(a,Qc(g,g.selectedDates))||g.setDate(a,!0,d)),n.$$.dirty&392&&g&&m)for(const[C,M]of Object.entries(k(p)))g.set(C,M)},[_,s,a,g,u,f,d,p,m,o,l,T]}class iu extends ve{constructor(e){super(),be(this,e,_T,mT,ge,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function gT(n){let e,t,i,s,l,o,r,a;function u(p){n[6](p)}function f(p){n[7](p)}let d={id:n[19],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(d.value=n[2]),n[0].options.min!==void 0&&(d.formattedValue=n[0].options.min),l=new iu({props:d}),se.push(()=>_e(l,"value",u)),se.push(()=>_e(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=y("label"),t=U("Min date (UTC)"),s=E(),z(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){$(p,e,m),v(e,t),$(p,s,m),V(l,p,m),a=!0},p(p,m){(!a||m&524288&&i!==(i=p[19]))&&h(e,"for",i);const _={};m&524288&&(_.id=p[19]),!o&&m&4&&(o=!0,_.value=p[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.min,ke(()=>r=!1)),l.$set(_)},i(p){a||(I(l.$$.fragment,p),a=!0)},o(p){L(l.$$.fragment,p),a=!1},d(p){p&&S(e),p&&S(s),H(l,p)}}}function bT(n){let e,t,i,s,l,o,r,a;function u(p){n[9](p)}function f(p){n[10](p)}let d={id:n[19],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(d.value=n[3]),n[0].options.max!==void 0&&(d.formattedValue=n[0].options.max),l=new iu({props:d}),se.push(()=>_e(l,"value",u)),se.push(()=>_e(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=y("label"),t=U("Max date (UTC)"),s=E(),z(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){$(p,e,m),v(e,t),$(p,s,m),V(l,p,m),a=!0},p(p,m){(!a||m&524288&&i!==(i=p[19]))&&h(e,"for",i);const _={};m&524288&&(_.id=p[19]),!o&&m&8&&(o=!0,_.value=p[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.max,ke(()=>r=!1)),l.$set(_)},i(p){a||(I(l.$$.fragment,p),a=!0)},o(p){L(l.$$.fragment,p),a=!1},d(p){p&&S(e),p&&S(s),H(l,p)}}}function vT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[gT,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[bT,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){$(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1572869&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&1572873&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&S(e),H(i),H(o)}}}function yT(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[vT]},$$scope:{ctx:n}};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("drop",n[15]),e.$on("dragstart",n[16]),e.$on("dragenter",n[17]),e.$on("dragleave",n[18]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?kt(s,[a&2&&{key:r[1]},a&32&&Bt(r[5])]):{};a&1048591&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function kT(n,e,t){var D,A;const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e,r=(D=l==null?void 0:l.options)==null?void 0:D.min,a=(A=l==null?void 0:l.options)==null?void 0:A.max;function u(P,N){P.detail&&P.detail.length==3&&t(0,l.options[N]=P.detail[1],l)}function f(P){r=P,t(2,r),t(0,l)}function d(P){n.$$.not_equal(l.options.min,P)&&(l.options.min=P,t(0,l))}const p=P=>u(P,"min");function m(P){a=P,t(3,a),t(0,l)}function _(P){n.$$.not_equal(l.options.max,P)&&(l.options.max=P,t(0,l))}const g=P=>u(P,"max");function b(P){l=P,t(0,l)}function k(P){de.call(this,n,P)}function w(P){de.call(this,n,P)}function T(P){de.call(this,n,P)}function C(P){de.call(this,n,P)}function M(P){de.call(this,n,P)}function O(P){de.call(this,n,P)}return n.$$set=P=>{e=Fe(Fe({},e),zt(P)),t(5,s=Ge(e,i)),"field"in P&&t(0,l=P.field),"key"in P&&t(1,o=P.key)},n.$$.update=()=>{var P,N,R,F;n.$$.dirty&5&&r!=((P=l==null?void 0:l.options)==null?void 0:P.min)&&t(2,r=(N=l==null?void 0:l.options)==null?void 0:N.min),n.$$.dirty&9&&a!=((R=l==null?void 0:l.options)==null?void 0:R.max)&&t(3,a=(F=l==null?void 0:l.options)==null?void 0:F.max)},[l,o,r,a,u,s,f,d,p,m,_,g,b,k,w,T,C,M,O]}class wT extends ve{constructor(e){super(),be(this,e,kT,yT,ge,{field:0,key:1})}}const ST=n=>({}),ed=n=>({});function td(n,e,t){const i=n.slice();return i[46]=e[t],i}const $T=n=>({}),nd=n=>({});function id(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function sd(n){let e,t,i;return{c(){e=y("div"),t=U(n[2]),i=E(),h(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5])},m(s,l){$(s,e,l),v(e,t),v(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&32&&x(e,"link-hint",!s[5])},d(s){s&&S(e)}}}function TT(n){let e,t=n[46]+"",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt")},m(s,l){$(s,e,l),v(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&le(i,t)},i:Q,o:Q,d(s){s&&S(e)}}}function CT(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{H(f,1)}),ae()}l?(e=Ot(l,o()),z(e.$$.fragment),I(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&S(t),e&&H(e,r)}}}function ld(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=y("span"),e.innerHTML='',h(e,"class","clear")},m(l,o){$(l,e,o),t||(i=[De(Ue.call(null,e,"Clear")),J(e,"click",Cn(pt(s)))],t=!0)},p(l,o){n=l},d(l){l&&S(e),t=!1,Ie(i)}}}function od(n){let e,t,i,s,l,o;const r=[CT,TT],a=[];function u(d,p){return d[8]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&ld(n);return{c(){e=y("div"),i.c(),s=E(),f&&f.c(),l=E(),h(e,"class","option")},m(d,p){$(d,e,p),a[t].m(e,null),v(e,s),f&&f.m(e,null),v(e,l),o=!0},p(d,p){let m=t;t=u(d),t===m?a[t].p(d,p):(re(),L(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(d,p):(i=a[t]=r[t](d),i.c()),I(i,1),i.m(e,s)),d[4]||d[6]?f?f.p(d,p):(f=ld(d),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(d){o||(I(i),o=!0)},o(d){L(i),o=!1},d(d){d&&S(e),a[t].d(),f&&f.d()}}}function rd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[DT]},$$scope:{ctx:n}};return e=new Vn({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&262144&&(o.trigger=s[18]),l[0]&1612938|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[39](null),H(e,s)}}}function ad(n){let e,t,i,s,l,o,r,a,u=n[15].length&&ud(n);return{c(){e=y("div"),t=y("label"),i=y("div"),i.innerHTML='',s=E(),l=y("input"),o=E(),u&&u.c(),h(i,"class","addon p-r-0"),l.autofocus=!0,h(l,"type","text"),h(l,"placeholder",n[3]),h(t,"class","input-group"),h(e,"class","form-field form-field-sm options-search")},m(f,d){$(f,e,d),v(e,t),v(t,i),v(t,s),v(t,l),ue(l,n[15]),v(t,o),u&&u.m(t,null),l.focus(),r||(a=J(l,"input",n[36]),r=!0)},p(f,d){d[0]&8&&h(l,"placeholder",f[3]),d[0]&32768&&l.value!==f[15]&&ue(l,f[15]),f[15].length?u?u.p(f,d):(u=ud(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&S(e),u&&u.d(),r=!1,a()}}}function ud(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-transparent clear"),h(e,"class","addon suffix p-r-5")},m(l,o){$(l,e,o),v(e,t),i||(s=J(t,"click",Cn(pt(n[21]))),i=!0)},p:Q,d(l){l&&S(e),i=!1,s()}}}function fd(n){let e,t=n[1]&&cd(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),$(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=cd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&S(e)}}}function cd(n){let e,t;return{c(){e=y("div"),t=U(n[1]),h(e,"class","txt-missing")},m(i,s){$(i,e,s),v(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&S(e)}}}function MT(n){let e=n[46]+"",t;return{c(){t=U(e)},m(i,s){$(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&le(t,e)},i:Q,o:Q,d(i){i&&S(t)}}}function OT(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{H(f,1)}),ae()}l?(e=Ot(l,o()),z(e.$$.fragment),I(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&S(t),e&&H(e,r)}}}function dd(n){let e,t,i,s,l,o,r;const a=[OT,MT],u=[];function f(m,_){return m[10]?0:1}t=f(n),i=u[t]=a[t](n);function d(...m){return n[37](n[46],...m)}function p(...m){return n[38](n[46],...m)}return{c(){e=y("div"),i.c(),s=E(),h(e,"tabindex","0"),h(e,"class","dropdown-item option"),x(e,"closable",n[7]),x(e,"selected",n[19](n[46]))},m(m,_){$(m,e,_),u[t].m(e,null),v(e,s),l=!0,o||(r=[J(e,"click",d),J(e,"keydown",p)],o=!0)},p(m,_){n=m;let g=t;t=f(n),t===g?u[t].p(n,_):(re(),L(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,_):(i=u[t]=a[t](n),i.c()),I(i,1),i.m(e,s)),(!l||_[0]&128)&&x(e,"closable",n[7]),(!l||_[0]&1572864)&&x(e,"selected",n[19](n[46]))},i(m){l||(I(i),l=!0)},o(m){L(i),l=!1},d(m){m&&S(e),u[t].d(),o=!1,Ie(r)}}}function DT(n){let e,t,i,s,l,o=n[12]&&ad(n);const r=n[33].beforeOptions,a=Pt(r,n,n[42],nd);let u=n[20],f=[];for(let g=0;gL(f[g],1,1,()=>{f[g]=null});let p=null;u.length||(p=fd(n));const m=n[33].afterOptions,_=Pt(m,n,n[42],ed);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=y("div");for(let g=0;gL(a[p],1,1,()=>{a[p]=null});let f=null;r.length||(f=sd(n));let d=!n[5]&&rd(n);return{c(){e=y("div"),t=y("div");for(let p=0;p{d=null}),ae()):d?(d.p(p,m),m[0]&32&&I(d,1)):(d=rd(p),d.c(),I(d,1),d.m(e,null)),(!o||m[0]&8192&&l!==(l="select "+p[13]))&&h(e,"class",l),(!o||m[0]&8208)&&x(e,"multiple",p[4]),(!o||m[0]&8224)&&x(e,"disabled",p[5])},i(p){if(!o){for(let m=0;mQe(Kt,qe))||[]}function G(te,qe){te.preventDefault(),g&&p?B(qe):q(qe)}function ce(te,qe){(te.code==="Enter"||te.code==="Space")&&G(te,qe)}function he(){X(),setTimeout(()=>{const te=N==null?void 0:N.querySelector(".dropdown-item.option.selected");te&&(te.focus(),te.scrollIntoView({block:"nearest"}))},0)}function Me(te){te.stopPropagation(),!m&&(A==null||A.toggle())}Zt(()=>{const te=document.querySelectorAll(`label[for="${r}"]`);for(const qe of te)qe.addEventListener("click",Me);return()=>{for(const qe of te)qe.removeEventListener("click",Me)}});const je=te=>F(te);function He(te){se[te?"unshift":"push"](()=>{R=te,t(18,R)})}function we(){P=this.value,t(15,P)}const Ce=(te,qe)=>G(qe,te),Je=(te,qe)=>ce(qe,te);function ht(te){se[te?"unshift":"push"](()=>{A=te,t(16,A)})}function Ze(te){de.call(this,n,te)}function We(te){se[te?"unshift":"push"](()=>{N=te,t(17,N)})}return n.$$set=te=>{"id"in te&&t(25,r=te.id),"noOptionsText"in te&&t(1,a=te.noOptionsText),"selectPlaceholder"in te&&t(2,u=te.selectPlaceholder),"searchPlaceholder"in te&&t(3,f=te.searchPlaceholder),"items"in te&&t(26,d=te.items),"multiple"in te&&t(4,p=te.multiple),"disabled"in te&&t(5,m=te.disabled),"selected"in te&&t(0,_=te.selected),"toggle"in te&&t(6,g=te.toggle),"closable"in te&&t(7,b=te.closable),"labelComponent"in te&&t(8,k=te.labelComponent),"labelComponentProps"in te&&t(9,w=te.labelComponentProps),"optionComponent"in te&&t(10,T=te.optionComponent),"optionComponentProps"in te&&t(11,C=te.optionComponentProps),"searchable"in te&&t(12,M=te.searchable),"searchFunc"in te&&t(27,O=te.searchFunc),"class"in te&&t(13,D=te.class),"$$scope"in te&&t(42,o=te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&d&&(ie(),X()),n.$$.dirty[0]&67141632&&t(20,i=fe(d,P)),n.$$.dirty[0]&1&&t(19,s=function(te){const qe=j.toArray(_);return j.inArray(qe,te)})},[_,a,u,f,p,m,g,b,k,w,T,C,M,D,F,P,A,N,R,s,i,X,G,ce,he,r,d,O,q,B,Y,Z,ee,l,je,He,we,Ce,Je,ht,Ze,We,o]}class su extends ve{constructor(e){super(),be(this,e,IT,ET,ge,{id:25,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:26,multiple:4,disabled:5,selected:0,toggle:6,closable: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 pd(n){let e,t;return{c(){e=y("i"),h(e,"class",t="icon "+n[0].icon)},m(i,s){$(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&h(e,"class",t)},d(i){i&&S(e)}}}function PT(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&&pd(n);return{c(){l&&l.c(),e=E(),t=y("span"),s=U(i),h(t,"class","txt")},m(o,r){l&&l.m(o,r),$(o,e,r),$(o,t,r),v(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=pd(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)+"")&&le(s,i)},i:Q,o:Q,d(o){l&&l.d(o),o&&S(e),o&&S(t)}}}function LT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class md extends ve{constructor(e){super(),be(this,e,LT,PT,ge,{item:0})}}const NT=n=>({}),hd=n=>({});function FT(n){let e;const t=n[8].afterOptions,i=Pt(t,n,n[12],hd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Nt(i,t,s,s[12],e?Lt(t,s[12],l,NT):Ft(s[12]),hd)},i(s){e||(I(i,s),e=!0)},o(s){L(i,s),e=!1},d(s){i&&i.d(s)}}}function RT(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:[FT]},$$scope:{ctx:n}};for(let r=0;r_e(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&62?kt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Bt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function qT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Ge(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=md}=e,{optionComponent:d=md}=e,{selectionKey:p="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function _(T){T=j.toArray(T,!0);let C=[];for(let M of T){const O=j.findByKey(r,p,M);O&&C.push(O)}T.length&&!C.length||t(0,u=a?C:C[0])}async function g(T){let C=j.toArray(T,!0).map(M=>M[p]);r.length&&t(6,m=a?C:C[0])}function b(T){u=T,t(0,u)}function k(T){de.call(this,n,T)}function w(T){de.call(this,n,T)}return n.$$set=T=>{e=Fe(Fe({},e),zt(T)),t(5,s=Ge(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,d=T.optionComponent),"selectionKey"in T&&t(7,p=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&_(m),n.$$.dirty&1&&g(u)},[u,r,a,f,d,s,m,p,l,b,k,w,o]}class Ni extends ve{constructor(e){super(),be(this,e,qT,RT,ge,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function jT(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[17],placeholder:"Choices: eg. optionA, optionB",required:!0,disabled:!n[18]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Rs({props:a}),se.push(()=>_e(t,"value",r)),{c(){e=y("div"),z(t.$$.fragment)},m(u,f){$(u,e,f),V(t,e,null),s=!0,l||(o=De(Ue.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const d={};f&131072&&(d.id=u[17]),f&262144&&(d.disabled=!u[18]),!i&&f&1&&(i=!0,d.value=u[0].options.values,ke(()=>i=!1)),t.$set(d)},i(u){s||(I(t.$$.fragment,u),s=!0)},o(u){L(t.$$.fragment,u),s=!1},d(u){u&&S(e),H(t),l=!1,o()}}}function VT(n){let e,t,i;function s(o){n[8](o)}let l={id:n[17],items:n[3],disabled:!n[18]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ni({props:l}),se.push(()=>_e(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&131072&&(a.id=o[17]),r&262144&&(a.disabled=!o[18]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function HT(n){let e,t,i,s;return e=new pe({props:{class:"form-field required "+(n[18]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[jT,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[18]?"":"disabled"),inlineError:!0,$$slots:{default:[VT,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o&262144&&(r.class="form-field required "+(l[18]?"":"disabled")),o&2&&(r.name="schema."+l[1]+".options.values"),o&917505&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&262144&&(a.class="form-field form-field-single-multiple-select "+(l[18]?"":"disabled")),o&917508&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}function _d(n){let e,t;return e=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[zT,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&655361&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function zT(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[17]),h(l,"id",o=n[17]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[6]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&>(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function BT(n){let e,t,i=!n[2]&&_d(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),$(s,e,l),t=!0},p(s,l){s[2]?i&&(re(),L(i,1,1,()=>{i=null}),ae()):i?(i.p(s,l),l&4&&I(i,1)):(i=_d(s),i.c(),I(i,1),i.m(e.parentNode,e))},i(s){t||(I(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&S(e)}}}function UT(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[BT],default:[HT,({interactive:r})=>({18:r}),({interactive:r})=>r?262144:0]},$$scope:{ctx:n}};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("drop",n[12]),e.$on("dragstart",n[13]),e.$on("dragenter",n[14]),e.$on("dragleave",n[15]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&18?kt(s,[a&2&&{key:r[1]},a&16&&Bt(r[4])]):{};a&786439&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function WT(n,e,t){var M;const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((M=l.options)==null?void 0:M.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function d(){l.options.maxSelect=gt(this.value),t(0,l),t(5,u),t(2,a)}function p(O){n.$$.not_equal(l.options.values,O)&&(l.options.values=O,t(0,l),t(5,u),t(2,a))}function m(O){a=O,t(2,a)}function _(O){l=O,t(0,l),t(5,u),t(2,a)}function g(O){de.call(this,n,O)}function b(O){de.call(this,n,O)}function k(O){de.call(this,n,O)}function w(O){de.call(this,n,O)}function T(O){de.call(this,n,O)}function C(O){de.call(this,n,O)}return n.$$set=O=>{e=Fe(Fe({},e),zt(O)),t(4,s=Ge(e,i)),"field"in O&&t(0,l=O.field),"key"in O&&t(1,o=O.key)},n.$$.update=()=>{var O,D;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((D=(O=l.options)==null?void 0:O.values)==null?void 0:D.length)||2,l)),n.$$.dirty&1&&j.isEmpty(l.options)&&f()},[l,o,a,r,s,u,d,p,m,_,g,b,k,w,T,C]}class YT extends ve{constructor(e){super(),be(this,e,WT,UT,ge,{field:0,key:1})}}function KT(n){let e;return{c(){e=y("i"),h(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function JT(n){let e;return{c(){e=y("i"),h(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function gd(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O,D='"{"a":1,"b":2}"',A,P,N,R,F,q,B,Y,Z,ee,ie,X,fe;return{c(){e=y("div"),t=y("div"),i=y("div"),s=U("In order to support seamlessly both "),l=y("code"),l.textContent="application/json",o=U(` and `),r=y("code"),r.textContent="multipart/form-data",a=U(` requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=U(` field is a `),d=y("strong"),d.textContent="plain string",p=U(`: `),m=y("ul"),_=y("li"),_.innerHTML=""true" is converted to the json true",g=E(),b=y("li"),b.innerHTML=""false" is converted to the json false",k=E(),w=y("li"),w.innerHTML=""null" is converted to the json null",T=E(),C=y("li"),C.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",M=E(),O=y("li"),A=U(D),P=U(" is converted to the json "),N=y("code"),N.textContent='{"a":1,"b":2}',R=E(),F=y("li"),F.textContent="numeric strings are converted to json number",q=E(),B=y("li"),B.textContent="double quoted strings are left as they are (aka. without normalizations)",Y=E(),Z=y("li"),Z.textContent="any other string (empty string too) is double quoted",ee=U(` Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside an object, eg.`),ie=y("code"),ie.textContent='{"data": anything}',h(i,"class","content"),h(t,"class","alert alert-warning m-b-0 m-t-10"),h(e,"class","block")},m(G,ce){$(G,e,ce),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(m,_),v(m,g),v(m,b),v(m,k),v(m,w),v(m,T),v(m,C),v(m,M),v(m,O),v(O,A),v(O,P),v(O,N),v(m,R),v(m,F),v(m,q),v(m,B),v(m,Y),v(m,Z),v(i,ee),v(i,ie),fe=!0},i(G){fe||(G&&et(()=>{fe&&(X||(X=Ve(e,wt,{duration:150},!0)),X.run(1))}),fe=!0)},o(G){G&&(X||(X=Ve(e,wt,{duration:150},!1)),X.run(0)),fe=!1},d(G){G&&S(e),G&&X&&X.end()}}}function ZT(n){let e,t,i,s,l,o,r;function a(p,m){return p[2]?JT:KT}let u=a(n),f=u(n),d=n[2]&&gd();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),d&&d.c(),l=Se(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,m){$(p,e,m),v(e,t),v(e,i),f.m(e,null),$(p,s,m),d&&d.m(p,m),$(p,l,m),o||(r=J(e,"click",n[4]),o=!0)},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?m&4&&I(d,1):(d=gd(),d.c(),I(d,1),d.m(l.parentNode,l)):d&&(re(),L(d,1,1,()=>{d=null}),ae())},d(p){p&&S(e),f.d(),p&&S(s),d&&d.d(p),p&&S(l),o=!1,r()}}}function GT(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[ZT]},$$scope:{ctx:n}};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&10?kt(s,[a&2&&{key:r[1]},a&8&&Bt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function XT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(b){l=b,t(0,l)}function f(b){de.call(this,n,b)}function d(b){de.call(this,n,b)}function p(b){de.call(this,n,b)}function m(b){de.call(this,n,b)}function _(b){de.call(this,n,b)}function g(b){de.call(this,n,b)}return n.$$set=b=>{e=Fe(Fe({},e),zt(b)),t(3,s=Ge(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,r,s,a,u,f,d,p,m,_,g]}class QT extends ve{constructor(e){super(),be(this,e,XT,GT,ge,{field:0,key:1})}}function xT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=U(t),s=E(),l=y("small"),r=U(o),h(e,"class","txt"),h(l,"class","txt-hint")},m(a,u){$(a,e,u),v(e,i),$(a,s,u),$(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&S(e),a&&S(s),a&&S(l)}}}function eC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class bd extends ve{constructor(e){super(),be(this,e,eC,xT,ge,{item:0})}}const tC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function nC(n){let e,t,i;function s(o){n[15](o)}let l={id:n[25],items:n[4],disabled:!n[26]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ni({props:l}),se.push(()=>_e(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&33554432&&(a.id=o[25]),r&67108864&&(a.disabled=!o[26]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function iC(n){let e,t;return e=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[26]?"":"disabled"),inlineError:!0,$$slots:{default:[nC,({uniqueId:i})=>({25:i}),({uniqueId:i})=>i?33554432:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&67108864&&(l.class="form-field form-field-single-multiple-select "+(i[26]?"":"disabled")),s&234881028&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function sC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=y("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=y("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=y("button"),r.innerHTML='Archives (zip, 7zip, rar)',h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item closable"),h(r,"type","button"),h(r,"class","dropdown-item closable")},m(f,d){$(f,e,d),$(f,t,d),$(f,i,d),$(f,s,d),$(f,l,d),$(f,o,d),$(f,r,d),a||(u=[J(e,"click",n[8]),J(i,"click",n[9]),J(l,"click",n[10]),J(r,"click",n[11])],a=!0)},p:Q,d(f){f&&S(e),f&&S(t),f&&S(i),f&&S(s),f&&S(l),f&&S(o),f&&S(r),a=!1,Ie(u)}}}function lC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T;function C(O){n[7](O)}let M={id:n[25],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:bd,optionComponent:bd};return n[0].options.mimeTypes!==void 0&&(M.keyOfSelected=n[0].options.mimeTypes),r=new Ni({props:M}),se.push(()=>_e(r,"keyOfSelected",C)),b=new Vn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[sC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Allowed mime types",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("button"),p=y("span"),p.textContent="Choose presets",m=E(),_=y("i"),g=E(),z(b.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[25]),h(p,"class","txt link-primary"),h(_,"class","ri-arrow-drop-down-fill"),h(d,"type","button"),h(d,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(O,D){$(O,e,D),v(e,t),v(e,i),v(e,s),$(O,o,D),V(r,O,D),$(O,u,D),$(O,f,D),v(f,d),v(d,p),v(d,m),v(d,_),v(d,g),V(b,d,null),k=!0,w||(T=De(Ue.call(null,s,{text:`Allow files ONLY with the listed mime types. Leave empty for no restriction.`,position:"top"})),w=!0)},p(O,D){(!k||D&33554432&&l!==(l=O[25]))&&h(e,"for",l);const A={};D&33554432&&(A.id=O[25]),D&8&&(A.items=O[3]),!a&&D&1&&(a=!0,A.keyOfSelected=O[0].options.mimeTypes,ke(()=>a=!1)),r.$set(A);const P={};D&134217729&&(P.$$scope={dirty:D,ctx:O}),b.$set(P)},i(O){k||(I(r.$$.fragment,O),I(b.$$.fragment,O),k=!0)},o(O){L(r.$$.fragment,O),L(b.$$.fragment,O),k=!1},d(O){O&&S(e),O&&S(o),H(r,O),O&&S(u),O&&S(f),H(b),w=!1,T()}}}function oC(n){let e;return{c(){e=y("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,h(e,"class","m-0")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function rC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M;function O(A){n[12](A)}let D={id:n[25],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Rs({props:D}),se.push(()=>_e(r,"value",O)),w=new Vn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[oC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=E(),m=y("button"),_=y("span"),_.textContent="Supported formats",g=E(),b=y("i"),k=E(),z(w.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[25]),h(d,"class","txt"),h(_,"class","txt link-primary"),h(b,"class","ri-arrow-drop-down-fill"),h(m,"type","button"),h(m,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(A,P){$(A,e,P),v(e,t),v(e,i),v(e,s),$(A,o,P),V(r,A,P),$(A,u,P),$(A,f,P),v(f,d),v(f,p),v(f,m),v(m,_),v(m,g),v(m,b),v(m,k),V(w,m,null),T=!0,C||(M=De(Ue.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(A,P){(!T||P&33554432&&l!==(l=A[25]))&&h(e,"for",l);const N={};P&33554432&&(N.id=A[25]),!a&&P&1&&(a=!0,N.value=A[0].options.thumbs,ke(()=>a=!1)),r.$set(N);const R={};P&134217728&&(R.$$scope={dirty:P,ctx:A}),w.$set(R)},i(A){T||(I(r.$$.fragment,A),I(w.$$.fragment,A),T=!0)},o(A){L(r.$$.fragment,A),L(w.$$.fragment,A),T=!1},d(A){A&&S(e),A&&S(o),H(r,A),A&&S(u),A&&S(f),H(w),C=!1,M()}}}function aC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Max file size"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Must be in bytes.",h(e,"for",i=n[25]),h(l,"type","number"),h(l,"id",o=n[25]),h(l,"step","1"),h(l,"min","0"),h(a,"class","help-block")},m(d,p){$(d,e,p),v(e,t),$(d,s,p),$(d,l,p),ue(l,n[0].options.maxSize),$(d,r,p),$(d,a,p),u||(f=J(l,"input",n[13]),u=!0)},p(d,p){p&33554432&&i!==(i=d[25])&&h(e,"for",i),p&33554432&&o!==(o=d[25])&&h(l,"id",o),p&1&>(l.value)!==d[0].options.maxSize&&ue(l,d[0].options.maxSize)},d(d){d&&S(e),d&&S(s),d&&S(l),d&&S(r),d&&S(a),u=!1,f()}}}function vd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[uC,({uniqueId:s})=>({25:s}),({uniqueId:s})=>s?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){$(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&167772161&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&S(e),H(t)}}}function uC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"id",o=n[25]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&1&>(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function fC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[lC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[rC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[aC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}});let _=!n[2]&&vd(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),p=E(),_&&_.c(),h(t,"class","col-sm-12"),h(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),h(u,"class",d=n[2]?"col-sm-4":"col-sm-3"),h(e,"class","grid grid-sm")},m(g,b){$(g,e,b),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,a),v(e,u),V(f,u,null),v(e,p),_&&_.m(e,null),m=!0},p(g,b){const k={};b&2&&(k.name="schema."+g[1]+".options.mimeTypes"),b&167772169&&(k.$$scope={dirty:b,ctx:g}),i.$set(k);const w={};b&2&&(w.name="schema."+g[1]+".options.thumbs"),b&167772161&&(w.$$scope={dirty:b,ctx:g}),o.$set(w),(!m||b&4&&r!==(r=g[2]?"col-sm-8":"col-sm-6"))&&h(l,"class",r);const T={};b&2&&(T.name="schema."+g[1]+".options.maxSize"),b&167772161&&(T.$$scope={dirty:b,ctx:g}),f.$set(T),(!m||b&4&&d!==(d=g[2]?"col-sm-4":"col-sm-3"))&&h(u,"class",d),g[2]?_&&(re(),L(_,1,1,()=>{_=null}),ae()):_?(_.p(g,b),b&4&&I(_,1)):(_=vd(g),_.c(),I(_,1),_.m(e,null))},i(g){m||(I(i.$$.fragment,g),I(o.$$.fragment,g),I(f.$$.fragment,g),I(_),m=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(f.$$.fragment,g),L(_),m=!1},d(g){g&&S(e),H(i),H(o),H(f),_&&_.d()}}}function cC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[16](r)}let o={$$slots:{options:[fC],default:[iC,({interactive:r})=>({26:r}),({interactive:r})=>r?67108864:0]},$$scope:{ctx:n}};for(let r=0;r_e(e,"field",l)),e.$on("rename",n[17]),e.$on("remove",n[18]),e.$on("drop",n[19]),e.$on("dragstart",n[20]),e.$on("dragenter",n[21]),e.$on("dragleave",n[22]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?kt(s,[a&2&&{key:r[1]},a&32&&Bt(r[5])]):{};a&201326607&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function dC(n,e,t){var q;const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=tC.slice(),u=((q=l.options)==null?void 0:q.maxSelect)<=1,f=u;function d(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function p(){if(j.isEmpty(l.options.mimeTypes))return;const B=[];for(const Y of l.options.mimeTypes)a.find(Z=>Z.mimeType===Y)||B.push({mimeType:Y});B.length&&t(3,a=a.concat(B))}function m(B){n.$$.not_equal(l.options.mimeTypes,B)&&(l.options.mimeTypes=B,t(0,l),t(6,f),t(2,u))}const _=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},g=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},b=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},k=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function w(B){n.$$.not_equal(l.options.thumbs,B)&&(l.options.thumbs=B,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=gt(this.value),t(0,l),t(6,f),t(2,u)}function C(){l.options.maxSelect=gt(this.value),t(0,l),t(6,f),t(2,u)}function M(B){u=B,t(2,u)}function O(B){l=B,t(0,l),t(6,f),t(2,u)}function D(B){de.call(this,n,B)}function A(B){de.call(this,n,B)}function P(B){de.call(this,n,B)}function N(B){de.call(this,n,B)}function R(B){de.call(this,n,B)}function F(B){de.call(this,n,B)}return n.$$set=B=>{e=Fe(Fe({},e),zt(B)),t(5,s=Ge(e,i)),"field"in B&&t(0,l=B.field),"key"in B&&t(1,o=B.key)},n.$$.update=()=>{var B,Y;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((Y=(B=l.options)==null?void 0:B.values)==null?void 0:Y.length)||99,l)),n.$$.dirty&1&&(j.isEmpty(l.options)?d():p())},[l,o,u,a,r,s,f,m,_,g,b,k,w,T,C,M,O,D,A,P,N,R,F]}class pC extends ve{constructor(e){super(),be(this,e,dC,cC,ge,{field:0,key:1})}}function mC(n){let e,t,i,s,l;return{c(){e=y("hr"),t=E(),i=y("button"),i.innerHTML=` New collection`,h(i,"type","button"),h(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=J(i,"click",n[15]),s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,l()}}}function hC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33]||n[0].id,$$slots:{afterOptions:[mC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ni({props:l}),se.push(()=>_e(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1|r[1]&4&&(a.disabled=!o[33]||o[0].id),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function _C(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ni({props:l}),se.push(()=>_e(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function gC(n){let e,t,i,s;return e=new pe({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[hC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[_C,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}function yd(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[bC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[vC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),i=E(),s=y("div"),z(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){$(r,e,a),V(t,e,null),$(r,i,a),$(r,s,a),V(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(I(t.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&S(e),H(t),r&&S(i),r&&S(s),H(l)}}}function bC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"min","1"),h(l,"placeholder","No min limit")},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.minSelect),r||(a=J(l,"input",n[11]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&h(e,"for",i),f[1]&2&&o!==(o=u[32])&&h(l,"id",o),f[0]&1&>(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function vC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"placeholder","No max limit"),h(l,"min",r=n[0].options.minSelect||2)},m(f,d){$(f,e,d),v(e,t),$(f,s,d),$(f,l,d),ue(l,n[0].options.maxSelect),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d[1]&2&&i!==(i=f[32])&&h(e,"for",i),d[1]&2&&o!==(o=f[32])&&h(l,"id",o),d[0]&1&&r!==(r=f[0].options.minSelect||2)&&h(l,"min",r),d[0]&1&>(l.value)!==f[0].options.maxSelect&&ue(l,f[0].options.maxSelect)},d(f){f&&S(e),f&&S(s),f&&S(l),a=!1,u()}}}function yC(n){let e,t,i,s,l,o,r,a,u,f,d;function p(_){n[13](_)}let m={multiple:!0,searchable:!0,id:n[32],selectPlaceholder:"Auto",items:n[5]};return n[0].options.displayFields!==void 0&&(m.selected=n[0].options.displayFields),r=new su({props:m}),se.push(()=>_e(r,"selected",p)),{c(){e=y("label"),t=y("span"),t.textContent="Display fields",i=E(),s=y("i"),o=E(),z(r.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[32])},m(_,g){$(_,e,g),v(e,t),v(e,i),v(e,s),$(_,o,g),V(r,_,g),u=!0,f||(d=De(Ue.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(_,g){(!u||g[1]&2&&l!==(l=_[32]))&&h(e,"for",l);const b={};g[1]&2&&(b.id=_[32]),g[0]&32&&(b.items=_[5]),!a&&g[0]&1&&(a=!0,b.selected=_[0].options.displayFields,ke(()=>a=!1)),r.$set(b)},i(_){u||(I(r.$$.fragment,_),u=!0)},o(_){L(r.$$.fragment,_),u=!1},d(_){_&&S(e),_&&S(o),H(r,_),f=!1,d()}}}function kC(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[32],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(u.keyOfSelected=n[0].options.cascadeDelete),l=new Ni({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("Delete main record on relation delete"),s=E(),z(l.$$.fragment),h(e,"for",i=n[32])},m(f,d){$(f,e,d),v(e,t),$(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&2&&i!==(i=f[32]))&&h(e,"for",i);const p={};d[1]&2&&(p.id=f[32]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].options.cascadeDelete,ke(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&S(e),f&&S(s),H(l,f)}}}function wC(n){let e,t,i,s,l,o,r,a,u=!n[2]&&yd(n);return s=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[yC,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[kC,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),u&&u.c(),t=E(),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(f,d){$(f,e,d),u&&u.m(e,null),v(e,t),v(e,i),V(s,i,null),v(e,l),v(e,o),V(r,o,null),a=!0},p(f,d){f[2]?u&&(re(),L(u,1,1,()=>{u=null}),ae()):u?(u.p(f,d),d[0]&4&&I(u,1)):(u=yd(f),u.c(),I(u,1),u.m(e,t));const p={};d[0]&2&&(p.name="schema."+f[1]+".options.displayFields"),d[0]&33|d[1]&10&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&2&&(m.name="schema."+f[1]+".options.cascadeDelete"),d[0]&1|d[1]&10&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){a||(I(u),I(s.$$.fragment,f),I(r.$$.fragment,f),a=!0)},o(f){L(u),L(s.$$.fragment,f),L(r.$$.fragment,f),a=!1},d(f){f&&S(e),u&&u.d(),H(s),H(r)}}}function SC(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[18](f)}let a={$$slots:{options:[wC],default:[gC,({interactive:f})=>({33:f}),({interactive:f})=>[0,f?4:0]]},$$scope:{ctx:n}};for(let f=0;f_e(e,"field",r)),e.$on("rename",n[19]),e.$on("remove",n[20]),e.$on("drop",n[21]),e.$on("dragstart",n[22]),e.$on("dragenter",n[23]),e.$on("dragleave",n[24]);let u={};return s=new lu({props:u}),n[25](s),s.$on("save",n[26]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,d){V(e,f,d),$(f,i,d),V(s,f,d),l=!0},p(f,d){const p=d[0]&258?kt(o,[d[0]&2&&{key:f[1]},d[0]&256&&Bt(f[8])]):{};d[0]&63|d[1]&12&&(p.$$scope={dirty:d,ctx:f}),!t&&d[0]&1&&(t=!0,p.field=f[0],ke(()=>t=!1)),e.$set(p);const m={};s.$set(m)},i(f){l||(I(e.$$.fragment,f),I(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){H(e,f),f&&S(i),n[25](null),H(s,f)}}}function $C(n,e,t){var fe;let i;const s=["field","key"];let l=Ge(e,s),o;Ke(n,bi,G=>t(3,o=G));let{field:r}=e,{key:a=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],f=[{label:"False",value:!1},{label:"True",value:!0}],d=["id","created","updated"],p=["username","email","emailVisibility","verified"];let m=null,_=[],g=null,b=((fe=r.options)==null?void 0:fe.maxSelect)==1,k=b;function w(){t(0,r.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},r),t(2,b=!0),t(10,k=b)}function T(){var G,ce;if(t(5,_=d.slice(0)),!!i){i.isAuth&&t(5,_=_.concat(p));for(const he of i.schema)_.push(he.name);if(((ce=(G=r.options)==null?void 0:G.displayFields)==null?void 0:ce.length)>0)for(let he=r.options.displayFields.length-1;he>=0;he--)_.includes(r.options.displayFields[he])||r.options.displayFields.splice(he,1)}}function C(){r.options.minSelect=gt(this.value),t(0,r),t(10,k),t(2,b)}function M(){r.options.maxSelect=gt(this.value),t(0,r),t(10,k),t(2,b)}function O(G){n.$$.not_equal(r.options.displayFields,G)&&(r.options.displayFields=G,t(0,r),t(10,k),t(2,b))}function D(G){n.$$.not_equal(r.options.cascadeDelete,G)&&(r.options.cascadeDelete=G,t(0,r),t(10,k),t(2,b))}const A=()=>m==null?void 0:m.show();function P(G){n.$$.not_equal(r.options.collectionId,G)&&(r.options.collectionId=G,t(0,r),t(10,k),t(2,b))}function N(G){b=G,t(2,b)}function R(G){r=G,t(0,r),t(10,k),t(2,b)}function F(G){de.call(this,n,G)}function q(G){de.call(this,n,G)}function B(G){de.call(this,n,G)}function Y(G){de.call(this,n,G)}function Z(G){de.call(this,n,G)}function ee(G){de.call(this,n,G)}function ie(G){se[G?"unshift":"push"](()=>{m=G,t(4,m)})}const X=G=>{var ce,he;(he=(ce=G==null?void 0:G.detail)==null?void 0:ce.collection)!=null&&he.id&&t(0,r.options.collectionId=G.detail.collection.id,r)};return n.$$set=G=>{e=Fe(Fe({},e),zt(G)),t(8,l=Ge(e,s)),"field"in G&&t(0,r=G.field),"key"in G&&t(1,a=G.key)},n.$$.update=()=>{n.$$.dirty[0]&1028&&k!=b&&(t(10,k=b),b?(t(0,r.options.minSelect=null,r),t(0,r.options.maxSelect=1,r)):t(0,r.options.maxSelect=null,r)),n.$$.dirty[0]&1&&j.isEmpty(r.options)&&w(),n.$$.dirty[0]&9&&(i=o.find(G=>G.id==r.options.collectionId)||null),n.$$.dirty[0]&513&&g!=r.options.collectionId&&(t(9,g=r.options.collectionId),T())},[r,a,b,o,m,_,u,f,l,g,k,C,M,O,D,A,P,N,R,F,q,B,Y,Z,ee,ie,X]}class TC extends ve{constructor(e){super(),be(this,e,$C,SC,ge,{field:0,key:1},null,[-1,-1])}}function kd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function wd(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, `),t=y("code"),t.textContent="username",i=U(` , `),s=y("code"),s.textContent="email",l=U(` , `),o=y("code"),o.textContent="emailVisibility",r=U(` , `),a=y("code"),a.textContent="verified",h(t,"class","txt-sm"),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm")},m(u,f){$(u,e,f),$(u,t,f),$(u,i,f),$(u,s,f),$(u,l,f),$(u,o,f),$(u,r,f),$(u,a,f)},d(u){u&&S(e),u&&S(t),u&&S(i),u&&S(s),u&&S(l),u&&S(o),u&&S(r),u&&S(a)}}}function Sd(n,e){let t,i,s,l,o;function r(m){e[7](m,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...m){return e[10](e[19],...m)}function f(...m){return e[11](e[19],...m)}var d=e[1][e[17].type];function p(m){let _={key:m[4](m[17])};return m[17]!==void 0&&(_.field=m[17]),{props:_}}return d&&(i=Ot(d,p(e)),se.push(()=>_e(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=Se(),i&&z(i.$$.fragment),l=Se(),this.first=t},m(m,_){$(m,t,_),i&&V(i,m,_),$(m,l,_),o=!0},p(m,_){e=m;const g={};if(_&1&&(g.key=e[4](e[17])),!s&&_&1&&(s=!0,g.field=e[17],ke(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){re();const b=i;L(b.$$.fragment,1,0,()=>{H(b,1)}),ae()}d?(i=Ot(d,p(e)),se.push(()=>_e(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),z(i.$$.fragment),I(i.$$.fragment,1),V(i,l.parentNode,l)):i=null}else d&&i.$set(g)},i(m){o||(i&&I(i.$$.fragment,m),o=!0)},o(m){i&&L(i.$$.fragment,m),o=!1},d(m){m&&S(t),m&&S(l),i&&H(i,m)}}}function CC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m=[],_=new Map,g,b,k,w,T,C,M,O,D=n[0].$isAuth&&wd(),A=n[0].schema;const P=F=>F[17];for(let F=0;F_e(C,"collection",N)),{c(){e=y("div"),t=y("p"),i=U(`System fields: `),s=y("code"),s.textContent="id",l=U(` , `),o=y("code"),o.textContent="created",r=U(` , `),a=y("code"),a.textContent="updated",u=E(),D&&D.c(),f=U(` .`),d=E(),p=y("div");for(let F=0;FM=!1)),C.$set(B)},i(F){if(!O){for(let q=0;qM.name===C)}function f(C){return i.findIndex(M=>M===C)}function d(C,M){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||C===M||!M||t(0,s.indexes=s.indexes.map(D=>j.replaceIndexColumn(D,C,M)),s)}function p(C,M){if(!C)return;C.dataTransfer.dropEffect="move";const O=parseInt(C.dataTransfer.getData("text/plain")),D=s.schema;Oo(C),g=C=>d(C.detail.oldName,C.detail.newName),b=(C,M)=>MC(M.detail,C),k=(C,M)=>p(M.detail,C),w=C=>r(C.detail);function T(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new _n),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,d,p,m,_,g,b,k,w,T]}class DC extends ve{constructor(e){super(),be(this,e,OC,CC,ge,{collection:0})}}const EC=n=>({isAdminOnly:n&512}),$d=n=>({isAdminOnly:n[9]});function AC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[PC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IC(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","txt-center")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function Td(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` Set Admins only`,h(e,"type","button"),h(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function Cd(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`Unlock and set custom rule
    `,h(e,"type","button"),h(e,"class","unlock-overlay svelte-1akuazq"),h(e,"aria-label","Unlock and set custom rule")},m(o,r){$(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:Q,i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Et,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function PC(n){let e,t,i,s,l,o=n[9]?"- Admins only":"",r,a,u,f,d,p,m,_,g,b,k=!n[9]&&Td(n);function w(A){n[14](A)}var T=n[7];function C(A){let P={id:A[18],baseCollection:A[1],disabled:A[9],placeholder:A[9]?"":A[5]};return A[0]!==void 0&&(P.value=A[0]),{props:P}}T&&(d=Ot(T,C(n)),n[13](d),se.push(()=>_e(d,"value",w)));let M=n[9]&&Cd(n);const O=n[12].default,D=Pt(O,n,n[15],$d);return{c(){e=y("div"),t=y("label"),i=y("span"),s=U(n[2]),l=E(),r=U(o),a=E(),k&&k.c(),f=E(),d&&z(d.$$.fragment),m=E(),M&&M.c(),_=E(),g=y("div"),D&&D.c(),h(i,"class","txt"),x(i,"txt-hint",n[9]),h(t,"for",u=n[18]),h(e,"class","input-wrapper svelte-1akuazq"),h(g,"class","help-block")},m(A,P){$(A,e,P),v(e,t),v(t,i),v(i,s),v(i,l),v(i,r),v(t,a),k&&k.m(t,null),v(e,f),d&&V(d,e,null),v(e,m),M&&M.m(e,null),$(A,_,P),$(A,g,P),D&&D.m(g,null),b=!0},p(A,P){(!b||P&4)&&le(s,A[2]),(!b||P&512)&&o!==(o=A[9]?"- Admins only":"")&&le(r,o),(!b||P&512)&&x(i,"txt-hint",A[9]),A[9]?k&&(k.d(1),k=null):k?k.p(A,P):(k=Td(A),k.c(),k.m(t,null)),(!b||P&262144&&u!==(u=A[18]))&&h(t,"for",u);const N={};if(P&262144&&(N.id=A[18]),P&2&&(N.baseCollection=A[1]),P&512&&(N.disabled=A[9]),P&544&&(N.placeholder=A[9]?"":A[5]),!p&&P&1&&(p=!0,N.value=A[0],ke(()=>p=!1)),P&128&&T!==(T=A[7])){if(d){re();const R=d;L(R.$$.fragment,1,0,()=>{H(R,1)}),ae()}T?(d=Ot(T,C(A)),A[13](d),se.push(()=>_e(d,"value",w)),z(d.$$.fragment),I(d.$$.fragment,1),V(d,e,m)):d=null}else T&&d.$set(N);A[9]?M?(M.p(A,P),P&512&&I(M,1)):(M=Cd(A),M.c(),I(M,1),M.m(e,null)):M&&(re(),L(M,1,1,()=>{M=null}),ae()),D&&D.p&&(!b||P&33280)&&Nt(D,O,A,A[15],b?Lt(O,A[15],P,EC):Ft(A[15]),$d)},i(A){b||(d&&I(d.$$.fragment,A),I(M),I(D,A),b=!0)},o(A){d&&L(d.$$.fragment,A),L(M),L(D,A),b=!1},d(A){A&&S(e),k&&k.d(),n[13](null),d&&H(d),M&&M.d(),A&&S(_),A&&S(g),D&&D.d(A)}}}function LC(n){let e,t,i,s;const l=[IC,AC],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),$(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&S(i)}}}let Md;function NC(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,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,m=null,_=Md,g=!1;b();async function b(){_||g||(t(8,g=!0),t(7,_=(await ft(()=>import("./FilterAutocompleteInput-358e5ad3.js"),["./FilterAutocompleteInput-358e5ad3.js","./index-6f704b4c.js"],import.meta.url)).default),Md=_,t(8,g=!1))}async function k(){t(0,r=m||""),await an(),p==null||p.focus()}async function w(){m=r,t(0,r=null)}function T(M){se[M?"unshift":"push"](()=>{p=M,t(6,p)})}function C(M){r=M,t(0,r)}return n.$$set=M=>{"collection"in M&&t(1,o=M.collection),"rule"in M&&t(0,r=M.rule),"label"in M&&t(2,a=M.label),"formKey"in M&&t(3,u=M.formKey),"required"in M&&t(4,f=M.required),"placeholder"in M&&t(5,d=M.placeholder),"$$scope"in M&&t(15,l=M.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,_,g,i,k,w,s,T,C,l]}class Ts extends ve{constructor(e){super(),be(this,e,NC,LC,ge,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Od(n,e,t){const i=n.slice();return i[10]=e[t],i}function Dd(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O,D,A,P=n[2],N=[];for(let R=0;R@request filter:",d=E(),p=y("div"),p.innerHTML=`@request.headers.* @request.query.* @request.data.* @request.auth.*`,m=E(),_=y("hr"),g=E(),b=y("p"),b.innerHTML="You could also add constraints and query other collections using the @collection filter:",k=E(),w=y("div"),w.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=E(),C=y("hr"),M=E(),O=y("p"),O.innerHTML=`Example rule:
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(a,"class","m-t-10 m-b-5"),h(f,"class","m-b-0"),h(p,"class","inline-flex flex-gap-5"),h(_,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h(w,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(R,F){$(R,e,F),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let q=0;q{A&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),A=!0)},o(R){R&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),A=!1},d(R){R&&S(e),ct(N,R),R&&D&&D.end()}}}function Ed(n){let e,t=n[10]+"",i;return{c(){e=y("code"),i=U(t)},m(s,l){$(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&S(e)}}}function Ad(n){let e,t,i,s,l,o,r,a,u;function f(b){n[6](b)}let d={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Ts({props:d}),se.push(()=>_e(e,"rule",f));function p(b){n[7](b)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Ts({props:m}),se.push(()=>_e(s,"rule",p));function _(b){n[8](b)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Ts({props:g}),se.push(()=>_e(r,"rule",_)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(b,k){V(e,b,k),$(b,i,k),V(s,b,k),$(b,o,k),V(r,b,k),u=!0},p(b,k){const w={};k&1&&(w.collection=b[0]),!t&&k&1&&(t=!0,w.rule=b[0].createRule,ke(()=>t=!1)),e.$set(w);const T={};k&1&&(T.collection=b[0]),!l&&k&1&&(l=!0,T.rule=b[0].updateRule,ke(()=>l=!1)),s.$set(T);const C={};k&1&&(C.collection=b[0]),!a&&k&1&&(a=!0,C.rule=b[0].deleteRule,ke(()=>a=!1)),r.$set(C)},i(b){u||(I(e.$$.fragment,b),I(s.$$.fragment,b),I(r.$$.fragment,b),u=!0)},o(b){L(e.$$.fragment,b),L(s.$$.fragment,b),L(r.$$.fragment,b),u=!1},d(b){H(e,b),b&&S(i),H(s,b),b&&S(o),H(r,b)}}}function Id(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[FC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ts({props:l}),se.push(()=>_e(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function FC(n){let e,t,i;return{c(){e=y("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=E(),i=y("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){$(s,e,l),$(s,t,l),$(s,i,l)},p:Q,d(s){s&&S(e),s&&S(t),s&&S(i)}}}function RC(n){var F,q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,m,_,g,b,k,w,T,C,M=n[1]&&Dd(n);function O(B){n[4](B)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),f=new Ts({props:D}),se.push(()=>_e(f,"rule",O));function A(B){n[5](B)}let P={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(P.rule=n[0].viewRule),m=new Ts({props:P}),se.push(()=>_e(m,"rule",A));let N=!((F=n[0])!=null&&F.isView)&&Ad(n),R=((q=n[0])==null?void 0:q.isAuth)&&Id(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators .`,s=E(),l=y("button"),r=U(o),a=E(),M&&M.c(),u=E(),z(f.$$.fragment),p=E(),z(m.$$.fragment),g=E(),N&&N.c(),b=E(),R&&R.c(),k=Se(),h(l,"type","button"),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex txt-sm txt-hint m-b-5"),h(e,"class","block m-b-sm handle")},m(B,Y){$(B,e,Y),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),M&&M.m(e,null),$(B,u,Y),V(f,B,Y),$(B,p,Y),V(m,B,Y),$(B,g,Y),N&&N.m(B,Y),$(B,b,Y),R&&R.m(B,Y),$(B,k,Y),w=!0,T||(C=J(l,"click",n[3]),T=!0)},p(B,[Y]){var ie,X;(!w||Y&2)&&o!==(o=B[1]?"Hide available fields":"Show available fields")&&le(r,o),B[1]?M?(M.p(B,Y),Y&2&&I(M,1)):(M=Dd(B),M.c(),I(M,1),M.m(e,null)):M&&(re(),L(M,1,1,()=>{M=null}),ae());const Z={};Y&1&&(Z.collection=B[0]),!d&&Y&1&&(d=!0,Z.rule=B[0].listRule,ke(()=>d=!1)),f.$set(Z);const ee={};Y&1&&(ee.collection=B[0]),!_&&Y&1&&(_=!0,ee.rule=B[0].viewRule,ke(()=>_=!1)),m.$set(ee),(ie=B[0])!=null&&ie.isView?N&&(re(),L(N,1,1,()=>{N=null}),ae()):N?(N.p(B,Y),Y&1&&I(N,1)):(N=Ad(B),N.c(),I(N,1),N.m(b.parentNode,b)),(X=B[0])!=null&&X.isAuth?R?(R.p(B,Y),Y&1&&I(R,1)):(R=Id(B),R.c(),I(R,1),R.m(k.parentNode,k)):R&&(re(),L(R,1,1,()=>{R=null}),ae())},i(B){w||(I(M),I(f.$$.fragment,B),I(m.$$.fragment,B),I(N),I(R),w=!0)},o(B){L(M),L(f.$$.fragment,B),L(m.$$.fragment,B),L(N),L(R),w=!1},d(B){B&&S(e),M&&M.d(),B&&S(u),H(f,B),B&&S(p),H(m,B),B&&S(g),N&&N.d(B),B&&S(b),R&&R.d(B),B&&S(k),T=!1,C()}}}function qC(n,e,t){let i,{collection:s=new _n}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function d(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function p(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class jC extends ve{constructor(e){super(),be(this,e,qC,RC,ge,{collection:0})}}function Pd(n,e,t){const i=n.slice();return i[9]=e[t],i}function VC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Ot(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),$(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Ot(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&S(i),e&&H(e,a)}}}function HC(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function Ld(n){let e,t,i=n[3],s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. MAX(balance) as maxBalance).
  • `,u=E(),g&&g.c(),f=Se(),h(t,"class","txt"),h(e,"for",i=n[8]),h(a,"class","help-block")},m(b,k){$(b,e,k),v(e,t),$(b,s,k),m[l].m(b,k),$(b,r,k),$(b,a,k),$(b,u,k),g&&g.m(b,k),$(b,f,k),d=!0},p(b,k){(!d||k&256&&i!==(i=b[8]))&&h(e,"for",i);let w=l;l=_(b),l===w?m[l].p(b,k):(re(),L(m[w],1,1,()=>{m[w]=null}),ae(),o=m[l],o?o.p(b,k):(o=m[l]=p[l](b),o.c()),I(o,1),o.m(r.parentNode,r)),b[3].length?g?g.p(b,k):(g=Ld(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(b){d||(I(o),d=!0)},o(b){L(o),d=!1},d(b){b&&S(e),b&&S(s),m[l].d(b),b&&S(r),b&&S(a),b&&S(u),g&&g.d(b),b&&S(f)}}}function BC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[zC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UC(n,e,t){let i;Ke(n,ii,d=>t(4,i=d));let{collection:s=new _n}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=j.getNestedVal(d,"schema",null);if(j.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=j.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let g in p)for(let b in p[g]){const k=p[g][b].message,w=m[g]||g;r.push(j.sentenize(w+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await ft(()=>import("./CodeEditor-8054534a.js"),["./CodeEditor-8054534a.js","./index-6f704b4c.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&mi("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class WC extends ve{constructor(e){super(),be(this,e,UC,BC,ge,{collection:0})}}const YC=n=>({active:n&1}),Fd=n=>({active:n[0]});function Rd(n){let e,t,i;const s=n[15].default,l=Pt(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){$(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Nt(l,s,o,o[14],i?Lt(s,o[14],r,null):Ft(o[14]),null)},i(o){i||(I(l,o),o&&et(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&S(e),l&&l.d(o),o&&t&&t.end()}}}function KC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Pt(a,n,n[14],Fd);let f=n[0]&&Rd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=E(),f&&f.c(),h(t,"type","button"),h(t,"class","accordion-header"),h(t,"draggable",n[2]),x(t,"interactive",n[3]),h(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){$(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",pt(n[17])),J(t,"drop",pt(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",pt(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&Nt(u,a,d,d[14],l?Lt(a,d[14],p,YC):Ft(d[14]),Fd),(!l||p&4)&&h(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&I(f,1)):(f=Rd(d),f.c(),I(f,1),f.m(e,null)):f&&(re(),L(f,1,1,()=>{f=null}),ae()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&h(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(I(u,d),I(f),l=!0)},o(d){L(u,d),L(f),l=!1},d(d){d&&S(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function JC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=St();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,m=!1;function _(){return!!f}function g(){w(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?b():g()}function w(){if(p&&o.closest(".accordions")){const N=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const R of N)R.click()}}Zt(()=>()=>clearTimeout(r));function T(N){de.call(this,n,N)}const C=()=>d&&k(),M=N=>{u&&(t(7,m=!1),w(),l("drop",N))},O=N=>u&&l("dragstart",N),D=N=>{u&&(t(7,m=!0),l("dragenter",N))},A=N=>{u&&(t(7,m=!1),l("dragleave",N))};function P(N){se[N?"unshift":"push"](()=>{o=N,t(6,o)})}return n.$$set=N=>{"class"in N&&t(1,a=N.class),"draggable"in N&&t(2,u=N.draggable),"active"in N&&t(0,f=N.active),"interactive"in N&&t(3,d=N.interactive),"single"in N&&t(9,p=N.single),"$$scope"in N&&t(14,s=N.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,d,k,w,o,m,l,p,_,g,b,r,s,i,T,C,M,O,D,A,P]}class ul extends ve{constructor(e){super(),be(this,e,JC,KC,ge,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function ZC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){$(u,e,f),e.checked=n[0].options.allowUsernameAuth,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function GC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[ZC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function XC(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function QC(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function qd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=De(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function xC(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowUsernameAuth?QC:XC}let u=a(n),f=u(n),d=n[3]&&qd();return{c(){e=y("div"),e.innerHTML=` Username/Password`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){$(p,e,m),$(p,t,m),$(p,i,m),$(p,s,m),f.m(p,m),$(p,l,m),d&&d.m(p,m),$(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?m&8&&I(d,1):(d=qd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),L(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){L(d),r=!1},d(p){p&&S(e),p&&S(t),p&&S(i),p&&S(s),f.d(p),p&&S(l),d&&d.d(p),p&&S(o)}}}function e4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){$(u,e,f),e.checked=n[0].options.allowEmailAuth,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function jd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[t4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[n4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid grid-sm p-t-sm")},m(u,f){$(u,e,f),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(I(i.$$.fragment,u),I(o.$$.fragment,u),u&&et(()=>{a&&(r||(r=Ve(e,wt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){L(i.$$.fragment,u),L(o.$$.fragment,u),u&&(r||(r=Ve(e,wt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&S(e),H(i),H(o),u&&r&&r.end()}}}function t4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[7](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Rs({props:g}),se.push(()=>_e(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){$(b,e,k),v(e,t),v(e,i),v(e,s),$(b,o,k),V(r,b,k),$(b,u,k),$(b,f,k),d=!0,p||(m=De(Ue.call(null,s,{text:`Email domains that are NOT allowed to sign up. This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const w={};k&4096&&(w.id=b[12]),k&1&&(w.disabled=!j.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,w.value=b[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(w)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){L(r.$$.fragment,b),d=!1},d(b){b&&S(e),b&&S(o),H(r,b),b&&S(u),b&&S(f),p=!1,m()}}}function n4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[8](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Rs({props:g}),se.push(()=>_e(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){$(b,e,k),v(e,t),v(e,i),v(e,s),$(b,o,k),V(r,b,k),$(b,u,k),$(b,f,k),d=!0,p||(m=De(Ue.call(null,s,{text:`Email domains that are ONLY allowed to sign up. This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const w={};k&4096&&(w.id=b[12]),k&1&&(w.disabled=!j.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,w.value=b[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(w)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){L(r.$$.fragment,b),d=!1},d(b){b&&S(e),b&&S(o),H(r,b),b&&S(u),b&&S(f),p=!1,m()}}}function i4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[e4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&jd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),$(o,t,r),l&&l.m(o,r),$(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&&I(l,1)):(l=jd(o),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&S(t),l&&l.d(o),o&&S(i)}}}function s4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function l4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Vd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=De(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function o4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowEmailAuth?l4:s4}let u=a(n),f=u(n),d=n[2]&&Vd();return{c(){e=y("div"),e.innerHTML=` Email/Password`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){$(p,e,m),$(p,t,m),$(p,i,m),$(p,s,m),f.m(p,m),$(p,l,m),d&&d.m(p,m),$(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?m&4&&I(d,1):(d=Vd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),L(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){L(d),r=!1},d(p){p&&S(e),p&&S(t),p&&S(i),p&&S(s),f.d(p),p&&S(l),d&&d.d(p),p&&S(o)}}}function r4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){$(u,e,f),e.checked=n[0].options.allowOAuth2Auth,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function Hd(n){let e,t,i;return{c(){e=y("div"),e.innerHTML='',h(e,"class","block")},m(s,l){$(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&S(e),s&&t&&t.end()}}}function a4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[r4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Hd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),$(o,t,r),l&&l.m(o,r),$(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&&I(l,1):(l=Hd(),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&S(t),l&&l.d(o),o&&S(i)}}}function u4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function f4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function zd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=De(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function c4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowOAuth2Auth?f4:u4}let u=a(n),f=u(n),d=n[1]&&zd();return{c(){e=y("div"),e.innerHTML=` OAuth2`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){$(p,e,m),$(p,t,m),$(p,i,m),$(p,s,m),f.m(p,m),$(p,l,m),d&&d.m(p,m),$(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?m&2&&I(d,1):(d=zd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),L(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){L(d),r=!1},d(p){p&&S(e),p&&S(t),p&&S(i),p&&S(s),f.d(p),p&&S(l),d&&d.d(p),p&&S(o)}}}function d4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Minimum password length"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0,h(l,"min","6"),h(l,"max","72")},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&>(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function p4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Always require email",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(l,"class","txt"),h(r,"class","ri-information-line txt-sm link-hint"),h(s,"for",a=n[12])},m(d,p){$(d,e,p),e.checked=n[0].options.requireEmail,$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),De(Ue.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(d,p){p&4096&&t!==(t=d[12])&&h(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&h(s,"for",a)},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,Ie(f)}}}function m4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return s=new ul({props:{single:!0,$$slots:{header:[xC],default:[GC]},$$scope:{ctx:n}}}),o=new ul({props:{single:!0,$$slots:{header:[o4],default:[i4]},$$scope:{ctx:n}}}),a=new ul({props:{single:!0,$$slots:{header:[c4],default:[a4]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[d4,({uniqueId:w})=>({12:w}),({uniqueId:w})=>w?4096:0]},$$scope:{ctx:n}}}),b=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[p4,({uniqueId:w})=>({12:w}),({uniqueId:w})=>w?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=E(),i=y("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("hr"),d=E(),p=y("h4"),p.textContent="General",m=E(),z(_.$$.fragment),g=E(),z(b.$$.fragment),h(e,"class","section-title"),h(i,"class","accordions"),h(p,"class","section-title")},m(w,T){$(w,e,T),$(w,t,T),$(w,i,T),V(s,i,null),v(i,l),V(o,i,null),v(i,r),V(a,i,null),$(w,u,T),$(w,f,T),$(w,d,T),$(w,p,T),$(w,m,T),V(_,w,T),$(w,g,T),V(b,w,T),k=!0},p(w,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:w}),s.$set(C);const M={};T&8197&&(M.$$scope={dirty:T,ctx:w}),o.$set(M);const O={};T&8195&&(O.$$scope={dirty:T,ctx:w}),a.$set(O);const D={};T&12289&&(D.$$scope={dirty:T,ctx:w}),_.$set(D);const A={};T&12289&&(A.$$scope={dirty:T,ctx:w}),b.$set(A)},i(w){k||(I(s.$$.fragment,w),I(o.$$.fragment,w),I(a.$$.fragment,w),I(_.$$.fragment,w),I(b.$$.fragment,w),k=!0)},o(w){L(s.$$.fragment,w),L(o.$$.fragment,w),L(a.$$.fragment,w),L(_.$$.fragment,w),L(b.$$.fragment,w),k=!1},d(w){w&&S(e),w&&S(t),w&&S(i),H(s),H(o),H(a),w&&S(u),w&&S(f),w&&S(d),w&&S(p),w&&S(m),H(_,w),w&&S(g),H(b,w)}}}function h4(n,e,t){let i,s,l,o;Ke(n,ii,g=>t(4,o=g));let{collection:r=new _n}=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 d(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=gt(this.value),t(0,r)}function _(){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,k,w;n.$$.dirty&1&&r.$isAuth&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty((w=o==null?void 0:o.options)==null?void 0:w.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,m,_]}class _4 extends ve{constructor(e){super(),be(this,e,h4,m4,ge,{collection:0})}}function Bd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Ud(n,e,t){const i=n.slice();return i[17]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Yd(n){let e;return{c(){e=y("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Kd(n){var r;let e,t,i,s,l=n[3]&&Jd(n),o=!((r=n[2])!=null&&r.$isView)&&Zd(n);return{c(){e=y("h6"),e.textContent="Changes:",t=E(),i=y("ul"),l&&l.c(),s=E(),o&&o.c(),h(i,"class","changes-list svelte-xqpcsf")},m(a,u){$(a,e,u),$(a,t,u),$(a,i,u),l&&l.m(i,null),v(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Jd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Zd(a),o.c(),o.m(i,null))},d(a){a&&S(e),a&&S(t),a&&S(i),l&&l.d(),o&&o.d()}}}function Jd(n){var m,_;let e,t,i,s,l=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,d=((_=n[2])==null?void 0:_.name)+"",p;return{c(){e=y("li"),t=y("div"),i=U(`Renamed collection `),s=y("strong"),o=U(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=U(d),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex"),h(e,"class","svelte-xqpcsf")},m(g,b){$(g,e,b),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(g,b){var k,w;b&2&&l!==(l=((k=g[1])==null?void 0:k.name)+"")&&le(o,l),b&4&&d!==(d=((w=g[2])==null?void 0:w.name)+"")&&le(p,d)},d(g){g&&S(e)}}}function Zd(n){let e,t,i,s=n[5],l=[];for(let f=0;f
    ',i=E(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=Se(),h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning")},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),u&&u.m(s,null),$(d,r,p),f&&f.m(d,p),$(d,a,p)},p(d,p){d[6].length?u||(u=Yd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=Kd(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&S(e),u&&u.d(),d&&S(r),f&&f.d(d),d&&S(a)}}}function b4(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function v4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='Cancel',t=E(),i=y("button"),i.innerHTML='Confirm',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,Ie(l)}}}function y4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[v4],header:[b4],default:[g4]},$$scope:{ctx:n}};return e=new vn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[13](null),H(e,s)}}}function k4(n,e,t){let i,s,l,o,r;const a=St();let u,f,d;async function p(C,M){t(1,f=C),t(2,d=M),await an(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const g=()=>m(),b=()=>_();function k(C){se[C?"unshift":"push"](()=>{u=C,t(4,u)})}function w(C){de.call(this,n,C)}function T(C){de.call(this,n,C)}return n.$$.update=()=>{var C,M,O;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(6,l=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(5,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>{var P,N,R;const A=(P=f==null?void 0:f.schema)==null?void 0:P.find(F=>F.id==D.id);return A?((N=A.options)==null?void 0:N.maxSelect)!=1&&((R=D.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.$isView)||i)},[m,f,d,i,u,o,l,s,r,_,p,g,b,k,w,T]}class w4 extends ve{constructor(e){super(),be(this,e,k4,y4,ge,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function xd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function S4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new DC({props:l}),se.push(()=>_e(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function $4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new WC({props:l}),se.push(()=>_e(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ep(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new jC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){$(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&S(e),H(t)}}}function tp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new _4({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===As)},m(r,a){$(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===As)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&S(e),H(t)}}}function T4(n){let e,t,i,s,l,o,r;const a=[$4,S4],u=[];function f(m,_){return m[2].$isView?0:1}i=f(n),s=u[i]=a[i](n);let d=n[3]===kl&&ep(n),p=n[2].$isAuth&&tp(n);return{c(){e=y("div"),t=y("div"),s.c(),l=E(),d&&d.c(),o=E(),p&&p.c(),h(t,"class","tab-item"),x(t,"active",n[3]===Ci),h(e,"class","tabs-content svelte-12y0yzb")},m(m,_){$(m,e,_),v(e,t),u[i].m(t,null),v(e,l),d&&d.m(e,null),v(e,o),p&&p.m(e,null),r=!0},p(m,_){let g=i;i=f(m),i===g?u[i].p(m,_):(re(),L(u[g],1,1,()=>{u[g]=null}),ae(),s=u[i],s?s.p(m,_):(s=u[i]=a[i](m),s.c()),I(s,1),s.m(t,null)),(!r||_[0]&8)&&x(t,"active",m[3]===Ci),m[3]===kl?d?(d.p(m,_),_[0]&8&&I(d,1)):(d=ep(m),d.c(),I(d,1),d.m(e,o)):d&&(re(),L(d,1,1,()=>{d=null}),ae()),m[2].$isAuth?p?(p.p(m,_),_[0]&4&&I(p,1)):(p=tp(m),p.c(),I(p,1),p.m(e,null)):p&&(re(),L(p,1,1,()=>{p=null}),ae())},i(m){r||(I(s),I(d),I(p),r=!0)},o(m){L(s),L(d),L(p),r=!1},d(m){m&&S(e),u[i].d(),d&&d.d(),p&&p.d()}}}function np(n){let e,t,i,s,l,o,r;return o=new Vn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[C4]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=E(),i=y("button"),s=y("i"),l=E(),z(o.$$.fragment),h(e,"class","flex-fill"),h(s,"class","ri-more-line"),h(i,"type","button"),h(i,"aria-label","More"),h(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){$(a,e,u),$(a,t,u),$(a,i,u),v(i,s),v(i,l),V(o,i,null),r=!0},p(a,u){const f={};u[1]&1048576&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(I(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&S(e),a&&S(t),a&&S(i),H(o)}}}function C4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=` Duplicate`,t=E(),i=y("button"),i.innerHTML=` Delete`,h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item txt-danger closable")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=[J(e,"click",n[24]),J(i,"click",Cn(pt(n[25])))],s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,Ie(l)}}}function ip(n){let e,t,i,s;return i=new Vn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[M4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=E(),z(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){$(l,e,o),$(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&S(e),l&&S(t),H(i,l)}}}function sp(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" collection"),u=E(),h(t,"class",i=Di(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),h(l,"class","txt"),h(e,"type","button"),h(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,_){$(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=J(e,"click",p),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=Di(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&h(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&le(r,o),_[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&S(e),f=!1,d()}}}function M4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s{R=null}),ae()),(!A||B[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(q[2].$isNew?"btn-outline":"btn-transparent")))&&h(p,"class",C),(!A||B[0]&4&&M!==(M=!q[2].$isNew))&&(p.disabled=M),q[2].system?F||(F=lp(),F.c(),F.m(D.parentNode,D)):F&&(F.d(1),F=null)},i(q){A||(I(R),A=!0)},o(q){L(R),A=!1},d(q){q&&S(e),q&&S(s),q&&S(l),q&&S(f),q&&S(d),R&&R.d(),q&&S(O),F&&F.d(q),q&&S(D),P=!1,N()}}}function op(n){let e,t,i,s,l,o;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){$(r,e,a),s=!0,l||(o=De(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Ht(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&et(()=>{s&&(i||(i=Ve(e,Et,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=Ve(e,Et,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&S(e),r&&i&&i.end(),l=!1,o()}}}function rp(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=De(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function ap(n){var a,u,f;let e,t,i,s=!j.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&&up();return{c(){e=y("button"),t=y("span"),t.textContent="Options",i=E(),r&&r.c(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","tab-item"),x(e,"active",n[3]===As)},m(d,p){$(d,e,p),v(e,t),v(e,i),r&&r.m(e,null),l||(o=J(e,"click",n[31]),l=!0)},p(d,p){var m,_,g;p[0]&32&&(s=!j.isEmpty((m=d[5])==null?void 0:m.options)&&!((g=(_=d[5])==null?void 0:_.options)!=null&&g.manageRule)),s?r?p[0]&32&&I(r,1):(r=up(),r.c(),I(r,1),r.m(e,null)):r&&(re(),L(r,1,1,()=>{r=null}),ae()),p[0]&8&&x(e,"active",d[3]===As)},d(d){d&&S(e),r&&r.d(),l=!1,o()}}}function up(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=De(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function D4(n){var Y,Z,ee,ie,X,fe,G,ce;let e,t=n[2].$isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,d,p,m,_=(Y=n[2])!=null&&Y.$isView?"Query":"Fields",g,b,k=!j.isEmpty(n[11]),w,T,C,M,O=!j.isEmpty((Z=n[5])==null?void 0:Z.listRule)||!j.isEmpty((ee=n[5])==null?void 0:ee.viewRule)||!j.isEmpty((ie=n[5])==null?void 0:ie.createRule)||!j.isEmpty((X=n[5])==null?void 0:X.updateRule)||!j.isEmpty((fe=n[5])==null?void 0:fe.deleteRule)||!j.isEmpty((ce=(G=n[5])==null?void 0:G.options)==null?void 0:ce.manageRule),D,A,P,N,R=!n[2].$isNew&&!n[2].system&&np(n);r=new pe({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[O4,({uniqueId:he})=>({46:he}),({uniqueId:he})=>[0,he?32768:0]]},$$scope:{ctx:n}}});let F=k&&op(n),q=O&&rp(),B=n[2].$isAuth&&ap(n);return{c(){e=y("h4"),i=U(t),s=E(),R&&R.c(),l=E(),o=y("form"),z(r.$$.fragment),a=E(),u=y("input"),f=E(),d=y("div"),p=y("button"),m=y("span"),g=U(_),b=E(),F&&F.c(),w=E(),T=y("button"),C=y("span"),C.textContent="API Rules",M=E(),q&&q.c(),D=E(),B&&B.c(),h(e,"class","upsert-panel-title svelte-12y0yzb"),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(m,"class","txt"),h(p,"type","button"),h(p,"class","tab-item"),x(p,"active",n[3]===Ci),h(C,"class","txt"),h(T,"type","button"),h(T,"class","tab-item"),x(T,"active",n[3]===kl),h(d,"class","tabs-header stretched")},m(he,Me){$(he,e,Me),v(e,i),$(he,s,Me),R&&R.m(he,Me),$(he,l,Me),$(he,o,Me),V(r,o,null),v(o,a),v(o,u),$(he,f,Me),$(he,d,Me),v(d,p),v(p,m),v(m,g),v(p,b),F&&F.m(p,null),v(d,w),v(d,T),v(T,C),v(T,M),q&&q.m(T,null),v(d,D),B&&B.m(d,null),A=!0,P||(N=[J(o,"submit",pt(n[28])),J(p,"click",n[29]),J(T,"click",n[30])],P=!0)},p(he,Me){var He,we,Ce,Je,ht,Ze,We,te;(!A||Me[0]&4)&&t!==(t=he[2].$isNew?"New collection":"Edit collection")&&le(i,t),!he[2].$isNew&&!he[2].system?R?(R.p(he,Me),Me[0]&4&&I(R,1)):(R=np(he),R.c(),I(R,1),R.m(l.parentNode,l)):R&&(re(),L(R,1,1,()=>{R=null}),ae());const je={};Me[0]&8192&&(je.class="form-field collection-field-name required m-b-0 "+(he[13]?"disabled":"")),Me[0]&8260|Me[1]&1081344&&(je.$$scope={dirty:Me,ctx:he}),r.$set(je),(!A||Me[0]&4)&&_!==(_=(He=he[2])!=null&&He.$isView?"Query":"Fields")&&le(g,_),Me[0]&2048&&(k=!j.isEmpty(he[11])),k?F?(F.p(he,Me),Me[0]&2048&&I(F,1)):(F=op(he),F.c(),I(F,1),F.m(p,null)):F&&(re(),L(F,1,1,()=>{F=null}),ae()),(!A||Me[0]&8)&&x(p,"active",he[3]===Ci),Me[0]&32&&(O=!j.isEmpty((we=he[5])==null?void 0:we.listRule)||!j.isEmpty((Ce=he[5])==null?void 0:Ce.viewRule)||!j.isEmpty((Je=he[5])==null?void 0:Je.createRule)||!j.isEmpty((ht=he[5])==null?void 0:ht.updateRule)||!j.isEmpty((Ze=he[5])==null?void 0:Ze.deleteRule)||!j.isEmpty((te=(We=he[5])==null?void 0:We.options)==null?void 0:te.manageRule)),O?q?Me[0]&32&&I(q,1):(q=rp(),q.c(),I(q,1),q.m(T,null)):q&&(re(),L(q,1,1,()=>{q=null}),ae()),(!A||Me[0]&8)&&x(T,"active",he[3]===kl),he[2].$isAuth?B?B.p(he,Me):(B=ap(he),B.c(),B.m(d,null)):B&&(B.d(1),B=null)},i(he){A||(I(R),I(r.$$.fragment,he),I(F),I(q),A=!0)},o(he){L(R),L(r.$$.fragment,he),L(F),L(q),A=!1},d(he){he&&S(e),he&&S(s),R&&R.d(he),he&&S(l),he&&S(o),H(r),he&&S(f),he&&S(d),F&&F.d(),q&&q.d(),B&&B.d(),P=!1,Ie(N)}}}function E4(n){let e,t,i,s,l,o=n[2].$isNew?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[9],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(d,p){$(d,e,p),v(e,t),$(d,i,p),$(d,s,p),v(s,l),v(l,r),u||(f=[J(e,"click",n[22]),J(s,"click",n[23])],u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&4&&o!==(o=d[2].$isNew?"Create":"Save changes")&&le(r,o),p[0]&4608&&a!==(a=!d[12]||d[9])&&(s.disabled=a),p[0]&512&&x(s,"btn-loading",d[9])},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,Ie(f)}}}function A4(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[36],$$slots:{footer:[E4],header:[D4],default:[T4]},$$scope:{ctx:n}};e=new vn({props:l}),n[37](e),e.$on("hide",n[38]),e.$on("show",n[39]);let o={};return i=new w4({props:o}),n[40](i),i.$on("confirm",n[41]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){V(e,r,a),$(r,t,a),V(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[36]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(I(e.$$.fragment,r),I(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[37](null),H(e,r),r&&S(t),n[40](null),H(i,r)}}}const Ci="schema",kl="api_rules",As="options",I4="base",fp="auth",cp="view";function Ar(n){return JSON.stringify(n)}function P4(n,e,t){let i,s,l,o;Ke(n,ii,te=>t(5,o=te));const r={};r[I4]="Base",r[cp]="View",r[fp]="Auth";const a=St();let u,f,d=null,p=new _n,m=!1,_=!1,g=Ci,b=Ar(p),k="";function w(te){t(3,g=te)}function T(te){return M(te),t(10,_=!0),w(Ci),u==null?void 0:u.show()}function C(){return u==null?void 0:u.hide()}async function M(te){gn({}),typeof te<"u"?(t(20,d=te),t(2,p=te.$clone())):(t(20,d=null),t(2,p=new _n)),t(2,p.schema=p.schema||[],p),t(2,p.originalName=p.name||"",p),await an(),t(21,b=Ar(p))}function O(){p.$isNew?D():f==null||f.show(d,p)}function D(){if(m)return;t(9,m=!0);const te=A();let qe;p.$isNew?qe=me.collections.create(te):qe=me.collections.update(p.id,te),qe.then(Qe=>{Da(),e$(Qe),t(10,_=!1),C(),Yt(p.$isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:p.$isNew,collection:Qe})}).catch(Qe=>{me.errorResponseHandler(Qe)}).finally(()=>{t(9,m=!1)})}function A(){const te=p.$export();te.schema=te.schema.slice(0);for(let qe=te.schema.length-1;qe>=0;qe--)te.schema[qe].toDelete&&te.schema.splice(qe,1);return te}function P(){d!=null&&d.id&&mn(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>me.collections.delete(d==null?void 0:d.id).then(()=>{C(),Yt(`Successfully deleted collection "${d==null?void 0:d.name}".`),a("delete",d),t$(d)}).catch(te=>{me.errorResponseHandler(te)}))}function N(te){t(2,p.type=te,p),mi("schema")}function R(){s?mn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const te=d==null?void 0:d.$clone();if(te){if(te.id="",te.created="",te.updated="",te.name+="_duplicate",!j.isEmpty(te.schema))for(const qe of te.schema)qe.id="";if(!j.isEmpty(te.indexes))for(let qe=0;qeC(),B=()=>O(),Y=()=>R(),Z=()=>P(),ee=te=>{t(2,p.name=j.slugify(te.target.value),p),te.target.value=p.name},ie=te=>N(te),X=()=>{l&&O()},fe=()=>w(Ci),G=()=>w(kl),ce=()=>w(As);function he(te){p=te,t(2,p),t(20,d)}function Me(te){p=te,t(2,p),t(20,d)}function je(te){p=te,t(2,p),t(20,d)}function He(te){p=te,t(2,p),t(20,d)}const we=()=>s&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),C()}),!1):!0;function Ce(te){se[te?"unshift":"push"](()=>{u=te,t(7,u)})}function Je(te){de.call(this,n,te)}function ht(te){de.call(this,n,te)}function Ze(te){se[te?"unshift":"push"](()=>{f=te,t(8,f)})}const We=()=>D();return n.$$.update=()=>{var te,qe;n.$$.dirty[0]&32&&(o.schema||(te=o.options)!=null&&te.query?t(11,k=j.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&p.type===cp&&(t(2,p.createRule=null,p),t(2,p.updateRule=null,p),t(2,p.deleteRule=null,p),t(2,p.indexes=[],p)),n.$$.dirty[0]&1048580&&p!=null&&p.name&&(d==null?void 0:d.name)!=(p==null?void 0:p.name)&&t(2,p.indexes=(qe=p.indexes)==null?void 0:qe.map(Qe=>j.replaceIndexTableName(Qe,p.name)),p),n.$$.dirty[0]&4&&t(13,i=!p.$isNew&&p.system),n.$$.dirty[0]&2097156&&t(4,s=b!=Ar(p)),n.$$.dirty[0]&20&&t(12,l=p.$isNew||s),n.$$.dirty[0]&12&&g===As&&p.type!==fp&&w(Ci)},[w,C,p,g,s,o,r,u,f,m,_,k,l,i,O,D,P,N,R,T,d,b,q,B,Y,Z,ee,ie,X,fe,G,ce,he,Me,je,He,we,Ce,Je,ht,Ze,We]}class lu extends ve{constructor(e){super(),be(this,e,P4,A4,ge,{changeTab:0,show:19,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function dp(n,e,t){const i=n.slice();return i[15]=e[t],i}function pp(n){let e,t=n[1].length&&mp();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),$(i,e,s)},p(i,s){i[1].length?t||(t=mp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&S(e)}}}function mp(n){let e;return{c(){e=y("p"),e.textContent="No collections found.",h(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function hp(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,d,p;return{key:n,first:null,c(){var m;t=y("a"),i=y("i"),l=E(),o=y("span"),a=U(r),u=E(),h(i,"class",s=j.getCollectionTypeIcon(e[15].type)),h(o,"class","txt"),h(t,"href",f="/collections?collectionId="+e[15].id),h(t,"class","sidebar-list-item"),x(t,"active",((m=e[5])==null?void 0:m.id)===e[15].id),this.first=t},m(m,_){$(m,t,_),v(t,i),v(t,l),v(t,o),v(o,a),v(t,u),d||(p=De(sn.call(null,t)),d=!0)},p(m,_){var g;e=m,_&8&&s!==(s=j.getCollectionTypeIcon(e[15].type))&&h(i,"class",s),_&8&&r!==(r=e[15].name+"")&&le(a,r),_&8&&f!==(f="/collections?collectionId="+e[15].id)&&h(t,"href",f),_&40&&x(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id)},d(m){m&&S(t),d=!1,p()}}}function _p(n){let e,t,i,s;return{c(){e=y("footer"),t=y("button"),t.innerHTML=` New collection`,h(t,"type","button"),h(t,"class","btn btn-block btn-outline"),h(e,"class","sidebar-footer")},m(l,o){$(l,e,o),v(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:Q,d(l){l&&S(e),i=!1,s()}}}function L4(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],m=new Map,_,g,b,k,w,T,C=n[3];const M=P=>P[15].id;for(let P=0;P',o=E(),r=y("input"),a=E(),u=y("hr"),f=E(),d=y("div");for(let P=0;P20),h(e,"class","page-sidebar collection-sidebar")},m(P,N){$(P,e,N),v(e,t),v(t,i),v(i,s),v(s,l),v(i,o),v(i,r),ue(r,n[0]),v(e,a),v(e,u),v(e,f),v(e,d);for(let R=0;R20),P[7]?D&&(D.d(1),D=null):D?D.p(P,N):(D=_p(P),D.c(),D.m(e,null));const R={};b.$set(R)},i(P){k||(I(b.$$.fragment,P),k=!0)},o(P){L(b.$$.fragment,P),k=!1},d(P){P&&S(e);for(let N=0;N{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function F4(n,e,t){let i,s,l,o,r,a,u;Ke(n,_i,w=>t(5,o=w)),Ke(n,bi,w=>t(9,r=w)),Ke(n,No,w=>t(6,a=w)),Ke(n,Ms,w=>t(7,u=w));let f,d="";function p(w){xt(_i,o=w,o)}const m=()=>t(0,d="");function _(){d=this.value,t(0,d)}const g=()=>f==null?void 0:f.show();function b(w){se[w?"unshift":"push"](()=>{f=w,t(2,f)})}const k=w=>{var T;(T=w.detail)!=null&&T.isNew&&w.detail.collection&&p(w.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&N4(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter(w=>w.id==d||w.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,m,_,g,b,k]}class R4 extends ve{constructor(e){super(),be(this,e,F4,L4,ge,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function vp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function yp(n){let e;return{c(){e=y("hr"),h(e,"class","m-t-sm m-b-sm")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function kp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&yp();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),d&&d.c(),s=E(),l=y("button"),r=U(o),a=E(),h(l,"type","button"),h(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,_){$(m,t,_),d&&d.m(m,_),$(m,s,_),$(m,l,_),v(l,r),v(l,a),u||(f=J(l,"click",p),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=yp(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&8&&o!==(o=e[15].label+"")&&le(r,o),_&40&&x(l,"active",e[5]===e[14])},d(m){m&&S(t),d&&d.d(m),m&&S(s),m&&S(l),u=!1,f()}}}function wp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:V4,then:j4,catch:q4,value:19,blocks:[,,,]};return cu(t=n[15].component,s),{c(){e=Se(),s.block.c()},m(l,o){$(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)&&cu(t,s)||Cb(s,n,o)},i(l){i||(I(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];L(r)}i=!1},d(l){l&&S(e),s.block.d(l),s.token=null,s=null}}}function q4(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function j4(n){bp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){V(e,s,l),$(s,t,l),i=!0},p(s,l){bp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(I(e.$$.fragment,s),i=!0)},o(s){L(e.$$.fragment,s),i=!1},d(s){H(e,s),s&&S(t)}}}function V4(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Sp(n,e){let t,i,s,l=e[5]===e[14]&&wp(e);return{key:n,first:null,c(){t=Se(),l&&l.c(),i=Se(),this.first=t},m(o,r){$(o,t,r),l&&l.m(o,r),$(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&I(l,1)):(l=wp(e),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(I(l),s=!0)},o(o){L(l),s=!1},d(o){o&&S(t),l&&l.d(o),o&&S(i)}}}function H4(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,d=Object.entries(n[3]);const p=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function B4(n){let e,t,i={class:"docs-panel",$$slots:{footer:[z4],default:[H4]},$$scope:{ctx:n}};return e=new vn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function U4(n,e,t){const i={list:{label:"List/Search",component:ft(()=>import("./ListApiDocs-c60f2b36.js"),["./ListApiDocs-c60f2b36.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:ft(()=>import("./ViewApiDocs-6fc1a66b.js"),["./ViewApiDocs-6fc1a66b.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:ft(()=>import("./CreateApiDocs-b327e4ec.js"),["./CreateApiDocs-b327e4ec.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:ft(()=>import("./UpdateApiDocs-0ab53b08.js"),["./UpdateApiDocs-0ab53b08.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:ft(()=>import("./DeleteApiDocs-75416801.js"),["./DeleteApiDocs-75416801.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:ft(()=>import("./RealtimeApiDocs-74b30fa3.js"),["./RealtimeApiDocs-74b30fa3.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:ft(()=>import("./AuthWithPasswordDocs-f8036660.js"),["./AuthWithPasswordDocs-f8036660.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:ft(()=>import("./AuthWithOAuth2Docs-49638d8c.js"),["./AuthWithOAuth2Docs-49638d8c.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:ft(()=>import("./AuthRefreshDocs-27449685.js"),["./AuthRefreshDocs-27449685.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:ft(()=>import("./RequestVerificationDocs-c443116e.js"),["./RequestVerificationDocs-c443116e.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:ft(()=>import("./ConfirmVerificationDocs-ab1c7c50.js"),["./ConfirmVerificationDocs-ab1c7c50.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:ft(()=>import("./RequestPasswordResetDocs-8ab8815b.js"),["./RequestPasswordResetDocs-8ab8815b.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:ft(()=>import("./ConfirmPasswordResetDocs-dd17fbc1.js"),["./ConfirmPasswordResetDocs-dd17fbc1.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:ft(()=>import("./RequestEmailChangeDocs-e6ba2879.js"),["./RequestEmailChangeDocs-e6ba2879.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:ft(()=>import("./ConfirmEmailChangeDocs-6ad20e15.js"),["./ConfirmEmailChangeDocs-6ad20e15.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:ft(()=>import("./AuthMethodsDocs-719a254f.js"),["./AuthMethodsDocs-719a254f.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:ft(()=>import("./ListExternalAuthsDocs-109517cb.js"),["./ListExternalAuthsDocs-109517cb.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:ft(()=>import("./UnlinkExternalAuthDocs-413f9307.js"),["./UnlinkExternalAuthDocs-413f9307.js","./SdkTabs-27c932bb.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new _n,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),d(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function d(k){t(5,r=k)}const p=()=>f(),m=k=>d(k);function _(k){se[k?"unshift":"push"](()=>{l=k,t(4,l)})}function g(k){de.call(this,n,k)}function b(k){de.call(this,n,k)}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"]):o.$isView?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,d,o,a,l,r,i,u,p,m,_,g,b]}class W4 extends ve{constructor(e){super(),be(this,e,U4,B4,ge,{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 Y4(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Username",o=E(),r=y("input"),h(t,"class",j.getFieldTypeIcon("user")),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","text"),h(r,"requried",a=!n[0].$isNew),h(r,"placeholder",u=n[0].$isNew?"Leave empty to auto generate...":n[3]),h(r,"id",f=n[12])},m(m,_){$(m,e,_),v(e,t),v(e,i),v(e,s),$(m,o,_),$(m,r,_),ue(r,n[0].username),d||(p=J(r,"input",n[4]),d=!0)},p(m,_){_&4096&&l!==(l=m[12])&&h(e,"for",l),_&1&&a!==(a=!m[0].$isNew)&&h(r,"requried",a),_&1&&u!==(u=m[0].$isNew?"Leave empty to auto generate...":m[3])&&h(r,"placeholder",u),_&4096&&f!==(f=m[12])&&h(r,"id",f),_&1&&r.value!==m[0].username&&ue(r,m[0].username)},d(m){m&&S(e),m&&S(o),m&&S(r),d=!1,p()}}}function K4(n){let e,t,i,s,l,o,r,a,u,f,d=n[0].emailVisibility?"On":"Off",p,m,_,g,b,k,w,T,C;return{c(){var M;e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("div"),a=y("button"),u=y("span"),f=U("Public: "),p=U(d),_=E(),g=y("input"),h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[12]),h(u,"class","txt"),h(a,"type","button"),h(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),h(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),h(g,"type","email"),g.autofocus=b=n[0].$isNew,h(g,"autocomplete","off"),h(g,"id",k=n[12]),g.required=w=(M=n[1].options)==null?void 0:M.requireEmail,h(g,"class","svelte-1751a4d")},m(M,O){$(M,e,O),v(e,t),v(e,i),v(e,s),$(M,o,O),$(M,r,O),v(r,a),v(a,u),v(u,f),v(u,p),$(M,_,O),$(M,g,O),ue(g,n[0].email),n[0].$isNew&&g.focus(),T||(C=[De(Ue.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",n[5]),J(g,"input",n[6])],T=!0)},p(M,O){var D;O&4096&&l!==(l=M[12])&&h(e,"for",l),O&1&&d!==(d=M[0].emailVisibility?"On":"Off")&&le(p,d),O&1&&m!==(m="btn btn-sm btn-transparent "+(M[0].emailVisibility?"btn-success":"btn-hint"))&&h(a,"class",m),O&1&&b!==(b=M[0].$isNew)&&(g.autofocus=b),O&4096&&k!==(k=M[12])&&h(g,"id",k),O&2&&w!==(w=(D=M[1].options)==null?void 0:D.requireEmail)&&(g.required=w),O&1&&g.value!==M[0].email&&ue(g,M[0].email)},d(M){M&&S(e),M&&S(o),M&&S(r),M&&S(_),M&&S(g),T=!1,Ie(C)}}}function $p(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[J4,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function J4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){$(u,e,f),e.checked=n[2],$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&4&&(e.checked=u[2]),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function Tp(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[Z4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[G4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),x(t,"p-t-xs",n[2]),h(e,"class","block")},m(f,d){$(f,e,d),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),u=!0},p(f,d){const p={};d&12289&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d&12289&&(m.$$scope={dirty:d,ctx:f}),r.$set(m),(!u||d&4)&&x(t,"p-t-xs",f[2])},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=Ve(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=Ve(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&S(e),H(s),H(r),f&&a&&a.end()}}}function Z4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[12]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[0].password),u||(f=J(r,"input",n[8]),u=!0)},p(d,p){p&4096&&l!==(l=d[12])&&h(e,"for",l),p&4096&&a!==(a=d[12])&&h(r,"id",a),p&1&&r.value!==d[0].password&&ue(r,d[0].password)},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,f()}}}function G4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[12]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[0].passwordConfirm),u||(f=J(r,"input",n[9]),u=!0)},p(d,p){p&4096&&l!==(l=d[12])&&h(e,"for",l),p&4096&&a!==(a=d[12])&&h(r,"id",a),p&1&&r.value!==d[0].passwordConfirm&&ue(r,d[0].passwordConfirm)},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,f()}}}function X4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Verified"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){$(u,e,f),e.checked=n[0].verified,$(u,i,f),$(u,s,f),v(s,l),r||(a=[J(e,"change",n[10]),J(e,"change",pt(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,Ie(a)}}}function Q4(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new pe({props:{class:"form-field "+(n[0].$isNew?"":"required"),name:"username",$$slots:{default:[Y4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+((b=n[1].options)!=null&&b.requireEmail?"required":""),name:"email",$$slots:{default:[K4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}});let _=!n[0].$isNew&&$p(n),g=(n[0].$isNew||n[2])&&Tp(n);return p=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[X4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),_&&_.c(),u=E(),g&&g.c(),f=E(),d=y("div"),z(p.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(a,"class","col-lg-12"),h(d,"class","col-lg-12"),h(e,"class","grid m-b-base")},m(k,w){$(k,e,w),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),_&&_.m(a,null),v(a,u),g&&g.m(a,null),v(e,f),v(e,d),V(p,d,null),m=!0},p(k,[w]){var O;const T={};w&1&&(T.class="form-field "+(k[0].$isNew?"":"required")),w&12289&&(T.$$scope={dirty:w,ctx:k}),i.$set(T);const C={};w&2&&(C.class="form-field "+((O=k[1].options)!=null&&O.requireEmail?"required":"")),w&12291&&(C.$$scope={dirty:w,ctx:k}),o.$set(C),k[0].$isNew?_&&(re(),L(_,1,1,()=>{_=null}),ae()):_?(_.p(k,w),w&1&&I(_,1)):(_=$p(k),_.c(),I(_,1),_.m(a,u)),k[0].$isNew||k[2]?g?(g.p(k,w),w&5&&I(g,1)):(g=Tp(k),g.c(),I(g,1),g.m(a,null)):g&&(re(),L(g,1,1,()=>{g=null}),ae());const M={};w&12289&&(M.$$scope={dirty:w,ctx:k}),p.$set(M)},i(k){m||(I(i.$$.fragment,k),I(o.$$.fragment,k),I(_),I(g),I(p.$$.fragment,k),m=!0)},o(k){L(i.$$.fragment,k),L(o.$$.fragment,k),L(_),L(g),L(p.$$.fragment,k),m=!1},d(k){k&&S(e),H(i),H(o),_&&_.d(),g&&g.d(),H(p)}}}function x4(n,e,t){let{collection:i=new _n}=e,{record:s=new di}=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 d(){s.password=this.value,t(0,s),t(2,o)}function p(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function m(){s.verified=this.checked,t(0,s),t(2,o)}const _=g=>{s.$isNew||mn("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),mi("password"),mi("passwordConfirm")))},[s,i,o,l,r,a,u,f,d,p,m,_]}class e5 extends ve{constructor(e){super(),be(this,e,x4,Q4,ge,{collection:1,record:0})}}function t5(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const _=r.closest("form");_!=null&&_.requestSubmit&&_.requestSubmit()}}Zt(()=>(u(),()=>clearTimeout(a)));function d(m){se[m?"unshift":"push"](()=>{r=m,t(1,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=Fe(Fe({},e),zt(m)),t(3,s=Ge(e,i)),"value"in m&&t(0,l=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,d,p]}class i5 extends ve{constructor(e){super(),be(this,e,n5,t5,ge,{value:0,maxHeight:4})}}function s5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function m(g){n[2](g)}let _={id:n[3],required:n[1].required};return n[0]!==void 0&&(_.value=n[0]),f=new i5({props:_}),se.push(()=>_e(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(g,b){$(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),$(g,u,b),V(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=j.getFieldTypeIcon(g[1].type)))&&h(t,"class",i),(!p||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=g[3]))&&h(e,"for",a);const k={};b&8&&(k.id=g[3]),b&2&&(k.required=g[1].required),!d&&b&1&&(d=!0,k.value=g[0],ke(()=>d=!1)),f.$set(k)},i(g){p||(I(f.$$.fragment,g),p=!0)},o(g){L(f.$$.fragment,g),p=!1},d(g){g&&S(e),g&&S(u),H(f,g)}}}function l5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[s5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function o5(n,e,t){let{field:i=new bn}=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 r5 extends ve{constructor(e){super(),be(this,e,o5,l5,ge,{field:1,value:0})}}function a5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_,g,b;return{c(){var k,w;e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","number"),h(f,"id",d=n[3]),f.required=p=n[1].required,h(f,"min",m=(k=n[1].options)==null?void 0:k.min),h(f,"max",_=(w=n[1].options)==null?void 0:w.max),h(f,"step","any")},m(k,w){$(k,e,w),v(e,t),v(e,s),v(e,l),v(l,r),$(k,u,w),$(k,f,w),ue(f,n[0]),g||(b=J(f,"input",n[2]),g=!0)},p(k,w){var T,C;w&2&&i!==(i=j.getFieldTypeIcon(k[1].type))&&h(t,"class",i),w&2&&o!==(o=k[1].name+"")&&le(r,o),w&8&&a!==(a=k[3])&&h(e,"for",a),w&8&&d!==(d=k[3])&&h(f,"id",d),w&2&&p!==(p=k[1].required)&&(f.required=p),w&2&&m!==(m=(T=k[1].options)==null?void 0:T.min)&&h(f,"min",m),w&2&&_!==(_=(C=k[1].options)==null?void 0:C.max)&&h(f,"max",_),w&1&>(f.value)!==k[0]&&ue(f,k[0])},d(k){k&&S(e),k&&S(u),k&&S(f),g=!1,b()}}}function u5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[a5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f5(n,e,t){let{field:i=new bn}=e,{value:s=void 0}=e;function l(){s=gt(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 c5 extends ve{constructor(e){super(),be(this,e,f5,u5,ge,{field:1,value:0})}}function d5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=y("input"),i=E(),s=y("label"),o=U(l),h(e,"type","checkbox"),h(e,"id",t=n[3]),h(s,"for",r=n[3])},m(f,d){$(f,e,d),e.checked=n[0],$(f,i,d),$(f,s,d),v(s,o),a||(u=J(e,"change",n[2]),a=!0)},p(f,d){d&8&&t!==(t=f[3])&&h(e,"id",t),d&1&&(e.checked=f[0]),d&2&&l!==(l=f[1].name+"")&&le(o,l),d&8&&r!==(r=f[3])&&h(s,"for",r)},d(f){f&&S(e),f&&S(i),f&&S(s),a=!1,u()}}}function p5(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[d5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function m5(n,e,t){let{field:i=new bn}=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 h5 extends ve{constructor(e){super(),be(this,e,m5,p5,ge,{field:1,value:0})}}function _5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","email"),h(f,"id",d=n[3]),f.required=p=n[1].required},m(g,b){$(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),$(g,u,b),$(g,f,b),ue(f,n[0]),m||(_=J(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&h(e,"for",a),b&8&&d!==(d=g[3])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&S(e),g&&S(u),g&&S(f),m=!1,_()}}}function g5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[_5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function b5(n,e,t){let{field:i=new bn}=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 v5 extends ve{constructor(e){super(),be(this,e,b5,g5,ge,{field:1,value:0})}}function y5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","url"),h(f,"id",d=n[3]),f.required=p=n[1].required},m(g,b){$(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),$(g,u,b),$(g,f,b),ue(f,n[0]),m||(_=J(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&h(e,"for",a),b&8&&d!==(d=g[3])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&S(e),g&&S(u),g&&S(f),m=!1,_()}}}function k5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[y5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function w5(n,e,t){let{field:i=new bn}=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 S5 extends ve{constructor(e){super(),be(this,e,w5,k5,ge,{field:1,value:0})}}function Cp(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","link-hint clear-btn svelte-11df51y"),h(e,"class","form-field-addon")},m(l,o){$(l,e,o),v(e,t),i||(s=[De(Ue.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(l){l&&S(e),i=!1,Ie(s)}}}function $5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_,g,b=n[0]&&!n[1].required&&Cp(n);function k(C){n[6](C)}function w(C){n[7](C)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),p=new iu({props:T}),se.push(()=>_e(p,"value",k)),se.push(()=>_e(p,"formattedValue",w)),p.$on("close",n[3]),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" (UTC)"),f=E(),b&&b.c(),d=E(),z(p.$$.fragment),h(t,"class",i=Di(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),h(l,"class","txt"),h(e,"for",u=n[8])},m(C,M){$(C,e,M),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),$(C,f,M),b&&b.m(C,M),$(C,d,M),V(p,C,M),g=!0},p(C,M){(!g||M&2&&i!==(i=Di(j.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&h(t,"class",i),(!g||M&2)&&o!==(o=C[1].name+"")&&le(r,o),(!g||M&256&&u!==(u=C[8]))&&h(e,"for",u),C[0]&&!C[1].required?b?b.p(C,M):(b=Cp(C),b.c(),b.m(d.parentNode,d)):b&&(b.d(1),b=null);const O={};M&256&&(O.id=C[8]),!m&&M&4&&(m=!0,O.value=C[2],ke(()=>m=!1)),!_&&M&1&&(_=!0,O.formattedValue=C[0],ke(()=>_=!1)),p.$set(O)},i(C){g||(I(p.$$.fragment,C),g=!0)},o(C){L(p.$$.fragment,C),g=!1},d(C){C&&S(e),C&&S(f),b&&b.d(C),C&&S(d),H(p,C)}}}function T5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function C5(n,e,t){let{field:i=new bn}=e,{value:s=void 0}=e,l=s;function o(d){d.detail&&d.detail.length==3&&t(0,s=d.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(d){l=d,t(2,l),t(0,s)}function f(d){s=d,t(0,s)}return n.$$set=d=>{"field"in d&&t(1,i=d.field),"value"in d&&t(0,s=d.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class M5 extends ve{constructor(e){super(),be(this,e,C5,T5,ge,{field:1,value:0})}}function Mp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=y("div"),t=U("Select up to "),s=U(i),l=U(" items."),h(e,"class","help-block")},m(o,r){$(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&S(e)}}}function O5(n){var w,T,C,M,O;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;function g(D){n[3](D)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((w=n[0])==null?void 0:w.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:(C=n[1].options)==null?void 0:C.values,searchable:((M=n[1].options)==null?void 0:M.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new su({props:b}),se.push(()=>_e(f,"selected",g));let k=((O=n[1].options)==null?void 0:O.maxSelect)>1&&Mp(n);return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),p=E(),k&&k.c(),m=Se(),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(D,A){$(D,e,A),v(e,t),v(e,s),v(e,l),v(l,r),$(D,u,A),V(f,D,A),$(D,p,A),k&&k.m(D,A),$(D,m,A),_=!0},p(D,A){var N,R,F,q,B;(!_||A&2&&i!==(i=j.getFieldTypeIcon(D[1].type)))&&h(t,"class",i),(!_||A&2)&&o!==(o=D[1].name+"")&&le(r,o),(!_||A&16&&a!==(a=D[4]))&&h(e,"for",a);const P={};A&16&&(P.id=D[4]),A&6&&(P.toggle=!D[1].required||D[2]),A&4&&(P.multiple=D[2]),A&7&&(P.closable=!D[2]||((N=D[0])==null?void 0:N.length)>=((R=D[1].options)==null?void 0:R.maxSelect)),A&2&&(P.items=(F=D[1].options)==null?void 0:F.values),A&2&&(P.searchable=((q=D[1].options)==null?void 0:q.values)>5),!d&&A&1&&(d=!0,P.selected=D[0],ke(()=>d=!1)),f.$set(P),((B=D[1].options)==null?void 0:B.maxSelect)>1?k?k.p(D,A):(k=Mp(D),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(D){_||(I(f.$$.fragment,D),_=!0)},o(D){L(f.$$.fragment,D),_=!1},d(D){D&&S(e),D&&S(u),H(f,D),D&&S(p),k&&k.d(D),D&&S(m)}}}function D5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[O5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function E5(n,e,t){let i,{field:s=new bn}=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 A5 extends ve{constructor(e){super(),be(this,e,E5,D5,ge,{field:1,value:0})}}function I5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("textarea"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4]),h(f,"id",d=n[4]),h(f,"class","txt-mono"),f.required=p=n[1].required,f.value=n[2]},m(g,b){$(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),$(g,u,b),$(g,f,b),m||(_=J(f,"input",n[3]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&16&&a!==(a=g[4])&&h(e,"for",a),b&16&&d!==(d=g[4])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&4&&(f.value=g[2])},d(g){g&&S(e),g&&S(u),g&&S(f),m=!1,_()}}}function P5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function L5(n,e,t){let{field:i=new bn}=e,{value:s=void 0}=e,l=JSON.stringify(typeof s>"u"?null:s,null,2);const o=r=>{t(2,l=r.target.value),t(0,s=r.target.value.trim())};return n.$$set=r=>{"field"in r&&t(1,i=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(l==null?void 0:l.trim())&&(t(2,l=JSON.stringify(typeof s>"u"?null:s,null,2)),t(0,s=l))},[s,i,l,o]}class N5 extends ve{constructor(e){super(),be(this,e,L5,P5,ge,{field:1,value:0})}}function F5(n){let e,t;return{c(){e=y("i"),h(e,"class","ri-file-line"),h(e,"alt",t=n[0].name)},m(i,s){$(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&h(e,"alt",t)},d(i){i&&S(e)}}}function R5(n){let e,t,i;return{c(){e=y("img"),Yn(e.src,t=n[2])||h(e,"src",t),h(e,"width",n[1]),h(e,"height",n[1]),h(e,"alt",i=n[0].name)},m(s,l){$(s,e,l)},p(s,l){l&4&&!Yn(e.src,t=s[2])&&h(e,"src",t),l&2&&h(e,"width",s[1]),l&2&&h(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&h(e,"alt",i)},d(s){s&&S(e)}}}function q5(n){let e;function t(l,o){return l[2]?R5:F5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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:Q,o:Q,d(l){s.d(l),l&&S(e)}}}function j5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),j.hasImageExtension(s==null?void 0:s.name)&&j.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 V5 extends ve{constructor(e){super(),be(this,e,j5,q5,ge,{file:0,size:1})}}function Op(n){let e;function t(l,o){return l[4]==="image"?z5:H5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function H5(n){let e,t;return{c(){e=y("object"),t=U("Cannot preview the file."),h(e,"title",n[2]),h(e,"data",n[1])},m(i,s){$(i,e,s),v(e,t)},p(i,s){s&4&&h(e,"title",i[2]),s&2&&h(e,"data",i[1])},d(i){i&&S(e)}}}function z5(n){let e,t,i;return{c(){e=y("img"),Yn(e.src,t=n[1])||h(e,"src",t),h(e,"alt",i="Preview "+n[2])},m(s,l){$(s,e,l)},p(s,l){l&2&&!Yn(e.src,t=s[1])&&h(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&h(e,"alt",i)},d(s){s&&S(e)}}}function B5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Op(n);return{c(){i&&i.c(),t=Se()},m(l,o){i&&i.m(l,o),$(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=Op(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&S(t)}}}function U5(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){$(s,e,l),t||(i=J(e,"click",pt(n[0])),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function W5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("a"),t=U(n[2]),i=E(),s=y("i"),l=E(),o=y("div"),r=E(),a=y("button"),a.textContent="Close",h(s,"class","ri-external-link-line"),h(e,"href",n[1]),h(e,"title",n[2]),h(e,"target","_blank"),h(e,"rel","noreferrer noopener"),h(e,"class","link-hint txt-ellipsis inline-flex"),h(o,"class","flex-fill"),h(a,"type","button"),h(a,"class","btn btn-transparent")},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,l,p),$(d,o,p),$(d,r,p),$(d,a,p),u||(f=J(a,"click",n[0]),u=!0)},p(d,p){p&4&&le(t,d[2]),p&2&&h(e,"href",d[1]),p&4&&h(e,"title",d[2])},d(d){d&&S(e),d&&S(l),d&&S(o),d&&S(r),d&&S(a),u=!1,f()}}}function Y5(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[W5],header:[U5],default:[B5]},$$scope:{ctx:n}};return e=new vn({props:i}),n[6](e),e.$on("show",n[7]),e.$on("hide",n[8]),{c(){z(e.$$.fragment)},m(s,l){V(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||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function K5(n,e,t){let i,s,l,o="";function r(p){p!==""&&(t(1,o=p),l==null||l.show())}function a(){return l==null?void 0:l.hide()}function u(p){se[p?"unshift":"push"](()=>{l=p,t(3,l)})}function f(p){de.call(this,n,p)}function d(p){de.call(this,n,p)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=o.substring(o.lastIndexOf("/")+1)),n.$$.dirty&4&&t(4,s=j.getFileType(i))},[a,o,i,l,s,r,u,f,d]}class J5 extends ve{constructor(e){super(),be(this,e,K5,Y5,ge,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function Z5(n){let e;return{c(){e=y("i"),h(e,"class","ri-file-3-line")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function G5(n){let e;return{c(){e=y("i"),h(e,"class","ri-video-line")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function X5(n){let e,t,i,s,l;return{c(){e=y("img"),Yn(e.src,t=n[4])||h(e,"src",t),h(e,"alt",n[0]),h(e,"title",i="Preview "+n[0])},m(o,r){$(o,e,r),s||(l=J(e,"error",n[7]),s=!0)},p(o,r){r&16&&!Yn(e.src,t=o[4])&&h(e,"src",t),r&1&&h(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&h(e,"title",i)},d(o){o&&S(e),s=!1,l()}}}function Q5(n){let e,t,i,s,l,o,r,a;function u(m,_){return m[2]==="image"?X5:m[2]==="video"||m[2]==="audio"?G5:Z5}let f=u(n),d=f(n),p={};return l=new J5({props:p}),n[10](l),{c(){e=y("a"),d.c(),s=E(),z(l.$$.fragment),h(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),h(e,"href",n[6]),h(e,"target","_blank"),h(e,"rel","noreferrer"),h(e,"title",i=(n[5]?"Preview":"Download")+" "+n[0])},m(m,_){$(m,e,_),d.m(e,null),$(m,s,_),V(l,m,_),o=!0,r||(a=J(e,"click",Cn(n[9])),r=!0)},p(m,[_]){f===(f=u(m))&&d?d.p(m,_):(d.d(1),d=f(m),d&&(d.c(),d.m(e,null))),(!o||_&2&&t!==(t="thumb "+(m[1]?`thumb-${m[1]}`:"")))&&h(e,"class",t),(!o||_&33&&i!==(i=(m[5]?"Preview":"Download")+" "+m[0]))&&h(e,"title",i);const g={};l.$set(g)},i(m){o||(I(l.$$.fragment,m),o=!0)},o(m){L(l.$$.fragment,m),o=!1},d(m){m&&S(e),d.d(),m&&S(s),n[10](null),H(l,m),r=!1,a()}}}function x5(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f=me.getFileUrl(l,o);function d(){t(4,u="")}const p=_=>{s&&(_.preventDefault(),a==null||a.show(f))};function m(_){se[_?"unshift":"push"](()=>{a=_,t(3,a)})}return n.$$set=_=>{"record"in _&&t(8,l=_.record),"filename"in _&&t(0,o=_.filename),"size"in _&&t(1,r=_.size)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.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,d,l,p,m]}class ou extends ve{constructor(e){super(),be(this,e,x5,Q5,ge,{record:8,filename:0,size:1})}}function Dp(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 eM(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){$(l,e,o),t||(i=[De(Ue.call(null,e,"Remove file")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&S(e),t=!1,Ie(i)}}}function tM(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=y("button"),e.innerHTML='Restore',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){$(l,e,o),t||(i=J(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&S(e),t=!1,i()}}}function Ap(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,d,p,m,_,g;s=new ou({props:{record:e[2],filename:e[25]}});function b(T,C){return C&18&&(_=null),_==null&&(_=!!T[1].includes(T[24])),_?tM:eM}let k=b(e,-1),w=k(e);return{key:n,first:null,c(){t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),r=y("a"),u=U(a),p=E(),m=y("div"),w.c(),x(i,"fade",e[1].includes(e[24])),h(r,"href",f=me.getFileUrl(e[2],e[25])),h(r,"class",d="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")),h(r,"title","Download"),h(r,"target","_blank"),h(r,"rel","noopener noreferrer"),h(o,"class","content"),h(m,"class","actions"),h(t,"class","list-item"),this.first=t},m(T,C){$(T,t,C),v(t,i),V(s,i,null),v(t,l),v(t,o),v(o,r),v(r,u),v(t,p),v(t,m),w.m(m,null),g=!0},p(T,C){e=T;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]+"")&&le(u,a),(!g||C&20&&f!==(f=me.getFileUrl(e[2],e[25])))&&h(r,"href",f),(!g||C&18&&d!==(d="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")))&&h(r,"class",d),k===(k=b(e,C))&&w?w.p(e,C):(w.d(1),w=k(e),w&&(w.c(),w.m(m,null)))},i(T){g||(I(s.$$.fragment,T),g=!0)},o(T){L(s.$$.fragment,T),g=!1},d(T){T&&S(t),H(s),w.d()}}}function Ip(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,d,p,m,_,g,b;i=new V5({props:{file:n[22]}});function k(){return n[15](n[24])}return{c(){e=y("div"),t=y("figure"),z(i.$$.fragment),s=E(),l=y("div"),o=y("small"),o.textContent="New",r=E(),a=y("span"),f=U(u),p=E(),m=y("button"),m.innerHTML='',h(t,"class","thumb"),h(o,"class","label label-success m-r-5"),h(a,"class","txt"),h(l,"class","filename m-r-auto"),h(l,"title",d=n[22].name),h(m,"type","button"),h(m,"class","btn btn-transparent btn-sm btn-circle btn-remove"),h(e,"class","list-item")},m(w,T){$(w,e,T),v(e,t),V(i,t,null),v(e,s),v(e,l),v(l,o),v(l,r),v(l,a),v(a,f),v(e,p),v(e,m),_=!0,g||(b=[De(Ue.call(null,m,"Remove file")),J(m,"click",k)],g=!0)},p(w,T){n=w;const C={};T&1&&(C.file=n[22]),i.$set(C),(!_||T&1)&&u!==(u=n[22].name+"")&&le(f,u),(!_||T&1&&d!==(d=n[22].name))&&h(l,"title",d)},i(w){_||(I(i.$$.fragment,w),_=!0)},o(w){L(i.$$.fragment,w),_=!1},d(w){w&&S(e),H(i),g=!1,Ie(b)}}}function nM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,d=[],p=new Map,m,_,g,b,k,w,T,C,M,O,D,A,P=n[4];const N=B=>B[25]+B[2].id;for(let B=0;BL(F[B],1,1,()=>{F[B]=null});return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div");for(let B=0;B({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function sM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new bn}=e,d,p;function m(A){j.removeByValue(u,A),t(1,u)}function _(A){j.pushUnique(u,A),t(1,u)}function g(A){j.isEmpty(a[A])||a.splice(A,1),t(0,a)}function b(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const k=A=>m(A),w=A=>_(A),T=A=>g(A);function C(A){se[A?"unshift":"push"](()=>{d=A,t(6,d)})}const M=()=>{for(let A of d.files)a.push(A);t(0,a),t(6,d.value=null,d)},O=()=>d==null?void 0:d.click();function D(A){se[A?"unshift":"push"](()=>{p=A,t(7,p)})}return n.$$set=A=>{"record"in A&&t(2,o=A.record),"value"in A&&t(12,r=A.value),"uploadedFiles"in A&&t(0,a=A.uploadedFiles),"deletedFileIndexes"in A&&t(1,u=A.deletedFileIndexes),"field"in A&&t(3,f=A.field)},n.$$.update=()=>{var A,P;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=j.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty&8&&t(5,i=((A=f.options)==null?void 0:A.maxSelect)>1),n.$$.dirty&4128&&j.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=j.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,d,p,l,m,_,g,r,k,w,T,C,M,O,D]}class lM extends ve{constructor(e){super(),be(this,e,sM,iM,ge,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function Pp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function oM(n,e){e=Pp(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=Pp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const rM=n=>({dragging:n&2,dragover:n&4}),Lp=n=>({dragging:n[1],dragover:n[2]});function aM(n){let e,t,i,s;const l=n[8].default,o=Pt(l,n,n[7],Lp);return{c(){e=y("div"),o&&o.c(),h(e,"draggable",!0),h(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[1]),x(e,"dragover",n[2])},m(r,a){$(r,e,a),o&&o.m(e,null),t=!0,i||(s=[J(e,"dragover",pt(n[9])),J(e,"dragleave",pt(n[10])),J(e,"dragend",n[11]),J(e,"dragstart",n[12]),J(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Nt(o,l,r,r[7],t?Lt(l,r[7],a,rM):Ft(r[7]),Lp),(!t||a&2)&&x(e,"dragging",r[1]),(!t||a&4)&&x(e,"dragover",r[2])},i(r){t||(I(o,r),t=!0)},o(r){L(o,r),t=!1},d(r){r&&S(e),o&&o.d(r),i=!1,Ie(s)}}}function uM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=St();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function d(w,T){!w&&!a||(t(1,u=!0),w.dataTransfer.effectAllowed="move",w.dataTransfer.dropEffect="move",w.dataTransfer.setData("text/plain",T))}function p(w,T){if(!w&&!a)return;t(2,f=!1),t(1,u=!1),w.dataTransfer.dropEffect="move";const C=parseInt(w.dataTransfer.getData("text/plain"));C{t(2,f=!0)},_=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},b=w=>d(w,o),k=w=>p(w,o);return n.$$set=w=>{"index"in w&&t(0,o=w.index),"list"in w&&t(5,r=w.list),"disabled"in w&&t(6,a=w.disabled),"$$scope"in w&&t(7,s=w.$$scope)},[o,u,f,d,p,r,a,s,i,m,_,g,b,k]}class fM extends ve{constructor(e){super(),be(this,e,uM,aM,ge,{index:0,list:5,disabled:6})}}function Np(n,e,t){const i=n.slice();i[6]=e[t];const s=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function Fp(n,e,t){const i=n.slice();return i[10]=e[t],i}function Rp(n){let e,t;return e=new ou({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function qp(n){let e=!j.isEmpty(n[10]),t,i,s=e&&Rp(n);return{c(){s&&s.c(),t=Se()},m(l,o){s&&s.m(l,o),$(l,t,o),i=!0},p(l,o){o&3&&(e=!j.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&I(s,1)):(s=Rp(l),s.c(),I(s,1),s.m(t.parentNode,t)):s&&(re(),L(s,1,1,()=>{s=null}),ae())},i(l){i||(I(s),i=!0)},o(l){L(s),i=!1},d(l){s&&s.d(l),l&&S(t)}}}function jp(n){let e,t,i=n[7],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oL(m[g],1,1,()=>{m[g]=null});return{c(){e=y("div"),t=y("i"),s=E();for(let g=0;gt(5,o=u));let{record:r}=e,{displayFields:a=[]}=e;return n.$$set=u=>{"record"in u&&t(0,r=u.record),"displayFields"in u&&t(3,a=u.displayFields)},n.$$.update=()=>{n.$$.dirty&33&&t(4,i=o==null?void 0:o.find(u=>u.id==(r==null?void 0:r.collectionId))),n.$$.dirty&24&&t(1,s=(a==null?void 0:a.filter(u=>{var f;return!!((f=i==null?void 0:i.schema)!=null&&f.find(d=>d.name==u&&d.type=="file"))}))||[]),n.$$.dirty&10&&t(2,l=(s.length?a==null?void 0:a.filter(u=>!s.includes(u)):a)||[])},[r,s,l,a,i,o]}class xo extends ve{constructor(e){super(),be(this,e,dM,cM,ge,{record:0,displayFields:3})}}function Vp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Hp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function zp(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='
    New record
    ',h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function Bp(n){let e,t;function i(o,r){return o[12]?mM:pM}let s=i(n),l=s(n);return{c(){e=y("div"),l.c(),t=E(),h(e,"class","list-item")},m(o,r){$(o,e,r),l.m(e,null),v(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&&S(e),l.d()}}}function pM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Up(n);return{c(){e=y("span"),e.textContent="No records found.",t=E(),s&&s.c(),i=Se(),h(e,"class","txt txt-hint")},m(o,r){$(o,e,r),$(o,t,r),s&&s.m(o,r),$(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&&S(e),o&&S(t),s&&s.d(o),o&&S(i)}}}function mM(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","block txt-center")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Up(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[35]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function hM(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function _M(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Wp(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),h(e,"class","actions nonintrusive")},m(o,r){$(o,e,r),v(e,t),i||(s=[De(Ue.call(null,t,"Edit")),J(t,"keydown",Cn(n[27])),J(t,"click",Cn(l))],i=!0)},p(o,r){n=o},d(o){o&&S(e),i=!1,Ie(s)}}}function Yp(n,e){var k;let t,i,s,l,o,r,a,u,f;function d(w,T){return w[6]?_M:hM}let p=d(e),m=p(e);l=new xo({props:{record:e[49],displayFields:e[13]}});let _=!((k=e[10])!=null&&k.$isView)&&Wp(e);function g(){return e[33](e[49])}function b(...w){return e[34](e[49],...w)}return{key:n,first:null,c(){t=y("div"),m.c(),i=E(),s=y("div"),z(l.$$.fragment),o=E(),_&&_.c(),r=E(),h(s,"class","content"),h(t,"tabindex","0"),h(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m(w,T){$(w,t,T),m.m(t,null),v(t,i),v(t,s),V(l,s,null),v(t,o),_&&_.m(t,null),v(t,r),a=!0,u||(f=[J(t,"click",g),J(t,"keydown",b)],u=!0)},p(w,T){var M;e=w,p!==(p=d(e))&&(m.d(1),m=p(e),m&&(m.c(),m.m(t,i)));const C={};T[0]&8&&(C.record=e[49]),T[0]&8192&&(C.displayFields=e[13]),l.$set(C),(M=e[10])!=null&&M.$isView?_&&(_.d(1),_=null):_?_.p(e,T):(_=Wp(e),_.c(),_.m(t,r)),(!a||T[0]&264)&&x(t,"selected",e[6]),(!a||T[0]&808)&&x(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i(w){a||(I(l.$$.fragment,w),a=!0)},o(w){L(l.$$.fragment,w),a=!1},d(w){w&&S(t),m.d(),H(l),_&&_.d(),u=!1,Ie(f)}}}function Kp(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){$(r,e,a),$(r,i,a),$(r,s,a),$(r,l,a),$(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&32&&le(l,r[5])},d(r){r&&S(e),r&&S(i),r&&S(s),r&&S(l),r&&S(o)}}}function gM(n){let e;return{c(){e=y("p"),e.textContent="No selected records.",h(e,"class","txt-hint")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function bM(n){let e,t,i=n[6],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){e=y("div");for(let o=0;o',l=E(),h(s,"type","button"),h(s,"title","Remove"),h(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),h(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,d){$(f,e,d),V(t,e,null),v(e,i),v(e,s),$(f,l,d),o=!0,r||(a=J(s,"click",u),r=!0)},p(f,d){n=f;const p={};d[0]&64&&(p.record=n[49]),d[0]&8192&&(p.displayFields=n[13]),t.$set(p),(!o||d[1]&2097152)&&x(e,"label-danger",n[52]),(!o||d[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(I(t.$$.fragment,f),o=!0)},o(f){L(t.$$.fragment,f),o=!1},d(f){f&&S(e),H(t),f&&S(l),r=!1,a()}}}function Jp(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[vM,({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 fM({props:l}),se.push(()=>_e(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){V(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],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function yM(n){var R;let e,t,i,s,l,o=[],r=new Map,a,u,f,d,p,m,_,g,b,k,w;t=new Yo({props:{value:n[2],autocompleteCollection:n[10]}}),t.$on("submit",n[30]);let T=!((R=n[10])!=null&&R.$isView)&&zp(n),C=n[3];const M=F=>F[49].id;for(let F=0;F1&&Kp(n);const A=[bM,gM],P=[];function N(F,q){return F[6].length?0:1}return m=N(n),_=P[m]=A[m](n),{c(){e=y("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=y("div");for(let F=0;F1?D?D.p(F,q):(D=Kp(F),D.c(),D.m(f,null)):D&&(D.d(1),D=null);let Y=m;m=N(F),m===Y?P[m].p(F,q):(re(),L(P[Y],1,1,()=>{P[Y]=null}),ae(),_=P[m],_?_.p(F,q):(_=P[m]=A[m](F),_.c()),I(_,1),_.m(g.parentNode,g))},i(F){if(!b){I(t.$$.fragment,F);for(let q=0;qCancel',t=E(),i=y("button"),i.innerHTML='Save selection',h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,Ie(l)}}}function SM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[wM],header:[kM],default:[yM]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ne));const _=St(),g="picker_"+j.randomString(5);let{value:b}=e,{field:k}=e,w,T,C="",M=[],O=[],D=1,A=0,P=!1,N=!1;function R(){return t(2,C=""),t(3,M=[]),t(6,O=[]),q(),B(!0),w==null?void 0:w.show()}function F(){return w==null?void 0:w.hide()}async function q(){const Ne=j.toArray(b);if(!s||!Ne.length)return;t(24,N=!0);let $e=[];const Xe=Ne.slice(),ye=[];for(;Xe.length>0;){const Pe=[];for(const nt of Xe.splice(0,Ir))Pe.push(`id="${nt}"`);ye.push(me.collection(s).getFullList(Ir,{filter:Pe.join("||"),$autoCancel:!1}))}try{await Promise.all(ye).then(Pe=>{$e=$e.concat(...Pe)}),t(6,O=[]);for(const Pe of Ne){const nt=j.findByKey($e,"id",Pe);nt&&O.push(nt)}C.trim()||t(3,M=j.filterDuplicatesByKey(O.concat(M)))}catch(Pe){me.errorResponseHandler(Pe)}t(24,N=!1)}async function B(Ne=!1){if(s){t(4,P=!0),Ne&&(C.trim()?t(3,M=[]):t(3,M=j.toArray(O).slice()));try{const $e=Ne?1:D+1,Xe=await me.collection(s).getList($e,Ir,{filter:C,sort:o!=null&&o.$isView?"":"-created",$cancelKey:g+"loadList"});t(3,M=j.filterDuplicatesByKey(M.concat(Xe.items))),D=Xe.page,t(23,A=Xe.totalItems)}catch($e){me.errorResponseHandler($e)}t(4,P=!1)}}function Y(Ne){i==1?t(6,O=[Ne]):u&&(j.pushOrReplaceByKey(O,Ne),t(6,O))}function Z(Ne){j.removeByKey(O,"id",Ne.id),t(6,O)}function ee(Ne){f(Ne)?Z(Ne):Y(Ne)}function ie(){var Ne;i!=1?t(20,b=O.map($e=>$e.id)):t(20,b=((Ne=O==null?void 0:O[0])==null?void 0:Ne.id)||""),_("save",O),F()}function X(Ne){de.call(this,n,Ne)}const fe=()=>F(),G=()=>ie(),ce=Ne=>t(2,C=Ne.detail),he=()=>T==null?void 0:T.show(),Me=Ne=>T==null?void 0:T.show(Ne),je=Ne=>ee(Ne),He=(Ne,$e)=>{($e.code==="Enter"||$e.code==="Space")&&($e.preventDefault(),$e.stopPropagation(),ee(Ne))},we=()=>t(2,C=""),Ce=()=>{a&&!P&&B()},Je=Ne=>Z(Ne);function ht(Ne){O=Ne,t(6,O)}function Ze(Ne){se[Ne?"unshift":"push"](()=>{w=Ne,t(1,w)})}function We(Ne){de.call(this,n,Ne)}function te(Ne){de.call(this,n,Ne)}function qe(Ne){se[Ne?"unshift":"push"](()=>{T=Ne,t(7,T)})}const Qe=Ne=>{j.removeByKey(M,"id",Ne.detail.id),M.unshift(Ne.detail),t(3,M),Y(Ne.detail)},Kt=Ne=>{j.removeByKey(M,"id",Ne.detail.id),t(3,M),Z(Ne.detail)};return n.$$set=Ne=>{e=Fe(Fe({},e),zt(Ne)),t(19,p=Ge(e,d)),"value"in Ne&&t(20,b=Ne.value),"field"in Ne&&t(21,k=Ne.field)},n.$$.update=()=>{var Ne,$e,Xe;n.$$.dirty[0]&2097152&&t(5,i=((Ne=k==null?void 0:k.options)==null?void 0:Ne.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=($e=k==null?void 0:k.options)==null?void 0:$e.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(Xe=k==null?void 0:k.options)==null?void 0:Xe.displayFields),n.$$.dirty[0]&100663296&&t(10,o=m.find(ye=>ye.id==s)||null),n.$$.dirty[0]&16777222&&typeof C<"u"&&!N&&w!=null&&w.isActive()&&B(!0),n.$$.dirty[0]&16777232&&t(12,r=P||N),n.$$.dirty[0]&8388616&&t(11,a=A>M.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>O.length),n.$$.dirty[0]&64&&t(8,f=function(ye){return j.findByKey(O,"id",ye.id)})},[F,w,C,M,P,i,O,T,f,u,o,a,r,l,B,Y,Z,ee,ie,p,b,k,R,A,N,s,m,X,fe,G,ce,he,Me,je,He,we,Ce,Je,ht,Ze,We,te,qe,Qe,Kt]}class TM extends ve{constructor(e){super(),be(this,e,$M,SM,ge,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Zp(n,e,t){const i=n.slice();return i[15]=e[t],i}function Gp(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xp(n){let e,t=n[5]&&Qp(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),$(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=Qp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&S(e)}}}function Qp(n){let e,t=j.toArray(n[0]).slice(0,10),i=[];for(let s=0;s `,h(e,"class","list-item")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function em(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new xo({props:{record:n[15],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[8](n[15])}return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),o=y("button"),o.innerHTML='',r=E(),h(t,"class","content"),h(o,"type","button"),h(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(l,"class","actions"),h(e,"class","list-item")},m(m,_){$(m,e,_),v(e,t),V(i,t,null),v(e,s),v(e,l),v(l,o),v(e,r),a=!0,u||(f=[De(Ue.call(null,o,"Remove")),J(o,"click",d)],u=!0)},p(m,_){var b;n=m;const g={};_&16&&(g.record=n[15]),_&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(m){a||(I(i.$$.fragment,m),a=!0)},o(m){L(i.$$.fragment,m),a=!1},d(m){m&&S(e),H(i),u=!1,Ie(f)}}}function CM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,w=n[4],T=[];for(let O=0;OL(T[O],1,1,()=>{T[O]=null});let M=null;return w.length||(M=Xp(n)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div"),d=y("div");for(let O=0;O Open picker`,h(t,"class",i=Di(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),h(l,"class","txt"),h(e,"for",a=n[14]),h(d,"class","relations-list svelte-1ynw0pc"),h(_,"type","button"),h(_,"class","btn btn-transparent btn-sm btn-block"),h(m,"class","list-item list-item-btn"),h(f,"class","list")},m(O,D){$(O,e,D),v(e,t),v(e,s),v(e,l),v(l,r),$(O,u,D),$(O,f,D),v(f,d);for(let A=0;A({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new TM({props:o}),n[11](i),i.$on("save",n[12]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){V(e,r,a),$(r,t,a),V(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(I(e.$$.fragment,r),I(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[10](null),H(e,r),r&&S(t),n[11](null),H(i,r)}}}const tm=100;function OM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new bn}=e,r,a=[],u=!1;f();async function f(){var C,M;const k=j.toArray(s);if(!((C=o==null?void 0:o.options)!=null&&C.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const w=k.slice(),T=[];for(;w.length>0;){const O=[];for(const D of w.splice(0,tm))O.push(`id="${D}"`);T.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(tm,{filter:O.join("||"),$autoCancel:!1}))}try{let O=[];await Promise.all(T).then(D=>{O=O.concat(...D)});for(const D of k){const A=j.findByKey(O,"id",D);A&&a.push(A)}t(4,a)}catch(O){me.errorResponseHandler(O)}t(5,u=!1)}function d(k){var w;j.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((w=a[0])==null?void 0:w.id)||"")}const p=k=>d(k),m=()=>l==null?void 0:l.show();function _(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function g(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const b=k=>{var w;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):((w=a[0])==null?void 0:w.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,d,p,m,_,g,b]}class DM extends ve{constructor(e){super(),be(this,e,OM,MM,ge,{value:0,picker:1,field:2})}}const EM=["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"],AM=(n,e)=>{EM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function IM(n){let e;return{c(){e=y("textarea"),h(e,"id",n[0]),Fr(e,"visibility","hidden")},m(t,i){$(t,e,i),n[18](e)},p(t,i){i&1&&h(e,"id",t[0])},d(t){t&&S(e),n[18](null)}}}function PM(n){let e;return{c(){e=y("div"),h(e,"id",n[0])},m(t,i){$(t,e,i),n[17](e)},p(t,i){i&1&&h(e,"id",t[0])},d(t){t&&S(e),n[17](null)}}}function LM(n){let e;function t(l,o){return l[1]?PM:IM}let i=t(n),s=i(n);return{c(){e=y("div"),s.c(),h(e,"class",n[2])},m(l,o){$(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&&h(e,"class",l[2])},i:Q,o:Q,d(l){l&&S(e),s.d(),n[19](null)}}}const Q1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),NM=()=>{let n={listeners:[],scriptId:Q1("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 FM=NM();function RM(n,e,t){var i;let{id:s=Q1("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:d="change input undo redo"}=e,{value:p=""}=e,{text:m=""}=e,{cssClass:_="tinymce-wrapper"}=e,g,b,k,w=p,T=o;const C=St(),M=()=>{const R=(()=>typeof window<"u"?window:global)();return R&&R.tinymce?R.tinymce:null},O=()=>{const N=Object.assign(Object.assign({},f),{target:b,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:R=>{t(14,k=R),R.on("init",()=>{R.setContent(p),R.on(d,()=>{t(15,w=R.getContent()),w!==p&&(t(5,p=w),t(6,m=R.getContent({format:"text"})))})}),AM(R,C),typeof f.setup=="function"&&f.setup(R)}});t(4,b.style.visibility="",b),M().init(N)};Zt(()=>{if(M()!==null)O();else{const N=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;FM.load(g.ownerDocument,N,()=>{O()})}}),R_(()=>{var N;k&&((N=M())===null||N===void 0||N.remove(k))});function D(N){se[N?"unshift":"push"](()=>{b=N,t(4,b)})}function A(N){se[N?"unshift":"push"](()=>{b=N,t(4,b)})}function P(N){se[N?"unshift":"push"](()=>{g=N,t(3,g)})}return n.$$set=N=>{"id"in N&&t(0,s=N.id),"inline"in N&&t(1,l=N.inline),"disabled"in N&&t(7,o=N.disabled),"apiKey"in N&&t(8,r=N.apiKey),"channel"in N&&t(9,a=N.channel),"scriptSrc"in N&&t(10,u=N.scriptSrc),"conf"in N&&t(11,f=N.conf),"modelEvents"in N&&t(12,d=N.modelEvents),"value"in N&&t(5,p=N.value),"text"in N&&t(6,m=N.text),"cssClass"in N&&t(2,_=N.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&w!==p&&(k.setContent(p),t(6,m=k.getContent({format:"text"}))),k&&o!==T&&(t(16,T=o),typeof(t(13,i=k.mode)===null||i===void 0?void 0:i.set)=="function"?k.mode.set(o?"readonly":"design"):k.setMode(o?"readonly":"design")))},[s,l,_,g,b,p,m,o,r,a,u,f,d,i,k,w,T,D,A,P]}class ru extends ve{constructor(e){super(),be(this,e,RM,LM,ge,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function qM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function m(g){n[2](g)}let _={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()};return n[0]!==void 0&&(_.value=n[0]),f=new ru({props:_}),se.push(()=>_e(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(g,b){$(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),$(g,u,b),V(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=j.getFieldTypeIcon(g[1].type)))&&h(t,"class",i),(!p||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=g[3]))&&h(e,"for",a);const k={};b&8&&(k.id=g[3]),!d&&b&1&&(d=!0,k.value=g[0],ke(()=>d=!1)),f.$set(k)},i(g){p||(I(f.$$.fragment,g),p=!0)},o(g){L(f.$$.fragment,g),p=!1},d(g){g&&S(e),g&&S(u),H(f,g)}}}function jM(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function VM(n,e,t){let{field:i=new bn}=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 HM extends ve{constructor(e){super(),be(this,e,VM,jM,ge,{field:1,value:0})}}function zM(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].authUrl),r||(a=J(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].authUrl&&ue(l,u[0].authUrl)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function BM(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].tokenUrl),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&ue(l,u[0].tokenUrl)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function UM(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("User API URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].userApiUrl),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&ue(l,u[0].userApiUrl)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function WM(n){let e,t,i,s,l,o,r,a,u,f,d,p;return l=new pe({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[zM,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[BM,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[UM,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Selfhosted endpoints (optional)",t=E(),i=y("div"),s=y("div"),z(l.$$.fragment),o=E(),r=y("div"),z(a.$$.fragment),u=E(),f=y("div"),z(d.$$.fragment),h(e,"class","section-title"),h(s,"class","col-lg-4"),h(r,"class","col-lg-4"),h(f,"class","col-lg-4"),h(i,"class","grid")},m(m,_){$(m,e,_),$(m,t,_),$(m,i,_),v(i,s),V(l,s,null),v(i,o),v(i,r),V(a,r,null),v(i,u),v(i,f),V(d,f,null),p=!0},p(m,[_]){const g={};_&2&&(g.name=m[1]+".authUrl"),_&97&&(g.$$scope={dirty:_,ctx:m}),l.$set(g);const b={};_&2&&(b.name=m[1]+".tokenUrl"),_&97&&(b.$$scope={dirty:_,ctx:m}),a.$set(b);const k={};_&2&&(k.name=m[1]+".userApiUrl"),_&97&&(k.$$scope={dirty:_,ctx:m}),d.$set(k)},i(m){p||(I(l.$$.fragment,m),I(a.$$.fragment,m),I(d.$$.fragment,m),p=!0)},o(m){L(l.$$.fragment,m),L(a.$$.fragment,m),L(d.$$.fragment,m),p=!1},d(m){m&&S(e),m&&S(t),m&&S(i),H(l),H(a),H(d)}}}function YM(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 nm extends ve{constructor(e){super(),be(this,e,YM,WM,ge,{key:1,config:0})}}function KM(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",h(e,"for",i=n[4]),h(l,"type","url"),h(l,"id",o=n[4]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[0].authUrl),$(p,a,m),$(p,u,m),f||(d=J(l,"input",n[2]),f=!0)},p(p,m){m&16&&i!==(i=p[4])&&h(e,"for",i),m&16&&o!==(o=p[4])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].authUrl&&ue(l,p[0].authUrl)},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(a),p&&S(u),f=!1,d()}}}function JM(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",h(e,"for",i=n[4]),h(l,"type","url"),h(l,"id",o=n[4]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[0].tokenUrl),$(p,a,m),$(p,u,m),f||(d=J(l,"input",n[3]),f=!0)},p(p,m){m&16&&i!==(i=p[4])&&h(e,"for",i),m&16&&o!==(o=p[4])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].tokenUrl&&ue(l,p[0].tokenUrl)},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(a),p&&S(u),f=!1,d()}}}function ZM(n){let e,t,i,s,l,o,r,a,u;return l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[KM,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[JM,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Azure AD endpoints",t=E(),i=y("div"),s=y("div"),z(l.$$.fragment),o=E(),r=y("div"),z(a.$$.fragment),h(e,"class","section-title"),h(s,"class","col-lg-12"),h(r,"class","col-lg-12"),h(i,"class","grid")},m(f,d){$(f,e,d),$(f,t,d),$(f,i,d),v(i,s),V(l,s,null),v(i,o),v(i,r),V(a,r,null),u=!0},p(f,[d]){const p={};d&1&&(p.class="form-field "+(f[0].enabled?"required":"")),d&2&&(p.name=f[1]+".authUrl"),d&49&&(p.$$scope={dirty:d,ctx:f}),l.$set(p);const m={};d&1&&(m.class="form-field "+(f[0].enabled?"required":"")),d&2&&(m.name=f[1]+".tokenUrl"),d&49&&(m.$$scope={dirty:d,ctx:f}),a.$set(m)},i(f){u||(I(l.$$.fragment,f),I(a.$$.fragment,f),u=!0)},o(f){L(l.$$.fragment,f),L(a.$$.fragment,f),u=!1},d(f){f&&S(e),f&&S(t),f&&S(i),H(l),H(a)}}}function GM(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 XM extends ve{constructor(e){super(),be(this,e,GM,ZM,ge,{key:1,config:0})}}function QM(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/authorize/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[0].authUrl),$(p,a,m),$(p,u,m),f||(d=J(l,"input",n[2]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].authUrl&&ue(l,p[0].authUrl)},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(a),p&&S(u),f=!1,d()}}}function xM(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/token/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[0].tokenUrl),$(p,a,m),$(p,u,m),f||(d=J(l,"input",n[3]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].tokenUrl&&ue(l,p[0].tokenUrl)},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(a),p&&S(u),f=!1,d()}}}function eO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("User API URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/userinfo/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[0].userApiUrl),$(p,a,m),$(p,u,m),f||(d=J(l,"input",n[4]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].userApiUrl&&ue(l,p[0].userApiUrl)},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(a),p&&S(u),f=!1,d()}}}function tO(n){let e,t,i,s,l,o,r,a,u,f,d,p;return l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[QM,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[xM,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[eO,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Endpoints",t=E(),i=y("div"),s=y("div"),z(l.$$.fragment),o=E(),r=y("div"),z(a.$$.fragment),u=E(),f=y("div"),z(d.$$.fragment),h(e,"class","section-title"),h(s,"class","col-lg-12"),h(r,"class","col-lg-12"),h(f,"class","col-lg-12"),h(i,"class","grid")},m(m,_){$(m,e,_),$(m,t,_),$(m,i,_),v(i,s),V(l,s,null),v(i,o),v(i,r),V(a,r,null),v(i,u),v(i,f),V(d,f,null),p=!0},p(m,[_]){const g={};_&1&&(g.class="form-field "+(m[0].enabled?"required":"")),_&2&&(g.name=m[1]+".authUrl"),_&97&&(g.$$scope={dirty:_,ctx:m}),l.$set(g);const b={};_&1&&(b.class="form-field "+(m[0].enabled?"required":"")),_&2&&(b.name=m[1]+".tokenUrl"),_&97&&(b.$$scope={dirty:_,ctx:m}),a.$set(b);const k={};_&1&&(k.class="form-field "+(m[0].enabled?"required":"")),_&2&&(k.name=m[1]+".userApiUrl"),_&97&&(k.$$scope={dirty:_,ctx:m}),d.$set(k)},i(m){p||(I(l.$$.fragment,m),I(a.$$.fragment,m),I(d.$$.fragment,m),p=!0)},o(m){L(l.$$.fragment,m),L(a.$$.fragment,m),L(d.$$.fragment,m),p=!1},d(m){m&&S(e),m&&S(t),m&&S(i),H(l),H(a),H(d)}}}function nO(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 Pr extends ve{constructor(e){super(),be(this,e,nO,tO,ge,{key:1,config:0})}}function iO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function sO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Team ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[3]),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&8&&l.value!==u[3]&&ue(l,u[3])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function lO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Key ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[4]),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&16&&l.value!==u[4]&&ue(l,u[4])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function oO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("span"),t.textContent="Duration (in seconds)",i=E(),s=y("i"),o=E(),r=y("input"),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[23]),h(r,"type","text"),h(r,"id",a=n[23]),h(r,"max",mo),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[6]),u||(f=[De(Ue.call(null,s,{text:`Max ${mo} seconds (~${mo/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],u=!0)},p(d,p){p&8388608&&l!==(l=d[23])&&h(e,"for",l),p&8388608&&a!==(a=d[23])&&h(r,"id",a),p&64&&r.value!==d[6]&&ue(r,d[6])},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,Ie(f)}}}function rO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Private key"),s=E(),l=y("textarea"),r=E(),a=y("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",h(e,"for",i=n[23]),h(l,"id",o=n[23]),l.required=!0,h(l,"rows","8"),h(l,"placeholder",`-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----`),h(a,"class","help-block")},m(d,p){$(d,e,p),v(e,t),$(d,s,p),$(d,l,p),ue(l,n[5]),$(d,r,p),$(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&h(e,"for",i),p&8388608&&o!==(o=d[23])&&h(l,"id",o),p&32&&ue(l,d[5])},d(d){d&&S(e),d&&S(s),d&&S(l),d&&S(r),d&&S(a),u=!1,f()}}}function aO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[iO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[sO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[lO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[oO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[rO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),d=E(),p=y("div"),z(m.$$.fragment),_=E(),z(g.$$.fragment),h(i,"class","col-lg-6"),h(o,"class","col-lg-6"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(t,"class","grid"),h(e,"id",n[9]),h(e,"autocomplete","off")},m(T,C){$(T,e,C),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),v(t,a),v(t,u),V(f,u,null),v(t,d),v(t,p),V(m,p,null),v(t,_),V(g,t,null),b=!0,k||(w=J(e,"submit",pt(n[17])),k=!0)},p(T,C){const M={};C&25165828&&(M.$$scope={dirty:C,ctx:T}),s.$set(M);const O={};C&25165832&&(O.$$scope={dirty:C,ctx:T}),r.$set(O);const D={};C&25165840&&(D.$$scope={dirty:C,ctx:T}),f.$set(D);const A={};C&25165888&&(A.$$scope={dirty:C,ctx:T}),m.$set(A);const P={};C&25165856&&(P.$$scope={dirty:C,ctx:T}),g.$set(P)},i(T){b||(I(s.$$.fragment,T),I(r.$$.fragment,T),I(f.$$.fragment,T),I(m.$$.fragment,T),I(g.$$.fragment,T),b=!0)},o(T){L(s.$$.fragment,T),L(r.$$.fragment,T),L(f.$$.fragment,T),L(m.$$.fragment,T),L(g.$$.fragment,T),b=!1},d(T){T&&S(e),H(s),H(r),H(f),H(m),H(g),k=!1,w()}}}function uO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",h(e,"class","center txt-break")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function fO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Generate and set secret",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[7],h(l,"class","ri-key-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[9]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){$(d,e,p),v(e,t),$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,f()}}}function cO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[fO],header:[uO],default:[aO]},$$scope:{ctx:n}};return e=new vn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const mo=15777e3;function dO(n,e,t){let i;const s=St(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,d,p=!1;function m(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,d=N.duration||mo),gn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function g(){t(7,p=!0);try{const N=await me.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Yt("Successfully generated client secret."),s("submit",N),o==null||o.hide()}catch(N){me.errorResponseHandler(N)}t(7,p=!1)}function b(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function w(){u=this.value,t(4,u)}function T(){d=this.value,t(6,d)}function C(){f=this.value,t(5,f)}const M=()=>g(),O=()=>!p;function D(N){se[N?"unshift":"push"](()=>{o=N,t(1,o)})}function A(N){de.call(this,n,N)}function P(N){de.call(this,n,N)}return t(8,i=!0),[_,o,r,a,u,f,d,p,i,l,g,m,b,k,w,T,C,M,O,D,A,P]}class pO extends ve{constructor(e){super(),be(this,e,dO,cO,ge,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function mO(n){let e,t,i,s,l,o,r,a,u,f,d={};return r=new pO({props:d}),n[4](r),r.$on("submit",n[5]),{c(){e=y("button"),t=y("i"),i=E(),s=y("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),h(t,"class","ri-key-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(p,m){$(p,e,m),v(e,t),v(e,i),v(e,s),$(p,o,m),V(r,p,m),a=!0,u||(f=J(e,"click",n[3]),u=!0)},p(p,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+p[1]))&&h(e,"class",l);const _={};r.$set(_)},i(p){a||(I(r.$$.fragment,p),a=!0)},o(p){L(r.$$.fragment,p),a=!1},d(p){p&&S(e),p&&S(o),n[4](null),H(r,p),u=!1,f()}}}function hO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){se[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class _O extends ve{constructor(e){super(),be(this,e,hO,mO,ge,{key:1,config:0})}}const Is={appleAuth:{title:"Apple",icon:"ri-apple-fill",optionsComponent:_O},googleAuth:{title:"Google",icon:"ri-google-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:XM},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:nm},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:nm},discordAuth:{title:"Discord",icon:"ri-discord-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},oidcAuth:{title:"OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",optionsComponent:Pr},oidc2Auth:{title:"(2) OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",hidden:!0,optionsComponent:Pr},oidc3Auth:{title:"(3) OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",hidden:!0,optionsComponent:Pr}};function im(n,e,t){const i=n.slice();return i[9]=e[t],i}function gO(n){let e;return{c(){e=y("h6"),e.textContent="No linked OAuth2 providers.",h(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function bO(n){let e,t=n[1],i=[];for(let s=0;s',h(e,"class","block txt-center")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function sm(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,d=n[9].providerId+"",p,m,_,g,b,k;function w(){return n[6](n[9])}return{c(){e=y("div"),t=y("i"),s=E(),l=y("span"),r=U(o),a=E(),u=y("div"),f=U("ID: "),p=U(d),m=E(),_=y("button"),_.innerHTML='',g=E(),h(t,"class",i=n[4](n[9].provider)),h(l,"class","txt"),h(u,"class","txt-hint"),h(_,"type","button"),h(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),h(e,"class","list-item")},m(T,C){$(T,e,C),v(e,t),v(e,s),v(e,l),v(l,r),v(e,a),v(e,u),v(u,f),v(u,p),v(e,m),v(e,_),v(e,g),b||(k=J(_,"click",w),b=!0)},p(T,C){n=T,C&2&&i!==(i=n[4](n[9].provider))&&h(t,"class",i),C&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),C&2&&d!==(d=n[9].providerId+"")&&le(p,d)},d(T){T&&S(e),b=!1,k()}}}function yO(n){let e;function t(l,o){var r;return l[2]?vO:(r=l[0])!=null&&r.id&&l[1].length?bO:gO}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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:Q,o:Q,d(l){s.d(l),l&&S(e)}}}function kO(n,e,t){const i=St();let{record:s}=e,l=[],o=!1;function r(p){var m;return((m=Is[p+"Auth"])==null?void 0:m.title)||j.sentenize(p,!1)}function a(p){var m;return((m=Is[p+"Auth"])==null?void 0:m.icon)||`ri-${p}-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 me.collection(s.collectionId).listExternalAuths(s.id))}catch(p){me.errorResponseHandler(p)}t(2,o=!1)}function f(p){!(s!=null&&s.id)||!p||mn(`Do you really want to unlink the ${r(p)} provider?`,()=>me.collection(s.collectionId).unlinkExternalAuth(s.id,p).then(()=>{Yt(`Successfully unlinked the ${r(p)} provider.`),i("unlink",p),u()}).catch(m=>{me.errorResponseHandler(m)}))}u();const d=p=>f(p.provider);return n.$$set=p=>{"record"in p&&t(0,s=p.record)},[s,l,o,r,a,f,d]}class wO extends ve{constructor(e){super(),be(this,e,kO,yO,ge,{record:0})}}function lm(n,e,t){const i=n.slice();return i[53]=e[t],i[54]=e,i[55]=t,i}function om(n){let e,t,i,s,l;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-calendar-event-line txt-disabled"),h(e,"class","form-field-addon")},m(o,r){$(o,e,r),v(e,t),s||(l=De(i=Ue.call(null,t,{text:`Created: ${n[3].created} Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&Ht(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created} Updated: ${o[3].updated}`,position:"left"})},d(o){o&&S(e),s=!1,l()}}}function SO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g=!n[6]&&om(n);return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",l=E(),o=y("span"),a=E(),g&&g.c(),u=E(),f=y("input"),h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[56]),h(f,"type","text"),h(f,"id",d=n[56]),h(f,"placeholder","Leave empty to auto generate..."),h(f,"minlength","15"),f.readOnly=p=!n[6]},m(b,k){$(b,e,k),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),$(b,a,k),g&&g.m(b,k),$(b,u,k),$(b,f,k),ue(f,n[3].id),m||(_=J(f,"input",n[30]),m=!0)},p(b,k){k[1]&33554432&&r!==(r=b[56])&&h(e,"for",r),b[6]?g&&(g.d(1),g=null):g?g.p(b,k):(g=om(b),g.c(),g.m(u.parentNode,u)),k[1]&33554432&&d!==(d=b[56])&&h(f,"id",d),k[0]&64&&p!==(p=!b[6])&&(f.readOnly=p),k[0]&8&&f.value!==b[3].id&&ue(f,b[3].id)},d(b){b&&S(e),b&&S(a),g&&g.d(b),b&&S(u),b&&S(f),m=!1,_()}}}function rm(n){var u,f;let e,t,i,s,l;function o(d){n[31](d)}let r={collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new e5({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&am();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(d,p){V(e,d,p),$(d,i,p),a&&a.m(d,p),$(d,s,p),l=!0},p(d,p){var _,g;const m={};p[0]&1&&(m.collection=d[0]),!t&&p[0]&8&&(t=!0,m.record=d[3],ke(()=>t=!1)),e.$set(m),(g=(_=d[0])==null?void 0:_.schema)!=null&&g.length?a||(a=am(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(I(e.$$.fragment,d),l=!0)},o(d){L(e.$$.fragment,d),l=!1},d(d){H(e,d),d&&S(i),a&&a.d(d),d&&S(s)}}}function am(n){let e;return{c(){e=y("hr")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function $O(n){let e,t,i;function s(o){n[44](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new DM({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function TO(n){let e,t,i,s,l;function o(f){n[41](f,n[53])}function r(f){n[42](f,n[53])}function a(f){n[43](f,n[53])}let u={field:n[53],record:n[3]};return n[3][n[53].name]!==void 0&&(u.value=n[3][n[53].name]),n[4][n[53].name]!==void 0&&(u.uploadedFiles=n[4][n[53].name]),n[5][n[53].name]!==void 0&&(u.deletedFileIndexes=n[5][n[53].name]),e=new lM({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,d){V(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[53]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[53].name],ke(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[53].name],ke(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[53].name],ke(()=>s=!1)),e.$set(p)},i(f){l||(I(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function CO(n){let e,t,i;function s(o){n[40](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new N5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function MO(n){let e,t,i;function s(o){n[39](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new A5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function OO(n){let e,t,i;function s(o){n[38](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new M5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function DO(n){let e,t,i;function s(o){n[37](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new HM({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function EO(n){let e,t,i;function s(o){n[36](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new S5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function AO(n){let e,t,i;function s(o){n[35](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new v5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function IO(n){let e,t,i;function s(o){n[34](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new h5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function PO(n){let e,t,i;function s(o){n[33](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new c5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function LO(n){let e,t,i;function s(o){n[32](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new r5({props:l}),se.push(()=>_e(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function um(n,e){let t,i,s,l,o;const r=[LO,PO,IO,AO,EO,DO,OO,MO,CO,TO,$O],a=[];function u(f,d){return f[53].type==="text"?0:f[53].type==="number"?1:f[53].type==="bool"?2:f[53].type==="email"?3:f[53].type==="url"?4:f[53].type==="editor"?5:f[53].type==="date"?6:f[53].type==="select"?7:f[53].type==="json"?8:f[53].type==="file"?9:f[53].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Se(),s&&s.c(),l=Se(),this.first=t},m(f,d){$(f,t,d),~i&&a[i].m(f,d),$(f,l,d),o=!0},p(f,d){e=f;let p=i;i=u(e),i===p?~i&&a[i].p(e,d):(s&&(re(),L(a[p],1,1,()=>{a[p]=null}),ae()),~i?(s=a[i],s?s.p(e,d):(s=a[i]=r[i](e),s.c()),I(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(I(s),o=!0)},o(f){L(s),o=!1},d(f){f&&S(t),~i&&a[i].d(f),f&&S(l)}}}function fm(n){let e,t,i;return t=new wO({props:{record:n[3]}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[11]===wl)},m(s,l){$(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&2048)&&x(e,"active",s[11]===wl)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&S(e),H(t)}}}function NO(n){var b,k;let e,t,i,s,l,o=[],r=new Map,a,u,f,d;i=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[SO,({uniqueId:w})=>({56:w}),({uniqueId:w})=>[0,w?33554432:0]]},$$scope:{ctx:n}}});let p=((b=n[0])==null?void 0:b.isAuth)&&rm(n),m=((k=n[0])==null?void 0:k.schema)||[];const _=w=>w[53].name;for(let w=0;w{p=null}),ae()),T[0]&57&&(m=((O=w[0])==null?void 0:O.schema)||[],re(),o=Dt(o,T,_,1,w,m,r,t,un,um,null,lm),ae()),(!u||T[0]&2048)&&x(t,"active",w[11]===es),w[0].$isAuth&&!w[6]?g?(g.p(w,T),T[0]&65&&I(g,1)):(g=fm(w),g.c(),I(g,1),g.m(e,null)):g&&(re(),L(g,1,1,()=>{g=null}),ae())},i(w){if(!u){I(i.$$.fragment,w),I(p);for(let T=0;T Send verification email`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[24]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` Send password reset email`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function FO(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&dm(n),u=n[0].$isAuth&&n[2].email&&pm(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=y("button"),i.innerHTML=` Duplicate`,s=E(),l=y("button"),l.innerHTML=` Delete`,h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),$(f,e,d),u&&u.m(f,d),$(f,t,d),$(f,i,d),$(f,s,d),$(f,l,d),o||(r=[J(i,"click",n[26]),J(l,"click",Cn(pt(n[27])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=dm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=pm(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&S(e),u&&u.d(f),f&&S(t),f&&S(i),f&&S(s),f&&S(l),o=!1,Ie(r)}}}function mm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=E(),s=y("button"),s.textContent="Authorized providers",h(t,"type","button"),h(t,"class","tab-item"),x(t,"active",n[11]===es),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[11]===wl),h(e,"class","tabs-header stretched")},m(r,a){$(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[J(t,"click",n[28]),J(s,"click",n[29])],l=!0)},p(r,a){a[0]&2048&&x(t,"active",r[11]===es),a[0]&2048&&x(s,"active",r[11]===wl)},d(r){r&&S(e),l=!1,Ie(o)}}}function RO(n){var g;let e,t=n[6]?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,d,p,m=!n[6]&&cm(n),_=n[0].$isAuth&&!n[6]&&mm(n);return{c(){e=y("h4"),i=U(t),s=E(),l=y("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),d=Se()},m(b,k){$(b,e,k),v(e,i),v(e,s),v(e,l),v(l,r),v(e,a),$(b,u,k),m&&m.m(b,k),$(b,f,k),_&&_.m(b,k),$(b,d,k),p=!0},p(b,k){var w;(!p||k[0]&64)&&t!==(t=b[6]?"New":"Edit")&&le(i,t),(!p||k[0]&1)&&o!==(o=((w=b[0])==null?void 0:w.name)+"")&&le(r,o),b[6]?m&&(re(),L(m,1,1,()=>{m=null}),ae()):m?(m.p(b,k),k[0]&64&&I(m,1)):(m=cm(b),m.c(),I(m,1),m.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?_?_.p(b,k):(_=mm(b),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},i(b){p||(I(m),p=!0)},o(b){L(m),p=!1},d(b){b&&S(e),b&&S(u),m&&m.d(b),b&&S(f),_&&_.d(b),b&&S(d)}}}function qO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[9],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[14]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(d,p){$(d,e,p),v(e,t),$(d,i,p),$(d,s,p),v(s,l),v(l,r),u||(f=J(e,"click",n[23]),u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&le(r,o),p[0]&4608&&a!==(a=!d[12]||d[9])&&(s.disabled=a),p[0]&512&&x(s,"btn-loading",d[9])},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,f()}}}function jO(n){var s;let e,t,i={class:` record-panel `+(n[13]?"overlay-panel-xl":"overlay-panel-lg")+` `+((s=n[0])!=null&&s.isAuth&&!n[6]?"colored-header":"")+` `,beforeHide:n[45],$$slots:{footer:[qO],header:[RO],default:[NO]},$$scope:{ctx:n}};return e=new vn({props:i}),n[46](e),e.$on("hide",n[47]),e.$on("show",n[48]),{c(){z(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&8257&&(r.class=` record-panel `+(l[13]?"overlay-panel-xl":"overlay-panel-lg")+` `+((a=l[0])!=null&&a.isAuth&&!l[6]?"colored-header":"")+` `),o[0]&1152&&(r.beforeHide=l[45]),o[0]&6781|o[1]&67108864&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[46](null),H(e,l)}}}const es="form",wl="providers";function hm(n){return JSON.stringify(n)}function VO(n,e,t){let i,s,l,o;const r=St(),a="record_"+j.randomString(5);let{collection:u}=e,f,d=null,p=new di,m=!1,_=!1,g={},b={},k="",w=es,T=!0;function C(ye){return O(ye),t(10,_=!0),t(11,w=es),f==null?void 0:f.show()}function M(){return f==null?void 0:f.hide()}async function O(ye){gn({}),t(2,d=ye||new di),ye!=null&&ye.$clone?t(3,p=ye.$clone()):t(3,p=new di),t(4,g={}),t(5,b={}),await an(),t(21,k=hm(p))}function D(){if(m||!o||!(u!=null&&u.id))return;t(9,m=!0);const ye=P();let Pe;T?Pe=me.collection(u.id).create(ye):Pe=me.collection(u.id).update(p.id,ye),Pe.then(nt=>{Yt(T?"Successfully created record.":"Successfully updated record."),t(10,_=!1),M(),r("save",nt)}).catch(nt=>{me.errorResponseHandler(nt)}).finally(()=>{t(9,m=!1)})}function A(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>me.collection(d.collectionId).delete(d.id).then(()=>{M(),Yt("Successfully deleted record."),r("delete",d)}).catch(ye=>{me.errorResponseHandler(ye)}))}function P(){const ye=(p==null?void 0:p.$export())||{},Pe=new FormData,nt={id:ye.id};for(const vt of(u==null?void 0:u.schema)||[])nt[vt.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const vt in ye)nt[vt]&&(typeof ye[vt]>"u"&&(ye[vt]=null),j.addValueToFormData(Pe,vt,ye[vt]));for(const vt in g){const On=j.toArray(g[vt]);for(const rt of On)Pe.append(vt,rt)}for(const vt in b){const On=j.toArray(b[vt]);for(const rt of On)Pe.append(vt+"."+rt,"")}return Pe}function N(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>me.collection(u.id).requestVerification(d.email).then(()=>{Yt(`Successfully sent verification email to ${d.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function R(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>me.collection(u.id).requestPasswordReset(d.email).then(()=>{Yt(`Successfully sent password reset email to ${d.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function F(){l?mn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ye=d==null?void 0:d.$clone();if(ye){ye.id="",ye.created="",ye.updated="";const Pe=(u==null?void 0:u.schema)||[];for(const nt of Pe)nt.type==="file"&&delete ye[nt.name]}C(ye),await an(),t(21,k="")}const B=()=>M(),Y=()=>N(),Z=()=>R(),ee=()=>F(),ie=()=>A(),X=()=>t(11,w=es),fe=()=>t(11,w=wl);function G(){p.id=this.value,t(3,p)}function ce(ye){p=ye,t(3,p)}function he(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Me(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function je(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function He(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function we(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Ce(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Je(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function ht(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Ze(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function We(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function te(ye,Pe){n.$$.not_equal(g[Pe.name],ye)&&(g[Pe.name]=ye,t(4,g))}function qe(ye,Pe){n.$$.not_equal(b[Pe.name],ye)&&(b[Pe.name]=ye,t(5,b))}function Qe(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}const Kt=()=>l&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),M()}),!1):(gn({}),!0);function Ne(ye){se[ye?"unshift":"push"](()=>{f=ye,t(8,f)})}function $e(ye){de.call(this,n,ye)}function Xe(ye){de.call(this,n,ye)}return n.$$set=ye=>{"collection"in ye&&t(0,u=ye.collection)},n.$$.update=()=>{var ye;n.$$.dirty[0]&1&&t(13,i=!!((ye=u==null?void 0:u.schema)!=null&&ye.find(Pe=>Pe.type==="editor"))),n.$$.dirty[0]&48&&t(22,s=j.hasNonEmptyProps(g)||j.hasNonEmptyProps(b)),n.$$.dirty[0]&6291464&&t(7,l=s||k!=hm(p)),n.$$.dirty[0]&4&&t(6,T=!d||d.isNew),n.$$.dirty[0]&192&&t(12,o=T||l)},[u,M,d,p,g,b,T,l,f,m,_,w,o,i,a,D,A,N,R,F,C,k,s,B,Y,Z,ee,ie,X,fe,G,ce,he,Me,je,He,we,Ce,Je,ht,Ze,We,te,qe,Qe,Kt,Ne,$e,Xe]}class x1 extends ve{constructor(e){super(),be(this,e,VO,jO,ge,{collection:0,show:20,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[20]}get hide(){return this.$$.ctx[1]}}function HO(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class",t=n[2]?n[1]:n[0])},m(o,r){$(o,e,r),s||(l=[De(i=Ue.call(null,e,n[2]?"":"Copy")),J(e,"click",Cn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&h(e,"class",t),i&&Ht(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&S(e),s=!1,Ie(l)}}}function zO(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Zt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class er extends ve{constructor(e){super(),be(this,e,zO,HO,ge,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function _m(n,e,t){const i=n.slice();return i[16]=e[t],i[8]=t,i}function gm(n,e,t){const i=n.slice();return i[13]=e[t],i}function bm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function vm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function BO(n){const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:200;return e[11]=s,e}function UO(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function WO(n){let e,t;return{c(){e=y("div"),t=U(n[3]),h(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){$(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&S(e)}}}function YO(n){let e,t=j.truncate(n[3])+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=j.truncate(n[3]))},m(l,o){$(l,e,o),v(e,i)},p(l,o){o&8&&t!==(t=j.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=j.truncate(l[3]))&&h(e,"title",s)},i:Q,o:Q,d(l){l&&S(e)}}}function KO(n){let e,t=[],i=new Map,s,l=j.toArray(n[3]);const o=r=>r[8]+r[16];for(let r=0;rn[11]&&Sm();return{c(){e=y("div"),i.c(),s=E(),u&&u.c(),h(e,"class","inline-flex")},m(f,d){$(f,e,d),r[t].m(e,null),v(e,s),u&&u.m(e,null),l=!0},p(f,d){let p=t;t=a(f),t===p?r[t].p(f,d):(re(),L(r[p],1,1,()=>{r[p]=null}),ae(),i=r[t],i?i.p(f,d):(i=r[t]=o[t](f),i.c()),I(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Sm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(I(i),l=!0)},o(f){L(i),l=!1},d(f){f&&S(e),r[t].d(),u&&u.d()}}}function ZO(n){let e,t=[],i=new Map,s=j.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&S(i)}}}function QO(n){let e,t=j.truncate(n[3])+"",i,s,l;return{c(){e=y("a"),i=U(t),h(e,"class","txt-ellipsis"),h(e,"href",n[3]),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(o,r){$(o,e,r),v(e,i),s||(l=[De(Ue.call(null,e,"Open in new tab")),J(e,"click",Cn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&h(e,"href",o[3])},i:Q,o:Q,d(o){o&&S(e),s=!1,Ie(l)}}}function xO(n){let e,t;return{c(){e=y("span"),t=U(n[3]),h(e,"class","txt")},m(i,s){$(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&S(e)}}}function eD(n){let e,t=n[3]?"True":"False",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt")},m(s,l){$(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:Q,o:Q,d(s){s&&S(e)}}}function tD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function nD(n){let e,t,i,s;const l=[aD,rD],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),$(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&S(i)}}}function ym(n,e){let t,i,s;return i=new ou({props:{record:e[0],filename:e[16],size:"sm"}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){$(l,t,o),V(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&8&&(r.filename=e[16]),i.$set(r)},i(l){s||(I(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&S(t),H(i,l)}}}function iD(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&Tm(n);return{c(){e=y("span"),i=U(t),s=E(),r&&r.c(),l=Se(),h(e,"class","txt")},m(a,u){$(a,e,u),v(e,i),$(a,s,u),r&&r.m(a,u),$(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&I(r,1)):(r=Tm(a),r.c(),I(r,1),r.m(l.parentNode,l)):r&&(re(),L(r,1,1,()=>{r=null}),ae())},i(a){o||(I(r),o=!0)},o(a){L(r),o=!1},d(a){a&&S(e),a&&S(s),r&&r.d(a),a&&S(l)}}}function aD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis")},m(s,l){$(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=j.truncate(s[5])+"")&&le(i,t)},i:Q,o:Q,d(s){s&&S(e)}}}function Tm(n){let e,t;return e=new er({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function uD(n){let e,t,i,s,l;const o=[nD,tD,eD,xO,QO,XO,GO,ZO,JO,KO,YO,WO],r=[];function a(f,d){return d&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,d){return d===0?UO(f):d===8?BO(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=Se()},m(f,d){r[t].m(f,d),$(f,s,d),l=!0},p(f,[d]){let p=t;t=a(f,d),t===p?r[t].p(u(f,t),d):(re(),L(r[p],1,1,()=>{r[p]=null}),ae(),i=r[t],i?i.p(u(f,t),d):(i=r[t]=o[t](u(f,t)),i.c()),I(i,1),i.m(s.parentNode,s))},i(f){l||(I(i),l=!0)},o(f){L(i),l=!1},d(f){r[t].d(f),f&&S(s)}}}function fD(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){de.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s[l.name])},[s,l,o,i,r]}class eb extends ve{constructor(e){super(),be(this,e,fD,uD,ge,{record:0,field:1,short:2})}}function Cm(n,e,t){const i=n.slice();return i[10]=e[t],i}function Mm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new eb({props:{field:n[10],record:n[3]}}),{c(){e=y("tr"),t=y("td"),s=U(i),l=E(),o=y("td"),z(r.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(o,"class","col-field svelte-1nt58f7")},m(u,f){$(u,e,f),v(e,t),v(t,s),v(e,l),v(e,o),V(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const d={};f&1&&(d.field=u[10]),f&8&&(d.record=u[3]),r.$set(d)},i(u){a||(I(r.$$.fragment,u),a=!0)},o(u){L(r.$$.fragment,u),a=!1},d(u){u&&S(e),H(r)}}}function Om(n){let e,t,i,s,l,o;return l=new hi({props:{date:n[3].created}}),{c(){e=y("tr"),t=y("td"),t.textContent="created",i=E(),s=y("td"),z(l.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(s,"class","col-field svelte-1nt58f7")},m(r,a){$(r,e,a),v(e,t),v(e,i),v(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(I(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&S(e),H(l)}}}function Dm(n){let e,t,i,s,l,o;return l=new hi({props:{date:n[3].updated}}),{c(){e=y("tr"),t=y("td"),t.textContent="updated",i=E(),s=y("td"),z(l.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(s,"class","col-field svelte-1nt58f7")},m(r,a){$(r,e,a),v(e,t),v(e,i),v(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(I(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&S(e),H(l)}}}function cD(n){var O;let e,t,i,s,l,o,r,a,u,f,d=n[3].id+"",p,m,_,g,b;a=new er({props:{value:n[3].id}});let k=(O=n[0])==null?void 0:O.schema,w=[];for(let D=0;DL(w[D],1,1,()=>{w[D]=null});let C=n[3].created&&Om(n),M=n[3].updated&&Dm(n);return{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="id",l=E(),o=y("td"),r=y("div"),z(a.$$.fragment),u=E(),f=y("span"),p=U(d),m=E();for(let D=0;D{C=null}),ae()),D[3].updated?M?(M.p(D,A),A&8&&I(M,1)):(M=Dm(D),M.c(),I(M,1),M.m(t,null)):M&&(re(),L(M,1,1,()=>{M=null}),ae())},i(D){if(!b){I(a.$$.fragment,D);for(let A=0;AClose',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[6]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function mD(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[pD],header:[dD],default:[cD]},$$scope:{ctx:n}};return e=new vn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function hD(n,e,t){let i,{collection:s}=e,l,o=new di;function r(m){return t(3,o=m),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(m){se[m?"unshift":"push"](()=>{l=m,t(2,l)})}function d(m){de.call(this,n,m)}function p(m){de.call(this,n,m)}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{var m;n.$$.dirty&1&&t(4,i=!!((m=s==null?void 0:s.schema)!=null&&m.find(_=>_.type==="editor")))},[s,a,l,o,i,r,u,f,d,p]}class _D extends ve{constructor(e){super(),be(this,e,hD,mD,ge,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function Em(n,e,t){const i=n.slice();return i[55]=e[t],i}function Am(n,e,t){const i=n.slice();return i[58]=e[t],i}function Im(n,e,t){const i=n.slice();return i[58]=e[t],i}function Pm(n,e,t){const i=n.slice();return i[51]=e[t],i}function Lm(n){let e;function t(l,o){return l[12]?bD:gD}let i=t(n),s=i(n);return{c(){e=y("th"),s.c(),h(e,"class","bulk-select-col min-width")},m(l,o){$(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&&S(e),s.d()}}}function gD(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("input"),s=E(),l=y("label"),h(t,"type","checkbox"),h(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],h(l,"for","checkbox_0"),h(e,"class","form-field")},m(a,u){$(a,e,u),v(e,t),v(e,s),v(e,l),o||(r=J(t,"change",n[28]),o=!0)},p(a,u){u[0]&16&&i!==(i=!a[4].length)&&(t.disabled=i),u[0]&65536&&(t.checked=a[16])},d(a){a&&S(e),o=!1,r()}}}function bD(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Nm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[vD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Xt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function vD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function Fm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&Rm(n),r=i&&qm(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=Se()},m(a,u){o&&o.m(a,u),$(a,t,u),r&&r.m(a,u),$(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&&I(o,1)):(o=Rm(a),o.c(),I(o,1),o.m(t.parentNode,t)):o&&(re(),L(o,1,1,()=>{o=null}),ae()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&I(r,1)):(r=qm(a),r.c(),I(r,1),r.m(s.parentNode,s)):r&&(re(),L(r,1,1,()=>{r=null}),ae())},i(a){l||(I(o),I(r),l=!0)},o(a){L(o),L(r),l=!1},d(a){o&&o.d(a),a&&S(t),r&&r.d(a),a&&S(s)}}}function Rm(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[yD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Xt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function yD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="username",h(t,"class",j.getFieldTypeIcon("user")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function qm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[kD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Xt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function kD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function wD(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=y("div"),t=y("i"),s=E(),l=y("span"),r=U(o),h(t,"class",i=j.getFieldTypeIcon(n[58].type)),h(l,"class","txt"),h(e,"class","col-header-content")},m(a,u){$(a,e,u),v(e,t),v(e,s),v(e,l),v(l,r)},p(a,u){u[0]&262144&&i!==(i=j.getFieldTypeIcon(a[58].type))&&h(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&S(e)}}}function jm(n,e){let t,i,s,l;function o(a){e[32](a)}let r={class:"col-type-"+e[58].type+" col-field-"+e[58].name,name:e[58].name,$$slots:{default:[wD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Xt({props:r}),se.push(()=>_e(i,"sort",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){$(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&262144&&(f.class="col-type-"+e[58].type+" col-field-"+e[58].name),u[0]&262144&&(f.name=e[58].name),u[0]&262144|u[2]&2&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ke(()=>s=!1)),i.$set(f)},i(a){l||(I(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&S(t),H(i,a)}}}function Vm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[SD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Xt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function SD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function Hm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[$D]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Xt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function $D(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="updated",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function zm(n){let e;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Toggle columns"),h(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){$(t,e,i),n[35](e)},p:Q,d(t){t&&S(e),n[35](null)}}}function Bm(n){let e;function t(l,o){return l[12]?CD:TD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function TD(n){let e,t,i,s,l;function o(u,f){var d,p;if((d=u[1])!=null&&d.length)return OD;if(!((p=u[2])!=null&&p.$isView))return MD}let r=o(n),a=r&&r(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No records found.",s=E(),a&&a.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(u,f){$(u,e,f),v(e,t),v(t,i),v(t,s),a&&a.m(t,null),v(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a&&a.d(1),a=r&&r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&S(e),a&&a.d()}}}function CD(n){let e;return{c(){e=y("tr"),e.innerHTML=` `},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function MD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` New record`,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function OD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function Um(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=E(),r=y("label"),h(i,"type","checkbox"),h(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],h(r,"for",a="checkbox_"+n[55].id),h(t,"class","form-field"),h(e,"class","bulk-select-col min-width")},m(p,m){$(p,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[J(i,"change",d),J(t,"click",Cn(n[26]))],u=!0)},p(p,m){n=p,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&h(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&h(r,"for",a)},d(p){p&&S(e),u=!1,Ie(f)}}}function Wm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new er({props:{value:n[55].id}});let d=n[2].$isAuth&&Ym(n);return{c(){e=y("td"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),a=U(r),u=E(),d&&d.c(),h(o,"class","txt"),h(i,"class","label"),h(t,"class","flex flex-gap-5"),h(e,"class","col-type-text col-field-id")},m(p,m){$(p,e,m),v(e,t),v(t,i),V(s,i,null),v(i,l),v(i,o),v(o,a),v(t,u),d&&d.m(t,null),f=!0},p(p,m){const _={};m[0]&16&&(_.value=p[55].id),s.$set(_),(!f||m[0]&16)&&r!==(r=p[55].id+"")&&le(a,r),p[2].$isAuth?d?d.p(p,m):(d=Ym(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(I(s.$$.fragment,p),f=!0)},o(p){L(s.$$.fragment,p),f=!1},d(p){p&&S(e),H(s),d&&d.d()}}}function Ym(n){let e;function t(l,o){return l[55].verified?ED:DD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function DD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){$(s,e,l),t||(i=De(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&S(e),t=!1,i()}}}function ED(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){$(s,e,l),t||(i=De(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&S(e),t=!1,i()}}}function Km(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Jm(n),o=i&&Zm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=Se()},m(r,a){l&&l.m(r,a),$(r,t,a),o&&o.m(r,a),$(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Jm(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=Zm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&S(t),o&&o.d(r),r&&S(s)}}}function Jm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].username)),t?ID:AD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-username")},m(o,r){$(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&&S(e),l.d()}}}function AD(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].username)},m(l,o){$(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&h(e,"title",s)},d(l){l&&S(e)}}}function ID(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Zm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].email)),t?LD:PD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-email")},m(o,r){$(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&&S(e),l.d()}}}function PD(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].email)},m(l,o){$(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&h(e,"title",s)},d(l){l&&S(e)}}}function LD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Gm(n,e){let t,i,s,l;return i=new eb({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=y("td"),z(i.$$.fragment),h(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){$(o,t,r),V(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&h(t,"class",s)},i(o){l||(I(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&S(t),H(i)}}}function Xm(n){let e,t,i;return t=new hi({props:{date:n[55].created}}),{c(){e=y("td"),z(t.$$.fragment),h(e,"class","col-type-date col-field-created")},m(s,l){$(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&S(e),H(t)}}}function Qm(n){let e,t,i;return t=new hi({props:{date:n[55].updated}}),{c(){e=y("td"),z(t.$$.fragment),h(e,"class","col-type-date col-field-updated")},m(s,l){$(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&S(e),H(t)}}}function xm(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),d,p=e[9]&&!e[7].includes("@updated"),m,_,g,b,k,w,T=!e[2].$isView&&Um(e),C=s&&Wm(e),M=e[2].$isAuth&&Km(e),O=e[18];const D=F=>F[58].name;for(let F=0;F',g=E(),h(_,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(F,q){$(F,t,q),T&&T.m(t,null),v(t,i),C&&C.m(t,null),v(t,l),M&&M.m(t,null),v(t,o);for(let B=0;B{C=null}),ae()),e[2].$isAuth?M?M.p(e,q):(M=Km(e),M.c(),M.m(t,o)):M&&(M.d(1),M=null),q[0]&262160&&(O=e[18],re(),r=Dt(r,q,D,1,e,O,a,t,un,Gm,u,Am),ae()),q[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?A?(A.p(e,q),q[0]&1152&&I(A,1)):(A=Xm(e),A.c(),I(A,1),A.m(t,d)):A&&(re(),L(A,1,1,()=>{A=null}),ae()),q[0]&640&&(p=e[9]&&!e[7].includes("@updated")),p?P?(P.p(e,q),q[0]&640&&I(P,1)):(P=Qm(e),P.c(),I(P,1),P.m(t,m)):P&&(re(),L(P,1,1,()=>{P=null}),ae())},i(F){if(!b){I(C);for(let q=0;qZ[58].name;for(let Z=0;ZZ[2].$isView?Z[55]:Z[55].id;for(let Z=0;Z{O=null}),ae()),Z[2].$isAuth?D?(D.p(Z,ee),ee[0]&4&&I(D,1)):(D=Fm(Z),D.c(),I(D,1),D.m(i,r)):D&&(re(),L(D,1,1,()=>{D=null}),ae()),ee[0]&262145&&(A=Z[18],re(),a=Dt(a,ee,P,1,Z,A,u,i,un,jm,f,Im),ae()),ee[0]&1152&&(d=Z[10]&&!Z[7].includes("@created")),d?N?(N.p(Z,ee),ee[0]&1152&&I(N,1)):(N=Vm(Z),N.c(),I(N,1),N.m(i,p)):N&&(re(),L(N,1,1,()=>{N=null}),ae()),ee[0]&640&&(m=Z[9]&&!Z[7].includes("@updated")),m?R?(R.p(Z,ee),ee[0]&640&&I(R,1)):(R=Hm(Z),R.c(),I(R,1),R.m(i,_)):R&&(re(),L(R,1,1,()=>{R=null}),ae()),Z[15].length?F?F.p(Z,ee):(F=zm(Z),F.c(),F.m(g,null)):F&&(F.d(1),F=null),ee[0]&4986582&&(q=Z[4],re(),w=Dt(w,ee,B,1,Z,q,T,k,un,xm,null,Em),ae(),!q.length&&Y?Y.p(Z,ee):q.length?Y&&(Y.d(1),Y=null):(Y=Bm(Z),Y.c(),Y.m(k,null))),(!C||ee[0]&4096)&&x(e,"table-loading",Z[12])},i(Z){if(!C){I(O),I(D);for(let ee=0;ee({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){$(l,t,o),V(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&32896|o[1]&8388608|o[2]&2&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(I(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&S(t),H(i,l)}}}function RD(n){let e,t,i=[],s=new Map,l,o,r=n[15];const a=u=>u[51].id+u[51].name;for(let u=0;u{i=null}),ae())},i(s){t||(I(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&S(e)}}}function nh(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=y("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[5]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){$(r,e,a),v(e,t),v(e,s),v(e,l),v(e,o)},p(r,a){a[0]&16&&i!==(i=r[4].length+"")&&le(s,i),a[0]&32&&le(o,r[5])},d(r){r&&S(e)}}}function ih(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=y("div"),t=y("button"),i=y("span"),s=U("Load more ("),o=U(l),r=U(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[12]),x(t,"btn-disabled",n[12]),h(e,"class","block txt-center m-t-xs")},m(f,d){$(f,e,d),v(e,t),v(t,i),v(i,s),v(i,o),v(i,r),a||(u=J(t,"click",n[41]),a=!0)},p(f,d){d[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),d[0]&4096&&x(t,"btn-loading",f[12]),d[0]&4096&&x(t,"btn-disabled",f[12])},d(f){f&&S(e),a=!1,u()}}}function sh(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,d,p,m,_,g,b,k,w;return{c(){e=y("div"),t=y("div"),i=U("Selected "),s=y("strong"),l=U(n[8]),o=E(),a=U(r),u=E(),f=y("button"),f.innerHTML='Reset',d=E(),p=y("div"),m=E(),_=y("button"),_.innerHTML='Delete selected',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[13]),h(p,"class","flex-fill"),h(_,"type","button"),h(_,"class","btn btn-sm btn-transparent btn-danger"),x(_,"btn-loading",n[13]),x(_,"btn-disabled",n[13]),h(e,"class","bulkbar")},m(T,C){$(T,e,C),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,d),v(e,p),v(e,m),v(e,_),b=!0,k||(w=[J(f,"click",n[42]),J(_,"click",n[43])],k=!0)},p(T,C){(!b||C[0]&256)&&le(l,T[8]),(!b||C[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!b||C[0]&8192)&&x(f,"btn-disabled",T[13]),(!b||C[0]&8192)&&x(_,"btn-loading",T[13]),(!b||C[0]&8192)&&x(_,"btn-disabled",T[13])},i(T){b||(T&&et(()=>{b&&(g||(g=Ve(e,ni,{duration:150,y:5},!0)),g.run(1))}),b=!0)},o(T){T&&(g||(g=Ve(e,ni,{duration:150,y:5},!1)),g.run(0)),b=!1},d(T){T&&S(e),T&&g&&g.end(),k=!1,Ie(w)}}}function jD(n){let e,t,i,s,l,o;e=new Pa({props:{class:"table-wrapper",$$slots:{before:[qD],default:[ND]},$$scope:{ctx:n}}});let r=n[4].length&&nh(n),a=n[4].length&&n[17]&&ih(n),u=n[8]&&sh(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=E(),u&&u.c(),l=Se()},m(f,d){V(e,f,d),$(f,t,d),r&&r.m(f,d),$(f,i,d),a&&a.m(f,d),$(f,s,d),u&&u.m(f,d),$(f,l,d),o=!0},p(f,d){const p={};d[0]&382679|d[2]&2&&(p.$$scope={dirty:d,ctx:f}),e.$set(p),f[4].length?r?r.p(f,d):(r=nh(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,d):(a=ih(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,d),d[0]&256&&I(u,1)):(u=sh(f),u.c(),I(u,1),u.m(l.parentNode,l)):u&&(re(),L(u,1,1,()=>{u=null}),ae())},i(f){o||(I(e.$$.fragment,f),I(u),o=!0)},o(f){L(e.$$.fragment,f),L(u),o=!1},d(f){H(e,f),f&&S(t),r&&r.d(f),f&&S(i),a&&a.d(f),f&&S(s),u&&u.d(f),f&&S(l)}}}const VD=/^([\+\-])?(\w+)$/;function HD(n,e,t){let i,s,l,o,r,a,u,f;const d=St();let{collection:p}=e,{sort:m=""}=e,{filter:_=""}=e,g=[],b=1,k=0,w={},T=!0,C=!1,M=0,O,D=[],A=[];function P(){p!=null&&p.id&&localStorage.setItem((p==null?void 0:p.id)+"@hiddenCollumns",JSON.stringify(D))}function N(){if(t(7,D=[]),!!(p!=null&&p.id))try{const $e=localStorage.getItem(p.id+"@hiddenCollumns");$e&&t(7,D=JSON.parse($e)||[])}catch{}}async function R(){const $e=b;for(let Xe=1;Xe<=$e;Xe++)(Xe===1||o)&&await F(Xe,!1)}async function F($e=1,Xe=!0){var vt,On;if(!(p!=null&&p.id))return;t(12,T=!0);let ye=m;const Pe=ye.match(VD),nt=Pe?s.find(rt=>rt.name===Pe[2]):null;if(Pe&&((On=(vt=nt==null?void 0:nt.options)==null?void 0:vt.displayFields)==null?void 0:On.length)>0){const rt=[];for(const Zn of nt.options.displayFields)rt.push((Pe[1]||"")+Pe[2]+"."+Zn);ye=rt.join(",")}return me.collection(p.id).getList($e,30,{sort:ye,filter:_,expand:s.map(rt=>rt.name).join(","),$cancelKey:"records_list"}).then(async rt=>{if($e<=1&&q(),t(12,T=!1),t(11,b=rt.page),t(5,k=rt.totalItems),d("load",g.concat(rt.items)),Xe){const Zn=++M;for(;rt.items.length&&M==Zn;)t(4,g=g.concat(rt.items.splice(0,15))),await j.yieldToMain()}else t(4,g=g.concat(rt.items))}).catch(rt=>{rt!=null&&rt.isAbort||(t(12,T=!1),console.warn(rt),q(),me.errorResponseHandler(rt,!1))})}function q(){t(4,g=[]),t(11,b=1),t(5,k=0),t(6,w={})}function B(){a?Y():Z()}function Y(){t(6,w={})}function Z(){for(const $e of g)t(6,w[$e.id]=$e,w);t(6,w)}function ee($e){w[$e.id]?delete w[$e.id]:t(6,w[$e.id]=$e,w),t(6,w)}function ie(){mn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,X)}async function X(){if(C||!r||!(p!=null&&p.id))return;let $e=[];for(const Xe of Object.keys(w))$e.push(me.collection(p.id).delete(Xe));return t(13,C=!0),Promise.all($e).then(()=>{Yt(`Successfully deleted the selected ${r===1?"record":"records"}.`),Y()}).catch(Xe=>{me.errorResponseHandler(Xe)}).finally(()=>(t(13,C=!1),R()))}function fe($e){de.call(this,n,$e)}const G=($e,Xe)=>{Xe.target.checked?j.removeByValue(D,$e.id):j.pushUnique(D,$e.id),t(7,D)},ce=()=>B();function he($e){m=$e,t(0,m)}function Me($e){m=$e,t(0,m)}function je($e){m=$e,t(0,m)}function He($e){m=$e,t(0,m)}function we($e){m=$e,t(0,m)}function Ce($e){m=$e,t(0,m)}function Je($e){se[$e?"unshift":"push"](()=>{O=$e,t(14,O)})}const ht=$e=>ee($e),Ze=$e=>d("select",$e),We=($e,Xe)=>{Xe.code==="Enter"&&(Xe.preventDefault(),d("select",$e))},te=()=>t(1,_=""),qe=()=>d("new"),Qe=()=>F(b+1),Kt=()=>Y(),Ne=()=>ie();return n.$$set=$e=>{"collection"in $e&&t(2,p=$e.collection),"sort"in $e&&t(0,m=$e.sort),"filter"in $e&&t(1,_=$e.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&p!=null&&p.id&&(N(),q()),n.$$.dirty[0]&4&&t(25,i=(p==null?void 0:p.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter($e=>$e.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter($e=>!D.includes($e.id))),n.$$.dirty[0]&7&&p!=null&&p.id&&m!==-1&&_!==-1&&F(1),n.$$.dirty[0]&48&&t(17,o=k>g.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(w).length),n.$$.dirty[0]&272&&t(16,a=g.length&&r===g.length),n.$$.dirty[0]&128&&D!==-1&&P(),n.$$.dirty[0]&20&&t(10,u=!(p!=null&&p.$isView)||g.length>0&&g[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(p!=null&&p.$isView)||g.length>0&&g[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,A=[].concat(p.$isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map($e=>({id:$e.id,name:$e.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,_,p,F,g,k,w,D,r,f,u,b,T,C,O,A,a,o,l,d,B,Y,ee,ie,R,i,fe,G,ce,he,Me,je,He,we,Ce,Je,ht,Ze,We,te,qe,Qe,Kt,Ne]}class zD extends ve{constructor(e){super(),be(this,e,HD,jD,ge,{collection:2,sort:0,filter:1,reloadLoadedPages:24,load:3},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[3]}}function BD(n){let e,t,i,s;return e=new R4({}),i=new Mn({props:{$$slots:{default:[YD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&1527|o[1]&8&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}function UD(n){let e,t;return e=new Mn({props:{center:!0,$$slots:{default:[ZD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1040|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function WD(n){let e,t;return e=new Mn({props:{center:!0,$$slots:{default:[GD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function lh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Edit collection"),h(e,"class","btn btn-transparent btn-circle")},m(s,l){$(s,e,l),t||(i=[De(Ue.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[15])],t=!0)},p:Q,d(s){s&&S(e),t=!1,Ie(i)}}}function oh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` New record`,h(e,"type","button"),h(e,"class","btn btn-expanded")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function YD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O,D,A,P,N,R=!n[10]&&lh(n);d=new Ia({}),d.$on("refresh",n[16]);let F=!n[2].$isView&&oh(n);k=new Yo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function q(Z){n[21](Z)}function B(Z){n[22](Z)}let Y={collection:n[2]};return n[0]!==void 0&&(Y.filter=n[0]),n[1]!==void 0&&(Y.sort=n[1]),M=new zD({props:Y}),n[20](M),se.push(()=>_e(M,"filter",q)),se.push(()=>_e(M,"sort",B)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=E(),l=y("div"),r=U(o),a=E(),u=y("div"),R&&R.c(),f=E(),z(d.$$.fragment),p=E(),m=y("div"),_=y("button"),_.innerHTML=` API Preview`,g=E(),F&&F.c(),b=E(),z(k.$$.fragment),w=E(),T=y("div"),C=E(),z(M.$$.fragment),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(u,"class","inline-flex gap-5"),h(_,"type","button"),h(_,"class","btn btn-outline"),h(m,"class","btns-group"),h(e,"class","page-header"),h(T,"class","clearfix m-b-base")},m(Z,ee){$(Z,e,ee),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),R&&R.m(u,null),v(u,f),V(d,u,null),v(e,p),v(e,m),v(m,_),v(m,g),F&&F.m(m,null),$(Z,b,ee),V(k,Z,ee),$(Z,w,ee),$(Z,T,ee),$(Z,C,ee),V(M,Z,ee),A=!0,P||(N=J(_,"click",n[17]),P=!0)},p(Z,ee){(!A||ee[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[10]?R&&(R.d(1),R=null):R?R.p(Z,ee):(R=lh(Z),R.c(),R.m(u,f)),Z[2].$isView?F&&(F.d(1),F=null):F?F.p(Z,ee):(F=oh(Z),F.c(),F.m(m,null));const ie={};ee[0]&1&&(ie.value=Z[0]),ee[0]&4&&(ie.autocompleteCollection=Z[2]),k.$set(ie);const X={};ee[0]&4&&(X.collection=Z[2]),!O&&ee[0]&1&&(O=!0,X.filter=Z[0],ke(()=>O=!1)),!D&&ee[0]&2&&(D=!0,X.sort=Z[1],ke(()=>D=!1)),M.$set(X)},i(Z){A||(I(d.$$.fragment,Z),I(k.$$.fragment,Z),I(M.$$.fragment,Z),A=!0)},o(Z){L(d.$$.fragment,Z),L(k.$$.fragment,Z),L(M.$$.fragment,Z),A=!1},d(Z){Z&&S(e),R&&R.d(),H(d),F&&F.d(),Z&&S(b),H(k,Z),Z&&S(w),Z&&S(T),Z&&S(C),n[20](null),H(M,Z),P=!1,N()}}}function KD(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=E(),i=y("button"),i.innerHTML=` Create new collection`,h(e,"class","m-b-10"),h(i,"type","button"),h(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=J(i,"click",n[14]),s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,l()}}}function JD(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",h(e,"class","m-b-10")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function ZD(n){let e,t,i;function s(r,a){return r[10]?JD:KD}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='',i=E(),o.c(),h(t,"class","icon"),h(e,"class","placeholder-section m-b-base")},m(r,a){$(r,e,a),v(e,t),v(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&&S(e),o.d()}}}function GD(n){let e;return{c(){e=y("div"),e.innerHTML=`

    Loading collections...

    `,h(e,"class","placeholder-section m-b-base")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function XD(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[WD,UD,BD],m=[];function _(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=_(n),t=m[e]=p[e](n);let g={};s=new lu({props:g}),n[25](s);let b={};o=new W4({props:b}),n[26](o);let k={collection:n[2]};a=new x1({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let w={collection:n[2]};return f=new _D({props:w}),n[30](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(T,C){m[e].m(T,C),$(T,i,C),V(s,T,C),$(T,l,C),V(o,T,C),$(T,r,C),V(a,T,C),$(T,u,C),V(f,T,C),d=!0},p(T,C){let M=e;e=_(T),e===M?m[e].p(T,C):(re(),L(m[M],1,1,()=>{m[M]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=p[e](T),t.c()),I(t,1),t.m(i.parentNode,i));const O={};s.$set(O);const D={};o.$set(D);const A={};C[0]&4&&(A.collection=T[2]),a.$set(A);const P={};C[0]&4&&(P.collection=T[2]),f.$set(P)},i(T){d||(I(t),I(s.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(f.$$.fragment,T),d=!0)},o(T){L(t),L(s.$$.fragment,T),L(o.$$.fragment,T),L(a.$$.fragment,T),L(f.$$.fragment,T),d=!1},d(T){m[e].d(T),T&&S(i),n[25](null),H(s,T),T&&S(l),n[26](null),H(o,T),T&&S(r),n[27](null),H(a,T),T&&S(u),n[30](null),H(f,T)}}}function QD(n,e,t){let i,s,l,o,r,a,u;Ke(n,_i,G=>t(2,s=G)),Ke(n,At,G=>t(31,l=G)),Ke(n,No,G=>t(3,o=G)),Ke(n,ba,G=>t(13,r=G)),Ke(n,bi,G=>t(9,a=G)),Ke(n,Ms,G=>t(10,u=G));const f=new URLSearchParams(r);let d,p,m,_,g,b=f.get("filter")||"",k=f.get("sort")||"",w=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,w=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.$isView&&!j.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}n$(w);const C=()=>d==null?void 0:d.show(),M=()=>d==null?void 0:d.show(s),O=()=>g==null?void 0:g.load(),D=()=>p==null?void 0:p.show(s),A=()=>m==null?void 0:m.show(),P=G=>t(0,b=G.detail);function N(G){se[G?"unshift":"push"](()=>{g=G,t(8,g)})}function R(G){b=G,t(0,b)}function F(G){k=G,t(1,k)}const q=G=>{s.$isView?_.show(G==null?void 0:G.detail):m==null||m.show(G==null?void 0:G.detail)},B=()=>m==null?void 0:m.show();function Y(G){se[G?"unshift":"push"](()=>{d=G,t(4,d)})}function Z(G){se[G?"unshift":"push"](()=>{p=G,t(5,p)})}function ee(G){se[G?"unshift":"push"](()=>{m=G,t(6,m)})}const ie=()=>g==null?void 0:g.reloadLoadedPages(),X=()=>g==null?void 0:g.reloadLoadedPages();function fe(G){se[G?"unshift":"push"](()=>{_=G,t(7,_)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=w&&xS(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&w!=s.id&&T(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const G=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();Ii("/collections?"+G)}n.$$.dirty[0]&4&&xt(At,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,m,_,g,a,u,w,i,r,C,M,O,D,A,P,N,R,F,q,B,Y,Z,ee,ie,X,fe]}class xD extends ve{constructor(e){super(),be(this,e,QD,XD,ge,{},null,[-1,-1])}}function eE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O,D,A,P;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=E(),l=y("a"),l.innerHTML=` Application`,o=E(),r=y("a"),r.innerHTML=` Mail settings`,a=E(),u=y("a"),u.innerHTML=` Files storage`,f=E(),d=y("div"),d.innerHTML='Sync',p=E(),m=y("a"),m.innerHTML=` Export collections`,_=E(),g=y("a"),g.innerHTML=` Import collections`,b=E(),k=y("div"),k.textContent="Authentication",w=E(),T=y("a"),T.innerHTML=` Auth providers`,C=E(),M=y("a"),M.innerHTML=` Token options`,O=E(),D=y("a"),D.innerHTML=` Admins`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(d,"class","sidebar-title"),h(m,"href","/settings/export-collections"),h(m,"class","sidebar-list-item"),h(g,"href","/settings/import-collections"),h(g,"class","sidebar-list-item"),h(k,"class","sidebar-title"),h(T,"href","/settings/auth-providers"),h(T,"class","sidebar-list-item"),h(M,"href","/settings/tokens"),h(M,"class","sidebar-list-item"),h(D,"href","/settings/admins"),h(D,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(N,R){$(N,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),v(t,f),v(t,d),v(t,p),v(t,m),v(t,_),v(t,g),v(t,b),v(t,k),v(t,w),v(t,T),v(t,C),v(t,M),v(t,O),v(t,D),A||(P=[De(Bn.call(null,l,{path:"/settings"})),De(sn.call(null,l)),De(Bn.call(null,r,{path:"/settings/mail/?.*"})),De(sn.call(null,r)),De(Bn.call(null,u,{path:"/settings/storage/?.*"})),De(sn.call(null,u)),De(Bn.call(null,m,{path:"/settings/export-collections/?.*"})),De(sn.call(null,m)),De(Bn.call(null,g,{path:"/settings/import-collections/?.*"})),De(sn.call(null,g)),De(Bn.call(null,T,{path:"/settings/auth-providers/?.*"})),De(sn.call(null,T)),De(Bn.call(null,M,{path:"/settings/tokens/?.*"})),De(sn.call(null,M)),De(Bn.call(null,D,{path:"/settings/admins/?.*"})),De(sn.call(null,D))],A=!0)},p:Q,i:Q,o:Q,d(N){N&&S(e),A=!1,Ie(P)}}}class Fi extends ve{constructor(e){super(),be(this,e,null,eE,ge,{})}}function rh(n,e,t){const i=n.slice();return i[30]=e[t],i}function ah(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[tE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",o=E(),r=y("div"),a=y("i"),f=E(),d=y("input"),h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[29]),h(a,"class","ri-calendar-event-line txt-disabled"),h(r,"class","form-field-addon"),h(d,"type","text"),h(d,"id",p=n[29]),d.value=m=n[1].id,d.readOnly=!0},m(b,k){$(b,e,k),v(e,t),v(e,i),v(e,s),$(b,o,k),$(b,r,k),v(r,a),$(b,f,k),$(b,d,k),_||(g=De(u=Ue.call(null,a,{text:`Created: ${n[1].created} Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(b,k){k[0]&536870912&&l!==(l=b[29])&&h(e,"for",l),u&&Ht(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${b[1].created} Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&h(d,"id",p),k[0]&2&&m!==(m=b[1].id)&&d.value!==m&&(d.value=m)},d(b){b&&S(e),b&&S(o),b&&S(r),b&&S(f),b&&S(d),_=!1,g()}}}function uh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=E(),Yn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[30]),h(e,"type","button"),h(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){$(u,e,f),v(e,t),v(e,s),o||(r=J(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"))&&h(e,"class",l)},d(u){u&&S(e),o=!1,r()}}}function nE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("input"),h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[29]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&8&&r.value!==d[3]&&ue(r,d[3])},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,f()}}}function fh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[iE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function iE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[29]),h(s,"for",o=n[29])},m(u,f){$(u,e,f),e.checked=n[4],$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function ch(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[sE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[lE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,d){$(f,e,d),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&536871424|d[1]&4&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=Ve(t,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=Ve(t,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&S(e),H(s),H(r),f&&a&&a.end()}}}function sE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&256&&r.value!==d[8]&&ue(r,d[8])},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,f()}}}function lE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&512&&r.value!==d[9]&&ue(r,d[9])},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,f()}}}function oE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_=!n[1].$isNew&&ah(n),g=[0,1,2,3,4,5,6,7,8,9],b=[];for(let T=0;T<10;T+=1)b[T]=uh(rh(n,g,T));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[nE,({uniqueId:T})=>({29:T}),({uniqueId:T})=>[T?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].$isNew&&fh(n),w=(n[1].$isNew||n[4])&&ch(n);return{c(){e=y("form"),_&&_.c(),t=E(),i=y("div"),s=y("p"),s.textContent="Avatar",l=E(),o=y("div");for(let T=0;T<10;T+=1)b[T].c();r=E(),z(a.$$.fragment),u=E(),k&&k.c(),f=E(),w&&w.c(),h(s,"class","section-title"),h(o,"class","flex flex-gap-xs flex-wrap"),h(i,"class","content"),h(e,"id",n[11]),h(e,"class","grid"),h(e,"autocomplete","off")},m(T,C){$(T,e,C),_&&_.m(e,null),v(e,t),v(e,i),v(i,s),v(i,l),v(i,o);for(let M=0;M<10;M+=1)b[M]&&b[M].m(o,null);v(e,r),V(a,e,null),v(e,u),k&&k.m(e,null),v(e,f),w&&w.m(e,null),d=!0,p||(m=J(e,"submit",pt(n[12])),p=!0)},p(T,C){if(T[1].$isNew?_&&(re(),L(_,1,1,()=>{_=null}),ae()):_?(_.p(T,C),C[0]&2&&I(_,1)):(_=ah(T),_.c(),I(_,1),_.m(e,t)),C[0]&4){g=[0,1,2,3,4,5,6,7,8,9];let O;for(O=0;O<10;O+=1){const D=rh(T,g,O);b[O]?b[O].p(D,C):(b[O]=uh(D),b[O].c(),b[O].m(o,null))}for(;O<10;O+=1)b[O].d(1)}const M={};C[0]&536870920|C[1]&4&&(M.$$scope={dirty:C,ctx:T}),a.$set(M),T[1].$isNew?k&&(re(),L(k,1,1,()=>{k=null}),ae()):k?(k.p(T,C),C[0]&2&&I(k,1)):(k=fh(T),k.c(),I(k,1),k.m(e,f)),T[1].$isNew||T[4]?w?(w.p(T,C),C[0]&18&&I(w,1)):(w=ch(T),w.c(),I(w,1),w.m(e,null)):w&&(re(),L(w,1,1,()=>{w=null}),ae())},i(T){d||(I(_),I(a.$$.fragment,T),I(k),I(w),d=!0)},o(T){L(_),L(a.$$.fragment,T),L(k),L(w),d=!1},d(T){T&&S(e),_&&_.d(),ct(b,T),H(a),k&&k.d(),w&&w.d(),p=!1,m()}}}function rE(n){let e,t=n[1].$isNew?"New admin":"Edit admin",i;return{c(){e=y("h4"),i=U(t)},m(s,l){$(s,e,l),v(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].$isNew?"New admin":"Edit admin")&&le(i,t)},d(s){s&&S(e)}}}function dh(n){let e,t,i,s,l,o,r,a,u;return o=new Vn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[aE]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("span"),i=E(),s=y("i"),l=E(),z(o.$$.fragment),r=E(),a=y("div"),h(s,"class","ri-more-line"),h(e,"type","button"),h(e,"aria-label","More"),h(e,"class","btn btn-sm btn-circle btn-transparent"),h(a,"class","flex-fill")},m(f,d){$(f,e,d),v(e,t),v(e,i),v(e,s),v(e,l),V(o,e,null),$(f,r,d),$(f,a,d),u=!0},p(f,d){const p={};d[1]&4&&(p.$$scope={dirty:d,ctx:f}),o.$set(p)},i(f){u||(I(o.$$.fragment,f),u=!0)},o(f){L(o.$$.fragment,f),u=!1},d(f){f&&S(e),H(o),f&&S(r),f&&S(a)}}}function aE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` Delete`,h(e,"type","button"),h(e,"class","dropdown-item txt-danger")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function uE(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,m=!n[1].$isNew&&dh(n);return{c(){m&&m.c(),e=E(),t=y("button"),i=y("span"),i.textContent="Cancel",s=E(),l=y("button"),o=y("span"),a=U(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-transparent"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(_,g){m&&m.m(_,g),$(_,e,g),$(_,t,g),v(t,i),$(_,s,g),$(_,l,g),v(l,o),v(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(_,g){_[1].$isNew?m&&(re(),L(m,1,1,()=>{m=null}),ae()):m?(m.p(_,g),g[0]&2&&I(m,1)):(m=dh(_),m.c(),I(m,1),m.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=_[6]),(!f||g[0]&2)&&r!==(r=_[1].$isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!_[10]||_[6]))&&(l.disabled=u),(!f||g[0]&64)&&x(l,"btn-loading",_[6])},i(_){f||(I(m),f=!0)},o(_){L(m),f=!1},d(_){m&&m.d(_),_&&S(e),_&&S(t),_&&S(s),_&&S(l),d=!1,p()}}}function fE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[uE],header:[rE],default:[oE]},$$scope:{ctx:n}};return e=new vn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){z(e.$$.fragment)},m(s,l){V(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||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[23](null),H(e,s)}}}function cE(n,e,t){let i;const s=St(),l="admin_"+j.randomString(5);let o,r=new ts,a=!1,u=!1,f=0,d="",p="",m="",_=!1;function g(Z){return k(Z),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(Z){t(1,r=Z!=null&&Z.$clone?Z.$clone():new ts),w()}function w(){t(4,_=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,m=""),gn({})}function T(){if(a||!i)return;t(6,a=!0);const Z={email:d,avatar:f};(r.$isNew||_)&&(Z.password=p,Z.passwordConfirm=m);let ee;r.$isNew?ee=me.admins.create(Z):ee=me.admins.update(r.id,Z),ee.then(async ie=>{var X;t(7,u=!1),b(),Yt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((X=me.authStore.model)==null?void 0:X.id)===ie.id&&me.authStore.save(me.authStore.token,ie)}).catch(ie=>{me.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&mn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),b(),Yt("Successfully deleted admin."),s("delete",r)}).catch(Z=>{me.errorResponseHandler(Z)}))}const M=()=>C(),O=()=>b(),D=Z=>t(2,f=Z);function A(){d=this.value,t(3,d)}function P(){_=this.checked,t(4,_)}function N(){p=this.value,t(8,p)}function R(){m=this.value,t(9,m)}const F=()=>i&&u?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function q(Z){se[Z?"unshift":"push"](()=>{o=Z,t(5,o)})}function B(Z){de.call(this,n,Z)}function Y(Z){de.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||_||d!==r.email||f!==r.avatar)},[b,r,f,d,_,o,a,u,p,m,i,l,T,C,g,M,O,D,A,P,N,R,F,q,B,Y]}class dE extends ve{constructor(e){super(),be(this,e,cE,fE,ge,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function ph(n,e,t){const i=n.slice();return i[24]=e[t],i}function pE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function mE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function hE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function _E(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="updated",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function mh(n){let e;function t(l,o){return l[5]?bE:gE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function gE(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&hh(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){$(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=hh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&S(e),o&&o.d()}}}function bE(n){let e;return{c(){e=y("tr"),e.innerHTML=` `},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function hh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function _h(n){let e;return{c(){e=y("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function gh(n,e){let t,i,s,l,o,r,a,u,f,d,p,m=e[24].id+"",_,g,b,k,w,T=e[24].email+"",C,M,O,D,A,P,N,R,F,q,B,Y,Z,ee;f=new er({props:{value:e[24].id}});let ie=e[24].id===e[7].id&&_h();A=new hi({props:{date:e[24].created}}),R=new hi({props:{date:e[24].updated}});function X(){return e[15](e[24])}function fe(...G){return e[16](e[24],...G)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=E(),a=y("td"),u=y("div"),z(f.$$.fragment),d=E(),p=y("span"),_=U(m),g=E(),ie&&ie.c(),b=E(),k=y("td"),w=y("span"),C=U(T),O=E(),D=y("td"),z(A.$$.fragment),P=E(),N=y("td"),z(R.$$.fragment),F=E(),q=y("td"),q.innerHTML='',B=E(),Yn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(p,"class","txt"),h(u,"class","label"),h(a,"class","col-type-text col-field-id"),h(w,"class","txt txt-ellipsis"),h(w,"title",M=e[24].email),h(k,"class","col-type-email col-field-email"),h(D,"class","col-type-date col-field-created"),h(N,"class","col-type-date col-field-updated"),h(q,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(G,ce){$(G,t,ce),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),V(f,u,null),v(u,d),v(u,p),v(p,_),v(a,g),ie&&ie.m(a,null),v(t,b),v(t,k),v(k,w),v(w,C),v(t,O),v(t,D),V(A,D,null),v(t,P),v(t,N),V(R,N,null),v(t,F),v(t,q),v(t,B),Y=!0,Z||(ee=[J(t,"click",X),J(t,"keydown",fe)],Z=!0)},p(G,ce){e=G,(!Y||ce&16&&!Yn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&h(l,"src",o);const he={};ce&16&&(he.value=e[24].id),f.$set(he),(!Y||ce&16)&&m!==(m=e[24].id+"")&&le(_,m),e[24].id===e[7].id?ie||(ie=_h(),ie.c(),ie.m(a,null)):ie&&(ie.d(1),ie=null),(!Y||ce&16)&&T!==(T=e[24].email+"")&&le(C,T),(!Y||ce&16&&M!==(M=e[24].email))&&h(w,"title",M);const Me={};ce&16&&(Me.date=e[24].created),A.$set(Me);const je={};ce&16&&(je.date=e[24].updated),R.$set(je)},i(G){Y||(I(f.$$.fragment,G),I(A.$$.fragment,G),I(R.$$.fragment,G),Y=!0)},o(G){L(f.$$.fragment,G),L(A.$$.fragment,G),L(R.$$.fragment,G),Y=!1},d(G){G&&S(t),H(f),ie&&ie.d(),H(A),H(R),Z=!1,Ie(ee)}}}function vE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M=[],O=new Map,D;function A(X){n[11](X)}let P={class:"col-type-text",name:"id",$$slots:{default:[pE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),o=new Xt({props:P}),se.push(()=>_e(o,"sort",A));function N(X){n[12](X)}let R={class:"col-type-email col-field-email",name:"email",$$slots:{default:[mE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),u=new Xt({props:R}),se.push(()=>_e(u,"sort",N));function F(X){n[13](X)}let q={class:"col-type-date col-field-created",name:"created",$$slots:{default:[hE]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),p=new Xt({props:q}),se.push(()=>_e(p,"sort",F));function B(X){n[14](X)}let Y={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[_E]},$$scope:{ctx:n}};n[2]!==void 0&&(Y.sort=n[2]),g=new Xt({props:Y}),se.push(()=>_e(g,"sort",B));let Z=n[4];const ee=X=>X[24].id;for(let X=0;Xr=!1)),o.$set(G);const ce={};fe&134217728&&(ce.$$scope={dirty:fe,ctx:X}),!f&&fe&4&&(f=!0,ce.sort=X[2],ke(()=>f=!1)),u.$set(ce);const he={};fe&134217728&&(he.$$scope={dirty:fe,ctx:X}),!m&&fe&4&&(m=!0,he.sort=X[2],ke(()=>m=!1)),p.$set(he);const Me={};fe&134217728&&(Me.$$scope={dirty:fe,ctx:X}),!b&&fe&4&&(b=!0,Me.sort=X[2],ke(()=>b=!1)),g.$set(Me),fe&186&&(Z=X[4],re(),M=Dt(M,fe,ee,1,X,Z,O,C,un,gh,null,ph),ae(),!Z.length&&ie?ie.p(X,fe):Z.length?ie&&(ie.d(1),ie=null):(ie=mh(X),ie.c(),ie.m(C,null))),(!D||fe&32)&&x(e,"table-loading",X[5])},i(X){if(!D){I(o.$$.fragment,X),I(u.$$.fragment,X),I(p.$$.fragment,X),I(g.$$.fragment,X);for(let fe=0;fe New admin`,m=E(),z(_.$$.fragment),g=E(),b=y("div"),k=E(),z(w.$$.fragment),T=E(),A&&A.c(),C=Se(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(f,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(e,"class","page-header"),h(b,"class","clearfix m-b-base")},m(P,N){$(P,e,N),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(e,r),V(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),$(P,m,N),V(_,P,N),$(P,g,N),$(P,b,N),$(P,k,N),V(w,P,N),$(P,T,N),A&&A.m(P,N),$(P,C,N),M=!0,O||(D=J(p,"click",n[9]),O=!0)},p(P,N){(!M||N&64)&&le(o,P[6]);const R={};N&2&&(R.value=P[1]),_.$set(R);const F={};N&134217918&&(F.$$scope={dirty:N,ctx:P}),w.$set(F),P[4].length?A?A.p(P,N):(A=bh(P),A.c(),A.m(C.parentNode,C)):A&&(A.d(1),A=null)},i(P){M||(I(a.$$.fragment,P),I(_.$$.fragment,P),I(w.$$.fragment,P),M=!0)},o(P){L(a.$$.fragment,P),L(_.$$.fragment,P),L(w.$$.fragment,P),M=!1},d(P){P&&S(e),H(a),P&&S(m),H(_,P),P&&S(g),P&&S(b),P&&S(k),H(w,P),P&&S(T),A&&A.d(P),P&&S(C),O=!1,D()}}}function kE(n){let e,t,i,s,l,o;e=new Fi({}),i=new Mn({props:{$$slots:{default:[yE]},$$scope:{ctx:n}}});let r={};return l=new dE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),$(a,t,u),V(i,a,u),$(a,s,u),V(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&S(t),H(i,a),a&&S(s),n[18](null),H(l,a)}}}function wE(n,e,t){let i,s,l;Ke(n,ba,R=>t(21,i=R)),Ke(n,At,R=>t(6,s=R)),Ke(n,Aa,R=>t(7,l=R)),xt(At,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:d||"-created",filter:f}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),m(),me.errorResponseHandler(R,!1))})}function m(){t(4,a=[])}const _=()=>p(),g=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function k(R){d=R,t(2,d)}function w(R){d=R,t(2,d)}function T(R){d=R,t(2,d)}function C(R){d=R,t(2,d)}const M=R=>r==null?void 0:r.show(R),O=(R,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(R))},D=()=>t(1,f="");function A(R){se[R?"unshift":"push"](()=>{r=R,t(3,r)})}const P=()=>p(),N=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:d}).toString();Ii("/settings/admins?"+R),p()}},[p,f,d,r,a,u,s,l,_,g,b,k,w,T,C,M,O,D,A,P,N]}class SE extends ve{constructor(e){super(),be(this,e,wE,kE,ge,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function $E(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[8]),h(l,"type","email"),h(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&h(e,"for",i),f&256&&o!==(o=u[8])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function TE(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",h(e,"for",i=n[8]),h(l,"type","password"),h(l,"id",o=n[8]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[1]),$(p,r,m),$(p,a,m),v(a,u),f||(d=[J(l,"input",n[5]),De(sn.call(null,u))],f=!0)},p(p,m){m&256&&i!==(i=p[8])&&h(e,"for",i),m&256&&o!==(o=p[8])&&h(l,"id",o),m&2&&l.value!==p[1]&&ue(l,p[1])},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(r),p&&S(a),f=!1,Ie(d)}}}function CE(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[$E,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[TE,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=y("button"),a.innerHTML=`Login `,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),h(e,"class","block")},m(p,m){$(p,e,m),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(e,"submit",pt(n[3])),f=!0)},p(p,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:p}),s.$set(_);const g={};m&770&&(g.$$scope={dirty:m,ctx:p}),o.$set(g),(!u||m&4)&&x(a,"btn-disabled",p[2]),(!u||m&4)&&x(a,"btn-loading",p[2])},i(p){u||(I(s.$$.fragment,p),I(o.$$.fragment,p),u=!0)},o(p){L(s.$$.fragment,p),L(o.$$.fragment,p),u=!1},d(p){p&&S(e),H(s),H(o),f=!1,d()}}}function ME(n){let e,t;return e=new Kg({props:{$$slots:{default:[CE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function OE(n,e,t){let i;Ke(n,ba,d=>t(6,i=d));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),me.admins.authWithPassword(l,o).then(()=>{Da(),Ii("/")}).catch(()=>{ml("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 DE extends ve{constructor(e){super(),be(this,e,OE,ME,ge,{})}}function EE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[IE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[PE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[LE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[NE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let O=n[3]&&vh(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),p=y("div"),m=y("div"),_=E(),O&&O.c(),g=E(),b=y("button"),k=y("span"),k.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(m,"class","flex-fill"),h(k,"class","txt"),h(b,"type","submit"),h(b,"class","btn btn-expanded"),b.disabled=w=!n[3]||n[2],x(b,"btn-loading",n[2]),h(p,"class","col-lg-12 flex"),h(e,"class","grid")},m(D,A){$(D,e,A),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),V(a,e,null),v(e,u),V(f,e,null),v(e,d),v(e,p),v(p,m),v(p,_),O&&O.m(p,null),v(p,g),v(p,b),v(b,k),T=!0,C||(M=J(b,"click",n[13]),C=!0)},p(D,A){const P={};A&1572865&&(P.$$scope={dirty:A,ctx:D}),i.$set(P);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:D}),o.$set(N);const R={};A&1572865&&(R.$$scope={dirty:A,ctx:D}),a.$set(R);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:D}),f.$set(F),D[3]?O?O.p(D,A):(O=vh(D),O.c(),O.m(p,g)):O&&(O.d(1),O=null),(!T||A&12&&w!==(w=!D[3]||D[2]))&&(b.disabled=w),(!T||A&4)&&x(b,"btn-loading",D[2])},i(D){T||(I(i.$$.fragment,D),I(o.$$.fragment,D),I(a.$$.fragment,D),I(f.$$.fragment,D),T=!0)},o(D){L(i.$$.fragment,D),L(o.$$.fragment,D),L(a.$$.fragment,D),L(f.$$.fragment,D),T=!1},d(D){D&&S(e),H(i),H(o),H(a),H(f),O&&O.d(),C=!1,M()}}}function AE(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function IE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application name"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function PE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application url"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].meta.appUrl),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&ue(l,u[0].meta.appUrl)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function LE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Logs max days retention"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","number"),h(l,"id",o=n[19]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].logs.maxDays),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&>(l.value)!==u[0].logs.maxDays&&ue(l,u[0].logs.maxDays)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function NE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Hide collection create and edit controls",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[19]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[19])},m(d,p){$(d,e,p),e.checked=n[0].meta.hideControls,$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),De(Ue.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(d,p){p&524288&&t!==(t=d[19])&&h(e,"id",t),p&1&&(e.checked=d[0].meta.hideControls),p&524288&&a!==(a=d[19])&&h(s,"for",a)},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,Ie(f)}}}function vh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){$(l,e,o),v(e,t),i||(s=J(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&S(e),i=!1,s()}}}function FE(n){let e,t,i,s,l,o,r,a,u;const f=[AE,EE],d=[];function p(m,_){return m[1]?0:1}return l=p(n),o=d[l]=f[l](n),{c(){e=y("header"),e.innerHTML=``,t=E(),i=y("div"),s=y("form"),o.c(),h(e,"class","page-header"),h(s,"class","panel"),h(s,"autocomplete","off"),h(i,"class","wrapper")},m(m,_){$(m,e,_),$(m,t,_),$(m,i,_),v(i,s),d[l].m(s,null),r=!0,a||(u=J(s,"submit",pt(n[4])),a=!0)},p(m,_){let g=l;l=p(m),l===g?d[l].p(m,_):(re(),L(d[g],1,1,()=>{d[g]=null}),ae(),o=d[l],o?o.p(m,_):(o=d[l]=f[l](m),o.c()),I(o,1),o.m(s,null))},i(m){r||(I(o),r=!0)},o(m){L(o),r=!1},d(m){m&&S(e),m&&S(t),m&&S(i),d[l].d(),a=!1,u()}}}function RE(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[FE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}function qE(n,e,t){let i,s,l,o;Ke(n,Ms,O=>t(14,s=O)),Ke(n,wo,O=>t(15,l=O)),Ke(n,At,O=>t(16,o=O)),xt(At,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const O=await me.settings.getAll()||{};_(O)}catch(O){me.errorResponseHandler(O)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const O=await me.settings.update(j.filterRedactedProps(a));_(O),Yt("Successfully saved application settings.")}catch(O){me.errorResponseHandler(O)}t(2,f=!1)}}function _(O={}){var D,A;xt(wo,l=(D=O==null?void 0:O.meta)==null?void 0:D.appName,l),xt(Ms,s=!!((A=O==null?void 0:O.meta)!=null&&A.hideControls),s),t(0,a={meta:(O==null?void 0:O.meta)||{},logs:(O==null?void 0:O.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 k(){a.meta.appUrl=this.value,t(0,a)}function w(){a.logs.maxDays=gt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,m,g,r,d,b,k,w,T,C,M]}class jE extends ve{constructor(e){super(),be(this,e,qE,RE,ge,{})}}function VE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=y("input"),h(t,"type","button"),h(t,"class","btn btn-transparent btn-circle"),h(e,"class","form-field-addon"),ti(s,a)},m(u,f){$(u,e,f),v(e,t),$(u,i,f),$(u,s,f),s.autofocus&&s.focus(),l||(o=[De(Ue.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ti(s,a=kt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&S(e),u&&S(i),u&&S(s),l=!1,Ie(o)}}}function zE(n){let e;function t(l,o){return l[3]?HE:VE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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:Q,o:Q,d(l){s.d(l),l&&S(e)}}}function BE(n,e,t){const i=["value","mask"];let s=Ge(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await an(),r==null||r.focus()}const f=()=>u();function d(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=Fe(Fe({},e),zt(m)),t(5,s=Ge(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,d,p]}class au extends ve{constructor(e){super(),be(this,e,BE,zE,ge,{value:0,mask:1})}}function UE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=U("Subject"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters: `),f=y("button"),f.textContent=`{APP_NAME} `,d=U(`, `),p=y("button"),p.textContent=`{APP_URL} `,m=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(a,"class","help-block")},m(b,k){$(b,e,k),v(e,t),$(b,s,k),$(b,l,k),ue(l,n[0].subject),$(b,r,k),$(b,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),_||(g=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],_=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&h(e,"for",i),k[1]&1&&o!==(o=b[31])&&h(l,"id",o),k[0]&1&&l.value!==b[0].subject&&ue(l,b[0].subject)},d(b){b&&S(e),b&&S(s),b&&S(l),b&&S(r),b&&S(a),_=!1,Ie(g)}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return{c(){e=y("label"),t=U("Action URL"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters: `),f=y("button"),f.textContent=`{APP_NAME} `,d=U(`, `),p=y("button"),p.textContent=`{APP_URL} `,m=U(`, `),_=y("button"),_.textContent=`{TOKEN} `,g=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(_,"title","Required parameter"),h(a,"class","help-block")},m(w,T){$(w,e,T),v(e,t),$(w,s,T),$(w,l,T),ue(l,n[0].actionUrl),$(w,r,T),$(w,a,T),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),b||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(_,"click",n[19])],b=!0)},p(w,T){T[1]&1&&i!==(i=w[31])&&h(e,"for",i),T[1]&1&&o!==(o=w[31])&&h(l,"id",o),T[0]&1&&l.value!==w[0].actionUrl&&ue(l,w[0].actionUrl)},d(w){w&&S(e),w&&S(s),w&&S(l),w&&S(r),w&&S(a),b=!1,Ie(k)}}}function YE(n){let e,t,i,s;return{c(){e=y("textarea"),h(e,"id",t=n[31]),h(e,"class","txt-mono"),h(e,"spellcheck","false"),h(e,"rows","14"),e.required=!0},m(l,o){$(l,e,o),ue(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&h(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:Q,o:Q,d(l){l&&S(e),i=!1,s()}}}function KE(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=Ot(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),$(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,ke(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Ot(o,r(a)),se.push(()=>_e(e,"value",l)),z(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&S(i),e&&H(e,a)}}}function JE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C;const M=[KE,YE],O=[];function D(A,P){return A[4]&&!A[5]?0:1}return l=D(n),o=O[l]=M[l](n),{c(){e=y("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=y("div"),u=U(`Available placeholder parameters: `),f=y("button"),f.textContent=`{APP_NAME} `,d=U(`, `),p=y("button"),p.textContent=`{APP_URL} `,m=U(`, `),_=y("button"),_.textContent=`{TOKEN} `,g=U(`, `),b=y("button"),b.textContent=`{ACTION_URL} `,k=U("."),h(e,"for",i=n[31]),h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(b,"type","button"),h(b,"class","label label-sm link-primary txt-mono"),h(b,"title","Required parameter"),h(a,"class","help-block")},m(A,P){$(A,e,P),v(e,t),$(A,s,P),O[l].m(A,P),$(A,r,P),$(A,a,P),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),v(a,b),v(a,k),w=!0,T||(C=[J(f,"click",n[22]),J(p,"click",n[23]),J(_,"click",n[24]),J(b,"click",n[25])],T=!0)},p(A,P){(!w||P[1]&1&&i!==(i=A[31]))&&h(e,"for",i);let N=l;l=D(A),l===N?O[l].p(A,P):(re(),L(O[N],1,1,()=>{O[N]=null}),ae(),o=O[l],o?o.p(A,P):(o=O[l]=M[l](A),o.c()),I(o,1),o.m(r.parentNode,r))},i(A){w||(I(o),w=!0)},o(A){L(o),w=!1},d(A){A&&S(e),A&&S(s),O[l].d(A),A&&S(r),A&&S(a),T=!1,Ie(C)}}}function ZE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[UE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[WE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[JE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){V(e,r,a),$(r,t,a),V(i,r,a),$(r,s,a),V(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 d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&S(t),H(i,r),r&&S(s),H(l,r)}}}function yh(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=De(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function GE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&yh();return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),l=U(n[2]),o=E(),r=y("div"),a=E(),f&&f.c(),u=Se(),h(t,"class","ri-draft-line"),h(s,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),$(d,o,p),$(d,r,p),$(d,a,p),f&&f.m(d,p),$(d,u,p)},p(d,p){p[0]&4&&le(l,d[2]),d[6]?f?p[0]&64&&I(f,1):(f=yh(),f.c(),I(f,1),f.m(u.parentNode,u)):f&&(re(),L(f,1,1,()=>{f=null}),ae())},d(d){d&&S(e),d&&S(o),d&&S(r),d&&S(a),f&&f.d(d),d&&S(u)}}}function XE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[GE],default:[ZE]},$$scope:{ctx:n}};for(let l=0;lt(12,o=X));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=kh,p=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){d||p||(t(5,p=!0),t(4,d=(await ft(()=>import("./CodeEditor-8054534a.js"),["./CodeEditor-8054534a.js","./index-6f704b4c.js"],import.meta.url)).default),kh=d,t(5,p=!1))}function k(X){j.copyToClipboard(X),Wg(`Copied ${X} to clipboard`,2e3)}b();function w(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const O=()=>k("{APP_NAME}"),D=()=>k("{APP_URL}"),A=()=>k("{TOKEN}");function P(X){n.$$.not_equal(u.body,X)&&(u.body=X,t(0,u))}function N(){u.body=this.value,t(0,u)}const R=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),q=()=>k("{TOKEN}"),B=()=>k("{ACTION_URL}");function Y(X){se[X?"unshift":"push"](()=>{f=X,t(3,f)})}function Z(X){de.call(this,n,X)}function ee(X){de.call(this,n,X)}function ie(X){de.call(this,n,X)}return n.$$set=X=>{e=Fe(Fe({},e),zt(X)),t(8,l=Ge(e,s)),"key"in X&&t(1,r=X.key),"title"in X&&t(2,a=X.title),"config"in X&&t(0,u=X.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||mi(r))},[u,r,a,f,d,p,i,k,l,m,_,g,o,w,T,C,M,O,D,A,P,N,R,F,q,B,Y,Z,ee,ie]}class Lr extends ve{constructor(e){super(),be(this,e,QE,XE,ge,{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 wh(n,e,t){const i=n.slice();return i[21]=e[t],i}function Sh(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,d,p,m;return d=mb(e[11][0]),{key:n,first:null,c(){t=y("div"),i=y("input"),l=E(),o=y("label"),a=U(r),f=E(),h(i,"type","radio"),h(i,"name","template"),h(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,i.value=i.__value,h(o,"for",u=e[20]+e[21].value),h(t,"class","form-field-block"),d.p(i),this.first=t},m(_,g){$(_,t,g),v(t,i),i.checked=i.__value===e[2],v(t,l),v(t,o),v(o,a),v(t,f),p||(m=J(i,"change",e[10]),p=!0)},p(_,g){e=_,g&1048576&&s!==(s=e[20]+e[21].value)&&h(i,"id",s),g&4&&(i.checked=i.__value===e[2]),g&1048576&&u!==(u=e[20]+e[21].value)&&h(o,"for",u)},d(_){_&&S(t),d.r(),p=!1,m()}}}function xE(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[eA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),h(e,"id",n[6]),h(e,"autocomplete","off")},m(a,u){$(a,e,u),V(t,e,null),v(e,i),V(s,e,null),l=!0,o||(r=J(e,"submit",pt(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const d={};u&17825794&&(d.$$scope={dirty:u,ctx:a}),s.$set(d)},i(a){l||(I(t.$$.fragment,a),I(s.$$.fragment,a),l=!0)},o(a){L(t.$$.fragment,a),L(s.$$.fragment,a),l=!1},d(a){a&&S(e),H(t),H(s),o=!1,r()}}}function nA(n){let e;return{c(){e=y("h4"),e.textContent="Send test email",h(e,"class","center txt-break")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function iA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Send",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[4],h(l,"class","ri-mail-send-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[6]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],x(s,"btn-loading",n[4])},m(d,p){$(d,e,p),v(e,t),$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&16&&(e.disabled=d[4]),p&48&&a!==(a=!d[5]||d[4])&&(s.disabled=a),p&16&&x(s,"btn-loading",d[4])},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,f()}}}function sA(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[iA],header:[nA],default:[tA]},$$scope:{ctx:n}};return e=new vn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){V(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[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[15](null),H(e,s)}}}const Nr="last_email_test",$h="email_test_request";function lA(n,e,t){let i;const s=St(),l="email_test_"+j.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(Nr),u=o[0].value,f=!1,d=null;function p(D="",A=""){t(1,a=D||localStorage.getItem(Nr)),t(2,u=A||o[0].value),gn({}),r==null||r.show()}function m(){return clearTimeout(d),r==null?void 0:r.hide()}async function _(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Nr,a),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest($h),ml("Test email send timeout.")},3e4);try{await me.settings.testEmail(a,u,{$cancelKey:$h}),Yt("Successfully sent test email."),s("submit"),t(4,f=!1),await an(),m()}catch(D){t(4,f=!1),me.errorResponseHandler(D)}clearTimeout(d)}}const g=[[]];function b(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const w=()=>_(),T=()=>!f;function C(D){se[D?"unshift":"push"](()=>{r=D,t(3,r)})}function M(D){de.call(this,n,D)}function O(D){de.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,_,p,b,g,k,w,T,C,M,O]}class oA extends ve{constructor(e){super(),be(this,e,lA,sA,ge,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function rA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O,D,A,P,N;i=new pe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[uA,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[fA,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}});function R(G){n[14](G)}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 Lr({props:F}),se.push(()=>_e(u,"config",R));function q(G){n[15](G)}let B={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(B.config=n[0].meta.resetPasswordTemplate),p=new Lr({props:B}),se.push(()=>_e(p,"config",q));function Y(G){n[16](G)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),g=new Lr({props:Z}),se.push(()=>_e(g,"config",Y)),C=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[cA,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}});let ee=n[0].smtp.enabled&&Th(n);function ie(G,ce){return G[4]?vA:bA}let X=ie(n),fe=X(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),d=E(),z(p.$$.fragment),_=E(),z(g.$$.fragment),k=E(),w=y("hr"),T=E(),z(C.$$.fragment),M=E(),ee&&ee.c(),O=E(),D=y("div"),A=y("div"),P=E(),fe.c(),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid m-b-base"),h(a,"class","accordions"),h(A,"class","flex-fill"),h(D,"class","flex")},m(G,ce){$(G,e,ce),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),$(G,r,ce),$(G,a,ce),V(u,a,null),v(a,d),V(p,a,null),v(a,_),V(g,a,null),$(G,k,ce),$(G,w,ce),$(G,T,ce),V(C,G,ce),$(G,M,ce),ee&&ee.m(G,ce),$(G,O,ce),$(G,D,ce),v(D,A),v(D,P),fe.m(D,null),N=!0},p(G,ce){const he={};ce[0]&1|ce[1]&3&&(he.$$scope={dirty:ce,ctx:G}),i.$set(he);const Me={};ce[0]&1|ce[1]&3&&(Me.$$scope={dirty:ce,ctx:G}),o.$set(Me);const je={};!f&&ce[0]&1&&(f=!0,je.config=G[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(je);const He={};!m&&ce[0]&1&&(m=!0,He.config=G[0].meta.resetPasswordTemplate,ke(()=>m=!1)),p.$set(He);const we={};!b&&ce[0]&1&&(b=!0,we.config=G[0].meta.confirmEmailChangeTemplate,ke(()=>b=!1)),g.$set(we);const Ce={};ce[0]&1|ce[1]&3&&(Ce.$$scope={dirty:ce,ctx:G}),C.$set(Ce),G[0].smtp.enabled?ee?(ee.p(G,ce),ce[0]&1&&I(ee,1)):(ee=Th(G),ee.c(),I(ee,1),ee.m(O.parentNode,O)):ee&&(re(),L(ee,1,1,()=>{ee=null}),ae()),X===(X=ie(G))&&fe?fe.p(G,ce):(fe.d(1),fe=X(G),fe&&(fe.c(),fe.m(D,null)))},i(G){N||(I(i.$$.fragment,G),I(o.$$.fragment,G),I(u.$$.fragment,G),I(p.$$.fragment,G),I(g.$$.fragment,G),I(C.$$.fragment,G),I(ee),N=!0)},o(G){L(i.$$.fragment,G),L(o.$$.fragment,G),L(u.$$.fragment,G),L(p.$$.fragment,G),L(g.$$.fragment,G),L(C.$$.fragment,G),L(ee),N=!1},d(G){G&&S(e),H(i),H(o),G&&S(r),G&&S(a),H(u),H(p),H(g),G&&S(k),G&&S(w),G&&S(T),H(C,G),G&&S(M),ee&&ee.d(G),G&&S(O),G&&S(D),fe.d()}}}function aA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function uA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Sender name"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].meta.senderName),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&ue(l,u[0].meta.senderName)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function fA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Sender address"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","email"),h(l,"id",o=n[31]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].meta.senderAddress),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&ue(l,u[0].meta.senderAddress)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function cA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[31]),e.required=!0,h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[31])},m(d,p){$(d,e,p),e.checked=n[0].smtp.enabled,$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[17]),De(Ue.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(d,p){p[1]&1&&t!==(t=d[31])&&h(e,"id",t),p[0]&1&&(e.checked=d[0].smtp.enabled),p[1]&1&&a!==(a=d[31])&&h(s,"for",a)},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,Ie(f)}}}function Th(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O;return i=new pe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[dA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[pA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[mA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),p=new pe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[hA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[_A,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),w=new pe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[gA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(g.$$.fragment),b=E(),k=y("div"),z(w.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-4"),h(l,"class","col-lg-2"),h(a,"class","col-lg-3"),h(d,"class","col-lg-3"),h(_,"class","col-lg-6"),h(k,"class","col-lg-6"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(D,A){$(D,e,A),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),v(e,f),v(e,d),V(p,d,null),v(e,m),v(e,_),V(g,_,null),v(e,b),v(e,k),V(w,k,null),v(e,T),v(e,C),O=!0},p(D,A){const P={};A[0]&1|A[1]&3&&(P.$$scope={dirty:A,ctx:D}),i.$set(P);const N={};A[0]&1|A[1]&3&&(N.$$scope={dirty:A,ctx:D}),o.$set(N);const R={};A[0]&1|A[1]&3&&(R.$$scope={dirty:A,ctx:D}),u.$set(R);const F={};A[0]&1|A[1]&3&&(F.$$scope={dirty:A,ctx:D}),p.$set(F);const q={};A[0]&1|A[1]&3&&(q.$$scope={dirty:A,ctx:D}),g.$set(q);const B={};A[0]&1|A[1]&3&&(B.$$scope={dirty:A,ctx:D}),w.$set(B)},i(D){O||(I(i.$$.fragment,D),I(o.$$.fragment,D),I(u.$$.fragment,D),I(p.$$.fragment,D),I(g.$$.fragment,D),I(w.$$.fragment,D),D&&et(()=>{O&&(M||(M=Ve(e,wt,{duration:150},!0)),M.run(1))}),O=!0)},o(D){L(i.$$.fragment,D),L(o.$$.fragment,D),L(u.$$.fragment,D),L(p.$$.fragment,D),L(g.$$.fragment,D),L(w.$$.fragment,D),D&&(M||(M=Ve(e,wt,{duration:150},!1)),M.run(0)),O=!1},d(D){D&&S(e),H(i),H(o),H(u),H(p),H(g),H(w),D&&M&&M.end()}}}function dA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("SMTP server host"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].smtp.host),r||(a=J(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&ue(l,u[0].smtp.host)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function pA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Port"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","number"),h(l,"id",o=n[31]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].smtp.port),r||(a=J(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&>(l.value)!==u[0].smtp.port&&ue(l,u[0].smtp.port)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function mA(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 Ni({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("TLS encryption"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){$(f,e,d),v(e,t),$(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&S(e),f&&S(s),H(l,f)}}}function hA(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 Ni({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("AUTH method"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){$(f,e,d),v(e,t),$(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&S(e),f&&S(s),H(l,f)}}}function _A(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Username"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31])},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].smtp.username),r||(a=J(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&ue(l,u[0].smtp.username)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function gA(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 au({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=y("label"),t=U("Password"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){$(f,e,d),v(e,t),$(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&S(e),f&&S(s),H(l,f)}}}function bA(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` Send test email`,h(e,"type","button"),h(e,"class","btn btn-expanded btn-outline")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function vA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],h(l,"class","txt"),h(s,"type","submit"),h(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){$(u,e,f),v(e,t),$(u,i,f),$(u,s,f),v(s,l),r||(a=[J(e,"click",n[24]),J(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&&S(e),u&&S(i),u&&S(s),r=!1,Ie(a)}}}function yA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[aA,rA],w=[];function T(C,M){return C[2]?0:1}return p=T(n),m=w[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[5]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,M){$(C,e,M),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(C,r,M),$(C,a,M),v(a,u),v(u,f),v(u,d),w[p].m(u,null),_=!0,g||(b=J(u,"submit",pt(n[27])),g=!0)},p(C,M){(!_||M[0]&32)&&le(o,C[5]);let O=p;p=T(C),p===O?w[p].p(C,M):(re(),L(w[O],1,1,()=>{w[O]=null}),ae(),m=w[p],m?m.p(C,M):(m=w[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){L(m),_=!1},d(C){C&&S(e),C&&S(r),C&&S(a),w[p].d(),g=!1,b()}}}function kA(n){let e,t,i,s,l,o;e=new Fi({}),i=new Mn({props:{$$slots:{default:[yA]},$$scope:{ctx:n}}});let r={};return l=new oA({props:r}),n[28](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),$(a,t,u),V(i,a,u),$(a,s,u),V(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 d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&S(t),H(i,a),a&&S(s),n[28](null),H(l,a)}}}function wA(n,e,t){let i,s,l;Ke(n,At,ie=>t(5,l=ie));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(At,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;m();async function m(){t(2,d=!0);try{const ie=await me.settings.getAll()||{};g(ie)}catch(ie){me.errorResponseHandler(ie)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const ie=await me.settings.update(j.filterRedactedProps(f));g(ie),gn({}),Yt("Successfully saved mail settings.")}catch(ie){me.errorResponseHandler(ie)}t(3,p=!1)}}function g(ie={}){t(0,f={meta:(ie==null?void 0:ie.meta)||{},smtp:(ie==null?void 0:ie.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 k(){f.meta.senderName=this.value,t(0,f)}function w(){f.meta.senderAddress=this.value,t(0,f)}function T(ie){n.$$.not_equal(f.meta.verificationTemplate,ie)&&(f.meta.verificationTemplate=ie,t(0,f))}function C(ie){n.$$.not_equal(f.meta.resetPasswordTemplate,ie)&&(f.meta.resetPasswordTemplate=ie,t(0,f))}function M(ie){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ie)&&(f.meta.confirmEmailChangeTemplate=ie,t(0,f))}function O(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=gt(this.value),t(0,f)}function P(ie){n.$$.not_equal(f.smtp.tls,ie)&&(f.smtp.tls=ie,t(0,f))}function N(ie){n.$$.not_equal(f.smtp.authMethod,ie)&&(f.smtp.authMethod=ie,t(0,f))}function R(){f.smtp.username=this.value,t(0,f)}function F(ie){n.$$.not_equal(f.smtp.password,ie)&&(f.smtp.password=ie,t(0,f))}const q=()=>b(),B=()=>_(),Y=()=>a==null?void 0:a.show(),Z=()=>_();function ee(ie){se[ie?"unshift":"push"](()=>{a=ie,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,d,p,s,l,o,r,_,b,u,i,k,w,T,C,M,O,D,A,P,N,R,F,q,B,Y,Z,ee]}class SA extends ve{constructor(e){super(),be(this,e,wA,kA,ge,{},null,[-1,-1])}}function $A(n){var C,M;let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[CA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}});let b=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&Ch(n),k=n[1].s3.enabled&&Mh(n),w=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&Oh(n),T=n[6]&&Dh(n);return{c(){z(e.$$.fragment),t=E(),b&&b.c(),i=E(),k&&k.c(),s=E(),l=y("div"),o=y("div"),r=E(),w&&w.c(),a=E(),T&&T.c(),u=E(),f=y("button"),d=y("span"),d.textContent="Save changes",h(o,"class","flex-fill"),h(d,"class","txt"),h(f,"type","submit"),h(f,"class","btn btn-expanded"),f.disabled=p=!n[6]||n[3],x(f,"btn-loading",n[3]),h(l,"class","flex")},m(O,D){V(e,O,D),$(O,t,D),b&&b.m(O,D),$(O,i,D),k&&k.m(O,D),$(O,s,D),$(O,l,D),v(l,o),v(l,r),w&&w.m(l,null),v(l,a),T&&T.m(l,null),v(l,u),v(l,f),v(f,d),m=!0,_||(g=J(f,"click",n[19]),_=!0)},p(O,D){var P,N;const A={};D&100663298&&(A.$$scope={dirty:D,ctx:O}),e.$set(A),((P=O[0].s3)==null?void 0:P.enabled)!=O[1].s3.enabled?b?(b.p(O,D),D&3&&I(b,1)):(b=Ch(O),b.c(),I(b,1),b.m(i.parentNode,i)):b&&(re(),L(b,1,1,()=>{b=null}),ae()),O[1].s3.enabled?k?(k.p(O,D),D&2&&I(k,1)):(k=Mh(O),k.c(),I(k,1),k.m(s.parentNode,s)):k&&(re(),L(k,1,1,()=>{k=null}),ae()),(N=O[1].s3)!=null&&N.enabled&&!O[6]&&!O[3]?w?w.p(O,D):(w=Oh(O),w.c(),w.m(l,a)):w&&(w.d(1),w=null),O[6]?T?T.p(O,D):(T=Dh(O),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!m||D&72&&p!==(p=!O[6]||O[3]))&&(f.disabled=p),(!m||D&8)&&x(f,"btn-loading",O[3])},i(O){m||(I(e.$$.fragment,O),I(b),I(k),m=!0)},o(O){L(e.$$.fragment,O),L(b),L(k),m=!1},d(O){H(e,O),O&&S(t),b&&b.d(O),O&&S(i),k&&k.d(O),O&&S(s),O&&S(l),w&&w.d(),T&&T.d(),_=!1,g()}}}function TA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function CA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Use S3 storage"),h(e,"type","checkbox"),h(e,"id",t=n[25]),e.required=!0,h(s,"for",o=n[25])},m(u,f){$(u,e,f),e.checked=n[1].s3.enabled,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&h(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function Ch(n){var P;let e,t,i,s,l,o,r,a=(P=n[0].s3)!=null&&P.enabled?"S3 storage":"local file system",u,f,d,p=n[1].s3.enabled?"S3 storage":"local file system",m,_,g,b,k,w,T,C,M,O,D,A;return{c(){e=y("div"),t=y("div"),i=y("div"),i.innerHTML='',s=E(),l=y("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=y("strong"),u=U(a),f=U(` to the `),d=y("strong"),m=U(p),_=U(`. `),g=y("br"),b=U(` There are numerous command line tools that can help you, such as: `),k=y("a"),k.textContent=`rclone `,w=U(`, `),T=y("a"),T.textContent=`s5cmd `,C=U(", etc."),M=E(),O=y("div"),h(i,"class","icon"),h(k,"href","https://github.com/rclone/rclone"),h(k,"target","_blank"),h(k,"rel","noopener noreferrer"),h(k,"class","txt-bold"),h(T,"href","https://github.com/peak/s5cmd"),h(T,"target","_blank"),h(T,"rel","noopener noreferrer"),h(T,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(O,"class","clearfix m-t-base")},m(N,R){$(N,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,d),v(d,m),v(l,_),v(l,g),v(l,b),v(l,k),v(l,w),v(l,T),v(l,C),v(e,M),v(e,O),A=!0},p(N,R){var F;(!A||R&1)&&a!==(a=(F=N[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!A||R&2)&&p!==(p=N[1].s3.enabled?"S3 storage":"local file system")&&le(m,p)},i(N){A||(N&&et(()=>{A&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),A=!0)},o(N){N&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),A=!1},d(N){N&&S(e),N&&D&&D.end()}}}function Mh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[MA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[OA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[DA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),p=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[EA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[AA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),w=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[IA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(g.$$.fragment),b=E(),k=y("div"),z(w.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(d,"class","col-lg-6"),h(_,"class","col-lg-6"),h(k,"class","col-lg-12"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(D,A){$(D,e,A),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),v(e,f),v(e,d),V(p,d,null),v(e,m),v(e,_),V(g,_,null),v(e,b),v(e,k),V(w,k,null),v(e,T),v(e,C),O=!0},p(D,A){const P={};A&100663298&&(P.$$scope={dirty:A,ctx:D}),i.$set(P);const N={};A&100663298&&(N.$$scope={dirty:A,ctx:D}),o.$set(N);const R={};A&100663298&&(R.$$scope={dirty:A,ctx:D}),u.$set(R);const F={};A&100663298&&(F.$$scope={dirty:A,ctx:D}),p.$set(F);const q={};A&100663298&&(q.$$scope={dirty:A,ctx:D}),g.$set(q);const B={};A&100663298&&(B.$$scope={dirty:A,ctx:D}),w.$set(B)},i(D){O||(I(i.$$.fragment,D),I(o.$$.fragment,D),I(u.$$.fragment,D),I(p.$$.fragment,D),I(g.$$.fragment,D),I(w.$$.fragment,D),D&&et(()=>{O&&(M||(M=Ve(e,wt,{duration:150},!0)),M.run(1))}),O=!0)},o(D){L(i.$$.fragment,D),L(o.$$.fragment,D),L(u.$$.fragment,D),L(p.$$.fragment,D),L(g.$$.fragment,D),L(w.$$.fragment,D),D&&(M||(M=Ve(e,wt,{duration:150},!1)),M.run(0)),O=!1},d(D){D&&S(e),H(i),H(o),H(u),H(p),H(g),H(w),D&&M&&M.end()}}}function MA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Endpoint"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function OA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Bucket"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&ue(l,u[1].s3.bucket)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function DA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Region"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[1].s3.region),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.region&&ue(l,u[1].s3.region)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function EA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Access key"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[1].s3.accessKey),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&ue(l,u[1].s3.accessKey)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function AA(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 au({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=y("label"),t=U("Secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[25])},m(f,d){$(f,e,d),v(e,t),$(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&33554432&&i!==(i=f[25]))&&h(e,"for",i);const p={};d&33554432&&(p.id=f[25]),!o&&d&2&&(o=!0,p.value=f[1].s3.secret,ke(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&S(e),f&&S(s),H(l,f)}}}function IA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Force path-style addressing",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[25]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[25])},m(d,p){$(d,e,p),e.checked=n[1].s3.forcePathStyle,$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[17]),De(Ue.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(d,p){p&33554432&&t!==(t=d[25])&&h(e,"id",t),p&2&&(e.checked=d[1].s3.forcePathStyle),p&33554432&&a!==(a=d[25])&&h(s,"for",a)},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,Ie(f)}}}function Oh(n){let e;function t(l,o){return l[4]?NA:l[5]?LA:PA}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function PA(n){let e;return{c(){e=y("div"),e.innerHTML=` S3 connected successfully`,h(e,"class","label label-sm label-success entrance-right")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function LA(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=` Failed to establish S3 connection`,h(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;$(l,e,o),i||(s=De(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Ht(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&S(e),i=!1,s()}}}function NA(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Dh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){$(l,e,o),v(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&S(e),i=!1,s()}}}function FA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[TA,$A],w=[];function T(C,M){return C[2]?0:1}return p=T(n),m=w[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[7]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML=`

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to a S3 compatible storage.

    `,d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,M){$(C,e,M),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(C,r,M),$(C,a,M),v(a,u),v(u,f),v(u,d),w[p].m(u,null),_=!0,g||(b=J(u,"submit",pt(n[20])),g=!0)},p(C,M){(!_||M&128)&&le(o,C[7]);let O=p;p=T(C),p===O?w[p].p(C,M):(re(),L(w[O],1,1,()=>{w[O]=null}),ae(),m=w[p],m?m.p(C,M):(m=w[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){L(m),_=!1},d(C){C&&S(e),C&&S(r),C&&S(a),w[p].d(),g=!1,b()}}}function RA(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[FA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}const ro="s3_test_request";function qA(n,e,t){let i,s,l;Ke(n,At,F=>t(7,l=F)),xt(At,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null,p=null;m();async function m(){t(2,a=!0);try{const F=await me.settings.getAll()||{};g(F)}catch(F){me.errorResponseHandler(F)}t(2,a=!1)}async function _(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(ro);const F=await me.settings.update(j.filterRedactedProps(r));gn({}),await g(F),Da(),d?Qv("Successfully saved but failed to establish S3 connection."):Yt("Successfully saved files storage settings.")}catch(F){me.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 k()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,d=null),!!r.s3.enabled){me.cancelRequest(ro),clearTimeout(p),p=setTimeout(()=>{me.cancelRequest(ro),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:ro})}catch(F){t(5,d=F)}t(4,f=!1),clearTimeout(p)}}Zt(()=>()=>{clearTimeout(p)});function w(){r.s3.enabled=this.checked,t(1,r)}function T(){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 O(){r.s3.accessKey=this.value,t(1,r)}function D(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function A(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>b(),N=()=>_(),R=()=>_();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,d,s,l,_,b,i,w,T,C,M,O,D,A,P,N,R]}class jA extends ve{constructor(e){super(),be(this,e,qA,RA,ge,{})}}function VA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[21]),h(s,"for",o=n[21])},m(u,f){$(u,e,f),e.checked=n[0].enabled,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function HA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[21]),h(l,"type","text"),h(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,d){$(f,e,d),v(e,t),$(f,s,d),$(f,l,d),ue(l,n[0].clientId),a||(u=J(l,"input",n[14]),a=!0)},p(f,d){d&2097152&&i!==(i=f[21])&&h(e,"for",i),d&2097152&&o!==(o=f[21])&&h(l,"id",o),d&1&&r!==(r=f[0].enabled)&&(l.required=r),d&1&&l.value!==f[0].clientId&&ue(l,f[0].clientId)},d(f){f&&S(e),f&&S(s),f&&S(l),a=!1,u()}}}function zA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new au({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=y("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[21])},m(f,d){$(f,e,d),v(e,t),$(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&2097152&&i!==(i=f[21]))&&h(e,"for",i);const p={};d&2097152&&(p.id=f[21]),d&1&&(p.required=f[0].enabled),!o&&d&1&&(o=!0,p.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&S(e),f&&S(s),H(l,f)}}}function Eh(n){let e,t,i,s;function l(a){n[16](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=Ot(o,r(n)),se.push(()=>_e(t,"config",l))),{c(){e=y("div"),t&&z(t.$$.fragment),h(e,"class","col-lg-12")},m(a,u){$(a,e,u),t&&V(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],ke(()=>i=!1)),u&16&&o!==(o=a[4])){if(t){re();const d=t;L(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(t=Ot(o,r(a)),se.push(()=>_e(t,"config",l)),z(t.$$.fragment),I(t.$$.fragment,1),V(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&I(t.$$.fragment,a),s=!0)},o(a){t&&L(t.$$.fragment,a),s=!1},d(a){a&&S(e),t&&H(t)}}}function BA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;t=new pe({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[VA,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientId",$$slots:{default:[HA,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientSecret",$$slots:{default:[zA,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}});let w=n[4]&&Eh(n);return{c(){e=y("div"),z(t.$$.fragment),i=E(),s=y("button"),s.innerHTML='Clear all fields',l=E(),o=y("div"),r=y("div"),a=E(),u=y("div"),z(f.$$.fragment),d=E(),p=y("div"),z(m.$$.fragment),_=E(),w&&w.c(),h(s,"type","button"),h(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),h(e,"class","flex"),h(r,"class","col-12 spacing"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(o,"class","grid")},m(T,C){$(T,e,C),V(t,e,null),v(e,i),v(e,s),$(T,l,C),$(T,o,C),v(o,r),v(o,a),v(o,u),V(f,u,null),v(o,d),v(o,p),V(m,p,null),v(o,_),w&&w.m(o,null),g=!0,b||(k=J(s,"click",n[7]),b=!0)},p(T,C){const M={};C&2&&(M.name=T[1]+".enabled"),C&6291457&&(M.$$scope={dirty:C,ctx:T}),t.$set(M);const O={};C&1&&(O.class="form-field "+(T[0].enabled?"required":"")),C&2&&(O.name=T[1]+".clientId"),C&6291457&&(O.$$scope={dirty:C,ctx:T}),f.$set(O);const D={};C&1&&(D.class="form-field "+(T[0].enabled?"required":"")),C&2&&(D.name=T[1]+".clientSecret"),C&6291457&&(D.$$scope={dirty:C,ctx:T}),m.$set(D),T[4]?w?(w.p(T,C),C&16&&I(w,1)):(w=Eh(T),w.c(),I(w,1),w.m(o,null)):w&&(re(),L(w,1,1,()=>{w=null}),ae())},i(T){g||(I(t.$$.fragment,T),I(f.$$.fragment,T),I(m.$$.fragment,T),I(w),g=!0)},o(T){L(t.$$.fragment,T),L(f.$$.fragment,T),L(m.$$.fragment,T),L(w),g=!1},d(T){T&&S(e),H(t),T&&S(l),T&&S(o),H(f),H(m),w&&w.d(),b=!1,k()}}}function Ah(n){let e;return{c(){e=y("i"),h(e,"class",n[3]),x(e,"txt-hint",!n[0].enabled)},m(t,i){$(t,e,i)},p(t,i){i&8&&h(e,"class",t[3]),i&9&&x(e,"txt-hint",!t[0].enabled)},d(t){t&&S(e)}}}function Ih(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=De(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function UA(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label label-hint")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function WA(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function YA(n){let e,t,i,s,l,o,r,a=n[1].substring(0,n[1].length-4)+"",u,f,d,p,m,_,g,b=n[3]&&Ah(n),k=n[6]&&Ih();function w(M,O){return M[0].enabled?WA:UA}let T=w(n),C=T(n);return{c(){e=y("div"),b&&b.c(),t=E(),i=y("span"),s=U(n[2]),l=E(),o=y("em"),r=U("("),u=U(a),f=U(")"),d=E(),p=y("div"),m=E(),k&&k.c(),_=E(),C.c(),g=Se(),h(i,"class","txt"),h(o,"class","txt-hint"),h(e,"class","inline-flex"),h(p,"class","flex-fill")},m(M,O){$(M,e,O),b&&b.m(e,null),v(e,t),v(e,i),v(i,s),v(e,l),v(e,o),v(o,r),v(o,u),v(o,f),$(M,d,O),$(M,p,O),$(M,m,O),k&&k.m(M,O),$(M,_,O),C.m(M,O),$(M,g,O)},p(M,O){M[3]?b?b.p(M,O):(b=Ah(M),b.c(),b.m(e,t)):b&&(b.d(1),b=null),O&4&&le(s,M[2]),O&2&&a!==(a=M[1].substring(0,M[1].length-4)+"")&&le(u,a),M[6]?k?O&64&&I(k,1):(k=Ih(),k.c(),I(k,1),k.m(_.parentNode,_)):k&&(re(),L(k,1,1,()=>{k=null}),ae()),T!==(T=w(M))&&(C.d(1),C=T(M),C&&(C.c(),C.m(g.parentNode,g)))},d(M){M&&S(e),b&&b.d(),M&&S(d),M&&S(p),M&&S(m),k&&k.d(M),M&&S(_),C.d(M),M&&S(g)}}}function KA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[YA],default:[BA]},$$scope:{ctx:n}};for(let l=0;lt(12,o=P));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{optionsComponent:d}=e,p;function m(){p==null||p.expand()}function _(){p==null||p.collapse()}function g(){p==null||p.collapseSiblings()}function b(){for(let P in f)t(0,f[P]="",f);t(0,f.enabled=!1,f)}function k(){f.enabled=this.checked,t(0,f)}function w(){f.clientId=this.value,t(0,f)}function T(P){n.$$.not_equal(f.clientSecret,P)&&(f.clientSecret=P,t(0,f))}function C(P){f=P,t(0,f)}function M(P){se[P?"unshift":"push"](()=>{p=P,t(5,p)})}function O(P){de.call(this,n,P)}function D(P){de.call(this,n,P)}function A(P){de.call(this,n,P)}return n.$$set=P=>{e=Fe(Fe({},e),zt(P)),t(8,l=Ge(e,s)),"key"in P&&t(1,r=P.key),"title"in P&&t(2,a=P.title),"icon"in P&&t(3,u=P.icon),"config"in P&&t(0,f=P.config),"optionsComponent"in P&&t(4,d=P.optionsComponent)},n.$$.update=()=>{n.$$.dirty&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||mi(r))},[f,r,a,u,d,p,i,b,l,m,_,g,o,k,w,T,C,M,O,D,A]}class ZA extends ve{constructor(e){super(),be(this,e,JA,KA,ge,{key:1,title:2,icon:3,config:0,optionsComponent:4,expand:9,collapse:10,collapseSiblings:11})}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Ph(n,e,t){const i=n.slice();return i[18]=e[t][0],i[19]=e[t][1],i[20]=e,i[21]=t,i}function GA(n){let e,t,i,s,l,o,r,a,u,f,d,p=Object.entries(Is),m=[];for(let k=0;kL(m[k],1,1,()=>{m[k]=null});let g=!n[4]&&Fh(n),b=n[5]&&Rh(n);return{c(){e=y("div");for(let k=0;kn[12](e,t),o=()=>n[12](null,t);function r(u){n[13](u,n[18])}let a={single:!0,key:n[18],title:n[19].title,icon:n[19].icon||"ri-fingerprint-line",optionsComponent:n[19].optionsComponent};return n[0][n[18]]!==void 0&&(a.config=n[0][n[18]]),e=new ZA({props:a}),l(),se.push(()=>_e(e,"config",r)),{c(){z(e.$$.fragment)},m(u,f){V(e,u,f),s=!0},p(u,f){n=u,t!==n[18]&&(o(),t=n[18],l());const d={};!i&&f&1&&(i=!0,d.config=n[0][n[18]],ke(()=>i=!1)),e.$set(d)},i(u){s||(I(e.$$.fragment,u),s=!0)},o(u){L(e.$$.fragment,u),s=!1},d(u){o(),H(e,u)}}}function Nh(n){var s;let e,t,i=(n[4]||!n[19].hidden||((s=n[0][n[18]])==null?void 0:s.enabled))&&Lh(n);return{c(){i&&i.c(),e=Se()},m(l,o){i&&i.m(l,o),$(l,e,o),t=!0},p(l,o){var r;l[4]||!l[19].hidden||(r=l[0][l[18]])!=null&&r.enabled?i?(i.p(l,o),o&17&&I(i,1)):(i=Lh(l),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(re(),L(i,1,1,()=>{i=null}),ae())},i(l){t||(I(i),t=!0)},o(l){L(i),t=!1},d(l){i&&i.d(l),l&&S(e)}}}function Fh(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("button"),t=y("i"),i=E(),s=y("span"),l=U("Show all ("),o=U(n[6]),r=U(")"),h(t,"class","ri-arrow-down-s-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(f,d){$(f,e,d),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),a||(u=J(e,"click",n[14]),a=!0)},p(f,d){d&64&&le(o,f[6])},d(f){f&&S(e),a=!1,u()}}}function Rh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){$(l,e,o),v(e,t),i||(s=J(e,"click",n[15]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&S(e),i=!1,s()}}}function QA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[XA,GA],w=[];function T(C,M){return C[2]?0:1}return p=T(n),m=w[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[7]),r=E(),a=y("div"),u=y("form"),f=y("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,M){$(C,e,M),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(C,r,M),$(C,a,M),v(a,u),v(u,f),v(u,d),w[p].m(u,null),_=!0,g||(b=J(u,"submit",pt(n[8])),g=!0)},p(C,M){(!_||M&128)&&le(o,C[7]);let O=p;p=T(C),p===O?w[p].p(C,M):(re(),L(w[O],1,1,()=>{w[O]=null}),ae(),m=w[p],m?m.p(C,M):(m=w[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){L(m),_=!1},d(C){C&&S(e),C&&S(r),C&&S(a),w[p].d(),g=!1,b()}}}function xA(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[QA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&4194559&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}function e6(n,e,t){let i,s,l,o;Ke(n,At,M=>t(7,o=M)),xt(At,o="Auth providers",o);let r={},a={},u={},f=!1,d=!1,p=!1;m();async function m(){t(2,f=!0);try{const M=await me.settings.getAll()||{};g(M)}catch(M){me.errorResponseHandler(M)}t(2,f=!1)}async function _(){var M;if(!(d||!s)){t(3,d=!0);try{const O=await me.settings.update(j.filterRedactedProps(u));g(O),gn({}),(M=r[Object.keys(r)[0]])==null||M.collapseSiblings(),Yt("Successfully updated auth providers.")}catch(O){me.errorResponseHandler(O)}t(3,d=!1)}}function g(M){M=M||{},t(0,u={});for(const O in Is)t(0,u[O]=Object.assign({enabled:!1},M[O]),u);t(10,a=JSON.parse(JSON.stringify(u)))}function b(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function k(M,O){se[M?"unshift":"push"](()=>{r[O]=M,t(1,r)})}function w(M,O){n.$$.not_equal(u[O],M)&&(u[O]=M,t(0,u))}const T=()=>t(4,p=!0),C=()=>b();return n.$$.update=()=>{n.$$.dirty&1024&&t(11,i=JSON.stringify(a)),n.$$.dirty&2049&&t(5,s=i!=JSON.stringify(u))},t(6,l=Object.values(Is).filter(M=>M.hidden).length),[u,r,f,d,p,s,l,o,_,b,a,i,k,w,T,C]}class t6 extends ve{constructor(e){super(),be(this,e,e6,xA,ge,{})}}function qh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function n6(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,d,p,m,_=n[5];const g=k=>k[16].key;for(let k=0;k<_.length;k+=1){let w=qh(n,_,k),T=g(w);t.set(T,e[k]=jh(T,w))}let b=n[3]&&Vh(n);return{c(){for(let k=0;k({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){$(l,t,o),V(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||(I(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&S(t),H(i,l)}}}function Vh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){$(l,e,o),v(e,t),i||(s=J(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&S(e),i=!1,s()}}}function l6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[i6,n6],w=[];function T(C,M){return C[1]?0:1}return p=T(n),m=w[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[4]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="

    Adjust common token options.

    ",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content m-b-sm txt-xl"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,M){$(C,e,M),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(C,r,M),$(C,a,M),v(a,u),v(u,f),v(u,d),w[p].m(u,null),_=!0,g||(b=J(u,"submit",pt(n[6])),g=!0)},p(C,M){(!_||M&16)&&le(o,C[4]);let O=p;p=T(C),p===O?w[p].p(C,M):(re(),L(w[O],1,1,()=>{w[O]=null}),ae(),m=w[p],m?m.p(C,M):(m=w[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){L(m),_=!1},d(C){C&&S(e),C&&S(r),C&&S(a),w[p].d(),g=!1,b()}}}function o6(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[l6]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}function r6(n,e,t){let i,s,l;Ke(n,At,T=>t(4,l=T));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"}];xt(At,l="Token options",l);let r={},a={},u=!1,f=!1;d();async function d(){t(1,u=!0);try{const T=await me.settings.getAll()||{};m(T)}catch(T){me.errorResponseHandler(T)}t(1,u=!1)}async function p(){if(!(f||!s)){t(2,f=!0);try{const T=await me.settings.update(j.filterRedactedProps(a));m(T),Yt("Successfully saved tokens options.")}catch(T){me.errorResponseHandler(T)}t(2,f=!1)}}function m(T){var C;T=T||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:((C=T[M.key])==null?void 0:C.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(T){a[T.key].duration=gt(this.value),t(0,a)}const b=T=>{a[T.key].secret?(delete a[T.key].secret,t(0,a)):t(0,a[T.key].secret=j.randomString(50),a)},k=()=>_(),w=()=>p();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,p,_,r,i,g,b,k,w]}class a6 extends ve{constructor(e){super(),be(this,e,r6,o6,ge,{})}}function u6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_;return o=new Y1({props:{content:n[2]}}),{c(){e=y("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in another PocketBase environment.

    `,t=E(),i=y("div"),s=y("button"),s.innerHTML='Copy',l=E(),z(o.$$.fragment),r=E(),a=y("div"),u=y("div"),f=E(),d=y("button"),d.innerHTML=` Download as JSON`,h(e,"class","content txt-xl m-b-base"),h(s,"type","button"),h(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),h(i,"tabindex","0"),h(i,"class","export-preview svelte-jm5c4z"),h(u,"class","flex-fill"),h(d,"type","button"),h(d,"class","btn btn-expanded"),h(a,"class","flex m-t-base")},m(g,b){$(g,e,b),$(g,t,b),$(g,i,b),v(i,s),v(i,l),V(o,i,null),n[8](i),$(g,r,b),$(g,a,b),v(a,u),v(a,f),v(a,d),p=!0,m||(_=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],m=!0)},p(g,b){const k={};b&4&&(k.content=g[2]),o.$set(k)},i(g){p||(I(o.$$.fragment,g),p=!0)},o(g){L(o.$$.fragment,g),p=!1},d(g){g&&S(e),g&&S(t),g&&S(i),H(o),n[8](null),g&&S(r),g&&S(a),m=!1,Ie(_)}}}function f6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function c6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[f6,u6],_=[];function g(b,k){return b[1]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[3]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){$(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(b,r,k),$(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k&8)&&le(o,b[3]);let w=f;f=g(b),f===w?_[f].p(b,k):(re(),L(_[w],1,1,()=>{_[w]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),I(d,1),d.m(u,null))},i(b){p||(I(d),p=!0)},o(b){L(d),p=!1},d(b){b&&S(e),b&&S(r),b&&S(a),_[f].d()}}}function d6(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[c6]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),$(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&S(t),H(i,l)}}}function p6(n,e,t){let i,s;Ke(n,At,b=>t(3,s=b)),xt(At,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){me.errorResponseHandler(b)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function d(){j.copyToClipboard(i),Wg("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function m(b){se[b?"unshift":"push"](()=>{o=b,t(0,o)})}const _=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const k=window.getSelection(),w=document.createRange();w.selectNodeContents(o),k.removeAllRanges(),k.addRange(w)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,m,_,g]}class m6 extends ve{constructor(e){super(),be(this,e,p6,d6,ge,{})}}function Hh(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 Bh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Wh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Yh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Kh(n,e,t){const i=n.slice();return i[30]=e[t],i}function h6(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Jh(),a=n[0].name!==n[1].name&&Zh(n);return{c(){e=y("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=y("strong"),o=U(l),h(s,"class","txt"),h(e,"class","inline-flex fleg-gap-5")},m(u,f){$(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[9]?r||(r=Jh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Zh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&S(e),r&&r.d(),a&&a.d()}}}function _6(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-danger")},m(r,a){$(r,e,a),$(r,t,a),$(r,i,a),v(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&S(e),r&&S(t),r&&S(i)}}}function g6(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Added",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-success")},m(r,a){$(r,e,a),$(r,t,a),$(r,i,a),v(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&S(e),r&&S(t),r&&S(i)}}}function Jh(n){let e;return{c(){e=y("span"),e.textContent="Changed",h(e,"class","label label-warning")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Zh(n){let e,t=n[0].name+"",i,s,l;return{c(){e=y("strong"),i=U(t),s=E(),l=y("i"),h(e,"class","txt-strikethrough txt-hint"),h(l,"class","ri-arrow-right-line txt-sm")},m(o,r){$(o,e,r),v(e,i),$(o,s,r),$(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&S(e),o&&S(s),o&&S(l)}}}function Gh(n){var b,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+"",f,d,p,m,_=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var w,T,C,M,O,D;e=y("tr"),t=y("td"),i=y("span"),l=U(s),o=E(),r=y("td"),a=y("pre"),f=U(u),d=E(),p=y("td"),m=y("pre"),g=U(_),h(t,"class","min-width svelte-lmkr38"),h(a,"class","txt"),h(r,"class","svelte-lmkr38"),x(r,"changed-old-col",!n[10]&&dn((w=n[0])==null?void 0:w[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(r,"changed-none-col",n[10]),h(m,"class","txt"),h(p,"class","svelte-lmkr38"),x(p,"changed-new-col",!n[5]&&dn((C=n[0])==null?void 0:C[n[30]],(M=n[1])==null?void 0:M[n[30]])),x(p,"changed-none-col",n[5]),h(e,"class","svelte-lmkr38"),x(e,"txt-primary",dn((O=n[0])==null?void 0:O[n[30]],(D=n[1])==null?void 0:D[n[30]]))},m(w,T){$(w,e,T),v(e,t),v(t,i),v(i,l),v(e,o),v(e,r),v(r,a),v(a,f),v(e,d),v(e,p),v(p,m),v(m,g)},p(w,T){var C,M,O,D,A,P,N,R;T[0]&1&&u!==(u=w[12]((C=w[0])==null?void 0:C[w[30]])+"")&&le(f,u),T[0]&3075&&x(r,"changed-old-col",!w[10]&&dn((M=w[0])==null?void 0:M[w[30]],(O=w[1])==null?void 0:O[w[30]])),T[0]&1024&&x(r,"changed-none-col",w[10]),T[0]&2&&_!==(_=w[12]((D=w[1])==null?void 0:D[w[30]])+"")&&le(g,_),T[0]&2083&&x(p,"changed-new-col",!w[5]&&dn((A=w[0])==null?void 0:A[w[30]],(P=w[1])==null?void 0:P[w[30]])),T[0]&32&&x(p,"changed-none-col",w[5]),T[0]&2051&&x(e,"txt-primary",dn((N=w[0])==null?void 0:N[w[30]],(R=w[1])==null?void 0:R[w[30]]))},d(w){w&&S(e)}}}function Xh(n){let e,t=n[6],i=[];for(let s=0;sProps Old New`,l=E(),o=y("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=E(),g&&g.c(),a=E();for(let C=0;C!["schema","created","updated"].includes(k));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(k=>!f.find(w=>k.id==w.id))))}function b(k){return typeof k>"u"?"":j.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.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,d=u.filter(k=>!f.find(w=>k.id==w.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find(w=>w.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(w=>w.id==k.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,b]}class y6 extends ve{constructor(e){super(),be(this,e,v6,b6,ge,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function l_(n,e,t){const i=n.slice();return i[17]=e[t],i}function o_(n){let e,t;return e=new y6({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function k6(n){let e,t,i=n[2],s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),Yt("Successfully imported collections configuration."),i("submit")}catch(C){me.errorResponseHandler(C)}t(4,u=!1),d()}}const g=()=>m(),b=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function w(C){de.call(this,n,C)}function T(C){de.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,m,f,l,o,g,b,k,w,T]}class C6 extends ve{constructor(e){super(),be(this,e,T6,$6,ge,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function r_(n,e,t){const i=n.slice();return i[32]=e[t],i}function a_(n,e,t){const i=n.slice();return i[35]=e[t],i}function u_(n,e,t){const i=n.slice();return i[32]=e[t],i}function M6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w,T,C,M,O,D;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[D6,({uniqueId:q})=>({40:q}),({uniqueId:q})=>[0,q?512:0]]},$$scope:{ctx:n}}});let A=!1,P=n[6]&&n[1].length&&!n[7]&&c_(),N=n[6]&&n[1].length&&n[7]&&d_(n),R=n[13].length&&S_(n),F=!!n[0]&&$_(n);return{c(){e=y("input"),t=E(),i=y("div"),s=y("p"),l=U(`Paste below the collections configuration you want to import or `),o=y("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),P&&P.c(),d=E(),N&&N.c(),p=E(),R&&R.c(),m=E(),_=y("div"),F&&F.c(),g=E(),b=y("div"),k=E(),w=y("button"),T=y("span"),T.textContent="Review",h(e,"type","file"),h(e,"class","hidden"),h(e,"accept",".json"),h(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),h(i,"class","content txt-xl m-b-base"),h(b,"class","flex-fill"),h(T,"class","txt"),h(w,"type","button"),h(w,"class","btn btn-expanded btn-warning m-l-auto"),w.disabled=C=!n[14],h(_,"class","flex m-t-base")},m(q,B){$(q,e,B),n[19](e),$(q,t,B),$(q,i,B),v(i,s),v(s,l),v(s,o),$(q,r,B),V(a,q,B),$(q,u,B),$(q,f,B),P&&P.m(q,B),$(q,d,B),N&&N.m(q,B),$(q,p,B),R&&R.m(q,B),$(q,m,B),$(q,_,B),F&&F.m(_,null),v(_,g),v(_,b),v(_,k),v(_,w),v(w,T),M=!0,O||(D=[J(e,"change",n[20]),J(o,"click",n[21]),J(w,"click",n[26])],O=!0)},p(q,B){(!M||B[0]&4096)&&x(o,"btn-loading",q[12]);const Y={};B[0]&64&&(Y.class="form-field "+(q[6]?"":"field-error")),B[0]&65|B[1]&1536&&(Y.$$scope={dirty:B,ctx:q}),a.$set(Y),q[6]&&q[1].length&&!q[7]?P||(P=c_(),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),q[6]&&q[1].length&&q[7]?N?N.p(q,B):(N=d_(q),N.c(),N.m(p.parentNode,p)):N&&(N.d(1),N=null),q[13].length?R?R.p(q,B):(R=S_(q),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),q[0]?F?F.p(q,B):(F=$_(q),F.c(),F.m(_,g)):F&&(F.d(1),F=null),(!M||B[0]&16384&&C!==(C=!q[14]))&&(w.disabled=C)},i(q){M||(I(a.$$.fragment,q),I(A),M=!0)},o(q){L(a.$$.fragment,q),L(A),M=!1},d(q){q&&S(e),n[19](null),q&&S(t),q&&S(i),q&&S(r),H(a,q),q&&S(u),q&&S(f),P&&P.d(q),q&&S(d),N&&N.d(q),q&&S(p),R&&R.d(q),q&&S(m),q&&S(_),F&&F.d(),O=!1,Ie(D)}}}function O6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function f_(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",h(e,"class","help-block help-block-error")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function D6(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&f_();return{c(){e=y("label"),t=U("Collections"),s=E(),l=y("textarea"),r=E(),d&&d.c(),a=Se(),h(e,"for",i=n[40]),h(e,"class","p-b-10"),h(l,"id",o=n[40]),h(l,"class","code"),h(l,"spellcheck","false"),h(l,"rows","15"),l.required=!0},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[0]),$(p,r,m),d&&d.m(p,m),$(p,a,m),u||(f=J(l,"input",n[22]),u=!0)},p(p,m){m[1]&512&&i!==(i=p[40])&&h(e,"for",i),m[1]&512&&o!==(o=p[40])&&h(l,"id",o),m[0]&1&&ue(l,p[0]),p[0]&&!p[6]?d||(d=f_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(r),d&&d.d(p),p&&S(a),u=!1,f()}}}function c_(n){let e;return{c(){e=y("div"),e.innerHTML=`
    Your collections configuration is already up-to-date!
    `,h(e,"class","alert alert-info")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function d_(n){let e,t,i,s,l,o=n[9].length&&p_(n),r=n[4].length&&__(n),a=n[8].length&&y_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=E(),i=y("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),h(e,"class","section-title"),h(i,"class","list")},m(u,f){$(u,e,f),$(u,t,f),$(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=p_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=__(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=y_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&S(e),u&&S(t),u&&S(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function p_(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=E(),s=y("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want to.`,l=E(),o=y("button"),o.innerHTML='Replace with original ids',h(t,"class","icon"),h(s,"class","content"),h(o,"type","button"),h(o,"class","btn btn-warning btn-sm btn-outline"),h(e,"class","alert alert-warning m-t-base")},m(u,f){$(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:Q,d(u){u&&S(e),r=!1,a()}}}function $_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear',h(e,"type","button"),h(e,"class","btn btn-transparent link-hint")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function E6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[O6,M6],_=[];function g(b,k){return b[5]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[15]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){$(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(b,r,k),$(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k[0]&32768)&&le(o,b[15]);let w=f;f=g(b),f===w?_[f].p(b,k):(re(),L(_[w],1,1,()=>{_[w]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),I(d,1),d.m(u,null))},i(b){p||(I(d),p=!0)},o(b){L(d),p=!1},d(b){b&&S(e),b&&S(r),b&&S(a),_[f].d()}}}function A6(n){let e,t,i,s,l,o;e=new Fi({}),i=new Mn({props:{$$slots:{default:[E6]},$$scope:{ctx:n}}});let r={};return l=new C6({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),$(a,t,u),V(i,a,u),$(a,s,u),V(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 d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&S(t),H(i,a),a&&S(s),n[27](null),H(l,a)}}}function I6(n,e,t){let i,s,l,o,r,a,u;Ke(n,At,X=>t(15,u=X)),xt(At,u="Import collections",u);let f,d,p="",m=!1,_=[],g=[],b=!0,k=[],w=!1;T();async function T(){t(5,w=!0);try{t(2,g=await me.collections.getFullList(200));for(let X of g)delete X.created,delete X.updated}catch(X){me.errorResponseHandler(X)}t(5,w=!1)}function C(){if(t(4,k=[]),!!i)for(let X of _){const fe=j.findByKey(g,"id",X.id);!(fe!=null&&fe.id)||!j.hasCollectionChanges(fe,X,b)||k.push({new:X,old:fe})}}function M(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=j.filterDuplicatesByKey(_)):t(1,_=[]);for(let X of _)delete X.created,delete X.updated,X.schema=j.filterDuplicatesByKey(X.schema)}function O(){var X,fe;for(let G of _){const ce=j.findByKey(g,"name",G.name)||j.findByKey(g,"id",G.id);if(!ce)continue;const he=G.id,Me=ce.id;G.id=Me;const je=Array.isArray(ce.schema)?ce.schema:[],He=Array.isArray(G.schema)?G.schema:[];for(const we of He){const Ce=j.findByKey(je,"name",we.name);Ce&&Ce.id&&(we.id=Ce.id)}for(let we of _)if(Array.isArray(we.schema))for(let Ce of we.schema)(X=Ce.options)!=null&&X.collectionId&&((fe=Ce.options)==null?void 0:fe.collectionId)===he&&(Ce.options.collectionId=Me)}t(0,p=JSON.stringify(_,null,4))}function D(X){t(12,m=!0);const fe=new FileReader;fe.onload=async G=>{t(12,m=!1),t(10,f.value="",f),t(0,p=G.target.result),await an(),_.length||(ml("Invalid collections configuration."),A())},fe.onerror=G=>{console.warn(G),ml("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(X)}function A(){t(0,p=""),t(10,f.value="",f),gn({})}function P(X){se[X?"unshift":"push"](()=>{f=X,t(10,f)})}const N=()=>{f.files.length&&D(f.files[0])},R=()=>{f.click()};function F(){p=this.value,t(0,p)}function q(){b=this.checked,t(3,b)}const B=()=>O(),Y=()=>A(),Z=()=>d==null?void 0:d.show(g,_,b);function ee(X){se[X?"unshift":"push"](()=>{d=X,t(11,d)})}const ie=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!p&&_.length&&_.length===_.filter(X=>!!X.id&&!!X.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(X=>i&&b&&!j.findByKey(_,"id",X.id))),n.$$.dirty[0]&70&&t(8,l=_.filter(X=>i&&!j.findByKey(g,"id",X.id))),n.$$.dirty[0]&10&&(typeof _<"u"||typeof b<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!p&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!w&&i&&o),n.$$.dirty[0]&6&&t(13,a=_.filter(X=>{let fe=j.findByKey(g,"name",X.name)||j.findByKey(g,"id",X.id);if(!fe)return!1;if(fe.id!=X.id)return!0;const G=Array.isArray(fe.schema)?fe.schema:[],ce=Array.isArray(X.schema)?X.schema:[];for(const he of ce){if(j.findByKey(G,"id",he.id))continue;const je=j.findByKey(G,"name",he.name);if(je&&he.id!=je.id)return!0}return!1}))},[p,_,g,b,k,w,i,o,l,s,f,d,m,a,r,u,O,D,A,P,N,R,F,q,B,Y,Z,ee,ie]}class P6 extends ve{constructor(e){super(),be(this,e,I6,A6,ge,{},null,[-1,-1])}}const Ut=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ii("/"):!0}],L6={"/login":qt({component:DE,conditions:Ut.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":qt({asyncComponent:()=>ft(()=>import("./PageAdminRequestPasswordReset-889eec51.js"),[],import.meta.url),conditions:Ut.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":qt({asyncComponent:()=>ft(()=>import("./PageAdminConfirmPasswordReset-0f70ec03.js"),[],import.meta.url),conditions:Ut.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":qt({component:xD,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":qt({component:QS,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":qt({component:jE,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":qt({component:SE,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":qt({component:SA,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":qt({component:jA,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":qt({component:t6,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":qt({component:a6,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":qt({component:m6,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":qt({component:P6,conditions:Ut.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":qt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmPasswordReset-1cce1694.js"),[],import.meta.url),conditions:Ut,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":qt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmPasswordReset-1cce1694.js"),[],import.meta.url),conditions:Ut,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":qt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmVerification-69fa57e5.js"),[],import.meta.url),conditions:Ut,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":qt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmVerification-69fa57e5.js"),[],import.meta.url),conditions:Ut,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":qt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmEmailChange-fe936843.js"),[],import.meta.url),conditions:Ut,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":qt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmEmailChange-fe936843.js"),[],import.meta.url),conditions:Ut,userData:{showAppSidebar:!1}}),"*":qt({component:yy,userData:{showAppSidebar:!1}})};function N6(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:d=m=>Math.sqrt(m)*120,easing:p=Wo}=i;return{delay:f,duration:Ht(d)?d(Math.sqrt(a*a+u*u)):d,easing:p,css:(m,_)=>{const g=_*a,b=_*u,k=m+_*e.width/t.width,w=m+_*e.height/t.height;return`transform: ${l} translate(${g}px, ${b}px) scale(${k}, ${w});`}}}function T_(n,e,t){const i=n.slice();return i[2]=e[t],i}function F6(n){let e;return{c(){e=y("i"),h(e,"class","ri-alert-line")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function R6(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function q6(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-line")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function j6(n){let e;return{c(){e=y("i"),h(e,"class","ri-information-line")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function C_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,d,p,m=Q,_,g,b;function k(M,O){return M[2].type==="info"?j6:M[2].type==="success"?q6:M[2].type==="warning"?R6:F6}let w=k(e),T=w(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=y("div"),i=y("div"),T.c(),s=E(),l=y("div"),r=U(o),a=E(),u=y("button"),u.innerHTML='',f=E(),h(i,"class","icon"),h(l,"class","content"),h(u,"type","button"),h(u,"class","close"),h(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,O){$(M,t,O),v(t,i),T.m(i,null),v(t,s),v(t,l),v(l,r),v(t,a),v(t,u),v(t,f),_=!0,g||(b=J(u,"click",pt(C)),g=!0)},p(M,O){e=M,w!==(w=k(e))&&(T.d(1),T=w(e),T&&(T.c(),T.m(i,null))),(!_||O&1)&&o!==(o=e[2].message+"")&&le(r,o),(!_||O&1)&&x(t,"alert-info",e[2].type=="info"),(!_||O&1)&&x(t,"alert-success",e[2].type=="success"),(!_||O&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||O&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){p=t.getBoundingClientRect()},f(){yb(t),m(),F_(t,p)},a(){m(),m=vb(t,p,N6,{duration:150})},i(M){_||(et(()=>{_&&(d||(d=Ve(t,yo,{duration:150},!0)),d.run(1))}),_=!0)},o(M){d||(d=Ve(t,yo,{duration:150},!1)),d.run(0),_=!1},d(M){M&&S(t),T.d(),M&&d&&d.end(),g=!1,b()}}}function V6(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Yg(l)]}class z6 extends ve{constructor(e){super(),be(this,e,H6,V6,ge,{})}}function B6(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=y("h4"),i=U(t),h(e,"class","block center txt-break"),h(e,"slot","header")},m(l,o){$(l,e,o),v(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&le(i,t)},d(l){l&&S(e)}}}function U6(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=y("span"),t.textContent="No",i=E(),s=y("button"),l=y("span"),l.textContent="Yes",h(t,"class","txt"),e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],x(s,"btn-loading",n[2])},m(a,u){$(a,e,u),v(e,t),$(a,i,u),$(a,s,u),v(s,l),e.focus(),o||(r=[J(e,"click",n[4]),J(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&&S(e),a&&S(i),a&&S(s),o=!1,Ie(r)}}}function W6(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:[U6],header:[B6]},$$scope:{ctx:n}};return e=new vn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){V(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||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function Y6(n,e,t){let i;Ke(n,nu,d=>t(1,i=d));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(d){se[d?"unshift":"push"](()=>{s=d,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await an(),t(3,o=!1),J1()};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 K6 extends ve{constructor(e){super(),be(this,e,Y6,W6,ge,{})}}function M_(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,w;return g=new Vn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[J6]},$$scope:{ctx:n}}}),{c(){var T;e=y("aside"),t=y("a"),t.innerHTML='PocketBase logo',i=E(),s=y("nav"),l=y("a"),l.innerHTML='',o=E(),r=y("a"),r.innerHTML='',a=E(),u=y("a"),u.innerHTML='',f=E(),d=y("figure"),p=y("img"),_=E(),z(g.$$.fragment),h(t,"href","/"),h(t,"class","logo logo-sm"),h(l,"href","/collections"),h(l,"class","menu-item"),h(l,"aria-label","Collections"),h(r,"href","/logs"),h(r,"class","menu-item"),h(r,"aria-label","Logs"),h(u,"href","/settings"),h(u,"class","menu-item"),h(u,"aria-label","Settings"),h(s,"class","main-menu"),Yn(p.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||h(p,"src",m),h(p,"alt","Avatar"),h(d,"class","thumb thumb-circle link-hint closable"),h(e,"class","app-sidebar")},m(T,C){$(T,e,C),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(e,f),v(e,d),v(d,p),v(d,_),V(g,d,null),b=!0,k||(w=[De(sn.call(null,t)),De(sn.call(null,l)),De(Bn.call(null,l,{path:"/collections/?.*",className:"current-route"})),De(Ue.call(null,l,{text:"Collections",position:"right"})),De(sn.call(null,r)),De(Bn.call(null,r,{path:"/logs/?.*",className:"current-route"})),De(Ue.call(null,r,{text:"Logs",position:"right"})),De(sn.call(null,u)),De(Bn.call(null,u,{path:"/settings/?.*",className:"current-route"})),De(Ue.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(T,C){var O;(!b||C&1&&!Yn(p.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&h(p,"src",m);const M={};C&4096&&(M.$$scope={dirty:C,ctx:T}),g.$set(M)},i(T){b||(I(g.$$.fragment,T),b=!0)},o(T){L(g.$$.fragment,T),b=!1},d(T){T&&S(e),H(g),k=!1,Ie(w)}}}function J6(n){let e,t,i,s,l,o,r;return{c(){e=y("a"),e.innerHTML=` Manage admins`,t=E(),i=y("hr"),s=E(),l=y("button"),l.innerHTML=` Logout`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item closable")},m(a,u){$(a,e,u),$(a,t,u),$(a,i,u),$(a,s,u),$(a,l,u),o||(r=[De(sn.call(null,e)),J(l,"click",n[7])],o=!0)},p:Q,d(a){a&&S(e),a&&S(t),a&&S(i),a&&S(s),a&&S(l),o=!1,Ie(r)}}}function O_(n){let e,t,i;return t=new ru({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){$(s,e,l),V(t,e,null),i=!0},p:Q,i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&S(e),H(t)}}}function Z6(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&M_(n);o=new Nb({props:{routes:L6}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new z6({}),f=new K6({});let g=n[1]&&!n[2]&&O_(n);return{c(){t=E(),i=y("div"),_&&_.c(),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),g&&g.c(),p=Se(),h(l,"class","app-body"),h(i,"class","app-layout")},m(k,w){$(k,t,w),$(k,i,w),_&&_.m(i,null),v(i,s),v(i,l),V(o,l,null),v(l,r),V(a,l,null),$(k,u,w),V(f,k,w),$(k,d,w),g&&g.m(k,w),$(k,p,w),m=!0},p(k,[w]){var T;(!m||w&24)&&e!==(e=j.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(T=k[0])!=null&&T.id&&k[1]?_?(_.p(k,w),w&3&&I(_,1)):(_=M_(k),_.c(),I(_,1),_.m(i,s)):_&&(re(),L(_,1,1,()=>{_=null}),ae()),k[1]&&!k[2]?g?(g.p(k,w),w&6&&I(g,1)):(g=O_(k),g.c(),I(g,1),g.m(p.parentNode,p)):g&&(re(),L(g,1,1,()=>{g=null}),ae())},i(k){m||(I(_),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(g),m=!0)},o(k){L(_),L(o.$$.fragment,k),L(a.$$.fragment,k),L(f.$$.fragment,k),L(g),m=!1},d(k){k&&S(t),k&&S(i),_&&_.d(),H(o),H(a),k&&S(u),H(f,k),k&&S(d),g&&g.d(k),k&&S(p)}}}function G6(n,e,t){let i,s,l,o;Ke(n,Ms,g=>t(10,i=g)),Ke(n,wo,g=>t(3,s=g)),Ke(n,Aa,g=>t(0,l=g)),Ke(n,At,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var b,k,w,T;((b=g==null?void 0:g.detail)==null?void 0:b.location)!==r&&(t(1,a=!!((w=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&w.showAppSidebar)),r=(T=g==null?void 0:g.detail)==null?void 0:T.location,xt(At,o="",o),gn({}),J1())}function d(){Ii("/")}async function p(){var g,b;if(l!=null&&l.id)try{const k=await me.settings.getAll({$cancelKey:"initialAppSettings"});xt(wo,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),xt(Ms,i=!!((b=k==null?void 0:k.meta)!=null&&b.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){me.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,m,_]}class X6 extends ve{constructor(e){super(),be(this,e,G6,Z6,ge,{})}}new X6({target:document.getElementById("app")});export{Ie as A,Yt as B,j as C,Ii as D,Se as E,Kg as F,ya as G,vu as H,Ke as I,bi as J,St as K,Zt as L,se as M,Y1 as N,Dt as O,is as P,un as Q,_n as R,ve as S,Fr as T,L as a,E as b,z as c,H as d,y as e,h as f,$ as g,v as h,be as i,De as j,re as k,sn as l,V as m,ae as n,S as o,me as p,pe as q,x as r,ge as s,I as t,J as u,pt as v,U as w,le as x,Q as y,ue as z};