(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 G(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function Yb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function r_(n){return n()}function ou(){return Object.create(null)}function Pe(n){n.forEach(r_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function Hn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Kb(n){return Object.keys(n).length===0}function a_(n,...e){if(n==null)return G;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(a_(e,t))}function Nt(n,e,t,i){if(n){const s=u_(n,e,t,i);return n[0](s)}}function u_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ca=f_?n=>requestAnimationFrame(n):G;const bs=new Set;function c_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&ca(c_)}function Fo(n){let e;return bs.size===0&&ca(c_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function d_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Jb(n){const e=b("style");return Zb(d_(n),e),e.sheet}function Zb(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function dt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function pt(n){return n===""?null:+n}function Gb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function fe(n,e){n.value=e??""}function Pr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function p_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function jt(n,e){return new n(e)}const po=new Map;let mo=0;function Xb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Qb(n,e){const t={stylesheet:Jb(e),rules:{}};return po.set(n,t),t}function rl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ `;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} }`,c=`__svelte_${Xb(f)}_${r}`,d=d_(n),{stylesheet:m,rules:h}=po.get(d)||Qb(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${s}ms 1 both`,mo+=1,c}function al(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),mo-=s,mo||xb())}function xb(){ca(()=>{mo||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function e1(n,e,t,i){if(!e)return G;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return G;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=G,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function _(){c&&(h=rl(n,0,1,o,l,r,c)),l||(m=!0)}function v(){c&&al(n,h),d=!1}return Fo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),v()),!d)return!1;if(m){const y=k-a,T=0+1*r(y/o);f(T,1-T)}return!0}),_(),f(0,1),v}function t1(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,m_(n,s)}}function m_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ul;function oi(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function Zt(n){wl().$$.on_mount.push(n)}function n1(n){wl().$$.after_update.push(n)}function h_(n){wl().$$.on_destroy.push(n)}function $t(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=p_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ze(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],se=[],oo=[],Lr=[],__=Promise.resolve();let Nr=!1;function g_(){Nr||(Nr=!0,__.then(da))}function sn(){return g_(),__}function xe(n){oo.push(n)}function ke(n){Lr.push(n)}const xo=new Set;let fs=0;function da(){if(fs!==0)return;const n=ul;do{try{for(;fs<_s.length;){const e=_s[fs];fs++,oi(e),i1(e.$$)}}catch(e){throw _s.length=0,fs=0,e}for(oi(null),_s.length=0,fs=0;se.length;)se.pop()();for(let e=0;e{Rs=null})),Rs}function Ki(n,e,t){n.dispatchEvent(p_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function re(){Jn={r:0,c:[],p:Jn}}function ae(){Jn.r||Pe(Jn.c),Jn=Jn.p}function E(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ma={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&&al(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:_=G,css:v}=s||ma;v&&(o=rl(n,0,1,m,d,h,v,a++)),_(0,1);const k=No()+d,y=k+m;r&&r.abort(),l=!0,xe(()=>Ki(n,!0,"start")),r=Fo(T=>{if(l){if(T>=y)return _(1,0),Ki(n,!0,"end"),u(),l=!1;if(T>=k){const C=h((T-k)/m);_(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),Bt(s)?(s=s(i),pa().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function v_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=G,css:m}=s||ma;m&&(o=rl(n,1,0,f,u,c,m));const h=No()+u,_=h+f;xe(()=>Ki(n,!1,"start")),Fo(v=>{if(l){if(v>=_)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?pa().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&al(n,o),l=!1)}}}function je(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&al(n,u)}function c(m,h){const _=m.b-o;return h*=Math.abs(_),{a:o,b:m.b,d:_,duration:h,start:m.start,end:m.start+h,group:m.group}}function d(m){const{delay:h=0,duration:_=300,easing:v=kl,tick:k=G,css:y}=l||ma,T={start:No()+h,b:m};m||(T.group=Jn,Jn.r+=1),r||a?a=T:(y&&(f(),u=rl(n,o,m,_,h,v,y)),m&&k(0,1),r=c(T,_),xe(()=>Ki(n,m,"start")),Fo(C=>{if(a&&C>a.start&&(r=c(a,_),a=null,Ki(n,r.b,"start"),y&&(f(),u=rl(n,o,r.b,r.duration,0,v,l.css))),r){if(C>=r.end)k(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?f():--r.group.r||Pe(r.group.c)),r=null;else if(C>=r.start){const M=C-r.start;o=r.a+r.d*v(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Bt(l)?pa().then(()=>{l=l(s),d(m)}):d(m)},end(){f(),r=a=null}}}function ru(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(re(),P(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),E(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&da()}if(Yb(n)){const s=wl();if(n.then(l=>{oi(s),i(e.then,1,e.value,l),oi(null)},l=>{if(oi(s),i(e.catch,2,e.error,l),oi(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 s1(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 es(n,e){n.d(1),e.delete(n.key)}function ln(n,e){P(n,1,1,()=>{e.delete(n.key)})}function l1(n,e){n.f(),ln(n,e)}function wt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,m=l.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const v=[],k=new Map,y=new Map;for(h=m;h--;){const $=c(s,l,h),D=t($);let A=o.get(D);A?i&&A.p($,e):(A=u(D,$),A.c()),k.set(D,v[h]=A),D in _&&y.set(D,Math.abs(h-_[D]))}const T=new Set,C=new Set;function M($){E($,1),$.m(r,f),o.set($.key,$),f=$.first,m--}for(;d&&m;){const $=v[m-1],D=n[d-1],A=$.key,I=D.key;$===D?(f=$.first,d--,m--):k.has(I)?!o.has(A)||T.has(A)?M($):C.has(I)?d--:y.get(A)>y.get(I)?(C.add(A),M($)):(T.add(I),d--):(a(D,o),d--)}for(;d--;){const $=n[d];k.has($.key)||a($,o)}for(;m;)M(v[m-1]);return v}function on(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function xn(n){return typeof n=="object"&&n!==null?n:{}}function _e(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function q(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||xe(()=>{const o=n.$$.on_mount.map(r_).filter(Bt);n.$$.on_destroy?n.$$.on_destroy.push(...o):Pe(o),n.$$.on_mount=[]}),l.forEach(xe)}function j(n,e){const t=n.$$;t.fragment!==null&&(Pe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function o1(n,e){n.$$.dirty[0]===-1&&(_s.push(n),g_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&o1(n,c)),d}):[],u.update(),f=!0,Pe(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Gb(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&E(n.$$.fragment),q(n,e.target,e.anchor,e.customElement),da()}oi(a)}class ye{$destroy(){j(this,1),this.$destroy=G}$on(e,t){if(!Bt(t))return G;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&&!Kb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Mt(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=null)}}return{set:s,update:l,subscribe:o}}function k_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return y_(t,o=>{let r=!1;const a=[];let u=0,f=G;const c=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=Bt(m)?m:G},d=s.map((m,h)=>a_(m,_=>{a[h]=_,u&=~(1<{u|=1<{j(f,1)}),ae()}l?(e=jt(l,o()),e.$on("routeEvent",r[7]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function a1(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{j(f,1)}),ae()}l?(e=jt(l,o()),e.$on("routeEvent",r[6]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function u1(n){let e,t,i,s;const l=[a1,r1],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Me()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function au(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ro=y_(null,function(e){e(au());const t=()=>{e(au())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});k_(Ro,n=>n.location);const ha=k_(Ro,n=>n.querystring),uu=Ln(void 0);async function Oi(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await sn();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 xt(n,e){if(e=cu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return fu(n,e),{update(t){t=cu(t),fu(n,t)}}}function f1(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function fu(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||c1(i.currentTarget.getAttribute("href"))})}function cu(n){return n&&typeof n=="string"?{href:n}:n||{}}function c1(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function d1(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,$){if(!$||typeof $!="function"&&(typeof $!="object"||$._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}=w_(M);this.path=M,typeof $=="object"&&$._sveltesparouter===!0?(this.component=$.component,this.conditions=$.conditions||[],this.userData=$.userData,this.props=$.props||{}):(this.component=()=>Promise.resolve($),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 I=M.match(s);if(I&&I[0])M=M.substr(I[0].length)||"/";else return null}}const $=this._pattern.exec(M);if($===null)return null;if(this._keys===!1)return $;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 c=$t();async function d(C,M){await sn(),c(C,M)}let m=null,h=null;l&&(h=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?m=C.state:m=null},window.addEventListener("popstate",h),n1(()=>{f1(m)}));let _=null,v=null;const k=Ro.subscribe(async C=>{_=C;let M=0;for(;M{uu.set(u)});return}t(0,a=null),v=null,uu.set(void 0)});h_(()=>{k(),h&&window.removeEventListener("popstate",h)});function y(C){ze.call(this,n,C)}function T(C){ze.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,y,T]}class p1 extends ye{constructor(e){super(),ve(this,e,d1,u1,he,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let S_;function T_(n){const e=n.pattern.test(S_);du(n,n.className,e),du(n,n.inactiveClassName,!e)}function du(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ro.subscribe(n=>{S_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(T_)});function qn(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"?w_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),T_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const m1="modulepreload",h1=function(n,e){return new URL(n,e).href},pu={},rt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=h1(l,i),l in pu)return;pu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":m1,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var Fr=function(n,e){return Fr=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])},Fr(n,e)};function Jt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Fr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Rr=function(){return Rr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i0&&s[s.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};var Sl=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){for(var t=0,i=Object.entries(e);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 Ti(t):new Xi(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||_1,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 Ti&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=mu(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||[]},_a=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getFullList=function(t,i){return t===void 0&&(t=200),i===void 0&&(i={}),this._getFullList(this.baseCrudPath,t,i)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),this._getList(this.baseCrudPath,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),this._getFirstListItem(this.baseCrudPath,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),this._getOne(this.baseCrudPath,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this._create(this.baseCrudPath,t,i)},e.prototype.update=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._update(this.baseCrudPath,t,i,s)},e.prototype.delete=function(t,i){return i===void 0&&(i={}),this._delete(this.baseCrudPath,t,i)},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return en(l,void 0,void 0,function(){return tn(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,m=c.totalItems;return o=o.concat(d),d.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 en(this,void 0,void 0,function(){return tn(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 en(t,void 0,void 0,function(){var l;return tn(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 fl({url:y.url,status:y.status,data:T});return[2,T]}})})}).catch(function(y){throw new fl(y)})]})})},n.prototype.getFileUrl=function(e,t,i){i===void 0&&(i={});var s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));var l=this.buildUrl(s.join("/"));if(Object.keys(i).length){var o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o"u"}function Ji(n){return typeof n=="number"}function qo(n){return typeof n=="number"&&n%1===0}function I1(n){return typeof n=="string"}function P1(n){return Object.prototype.toString.call(n)==="[object Date]"}function J_(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function L1(n){return Array.isArray(n)?n:[n]}function _u(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 N1(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Cs(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ri(n,e,t){return qo(n)&&n>=e&&n<=t}function F1(n,e){return n-e*Math.floor(n/e)}function Ot(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function _i(n){if(!(Ge(n)||n===null||n===""))return parseInt(n,10)}function Fi(n){if(!(Ge(n)||n===null||n===""))return parseFloat(n)}function ba(n){if(!(Ge(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function va(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Cl(n){return n%4===0&&(n%100!==0||n%400===0)}function xs(n){return Cl(n)?366:365}function ho(n,e){const t=F1(e-1,12)+1,i=n+(e-t)/12;return t===2?Cl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ya(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 _o(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 Vr(n){return n>99?n:n>60?1900+n:2e3+n}function Z_(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function jo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function G_(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new On(`Invalid unit value ${n}`);return e}function go(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 el(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Ot(t,2)}:${Ot(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Ot(t,2)}${Ot(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return N1(n,["hour","minute","second","millisecond"])}const X_=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,R1=["January","February","March","April","May","June","July","August","September","October","November","December"],Q_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],q1=["J","F","M","A","M","J","J","A","S","O","N","D"];function x_(n){switch(n){case"narrow":return[...q1];case"short":return[...Q_];case"long":return[...R1];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 eg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],tg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],j1=["M","T","W","T","F","S","S"];function ng(n){switch(n){case"narrow":return[...j1];case"short":return[...tg];case"long":return[...eg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ig=["AM","PM"],V1=["Before Christ","Anno Domini"],H1=["BC","AD"],z1=["B","A"];function sg(n){switch(n){case"narrow":return[...z1];case"short":return[...H1];case"long":return[...V1];default:return null}}function B1(n){return ig[n.hour<12?0:1]}function U1(n,e){return ng(e)[n.weekday-1]}function W1(n,e){return x_(e)[n.month-1]}function Y1(n,e){return sg(e)[n.year<0?0:1]}function K1(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function gu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const J1={D:jr,DD:D_,DDD:E_,DDDD:A_,t:I_,tt:P_,ttt:L_,tttt:N_,T:F_,TT:R_,TTT:q_,TTTT:j_,f:V_,ff:z_,fff:U_,ffff:Y_,F:H_,FF:B_,FFF:W_,FFFF:K_};class dn{static create(e,t={}){return new dn(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 J1[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 Ot(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?B1(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?W1(e,m):l(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?U1(e,m):l(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=dn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Y1(e,m):l({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"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 gu(dn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=dn.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 gu(l,s(r))}}class jn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class $l{get type(){throw new mi}get name(){throw new mi}get ianaName(){return this.name}get isUniversal(){throw new mi}offsetName(e,t){throw new mi}formatOffset(e,t){throw new mi}offset(e){throw new mi}equals(e){throw new mi}get isValid(){throw new mi}}let er=null;class ka extends $l{static get instance(){return er===null&&(er=new ka),er}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Z_(e,t,i)}formatOffset(e,t){return el(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function Z1(n){return uo[n]||(uo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),uo[n]}const G1={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function X1(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 Q1(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let tr=null;class nn extends $l{static get utcInstance(){return tr===null&&(tr=new nn(0)),tr}static instance(e){return e===0?nn.utcInstance:new nn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new nn(jo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${el(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${el(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return el(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class x1 extends $l{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 gi(n,e){if(Ge(n)||n===null)return e;if(n instanceof $l)return n;if(I1(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?nn.utcInstance:nn.parseSpecifier(t)||ai.create(n)}else return Ji(n)?nn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new x1(n)}let bu=()=>Date.now(),vu="system",yu=null,ku=null,wu=null,Su;class Lt{static get now(){return bu}static set now(e){bu=e}static set defaultZone(e){vu=e}static get defaultZone(){return gi(vu,ka.instance)}static get defaultLocale(){return yu}static set defaultLocale(e){yu=e}static get defaultNumberingSystem(){return ku}static set defaultNumberingSystem(e){ku=e}static get defaultOutputCalendar(){return wu}static set defaultOutputCalendar(e){wu=e}static get throwOnInvalid(){return Su}static set throwOnInvalid(e){Su=e}static resetCaches(){gt.resetCache(),ai.resetCache()}}let Tu={};function e0(n,e={}){const t=JSON.stringify([n,e]);let i=Tu[t];return i||(i=new Intl.ListFormat(n,e),Tu[t]=i),i}let Hr={};function zr(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.DateTimeFormat(n,e),Hr[t]=i),i}let Br={};function t0(n,e={}){const t=JSON.stringify([n,e]);let i=Br[t];return i||(i=new Intl.NumberFormat(n,e),Br[t]=i),i}let Ur={};function n0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Ur[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Ur[s]=l),l}let Gs=null;function i0(){return Gs||(Gs=new Intl.DateTimeFormat().resolvedOptions().locale,Gs)}function s0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=zr(n).resolvedOptions()}catch{t=zr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function l0(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=qe.utc(2016,t,1);e.push(n(i))}return e}function r0(n){const e=[];for(let t=1;t<=7;t++){const i=qe.utc(2016,11,13+t);e.push(n(i))}return e}function Vl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function a0(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 u0{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=t0(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):va(e,3);return Ot(t,this.padTo)}}}class f0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ai.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:qe.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=zr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class c0{constructor(e,t,i){this.opts={style:"long",...i},!t&&J_()&&(this.rtf=n0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):K1(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class gt{static fromOpts(e){return gt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Lt.defaultLocale,o=l||(s?"en-US":i0()),r=t||Lt.defaultNumberingSystem,a=i||Lt.defaultOutputCalendar;return new gt(o,r,a,l)}static resetCache(){Gs=null,Hr={},Br={},Ur={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return gt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=s0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=l0(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=a0(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:gt.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 Vl(this,e,i,x_,()=>{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 Vl(this,e,i,ng,()=>{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]=r0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Vl(this,void 0,e,()=>ig,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[qe.utc(2016,11,13,9),qe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Vl(this,e,t,sg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[qe.utc(-40,1,1),qe.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 u0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new f0(e,this.intl,t)}relFormatter(e={}){return new c0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return e0(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function As(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Is(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Ps(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function lg(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(h||m&&f)?-m:m;return[{years:d(Fi(t)),months:d(Fi(i)),weeks:d(Fi(s)),days:d(Fi(l)),hours:d(Fi(o)),minutes:d(Fi(r)),seconds:d(Fi(a),a==="-0"),milliseconds:d(ba(u),c)}]}const T0={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 Ta(n,e,t,i,s,l,o){const r={year:e.length===2?Vr(_i(e)):_i(e),month:Q_.indexOf(t)+1,day:_i(i),hour:_i(s),minute:_i(l)};return o&&(r.second=_i(o)),n&&(r.weekday=n.length>3?eg.indexOf(n)+1:tg.indexOf(n)+1),r}const C0=/^(?:(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 $0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Ta(e,s,i,t,l,o,r);let m;return a?m=T0[a]:u?m=0:m=jo(f,c),[d,new nn(m)]}function M0(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const O0=/^(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$/,D0=/^(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$/,E0=/^(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 Cu(n){const[,e,t,i,s,l,o,r]=n;return[Ta(e,s,i,t,l,o,r),nn.utcInstance]}function A0(n){const[,e,t,i,s,l,o,r]=n;return[Ta(e,r,t,i,s,l,o),nn.utcInstance]}const I0=As(p0,Sa),P0=As(m0,Sa),L0=As(h0,Sa),N0=As(rg),ug=Is(y0,Ls,Ml,Ol),F0=Is(_0,Ls,Ml,Ol),R0=Is(g0,Ls,Ml,Ol),q0=Is(Ls,Ml,Ol);function j0(n){return Ps(n,[I0,ug],[P0,F0],[L0,R0],[N0,q0])}function V0(n){return Ps(M0(n),[C0,$0])}function H0(n){return Ps(n,[O0,Cu],[D0,Cu],[E0,A0])}function z0(n){return Ps(n,[w0,S0])}const B0=Is(Ls);function U0(n){return Ps(n,[k0,B0])}const W0=As(b0,v0),Y0=As(ag),K0=Is(Ls,Ml,Ol);function J0(n){return Ps(n,[W0,ug],[Y0,K0])}const Z0="Invalid Duration",fg={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}},G0={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},...fg},Sn=146097/400,ds=146097/4800,X0={years:{quarters:4,months:12,weeks:Sn/7,days:Sn,hours:Sn*24,minutes:Sn*24*60,seconds:Sn*24*60*60,milliseconds:Sn*24*60*60*1e3},quarters:{months:3,weeks:Sn/28,days:Sn/4,hours:Sn*24/4,minutes:Sn*24*60/4,seconds:Sn*24*60*60/4,milliseconds:Sn*24*60*60*1e3/4},months:{weeks:ds/7,days:ds,hours:ds*24,minutes:ds*24*60,seconds:ds*24*60*60,milliseconds:ds*24*60*60*1e3},...fg},zi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Q0=zi.slice(0).reverse();function Ri(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 tt(i)}function x0(n){return n<0?Math.floor(n):Math.ceil(n)}function cg(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?x0(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function ev(n,e){Q0.reduce((t,i)=>Ge(e[i])?t:(t&&cg(n,e,t,e,i),i),null)}class tt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||gt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?X0:G0,this.isLuxonDuration=!0}static fromMillis(e,t){return tt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new On(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new tt({values:go(e,tt.normalizeUnit),loc:gt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Ji(e))return tt.fromMillis(e);if(tt.isDuration(e))return e;if(typeof e=="object")return tt.fromObject(e);throw new On(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=z0(e);return i?tt.fromObject(i,t):tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=U0(e);return i?tt.fromObject(i,t):tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new On("need to specify a reason the Duration is invalid");const i=e instanceof jn?e:new jn(e,t);if(Lt.throwOnInvalid)throw new D1(i);return new tt({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new O_(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?dn.create(this.loc,i).formatDurationFromString(this,e):Z0}toHuman(e={}){const t=zi.map(i=>{const s=this.values[i];return Ge(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+=va(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=tt.fromDurationLike(e),i={};for(const s of zi)(Cs(t.values,s)||Cs(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Ri(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=G_(e(this.values[i],i));return Ri(this,{values:t},!0)}get(e){return this[tt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...go(e,tt.normalizeUnit)};return Ri(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),Ri(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return ev(this.matrix,e),Ri(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>tt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of zi)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;Ji(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)zi.indexOf(u)>zi.indexOf(o)&&cg(this.matrix,s,u,t,o)}else Ji(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 Ri(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 Ri(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 zi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const qs="Invalid Interval";function tv(n,e){return!n||!n.isValid?vt.invalid("missing or invalid start"):!e||!e.isValid?vt.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?vt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(vt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=tt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(vt.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:vt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return vt.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(vt.fromDateTimes(t,a.time)),t=null);return vt.merge(s)}difference(...e){return vt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:qs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:qs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:qs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:qs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:qs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):tt.invalid(this.invalidReason)}mapEndpoints(e){return vt.fromDateTimes(e(this.s),e(this.e))}}class Hl{static hasDST(e=Lt.defaultZone){const t=qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ai.isValidZone(e)}static normalizeZone(e){return gi(e,Lt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||gt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||gt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||gt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||gt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return gt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return gt.create(t,null,"gregory").eras(e)}static features(){return{relative:J_()}}}function $u(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(tt.fromMillis(i).as("days"))}function nv(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=$u(r,a);return(u-u%7)/7}],["days",$u]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function iv(n,e,t,i){let[s,l,o,r]=nv(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?tt.fromMillis(a,i).shiftTo(...u).plus(f):f}const Ca={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mu={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]},sv=Ca.hanidec.replace(/[\[|\]]/g,"").split("");function lv(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 Fn({numberingSystem:n},e=""){return new RegExp(`${Ca[n||"latn"]}${e}`)}const ov="missing Intl.DateTimeFormat.formatToParts support";function it(n,e=t=>t){return{regex:n,deser:([t])=>e(lv(t))}}const rv=String.fromCharCode(160),dg=`[ ${rv}]`,pg=new RegExp(dg,"g");function av(n){return n.replace(/\./g,"\\.?").replace(pg,dg)}function Ou(n){return n.replace(/\./g,"").replace(pg," ").toLowerCase()}function Rn(n,e){return n===null?null:{regex:RegExp(n.map(av).join("|")),deser:([t])=>n.findIndex(i=>Ou(t)===Ou(i))+e}}function Du(n,e){return{regex:n,deser:([,t,i])=>jo(t,i),groups:e}}function nr(n){return{regex:n,deser:([e])=>e}}function uv(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function fv(n,e){const t=Fn(e),i=Fn(e,"{2}"),s=Fn(e,"{3}"),l=Fn(e,"{4}"),o=Fn(e,"{6}"),r=Fn(e,"{1,2}"),a=Fn(e,"{1,3}"),u=Fn(e,"{1,6}"),f=Fn(e,"{1,9}"),c=Fn(e,"{2,4}"),d=Fn(e,"{4,6}"),m=v=>({regex:RegExp(uv(v.val)),deser:([k])=>k,literal:!0}),_=(v=>{if(n.literal)return m(v);switch(v.val){case"G":return Rn(e.eras("short",!1),0);case"GG":return Rn(e.eras("long",!1),0);case"y":return it(u);case"yy":return it(c,Vr);case"yyyy":return it(l);case"yyyyy":return it(d);case"yyyyyy":return it(o);case"M":return it(r);case"MM":return it(i);case"MMM":return Rn(e.months("short",!0,!1),1);case"MMMM":return Rn(e.months("long",!0,!1),1);case"L":return it(r);case"LL":return it(i);case"LLL":return Rn(e.months("short",!1,!1),1);case"LLLL":return Rn(e.months("long",!1,!1),1);case"d":return it(r);case"dd":return it(i);case"o":return it(a);case"ooo":return it(s);case"HH":return it(i);case"H":return it(r);case"hh":return it(i);case"h":return it(r);case"mm":return it(i);case"m":return it(r);case"q":return it(r);case"qq":return it(i);case"s":return it(r);case"ss":return it(i);case"S":return it(a);case"SSS":return it(s);case"u":return nr(f);case"uu":return nr(r);case"uuu":return it(t);case"a":return Rn(e.meridiems(),0);case"kkkk":return it(l);case"kk":return it(c,Vr);case"W":return it(r);case"WW":return it(i);case"E":case"c":return it(t);case"EEE":return Rn(e.weekdays("short",!1,!1),1);case"EEEE":return Rn(e.weekdays("long",!1,!1),1);case"ccc":return Rn(e.weekdays("short",!0,!1),1);case"cccc":return Rn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Du(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Du(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return nr(/[a-z_+-/]{1,256}?/i);default:return m(v)}})(n)||{invalidReason:ov};return _.token=n,_}const cv={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 dv(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=cv[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function pv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function mv(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 hv(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 Ge(n.z)||(t=ai.create(n.z)),Ge(n.Z)||(t||(t=new nn(n.Z)),i=n.Z),Ge(n.q)||(n.M=(n.q-1)*3+1),Ge(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),Ge(n.u)||(n.S=ba(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ir=null;function _v(){return ir||(ir=qe.fromMillis(1555555555555)),ir}function gv(n,e){if(n.literal)return n;const t=dn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=dn.create(e,t).formatDateTimeParts(_v()).map(o=>dv(o,e,t));return l.includes(void 0)?n:l}function bv(n,e){return Array.prototype.concat(...n.map(t=>gv(t,e)))}function mg(n,e,t){const i=bv(dn.parseFormat(t),n),s=i.map(o=>fv(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=pv(s),a=RegExp(o,"i"),[u,f]=mv(e,a,r),[c,d,m]=f?hv(f):[null,null,void 0];if(Cs(f,"a")&&Cs(f,"H"))throw new Zs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:m}}}function vv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=mg(n,e,t);return[i,s,l,o]}const hg=[0,31,59,90,120,151,181,212,243,273,304,334],_g=[0,31,60,91,121,152,182,213,244,274,305,335];function En(n,e){return new jn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function gg(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 bg(n,e,t){return t+(Cl(n)?_g:hg)[e-1]}function vg(n,e){const t=Cl(n)?_g:hg,i=t.findIndex(l=>l_o(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function Eu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=gg(e,1,4),l=xs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=xs(r)):o>l?(r=e+1,o-=xs(e)):r=e;const{month:a,day:u}=vg(r,o);return{year:r,month:a,day:u,...Vo(n)}}function sr(n){const{year:e,month:t,day:i}=n,s=bg(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function Au(n){const{year:e,ordinal:t}=n,{month:i,day:s}=vg(e,t);return{year:e,month:i,day:s,...Vo(n)}}function yv(n){const e=qo(n.weekYear),t=ri(n.weekNumber,1,_o(n.weekYear)),i=ri(n.weekday,1,7);return e?t?i?!1:En("weekday",n.weekday):En("week",n.week):En("weekYear",n.weekYear)}function kv(n){const e=qo(n.year),t=ri(n.ordinal,1,xs(n.year));return e?t?!1:En("ordinal",n.ordinal):En("year",n.year)}function yg(n){const e=qo(n.year),t=ri(n.month,1,12),i=ri(n.day,1,ho(n.year,n.month));return e?t?i?!1:En("day",n.day):En("month",n.month):En("year",n.year)}function kg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ri(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ri(t,0,59),r=ri(i,0,59),a=ri(s,0,999);return l?o?r?a?!1:En("millisecond",s):En("second",i):En("minute",t):En("hour",e)}const lr="Invalid DateTime",Iu=864e13;function zl(n){return new jn("unsupported zone",`the zone "${n.name}" is not supported`)}function or(n){return n.weekData===null&&(n.weekData=Wr(n.c)),n.weekData}function js(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new qe({...t,...e,old:t})}function wg(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 Pu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function fo(n,e,t){return wg(ya(n),e,t)}function Lu(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,ho(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=tt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=ya(l);let[a,u]=wg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=qe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return qe.invalid(new jn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Bl(n,e,t=!0){return n.isValid?dn.create(gt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function rr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Ot(n.c.year,t?6:4),e?(i+="-",i+=Ot(n.c.month),i+="-",i+=Ot(n.c.day)):(i+=Ot(n.c.month),i+=Ot(n.c.day)),i}function Nu(n,e,t,i,s,l){let o=Ot(n.c.hour);return e?(o+=":",o+=Ot(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ot(n.c.minute),(n.c.second!==0||!t)&&(o+=Ot(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ot(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Ot(Math.trunc(-n.o/60)),o+=":",o+=Ot(Math.trunc(-n.o%60))):(o+="+",o+=Ot(Math.trunc(n.o/60)),o+=":",o+=Ot(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Sg={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},wv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Sv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Tg=["year","month","day","hour","minute","second","millisecond"],Tv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cv=["year","ordinal","hour","minute","second","millisecond"];function Fu(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 O_(n);return e}function Ru(n,e){const t=gi(e.zone,Lt.defaultZone),i=gt.fromObject(e),s=Lt.now();let l,o;if(Ge(n.year))l=s;else{for(const u of Tg)Ge(n[u])&&(n[u]=Sg[u]);const r=yg(n)||kg(n);if(r)return qe.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new qe({ts:l,zone:t,loc:i,o})}function qu(n,e,t){const i=Ge(t.round)?!0:t.round,s=(o,r)=>(o=va(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 ju(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 qe{constructor(e){const t=e.zone||Lt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new jn("invalid input"):null)||(t.isValid?null:zl(t));this.ts=Ge(e.ts)?Lt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Pu(this.ts,r),i=Number.isNaN(s.year)?new jn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||gt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new qe({})}static local(){const[e,t]=ju(arguments),[i,s,l,o,r,a,u]=t;return Ru({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=ju(arguments),[i,s,l,o,r,a,u]=t;return e.zone=nn.utcInstance,Ru({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=P1(e)?e.valueOf():NaN;if(Number.isNaN(i))return qe.invalid("invalid input");const s=gi(t.zone,Lt.defaultZone);return s.isValid?new qe({ts:i,zone:s,loc:gt.fromObject(t)}):qe.invalid(zl(s))}static fromMillis(e,t={}){if(Ji(e))return e<-Iu||e>Iu?qe.invalid("Timestamp out of range"):new qe({ts:e,zone:gi(t.zone,Lt.defaultZone),loc:gt.fromObject(t)});throw new On(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ji(e))return new qe({ts:e*1e3,zone:gi(t.zone,Lt.defaultZone),loc:gt.fromObject(t)});throw new On("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=gi(t.zone,Lt.defaultZone);if(!i.isValid)return qe.invalid(zl(i));const s=Lt.now(),l=Ge(t.specificOffset)?i.offset(s):t.specificOffset,o=go(e,Fu),r=!Ge(o.ordinal),a=!Ge(o.year),u=!Ge(o.month)||!Ge(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=gt.fromObject(t);if((f||r)&&c)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Zs("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let h,_,v=Pu(s,l);m?(h=Tv,_=wv,v=Wr(v)):r?(h=Cv,_=Sv,v=sr(v)):(h=Tg,_=Sg);let k=!1;for(const A of h){const I=o[A];Ge(I)?k?o[A]=_[A]:o[A]=v[A]:k=!0}const y=m?yv(o):r?kv(o):yg(o),T=y||kg(o);if(T)return qe.invalid(T);const C=m?Eu(o):r?Au(o):o,[M,$]=fo(C,l,i),D=new qe({ts:M,zone:i,o:$,loc:d});return o.weekday&&f&&e.weekday!==D.weekday?qe.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]=j0(e);return Vs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=V0(e);return Vs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=H0(e);return Vs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ge(e)||Ge(t))throw new On("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=gt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=vv(o,e,t);return f?qe.invalid(f):Vs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=J0(e);return Vs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new On("need to specify a reason the DateTime is invalid");const i=e instanceof jn?e:new jn(e,t);if(Lt.throwOnInvalid)throw new M1(i);return new qe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?or(this).weekYear:NaN}get weekNumber(){return this.isValid?or(this).weekNumber:NaN}get weekday(){return this.isValid?or(this).weekday:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Hl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Hl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Hl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Hl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Cl(this.year)}get daysInMonth(){return ho(this.year,this.month)}get daysInYear(){return this.isValid?xs(this.year):NaN}get weeksInWeekYear(){return this.isValid?_o(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=dn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(nn.instance(e),t)}toLocal(){return this.setZone(Lt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=gi(e,Lt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=fo(o,l,e)}return js(this,{ts:s,zone:e})}else return qe.invalid(zl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return js(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=go(e,Fu),i=!Ge(t.weekYear)||!Ge(t.weekNumber)||!Ge(t.weekday),s=!Ge(t.ordinal),l=!Ge(t.year),o=!Ge(t.month)||!Ge(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Zs("Can't mix ordinal dates with month/day");let u;i?u=Eu({...Wr(this.c),...t}):Ge(t.ordinal)?(u={...this.toObject(),...t},Ge(t.day)&&(u.day=Math.min(ho(u.year,u.month),u.day))):u=Au({...sr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return js(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e);return js(this,Lu(this,t))}minus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e).negate();return js(this,Lu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=tt.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?dn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):lr}toLocaleString(e=jr,t={}){return this.isValid?dn.create(this.loc.clone(t),e).formatDateTime(this):lr}toLocaleParts(e={}){return this.isValid?dn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=rr(this,o);return r+="T",r+=Nu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?rr(this,e==="extended"):null}toISOWeekDate(){return Bl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Nu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Bl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Bl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Bl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():lr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return tt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=L1(t).map(tt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=iv(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(qe.now(),e,t)}until(e){return this.isValid?vt.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||qe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(qe.isDateTime))throw new On("max requires all arguments be DateTimes");return _u(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=gt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return mg(o,e,t)}static fromStringExplain(e,t,i={}){return qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return jr}static get DATE_MED(){return D_}static get DATE_MED_WITH_WEEKDAY(){return E1}static get DATE_FULL(){return E_}static get DATE_HUGE(){return A_}static get TIME_SIMPLE(){return I_}static get TIME_WITH_SECONDS(){return P_}static get TIME_WITH_SHORT_OFFSET(){return L_}static get TIME_WITH_LONG_OFFSET(){return N_}static get TIME_24_SIMPLE(){return F_}static get TIME_24_WITH_SECONDS(){return R_}static get TIME_24_WITH_SHORT_OFFSET(){return q_}static get TIME_24_WITH_LONG_OFFSET(){return j_}static get DATETIME_SHORT(){return V_}static get DATETIME_SHORT_WITH_SECONDS(){return H_}static get DATETIME_MED(){return z_}static get DATETIME_MED_WITH_SECONDS(){return B_}static get DATETIME_MED_WITH_WEEKDAY(){return A1}static get DATETIME_FULL(){return U_}static get DATETIME_FULL_WITH_SECONDS(){return W_}static get DATETIME_HUGE(){return Y_}static get DATETIME_HUGE_WITH_SECONDS(){return K_}}function Hs(n){if(qe.isDateTime(n))return n;if(n&&n.valueOf&&Ji(n.valueOf()))return qe.fromJSDate(n);if(n&&typeof n=="object")return qe.fromObject(n);throw new On(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const $v=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Mv=[".mp4",".avi",".mov",".3gp",".wmv"],Ov=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Dv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class H{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||H.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 H.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!H.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!H.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){H.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]=H.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(!H.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)(!H.isObject(l)&&!Array.isArray(l)||!H.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)(!H.isObject(s)&&!Array.isArray(s)||!H.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):H.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||H.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||H.isObject(e)&&Object.keys(e).length>0)&&H.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 qe.fromFormat(e,i,{zone:"UTC"})}return qe.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return H.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return H.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!!$v.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Mv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Ov.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Dv.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return H.hasImageExtension(e)?"image":H.hasDocumentExtension(e)?"document":H.hasVideoExtension(e)?"video":H.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(H.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)H.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):H.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,c,d;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)||H.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)||H.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 h=null;m.type==="number"?h=123:m.type==="date"?h="2022-01-01 10:00:00.123Z":m.type==="bool"?h=!0:m.type==="email"?h="test@example.com":m.type==="url"?h="https://example.com":m.type==="json"?h="JSON":m.type==="file"?(h="filename.jpg",((a=m.options)==null?void 0:a.maxSelect)!==1&&(h=[h])):m.type==="select"?(h=(f=(u=m.options)==null?void 0:u.values)==null?void 0:f[0],((c=m.options)==null?void 0:c.maxSelect)!==1&&(h=[h])):m.type==="relation"?(h="RELATION_RECORD_ID",((d=m.options)==null?void 0:d.maxSelect)!==1&&(h=[h])):h="test",i[m.name]=h}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)&&!H.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!H.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=H.isObject(u)&&H.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const l of e)l.type==="auth"?t.push(l):l.type==="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],c=u.create(a,o,f);u.add(c),e(c.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"||(H.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?H.plainText(r):r,s.push(H.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(!H.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 H.extractColumnsFromQuery(e.options.query))H.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)H.pushUnique(i,t+l.name);return i}}const Ho=Ln([]);function Cg(n,e=4e3){return zo(n,"info",e)}function zt(n,e=3e3){return zo(n,"success",e)}function cl(n,e=4500){return zo(n,"error",e)}function Ev(n,e=4500){return zo(n,"warning",e)}function zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{$g(i)},t)};Ho.update(s=>(Ma(s,i.message),H.pushOrReplaceByKey(s,i,"message"),s))}function $g(n){Ho.update(e=>(Ma(e,n),e))}function $a(){Ho.update(n=>{for(let e of n)Ma(n,e);return[]})}function Ma(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const fi=Ln({});function Bn(n){fi.set(n||{})}function Qi(n){fi.update(e=>(H.deleteByPath(e,n),e))}const Oa=Ln({});function Yr(n){Oa.set(n||{})}ga.prototype.logout=function(n=!0){this.authStore.clear(),n&&Oi("/login")};ga.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&cl(l)}if(H.isEmpty(s.data)||Bn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Oi("/")};class Av extends $_{save(e,t){super.save(e,t),t instanceof Xi&&Yr(t)}clear(){super.clear(),Yr(null)}}const pe=new ga("../",new Av("pb_admin_auth"));pe.authStore.model instanceof Xi&&Yr(pe.authStore.model);function Iv(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=n[3].default,h=Nt(m,n,n[2],null);return{c(){e=b("div"),t=b("main"),h&&h.c(),i=O(),s=b("footer"),l=b("a"),l.innerHTML='Docs',o=O(),r=b("span"),r.textContent="|",a=O(),u=b("a"),f=b("span"),f.textContent="PocketBase v0.13.1",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(_,v){S(_,e,v),g(e,t),h&&h.m(t,null),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(u,f),d=!0},p(_,[v]){h&&h.p&&(!d||v&4)&&Rt(h,m,_,_[2],d?Ft(m,_[2],v,null):qt(_[2]),null),(!d||v&2&&c!==(c="page-wrapper "+_[1]))&&p(e,"class",c),(!d||v&3)&&Q(e,"center-content",_[0])},i(_){d||(E(h,_),d=!0)},o(_){P(h,_),d=!1},d(_){_&&w(e),h&&h.d(_)}}}function Pv(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 wn extends ye{constructor(e){super(),ve(this,e,Pv,Iv,he,{center:0,class:1})}}function Vu(n){let e,t,i;return{c(){e=b("div"),e.innerHTML=``,t=O(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function Lv(n){let e,t,i,s=!n[0]&&Vu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=O(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Vu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):qt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Nv(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[Lv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Fv(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 Mg extends ye{constructor(e){super(),ve(this,e,Fv,Nv,he,{nobranding:0})}}function Hu(n,e,t){const i=n.slice();return i[11]=e[t],i}const Rv=n=>({}),zu=n=>({uniqueId:n[3]});function qv(n){let e=(n[11]||bo)+"",t;return{c(){t=B(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||bo)+"")&&le(t,e)},d(i){i&&w(t)}}}function jv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||bo)+"",i;return{c(){e=b("pre"),i=B(t)},m(o,r){S(o,e,r),g(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||bo)+"")&&le(i,t)},d(o){o&&w(e)}}}function Bu(n){let e,t;function i(o,r){return typeof o[11]=="object"?jv:qv}let s=i(n),l=s(n);return{c(){e=b("div"),l.c(),t=O(),p(e,"class","help-block help-block-error")},m(o,r){S(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function Vv(n){let e,t,i,s,l;const o=n[8].default,r=Nt(o,n,n[7],zu);let a=n[2],u=[];for(let f=0;ft(6,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Qi(r)}Zt(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){ze.call(this,n,h)}function m(h){se[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(7,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&80&&t(2,f=H.toArray(H.getNestedVal(i,r)))},[a,u,f,o,r,c,i,l,s,d,m]}class me extends ye{constructor(e){super(),ve(this,e,Hv,Vv,he,{name:4,class:0,changed:5})}get changed(){return this.$$.ctx[5]}}function zv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Email"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Bv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=B("Password"),s=O(),l=b("input"),r=O(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),fe(l,n[1]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&fe(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function Uv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Password confirm"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&fe(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Wv(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new me({props:{class:"form-field required",name:"email",$$slots:{default:[zv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[Bv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Uv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),f=b("button"),f.innerHTML=`Create and login `,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){S(h,e,_),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),q(a,e,null),g(e,u),g(e,f),c=!0,d||(m=Y(e,"submit",dt(n[4])),d=!0)},p(h,[_]){const v={};_&1537&&(v.$$scope={dirty:_,ctx:h}),s.$set(v);const k={};_&1538&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&1540&&(y.$$scope={dirty:_,ctx:h}),a.$set(y),(!c||_&8)&&Q(f,"btn-disabled",h[3]),(!c||_&8)&&Q(f,"btn-loading",h[3])},i(h){c||(E(s.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,m()}}}function Yv(n,e,t){const i=$t();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await pe.admins.create({email:s,password:l,passwordConfirm:o}),await pe.admins.authWithPassword(s,l),i("submit")}catch(d){pe.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class Kv extends ye{constructor(e){super(),ve(this,e,Yv,Wv,he,{})}}function Uu(n){let e,t;return e=new Mg({props:{$$slots:{default:[Jv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Jv(n){let e,t;return e=new Kv({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:G,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Zv(n){let e,t,i=n[0]&&Uu(n);return{c(){i&&i.c(),e=Me()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&E(i,1)):(i=Uu(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Gv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){pe.logout(!1),t(0,i=!0);return}pe.authStore.isValid?Oi("/collections"):pe.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class Xv extends ye{constructor(e){super(),ve(this,e,Gv,Zv,he,{})}}const St=Ln(""),vo=Ln(""),$s=Ln(!1);function Bo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function An(n,{delay:e=0,duration:t=400,easing:i=Bo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px); opacity: ${a-f*d}`}}function At(n,{delay:e=0,duration:t=400,easing:i=Bo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Bo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} `}}function Qv(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),fe(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&fe(e,l[7])},i:G,o:G,d(l){l&&w(e),n[13](null),i=!1,s()}}}function xv(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=jt(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Me()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),o!==(o=a[4])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Wu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Yu();return{c(){r&&r.c(),e=O(),t=b("button"),t.innerHTML='Clear',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&E(r,1):(r=Yu(),r.c(),E(r,1),r.m(e.parentNode,e)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){s||(E(r),a&&xe(()=>{i||(i=je(t,An,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=je(t,An,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Yu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,An,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,An,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function ey(n){let e,t,i,s,l,o,r,a,u,f;const c=[xv,Qv],d=[];function m(_,v){return _[4]&&!_[5]?0:1}l=m(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&Wu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=O(),o.c(),r=O(),h&&h.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(_,v){S(_,e,v),g(e,t),g(t,i),g(e,s),d[l].m(e,null),g(e,r),h&&h.m(e,null),a=!0,u||(f=[Y(e,"click",kn(n[11])),Y(e,"submit",dt(n[10]))],u=!0)},p(_,[v]){let k=l;l=m(_),l===k?d[l].p(_,v):(re(),P(d[k],1,1,()=>{d[k]=null}),ae(),o=d[l],o?o.p(_,v):(o=d[l]=c[l](_),o.c()),E(o,1),o.m(e,r)),_[0].length||_[7].length?h?(h.p(_,v),v&129&&E(h,1)):(h=Wu(_),h.c(),E(h,1),h.m(e,null)):h&&(re(),P(h,1,1,()=>{h=null}),ae())},i(_){a||(E(o),E(h),a=!0)},o(_){P(o),P(h),a=!1},d(_){_&&w(e),d[l].d(),h&&h.d(),u=!1,Pe(f)}}}function ty(n,e,t){const i=$t(),s="search_"+H.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new pn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function h(){t(0,l=d),i("submit",l)}async function _(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-179cf2f2.js"),["./FilterAutocompleteInput-179cf2f2.js","./index-a6ccb683.js"],import.meta.url)).default),t(5,f=!1))}Zt(()=>{_()});function v(M){ze.call(this,n,M)}function k(M){d=M,t(7,d),t(0,l)}function y(M){se[M?"unshift":"push"](()=>{c=M,t(6,c)})}function T(){d=this.value,t(7,d),t(0,l)}const C=()=>{m(!1),h()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,h,v,k,y,T,C]}class Uo extends ye{constructor(e){super(),ve(this,e,ty,ey,he,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Kr,qi;const Jr="app-tooltip";function Ku(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function ki(){return qi=qi||document.querySelector("."+Jr),qi||(qi=document.createElement("div"),qi.classList.add(Jr),document.body.appendChild(qi)),qi}function Og(n,e){let t=ki();if(!t.classList.contains("active")||!(e!=null&&e.text)){Zr();return}t.textContent=e.text,t.className=Jr+" 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 Zr(){clearTimeout(Kr),ki().classList.remove("active"),ki().activeNode=void 0}function ny(n,e){ki().activeNode=n,clearTimeout(Kr),Kr=setTimeout(()=>{ki().classList.add("active"),Og(n,e)},isNaN(e.delay)?0:e.delay)}function Ue(n,e){let t=Ku(e);function i(){ny(n,t)}function s(){Zr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&H.isFocusable(n))&&n.addEventListener("click",s),ki(),{update(l){var o,r;t=Ku(l),(r=(o=ki())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Og(n,t)},destroy(){var l,o;(o=(l=ki())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Zr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function iy(n){let e,t,i,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class","btn btn-transparent btn-circle svelte-1bvelc2"),Q(e,"refreshing",n[1])},m(l,o){S(l,e,o),i||(s=[Ie(t=Ue.call(null,e,n[0])),Y(e,"click",n[2])],i=!0)},p(l,[o]){t&&Bt(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&Q(e,"refreshing",l[1])},i:G,o:G,d(l){l&&w(e),i=!1,Pe(s)}}}function sy(n,e,t){const i=$t();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 Da extends ye{constructor(e){super(),ve(this,e,sy,iy,he,{tooltip:0})}}function ly(n){let e,t,i,s,l;const o=n[6].default,r=Nt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){S(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Rt(r,o,a,a[5],i?Ft(o,a[5],u,null):qt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,Pe(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(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class Wt extends ye{constructor(e){super(),ve(this,e,oy,ly,he,{class:1,name:2,sort:0,disable:3})}}function ry(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function ay(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("div"),i=B(n[2]),s=O(),l=b("div"),o=B(n[1]),r=B(" UTC"),p(t,"class","date"),p(l,"class","time svelte-zdiknu"),p(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(e,s),g(e,l),g(l,o),g(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&w(e)}}}function uy(n){let e;function t(l,o){return l[0]?ay:ry}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function fy(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 ui extends ye{constructor(e){super(),ve(this,e,fy,uy,he,{date:0})}}const cy=n=>({}),Ju=n=>({}),dy=n=>({}),Zu=n=>({});function py(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Nt(u,n,n[4],Zu),c=n[5].default,d=Nt(c,n,n[4],null),m=n[5].after,h=Nt(m,n,n[4],Ju);return{c(){e=b("div"),f&&f.c(),t=O(),i=b("div"),d&&d.c(),l=O(),h&&h.c(),p(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),p(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(_,v){S(_,e,v),f&&f.m(e,null),g(e,t),g(e,i),d&&d.m(i,null),n[6](i),g(e,l),h&&h.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(_,[v]){f&&f.p&&(!o||v&16)&&Rt(f,u,_,_[4],o?Ft(u,_[4],v,dy):qt(_[4]),Zu),d&&d.p&&(!o||v&16)&&Rt(d,c,_,_[4],o?Ft(c,_[4],v,null):qt(_[4]),null),(!o||v&9&&s!==(s="horizontal-scroller "+_[0]+" "+_[3]+" svelte-wc2j9h"))&&p(i,"class",s),h&&h.p&&(!o||v&16)&&Rt(h,m,_,_[4],o?Ft(m,_[4],v,cy):qt(_[4]),Ju)},i(_){o||(E(f,_),E(d,_),E(h,_),o=!0)},o(_){P(f,_),P(d,_),P(h,_),o=!1},d(_){_&&w(e),f&&f.d(_),d&&d.d(_),n[6](null),h&&h.d(_),r=!1,Pe(a)}}}function my(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,u;function f(){o&&(clearTimeout(a),a=setTimeout(()=>{const d=o.offsetWidth,m=o.scrollWidth;m-d?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+d==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 c(d){se[d?"unshift":"push"](()=>{o=d,t(2,o)})}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"$$scope"in d&&t(4,s=d.$$scope)},[l,f,o,r,s,i,c]}class Ea extends ye{constructor(e){super(),ve(this,e,my,py,he,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function Gu(n,e,t){const i=n.slice();return i[23]=e[t],i}function hy(n){let e;return{c(){e=b("div"),e.innerHTML=` method`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function _y(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="url",p(t,"class",H.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function gy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="referer",p(t,"class",H.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function by(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="User IP",p(t,"class",H.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function vy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="status",p(t,"class",H.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function yy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Xu(n){let e;function t(l,o){return l[6]?wy:ky}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function ky(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Qu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Qu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function wy(n){let e;return{c(){e=b("tr"),e.innerHTML=` `},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Qu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function xu(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ef(n,e){var Se,We,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,h,_,v,k,y=(e[23].referer||"N/A")+"",T,C,M,$,D,A=(e[23].userIp||"N/A")+"",I,L,N,F,R,K=e[23].status+"",x,U,X,ne,J,ue,Z,de,ge,Ce,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&xu();ne=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function be(...ce){return e[18](e[23],...ce)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("span"),o=B(l),a=O(),u=b("td"),f=b("span"),d=B(c),h=O(),Ne&&Ne.c(),_=O(),v=b("td"),k=b("span"),T=B(y),M=O(),$=b("td"),D=b("span"),I=B(A),N=O(),F=b("td"),R=b("span"),x=B(K),U=O(),X=b("td"),V(ne.$$.fragment),J=O(),ue=b("td"),ue.innerHTML='',Z=O(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(k,"class","txt txt-ellipsis"),p(k,"title",C=e[23].referer),Q(k,"txt-hint",!e[23].referer),p(v,"class","col-type-text col-field-referer"),p(D,"class","txt txt-ellipsis"),p(D,"title",L=e[23].userIp),Q(D,"txt-hint",!e[23].userIp),p($,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(ue,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ce,He){S(ce,t,He),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,h),Ne&&Ne.m(u,null),g(t,_),g(t,v),g(v,k),g(k,T),g(t,M),g(t,$),g($,D),g(D,I),g(t,N),g(t,F),g(F,R),g(R,x),g(t,U),g(t,X),q(ne,X,null),g(t,J),g(t,ue),g(t,Z),de=!0,ge||(Ce=[Y(t,"click",Re),Y(t,"keydown",be)],ge=!0)},p(ce,He){var Fe,ot,Vt;e=ce,(!de||He&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||He&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!de||He&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||He&8&&m!==(m=e[23].url))&&p(f,"title",m),(ot=e[23].meta)!=null&&ot.errorMessage||(Vt=e[23].meta)!=null&&Vt.errorData?Ne||(Ne=xu(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||He&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le(T,y),(!de||He&8&&C!==(C=e[23].referer))&&p(k,"title",C),(!de||He&8)&&Q(k,"txt-hint",!e[23].referer),(!de||He&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&le(I,A),(!de||He&8&&L!==(L=e[23].userIp))&&p(D,"title",L),(!de||He&8)&&Q(D,"txt-hint",!e[23].userIp),(!de||He&8)&&K!==(K=e[23].status+"")&&le(x,K),(!de||He&8)&&Q(R,"label-danger",e[23].status>=400);const te={};He&8&&(te.date=e[23].created),ne.$set(te)},i(ce){de||(E(ne.$$.fragment,ce),de=!0)},o(ce){P(ne.$$.fragment,ce),de=!1},d(ce){ce&&w(t),Ne&&Ne.d(),j(ne),ge=!1,Pe(Ce)}}}function Sy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I=[],L=new Map,N;function F(be){n[11](be)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[hy]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),se.push(()=>_e(s,"sort",F));function K(be){n[12](be)}let x={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[_y]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),r=new Wt({props:x}),se.push(()=>_e(r,"sort",K));function U(be){n[13](be)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[gy]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new Wt({props:X}),se.push(()=>_e(f,"sort",U));function ne(be){n[14](be)}let J={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[by]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),m=new Wt({props:J}),se.push(()=>_e(m,"sort",ne));function ue(be){n[15](be)}let Z={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[vy]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),v=new Wt({props:Z}),se.push(()=>_e(v,"sort",ue));function de(be){n[16](be)}let ge={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[yy]},$$scope:{ctx:n}};n[1]!==void 0&&(ge.sort=n[1]),T=new Wt({props:ge}),se.push(()=>_e(T,"sort",de));let Ce=n[3];const Ne=be=>be[23].id;for(let be=0;bel=!1)),s.$set(We);const lt={};Se&67108864&&(lt.$$scope={dirty:Se,ctx:be}),!a&&Se&2&&(a=!0,lt.sort=be[1],ke(()=>a=!1)),r.$set(lt);const ce={};Se&67108864&&(ce.$$scope={dirty:Se,ctx:be}),!c&&Se&2&&(c=!0,ce.sort=be[1],ke(()=>c=!1)),f.$set(ce);const He={};Se&67108864&&(He.$$scope={dirty:Se,ctx:be}),!h&&Se&2&&(h=!0,He.sort=be[1],ke(()=>h=!1)),m.$set(He);const te={};Se&67108864&&(te.$$scope={dirty:Se,ctx:be}),!k&&Se&2&&(k=!0,te.sort=be[1],ke(()=>k=!1)),v.$set(te);const Fe={};Se&67108864&&(Fe.$$scope={dirty:Se,ctx:be}),!C&&Se&2&&(C=!0,Fe.sort=be[1],ke(()=>C=!1)),T.$set(Fe),Se&841&&(Ce=be[3],re(),I=wt(I,Se,Ne,1,be,Ce,L,A,ln,ef,null,Gu),ae(),!Ce.length&&Re?Re.p(be,Se):Ce.length?Re&&(Re.d(1),Re=null):(Re=Xu(be),Re.c(),Re.m(A,null))),(!N||Se&64)&&Q(e,"table-loading",be[6])},i(be){if(!N){E(s.$$.fragment,be),E(r.$$.fragment,be),E(f.$$.fragment,be),E(m.$$.fragment,be),E(v.$$.fragment,be),E(T.$$.fragment,be);for(let Se=0;Se{if(L<=1&&_(),t(6,d=!1),t(5,f=F.page),t(4,c=F.totalItems),s("load",u.concat(F.items)),N){const R=++m;for(;F.items.length&&m==R;)t(3,u=u.concat(F.items.splice(0,10))),await H.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),_(),pe.errorResponseHandler(F,!1))})}function _(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(L){a=L,t(1,a)}function k(L){a=L,t(1,a)}function y(L){a=L,t(1,a)}function T(L){a=L,t(1,a)}function C(L){a=L,t(1,a)}function M(L){a=L,t(1,a)}const $=L=>s("select",L),D=(L,N)=>{N.code==="Enter"&&(N.preventDefault(),s("select",L))},A=()=>t(0,o=""),I=()=>h(f+1);return n.$$set=L=>{"filter"in L&&t(0,o=L.filter),"presets"in L&&t(10,r=L.presets),"sort"in L&&t(1,a=L.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(_(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,v,k,y,T,C,M,$,D,A,I]}class $y extends ye{constructor(e){super(),ve(this,e,Cy,Ty,he,{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 ni(){}const My=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function _t(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 Ke(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Ct=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Cn(n,e){return Ct(n)?n:e}function Xe(n,e){return typeof n>"u"?e:n}const Oy=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Dg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ut(n,e,t,i){let s,l,o;if(_t(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 Ci(n,e){return(sf[e]||(sf[e]=Ay(e)))(n)}function Ay(n){const e=Iy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Iy(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 Aa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const In=n=>typeof n<"u",$i=n=>typeof n=="function",lf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Py(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,ct=2*Tt,Ly=ct+Tt,So=Number.POSITIVE_INFINITY,Ny=Tt/180,kt=Tt/2,zs=Tt/4,of=Tt*2/3,Dn=Math.log10,Gn=Math.sign;function rf(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Dn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Fy(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)=n}function Ag(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 Pa(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 Yi=(n,e,t,i)=>Pa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]Pa(n,t,i=>n[i][e]>=t);function Hy(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Aa(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 uf(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)&&(Pg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Lg(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function Fg(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,Ng.call(window,()=>{s=!1,n.apply(e,l)}))}}function By(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Uy=n=>n==="start"?"left":n==="end"?"right":"center",ff=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Rg(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=Yt(Math.min(Yi(r,o.axis,u).lo,t?i:Yi(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=Yt(Math.max(Yi(r,o.axis,f,!0).hi+1,t?0:Yi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function qg(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Ul=n=>n===0||n===1,cf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ct/t)),df=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ct/t)+1,il={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*kt)+1,easeOutSine:n=>Math.sin(n*kt),easeInOutSine:n=>-.5*(Math.cos(Tt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ul(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ul(n)?n:cf(n,.075,.3),easeOutElastic:n=>Ul(n)?n:df(n,.075,.3),easeInOutElastic(n){return Ul(n)?n:n<.5?.5*cf(n*2,.1125,.45):.5+.5*df(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-il.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?il.easeInBounce(n*2)*.5:il.easeOutBounce(n*2-1)*.5+.5};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License */function Dl(n){return n+.5|0}const bi=(n,e,t)=>Math.max(Math.min(n,t),e);function Xs(n){return bi(Dl(n*2.55),0,255)}function wi(n){return bi(Dl(n*255),0,255)}function li(n){return bi(Dl(n/2.55)/100,0,1)}function pf(n){return bi(Dl(n*100),0,100)}const Tn={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},Xr=[..."0123456789ABCDEF"],Wy=n=>Xr[n&15],Yy=n=>Xr[(n&240)>>4]+Xr[n&15],Wl=n=>(n&240)>>4===(n&15),Ky=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function Jy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Tn[n[1]]*17,g:255&Tn[n[2]]*17,b:255&Tn[n[3]]*17,a:e===5?Tn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Tn[n[1]]<<4|Tn[n[2]],g:Tn[n[3]]<<4|Tn[n[4]],b:Tn[n[5]]<<4|Tn[n[6]],a:e===9?Tn[n[7]]<<4|Tn[n[8]]:255})),t}const Zy=(n,e)=>n<255?e(n):"";function Gy(n){var e=Ky(n)?Wy:Yy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Zy(n.a,e):void 0}const Xy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function jg(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 Qy(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 xy(n,e,t){const i=jg(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 e2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=e2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Na(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(wi)}function Fa(n,e,t){return Na(jg,n,e,t)}function t2(n,e,t){return Na(xy,n,e,t)}function n2(n,e,t){return Na(Qy,n,e,t)}function Vg(n){return(n%360+360)%360}function i2(n){const e=Xy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):wi(+e[5]));const s=Vg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=t2(s,l,o):e[1]==="hsv"?i=n2(s,l,o):i=Fa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function s2(n,e){var t=La(n);t[0]=Vg(t[0]+e),t=Fa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function l2(n){if(!n)return;const e=La(n),t=e[0],i=pf(e[1]),s=pf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const mf={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"},hf={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(hf),t=Object.keys(mf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Yl;function r2(n){Yl||(Yl=o2(),Yl.transparent=[0,0,0,0]);const e=Yl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const a2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function u2(n){const e=a2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Xs(o):bi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Xs(i):bi(i,0,255)),s=255&(e[4]?Xs(s):bi(s,0,255)),l=255&(e[6]?Xs(l):bi(l,0,255)),{r:i,g:s,b:l,a:t}}}function f2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${li(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ar=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ps=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function c2(n,e,t){const i=ps(li(n.r)),s=ps(li(n.g)),l=ps(li(n.b));return{r:wi(ar(i+t*(ps(li(e.r))-i))),g:wi(ar(s+t*(ps(li(e.g))-s))),b:wi(ar(l+t*(ps(li(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Kl(n,e,t){if(n){let i=La(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Fa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Hg(n,e){return n&&Object.assign(e||{},n)}function _f(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=wi(n[3]))):(e=Hg(n,{r:0,g:0,b:0,a:1}),e.a=wi(e.a)),e}function d2(n){return n.charAt(0)==="r"?u2(n):i2(n)}class To{constructor(e){if(e instanceof To)return e;const t=typeof e;let i;t==="object"?i=_f(e):t==="string"&&(i=Jy(e)||r2(e)||d2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Hg(this._rgb);return e&&(e.a=li(e.a)),e}set rgb(e){this._rgb=_f(e)}rgbString(){return this._valid?f2(this._rgb):void 0}hexString(){return this._valid?Gy(this._rgb):void 0}hslString(){return this._valid?l2(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=c2(this._rgb,e._rgb,t)),this}clone(){return new To(this.rgb)}alpha(e){return this._rgb.a=wi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Dl(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Kl(this._rgb,2,e),this}darken(e){return Kl(this._rgb,2,-e),this}saturate(e){return Kl(this._rgb,1,e),this}desaturate(e){return Kl(this._rgb,1,-e),this}rotate(e){return s2(this._rgb,e),this}}function zg(n){return new To(n)}function Bg(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function gf(n){return Bg(n)?n:zg(n)}function ur(n){return Bg(n)?n:zg(n).saturate(.5).darken(.1).hexString()}const xi=Object.create(null),Qr=Object.create(null);function sl(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)=>ur(i.backgroundColor),this.hoverBorderColor=(t,i)=>ur(i.borderColor),this.hoverColor=(t,i)=>ur(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return fr(this,e,t)}get(e){return sl(this,e)}describe(e,t){return fr(Qr,e,t)}override(e,t){return fr(xi,e,t)}route(e,t,i,s){const l=sl(this,e),o=sl(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return Ke(a)?Object.assign({},u,a):Xe(a,u)},set(a){this[r]=a}}})}}var Qe=new p2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function m2(n){return!n||at(n.size)||at(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Co(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function h2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function hl(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,v2(n,l),a=0;a+n||0;function ja(n,e){const t={},i=Ke(e),s=i?Object.keys(e):e,l=Ke(n)?i?o=>Xe(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=T2(l(o));return t}function Ug(n){return ja(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return ja(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Pn(n){const e=Ug(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function vn(n,e){n=n||{},e=e||Qe.font;let t=Xe(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Xe(n.style,e.style);i&&!(""+i).match(w2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:Xe(n.family,e.family),lineHeight:S2(Xe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Xe(n.weight,e.weight),string:""};return s.string=m2(s),s}function Jl(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 Di(n,e){return Object.assign(Object.create(n),e)}function Va(n,e=[""],t=n,i,s=()=>n[0]){In(i)||(i=Jg("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Va([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 Yg(o,r,()=>P2(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return yf(o).includes(r)},ownKeys(o){return yf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Os(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Wg(n,i),setContext:l=>Os(n,l,t,i),override:l=>Os(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 Yg(l,o,()=>M2(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 Wg(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:$i(t)?t:()=>t,isIndexable:$i(i)?i:()=>i}}const $2=(n,e)=>n?n+Aa(e):e,Ha=(n,e)=>Ke(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Yg(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function M2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return $i(r)&&o.isScriptable(e)&&(r=O2(e,r,n,t)),_t(r)&&r.length&&(r=D2(e,r,n,o.isIndexable)),Ha(e,r)&&(r=Os(r,s,l&&l[e],o)),r}function O2(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),Ha(n,e)&&(e=za(s._scopes,s,n,e)),e}function D2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(In(l.index)&&i(n))e=e[l.index%e.length];else if(Ke(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=za(u,s,n,f);e.push(Os(c,l,o&&o[n],r))}}return e}function Kg(n,e,t){return $i(n)?n(e,t):n}const E2=(n,e)=>n===!0?e:typeof n=="string"?Ci(e,n):void 0;function A2(n,e,t,i,s){for(const l of e){const o=E2(t,l);if(o){n.add(o);const r=Kg(o._fallback,t,s);if(In(r)&&r!==t&&r!==i)return r}else if(o===!1&&In(i)&&t!==i)return null}return!1}function za(n,e,t,i){const s=e._rootScopes,l=Kg(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=vf(r,o,t,l||t,i);return a===null||In(l)&&l!==t&&(a=vf(r,o,l,a,i),a===null)?!1:Va(Array.from(r),[""],s,l,()=>I2(e,t,i))}function vf(n,e,t,i,s){for(;t;)t=A2(n,e,t,i,s);return t}function I2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return _t(s)&&Ke(t)?t:s}function P2(n,e,t,i){let s;for(const l of e)if(s=Jg($2(l,n),t),In(s))return Ha(n,s)?za(t,i,n,s):s}function Jg(n,e){for(const t of e){if(!t)continue;const i=t[n];if(In(i))return i}}function yf(n){let e=n._keys;return e||(e=n._keys=L2(n._scopes)),e}function L2(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 Zg(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 F2(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Gr(l,s),a=Gr(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function R2(n,e,t){const i=n.length;let s,l,o,r,a,u=Ds(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")j2(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function z2(n,e){return Wo(n).getPropertyValue(e)}const B2=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=B2[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const U2=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function W2(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(U2(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 Bi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Wo(t),l=s.boxSizing==="border-box",o=Zi(s,"padding"),r=Zi(s,"border","width"),{x:a,y:u,box:f}=W2(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return l&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function Y2(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ba(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Wo(l),a=Zi(r,"border","width"),u=Zi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Oo(r.maxWidth,l,"clientWidth"),s=Oo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||So,maxHeight:s||So}}const cr=n=>Math.round(n*10)/10;function K2(n,e,t,i){const s=Wo(n),l=Zi(s,"margin"),o=Oo(s.maxWidth,n,"clientWidth")||So,r=Oo(s.maxHeight,n,"clientHeight")||So,a=Y2(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=Zi(s,"border","width"),d=Zi(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=cr(Math.min(u,o,a.maxWidth)),f=cr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=cr(u/2)),{width:u,height:f}}function kf(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 J2=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 wf(n,e){const t=z2(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ui(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Z2(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 G2(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Ui(n,s,t),r=Ui(s,l,t),a=Ui(l,e,t),u=Ui(o,r,t),f=Ui(r,a,t);return Ui(u,f,t)}const Sf=new Map;function X2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Sf.get(t);return i||(i=new Intl.NumberFormat(n,e),Sf.set(t,i)),i}function El(n,e,t){return X2(e,t).format(n)}const Q2=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}}},x2=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function dr(n,e,t){return n?Q2(e,t):x2()}function ek(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 tk(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Qg(n){return n==="angle"?{between:pl,compare:qy,normalize:bn}:{between:ml,compare:(e,t)=>e-t,normalize:e=>e}}function Tf({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 nk(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=Qg(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(s,T,k)&&r(s,T)!==0,M=()=>r(l,k)===0||a(l,T,k),$=()=>_||C(),D=()=>!_||M();for(let A=f,I=f;A<=c;++A)y=e[A%o],!y.skip&&(k=u(y[i]),k!==T&&(_=a(k,s,l),v===null&&$()&&(v=r(k,s)===0?A:I),v!==null&&D()&&(h.push(Tf({start:v,end:A,loop:d,count:o,style:m})),v=null),I=A,T=k));return v!==null&&h.push(Tf({start:v,end:c,loop:d,count:o,style:m})),h}function eb(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 sk(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 lk(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=ik(t,s,l,i);if(i===!0)return Cf(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=Ng.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 ii=new ak;const Mf="transparent",uk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=gf(n||Mf),s=i.valid&&gf(e||Mf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class fk{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||uk[e.type||typeof o],this._easing=il[e.easing]||il.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||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"});Qe.set("animations",{colors:{type:"color",properties:dk},numbers:{type:"number",properties:ck}});Qe.describe("animations",{_fallback:"animation"});Qe.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 tb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ke(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ke(s))return;const l={};for(const o of pk)l[o]=s[o];(_t(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=hk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&mk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new fk(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ii.add(this._chart,i),!0}}function mk(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function If(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=vk(l,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function wk(n,e){return Di(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Sk(n,e,t){return Di(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Bs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const mr=n=>n==="reset"||n==="none",Pf=(n,e)=>e?n:Object.assign({},n),Tk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:nb(t,!0),values:null};class Un{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=Ef(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Bs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,l=t.xAxisID=Xe(i.xAxisID,pr(e,"x")),o=t.yAxisID=Xe(i.yAxisID,pr(e,"y")),r=t.rAxisID=Xe(i.rAxisID,pr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&uf(this._data,this),e._stacked&&Bs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(Ke(t))this._data=bk(t);else if(i!==t){if(i){uf(i,this);const s=this._cachedMeta;Bs(s),s._parsed=[]}t&&Object.isExtensible(t)&&zy(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=Ef(t.vScale,t),t.stack!==i.stack&&(s=!0,Bs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&If(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{_t(s[e])?d=this.parseArrayData(i,s,e,t):Ke(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const m=()=>c[r]===null||u&&c[r]_||c<_}for(d=0;d=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),_=u.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,l[o]=Object.freeze(Pf(_,a))),_}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new tb(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||mr(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){mr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!mr(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 $k(n){const e=n.iScale,t=Ck(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(In(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 ib(n,e,t,i){return _t(n)?Dk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Lf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function Ak(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(at(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,c=r.axis;for(let d=t;dpl(T,r,a,!0)?1:Math.max(C,C*t,M,M*t),h=(T,C,M)=>pl(T,r,a,!0)?-1:Math.min(C,C*t,M,M*t),_=m(0,u,c),v=m(kt,f,d),k=h(Tt,u,c),y=h(Tt+kt,f,d);i=(_-k)/2,s=(v-y)/2,l=-(_+k)/2,o=-(v+y)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Al extends Un{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(Ke(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ci(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?ct*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=El(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Al.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return _t(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Yo extends Un{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}=Rg(t,s,o);this._drawStart=r,this._drawCount=a,qg(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,m=r.axis,{spanGaps:h,segment:_}=this.options,v=Ms(h)?h:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let y=t>0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs(M[d]-y[d])>v,_&&($.parsed=M,$.raw=u.data[T]),c&&($.options=f||this.resolveDataElementOptions(T,C.active?"active":s)),k||this.updateElement(C,T,$,s),y=M}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Yo.id="line";Yo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ya extends Un{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=El(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return Zg.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,c=u.yCenter,d=u.getIndexAngle(0)-.5*Tt;let m=d,h;const _=360/this.countVisibleElements();for(h=0;h{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Vn(this.resolveDataElementOptions(e,t).angle||i):0}}Ya.id="polarArea";Ya.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ya.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 sb extends Al{}sb.id="pie";sb.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ka extends Un{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 Zg.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}};ci.defaults={};ci.defaultRoutes=void 0;const lb={values(n){return _t(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=Fk(n,t)}const o=Dn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),El(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Dn(n)));return i===1||i===2||i===5?lb.numeric.call(this,n,e,t):""}};function Fk(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Ko={formatters:lb};Qe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ko.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});Qe.route("scale.ticks","color","","color");Qe.route("scale.grid","color","","borderColor");Qe.route("scale.grid","borderColor","","borderColor");Qe.route("scale.title","color","","color");Qe.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});Qe.describe("scales",{_fallback:"scale"});Qe.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function Rk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||qk(n),s=t.major.enabled?Vk(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Hk(e,a,s,l/i),a;const u=jk(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Gl(e,a,u,at(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function Vk(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Rf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function qf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function Wk(n,e){ut(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:Cn(t,Cn(i,t)),max:Cn(i,Cn(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(){yt(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=C2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=Yt(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Us(e.grid)-t.padding-jf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Ia(Math.min(Math.asin(Yt((f.highest.height+6)/r,-1,1)),Math.asin(Yt(a/u,-1,1))-Math.asin(Yt(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){yt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){yt(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=jf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Us(l)+a):(e.height=this.maxHeight,e.width=Us(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Vn(this.labelRotation),_=Math.cos(h),v=Math.sin(h);if(r){const k=i.mirror?0:v*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:_*c.width+v*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,v,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=s*e.width,m=i*t.height):(d=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){yt(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:$(0),last:$(t-1),widest:$(C),highest:$(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 jy(this._alignToPixels?ji(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),c=Us(l),d=[],m=l.setContext(this.getContext()),h=m.drawBorder?m.borderWidth:0,_=h/2,v=function(x){return ji(i,x,h)};let k,y,T,C,M,$,D,A,I,L,N,F;if(o==="top")k=v(this.bottom),$=this.bottom-c,A=k-_,L=v(e.top)+_,F=e.bottom;else if(o==="bottom")k=v(this.top),L=e.top,F=v(e.bottom)-_,$=k+_,A=this.top+c;else if(o==="left")k=v(this.right),M=this.right-c,D=k-_,I=v(e.left)+_,N=e.right;else if(o==="right")k=v(this.left),I=e.left,N=v(e.right)-_,M=k+_,D=this.left+c;else if(t==="x"){if(o==="center")k=v((e.top+e.bottom)/2+.5);else if(Ke(o)){const x=Object.keys(o)[0],U=o[x];k=v(this.chart.scales[x].getPixelForValue(U))}L=e.top,F=e.bottom,$=k+_,A=$+c}else if(t==="y"){if(o==="center")k=v((e.left+e.right)/2);else if(Ke(o)){const x=Object.keys(o)[0],U=o[x];k=v(this.chart.scales[x].getPixelForValue(U))}M=k-_,D=M-c,I=e.left,N=e.right}const R=Xe(s.ticks.maxTicksLimit,f),K=Math.max(1,Math.ceil(f/R));for(y=0;yl.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(".");Qe.route(l,s,a,r)})}function Qk(n){return"id"in n&&"defaults"in n}class xk{constructor(){this.controllers=new Xl(Un,"datasets",!0),this.elements=new Xl(ci,"elements"),this.plugins=new Xl(Object,"plugins"),this.scales=new Xl(ns,"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):ut(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Aa(e);yt(i["before"+s],[],i),t[e](i),yt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs($[m]-T[m])>k,v&&(D.parsed=$,D.raw=u.data[C]),d&&(D.options=c||this.resolveDataElementOptions(C,M.active?"active":s)),y||this.updateElement(M,C,D,s),T=$}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Ja.id="scatter";Ja.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ja.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Vi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ea{constructor(e){this.options=e||{}}init(e){}formats(){return Vi()}parse(e,t){return Vi()}format(e,t){return Vi()}add(e,t,i){return Vi()}diff(e,t,i){return Vi()}startOf(e,t,i){return Vi()}endOf(e,t){return Vi()}}ea.override=function(n){Object.assign(ea.prototype,n)};var ob={_date:ea};function ew(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?Vy:Yi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Il(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[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 sw={evaluateInteractionItems:Il,modes:{index(n,e,t,i){const s=Bi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?_r(n,s,l,i,o):gr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Bi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?_r(n,s,l,i,o):gr(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 Hf(n,e){return n.filter(t=>rb.indexOf(t.pos)===-1&&t.box.axis===e)}function Ys(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function lw(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Ys(Ws(e,"left"),!0),s=Ys(Ws(e,"right")),l=Ys(Ws(e,"top"),!0),o=Ys(Ws(e,"bottom")),r=Hf(e,"x"),a=Hf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ws(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function zf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function ab(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 uw(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!Ke(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&ab(o,l.getPadding());const r=Math.max(0,e.outerWidth-zf(o,n,"left","right")),a=Math.max(0,e.outerHeight-zf(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 fw(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 cw(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Qs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof _.beforeLayout=="function"&&_.beforeLayout()});const f=a.reduce((_,v)=>v.box.options&&v.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);ab(d,Pn(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),h=rw(a.concat(u),c);Qs(r.fullSize,m,c,h),Qs(a,m,c,h),Qs(u,m,c,h)&&Qs(a,m,c,h),fw(m),Bf(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Bf(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},ut(r.chartArea,_=>{const v=_.box;Object.assign(v,n.chartArea),v.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class ub{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 dw extends ub{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",pw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Uf=n=>n===null||n==="";function mw(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Uf(s)){const l=wf(n,"width");l!==void 0&&(n.width=l)}if(Uf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=wf(n,"height");l!==void 0&&(n.height=l)}return n}const fb=J2?{passive:!0}:!1;function hw(n,e,t){n.addEventListener(e,t,fb)}function _w(n,e,t){n.canvas.removeEventListener(e,t,fb)}function gw(n,e){const t=pw[n.type]||n.type,{x:i,y:s}=Bi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Do(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function bw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.addedNodes,i),o=o&&!Do(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function vw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.removedNodes,i),o=o&&!Do(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const _l=new Map;let Wf=0;function cb(){const n=window.devicePixelRatio;n!==Wf&&(Wf=n,_l.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function yw(n,e){_l.size||window.addEventListener("resize",cb),_l.set(n,e)}function kw(n){_l.delete(n),_l.size||window.removeEventListener("resize",cb)}function ww(n,e,t){const i=n.canvas,s=i&&Ba(i);if(!s)return;const l=Fg((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),yw(n,l),o}function br(n,e,t){t&&t.disconnect(),e==="resize"&&kw(n)}function Sw(n,e,t){const i=n.canvas,s=Fg(l=>{n.ctx!==null&&t(gw(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return hw(i,e,s),s}class Tw extends ub{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(mw(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];at(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:bw,detach:vw,resize:ww}[t]||Sw;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:br,detach:br,resize:br}[t]||_w)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return K2(e,t,i,s)}isAttached(e){const t=Ba(e);return!!(t&&t.isConnected)}}function Cw(n){return!Xg()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?dw:Tw}class $w{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(yt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){at(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=Xe(i.options&&i.options.plugins,{}),l=Mw(i);return s===!1&&!t?[]:Dw(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 Mw(n){const e={},t=[],i=Object.keys(Zn.plugins.items);for(let l=0;l{const a=i[r];if(!Ke(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=na(r,a),f=Iw(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=tl(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||ta(a,e),c=(xi[a]||{}).scales||{};Object.keys(c).forEach(d=>{const m=Aw(d,u),h=r[m+"AxisID"]||l[m]||m;o[h]=o[h]||Object.create(null),tl(o[h],[{axis:m},i[h],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];tl(a,[Qe.scales[a.type],Qe.scale])}),o}function db(n){const e=n.options||(n.options={});e.plugins=Xe(e.plugins,{}),e.scales=Lw(n,e)}function pb(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Nw(n){return n=n||{},n.data=pb(n.data),db(n),n}const Yf=new Map,mb=new Set;function eo(n,e){let t=Yf.get(n);return t||(t=e(),Yf.set(n,t),mb.add(t)),t}const Ks=(n,e,t)=>{const i=Ci(e,t);i!==void 0&&n.add(i)};class Fw{constructor(e){this._config=Nw(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=pb(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(),db(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return eo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return eo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return eo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return eo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Ks(a,e,c))),f.forEach(c=>Ks(a,s,c)),f.forEach(c=>Ks(a,xi[l]||{},c)),f.forEach(c=>Ks(a,Qe,c)),f.forEach(c=>Ks(a,Qr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),mb.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,xi[t]||{},Qe.datasets[t]||{},{type:t},Qe,Qr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Kf(this._resolverCache,e,s);let a=o;if(qw(o,t)){l.$shared=!1,i=$i(i)?i():i;const u=this.createResolver(e,i,r);a=Os(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Kf(this._resolverCache,e,i);return Ke(t)?Os(l,t,void 0,s):l}}function Kf(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:Va(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const Rw=n=>Ke(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||$i(n[t]),!1);function qw(n,e){const{isScriptable:t,isIndexable:i}=Wg(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&($i(r)||Rw(r))||o&&_t(r))return!0}return!1}var jw="3.9.1";const Vw=["top","bottom","left","right","chartArea"];function Jf(n,e){return n==="top"||n==="bottom"||Vw.indexOf(n)===-1&&e==="x"}function Zf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Gf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),yt(t&&t.onComplete,[n],e)}function Hw(n){const e=n.chart,t=e.options.animation;yt(t&&t.onProgress,[n],e)}function hb(n){return Xg()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Eo={},_b=n=>{const e=hb(n);return Object.values(Eo).filter(t=>t.canvas===e).pop()};function zw(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 Bw(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Ao{constructor(e,t){const i=this.config=new Fw(t),s=hb(e),l=_b(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||Cw(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=My(),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 $w,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=By(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Eo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ii.listen(this,"complete",Gf),ii.listen(this,"progress",Hw),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return at(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():kf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return bf(this.canvas,this.ctx),this}stop(){return ii.stop(this),this}resize(e,t){ii.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,kf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),yt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};ut(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=na(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),ut(l,o=>{const r=o.options,a=r.id,u=na(a,r),f=Xe(r.type,o.dtype);(r.position===void 0||Jf(r.position,u)!==Jf(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=Zn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),ut(s,(o,r)=>{o||delete i[r]}),ut(i,o=>{xl.configure(this,o,o.options),xl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;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(Zf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){ut(this.scales,e=>{xl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!lf(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;zw(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;xl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ut(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&&Ra(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&&qa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return hl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=sw.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=Di(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);In(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(),ii.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)};ut(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(){ut(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ut(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}});!ko(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=Py(e),u=Bw(e,this._lastEvent,i,a);i&&(this._lastEvent=null,yt(l.onHover,[e,r,this],this),a&&yt(l.onClick,[e,r,this],this));const f=!ko(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const Xf=()=>ut(Ao.instances,n=>n._plugins.invalidate()),hi=!0;Object.defineProperties(Ao,{defaults:{enumerable:hi,value:Qe},instances:{enumerable:hi,value:Eo},overrides:{enumerable:hi,value:xi},registry:{enumerable:hi,value:Zn},version:{enumerable:hi,value:jw},getChart:{enumerable:hi,value:_b},register:{enumerable:hi,value:(...n)=>{Zn.add(...n),Xf()}},unregister:{enumerable:hi,value:(...n)=>{Zn.remove(...n),Xf()}}});function gb(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+kt,i-kt),n.closePath(),n.clip()}function Uw(n){return ja(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ww(n,e,t,i){const s=Uw(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 Yt(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Yt(s.innerStart,0,o),innerEnd:Yt(s.innerEnd,0,o)}}function ms(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function ia(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let m=0;const h=s-a;if(i){const x=f>0?f-i:0,U=c>0?c-i:0,X=(x+U)/2,ne=X!==0?h*X/(X+i):h;m=(h-ne)/2}const _=Math.max(.001,h*c-t/Tt)/c,v=(h-_)/2,k=a+v+m,y=s-v-m,{outerStart:T,outerEnd:C,innerStart:M,innerEnd:$}=Ww(e,d,c,y-k),D=c-T,A=c-C,I=k+T/D,L=y-C/A,N=d+M,F=d+$,R=k+M/N,K=y-$/F;if(n.beginPath(),l){if(n.arc(o,r,c,I,L),C>0){const X=ms(A,L,o,r);n.arc(X.x,X.y,C,L,y+kt)}const x=ms(F,y,o,r);if(n.lineTo(x.x,x.y),$>0){const X=ms(F,K,o,r);n.arc(X.x,X.y,$,y+kt,K+Math.PI)}if(n.arc(o,r,d,y-$/d,k+M/d,!0),M>0){const X=ms(N,R,o,r);n.arc(X.x,X.y,M,R+Math.PI,k-kt)}const U=ms(D,k,o,r);if(n.lineTo(U.x,U.y),T>0){const X=ms(D,I,o,r);n.arc(X.x,X.y,T,k-kt,I)}}else{n.moveTo(o,r);const x=Math.cos(I)*c+o,U=Math.sin(I)*c+r;n.lineTo(x,U);const X=Math.cos(L)*c+o,ne=Math.sin(L)*c+r;n.lineTo(X,ne)}n.closePath()}function Yw(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){ia(n,e,t,i,o+ct,s);for(let u=0;u=ct||pl(l,r,a),_=ml(o,u+d,f+d);return h&&_}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>ct?Math.floor(i/ct):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>=Tt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=Yw(e,this,r,l,o);Jw(e,this,r,l,a,o),e.restore()}}Za.id="arc";Za.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Za.defaultRoutes={backgroundColor:"backgroundColor"};function bb(n,e,t=e){n.lineCap=Xe(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Xe(t.borderDash,e.borderDash)),n.lineDashOffset=Xe(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Xe(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Xe(t.borderWidth,e.borderWidth),n.strokeStyle=Xe(t.borderColor,e.borderColor)}function Zw(n,e,t){n.lineTo(t.x,t.y)}function Gw(n){return n.stepped?g2:n.tension||n.cubicInterpolationMode==="monotone"?b2:Zw}function vb(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=()=>{_!==v&&(n.lineTo(f,v),n.lineTo(f,_),n.lineTo(f,k))};for(a&&(m=s[y(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=s[y(d)],m.skip)continue;const C=m.x,M=m.y,$=C|0;$===h?(M<_?_=M:M>v&&(v=M),f=(c*f+C)/++c):(T(),n.lineTo(C,M),h=$,c=0,_=v=M),k=M}T()}function sa(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?Qw:Xw}function xw(n){return n.stepped?Z2:n.tension||n.cubicInterpolationMode==="monotone"?G2:Ui}function eS(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),bb(n,e.options),n.stroke(s)}function tS(n,e,t,i){const{segments:s,options:l}=e,o=sa(e);for(const r of s)bb(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const nS=typeof Path2D=="function";function iS(n,e,t,i){nS&&!e.options.segment?eS(n,e,t,i):tS(n,e,t,i)}class Ei extends ci{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;H2(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=lk(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=eb(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=xw(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function Qf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Xa(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 Xa(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function xf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function kb(n,e){let t=[],i=!1;return _t(n)?(i=!0,t=n):t=fS(n,e),t.length?new Ei({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function ec(n){return n&&n.fill!==!1}function cS(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(!Ct(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function dS(n,e,t){const i=_S(n);if(Ke(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Ct(s)&&Math.floor(s)===s?pS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function pS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function mS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:Ke(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function hS(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:Ke(n)?i=n.value:i=e.getBaseValue(),i}function _S(n){const e=n.options,t=e.fill;let i=Xe(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function gS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=bS(e,t);r.push(kb({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&&kr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;ec(l)&&kr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ec(i)||t.drawTime!=="beforeDatasetDraw"||kr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ll={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` `):n}function DS(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 sc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=vn(e.bodyFont),u=vn(e.titleFont),f=vn(e.footerFont),c=l.length,d=s.length,m=i.length,h=Pn(e.padding);let _=h.height,v=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,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const T=function(C){v=Math.max(v,t.measureText(C).width+y)};return t.save(),t.font=u.string,ut(n.title,T),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),T),y=e.displayColors?o+2+e.boxPadding:0,ut(i,C=>{ut(C.before,T),ut(C.lines,T),ut(C.after,T)}),y=0,t.font=f.string,ut(n.footer,T),t.restore(),v+=h.width,{width:v,height:_}}function ES(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function AS(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 IS(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"),AS(u,n,e,t)&&(u="center"),u}function lc(n,e,t){const i=t.yAlign||e.yAlign||ES(n,t);return{xAlign:t.xAlign||e.xAlign||IS(n,e,t,i),yAlign:i}}function PS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function LS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function oc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=ys(o);let h=PS(e,r);const _=LS(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:Yt(h,0,i.width-e.width),y:Yt(_,0,i.height-e.height)}}function to(n,e,t){const i=Pn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function rc(n){return Kn([],si(n))}function NS(n,e,t){return Di(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function ac(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class oa extends ci{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 tb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=NS(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=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}getBeforeBody(e,t){return rc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=ac(i,l);Kn(o.before,si(r.beforeLabel.call(this,l))),Kn(o.lines,r.label.call(this,l)),Kn(o.after,si(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return rc(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=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ut(r,f=>{const c=ac(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=ll[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=sc(this,i),u=Object.assign({},r,a),f=lc(this.chart,i,u),c=oc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=ys(r),{x:d,y:m}=e,{width:h,height:_}=t;let v,k,y,T,C,M;return l==="center"?(C=m+_/2,s==="left"?(v=d,k=v-o,T=C+o,M=C-o):(v=d+h,k=v+o,T=C-o,M=C+o),y=v):(s==="left"?k=d+Math.max(a,f)+o:s==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,l==="top"?(T=m,C=T-o,v=k-o,y=k+o):(T=m+_,C=T+o,v=k+o,y=k-o),M=T),{x1:v,x2:k,x3:y,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=dr(i.rtl,this.x,this.width);for(e.x=to(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=vn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aT!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Mo(e,{x:v,y:_,w:u,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Mo(e,{x:k,y:_+1,w:u-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(v,_,u,a),e.strokeRect(v,_,u,a),e.fillStyle=o.backgroundColor,e.fillRect(k,_+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=vn(i.bodyFont);let d=c.lineHeight,m=0;const h=dr(i.rtl,this.x,this.width),_=function(A){t.fillText(A,h.x(e.x+m),e.y+d/2),e.y+=d+l},v=h.textAlign(o);let k,y,T,C,M,$,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=to(this,v,i),t.fillStyle=i.bodyColor,ut(this.beforeBody,_),m=r&&v!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,$=s.length;C<$;++C){for(k=s[C],y=this.labelTextColors[C],t.fillStyle=y,ut(k.before,_),T=k.lines,r&&T.length&&(this._drawColorBox(t,e,C,h,i),d=Math.max(c.lineHeight,a)),M=0,D=T.length;M0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ll[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=sc(this,e),a=Object.assign({},o,this._size),u=lc(t,e,a),f=oc(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=Pn(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),ek(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),tk(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!ko(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!ko(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=ll[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}oa.positioners=ll;var FS={id:"tooltip",_element:oa,positioners:ll,afterInit(n,e,t){t&&(n.tooltip=new oa({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:ni,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 RS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function qS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return RS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const jS=(n,e)=>n===null?null:Yt(Math.round(n),0,e);class ra extends ns{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(at(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:qS(i,e,Xe(t,e),this._addedLabels),jS(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}}ra.id="category";ra.defaults={ticks:{callback:ra.prototype.getLabelForValue}};function VS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=l||1,h=f-1,{min:_,max:v}=e,k=!at(o),y=!at(r),T=!at(u),C=(v-_)/(c+1);let M=rf((v-_)/h/m)*m,$,D,A,I;if(M<1e-14&&!k&&!y)return[{value:_},{value:v}];I=Math.ceil(v/M)-Math.floor(_/M),I>h&&(M=rf(I*M/h/m)*m),at(a)||($=Math.pow(10,a),M=Math.ceil(M*$)/$),s==="ticks"?(D=Math.floor(_/M)*M,A=Math.ceil(v/M)*M):(D=_,A=v),k&&y&&l&&Ry((r-o)/l,M/1e3)?(I=Math.round(Math.min((r-o)/M,f)),M=(r-o)/I,D=o,A=r):T?(D=k?o:D,A=y?r:A,I=u-1,M=(A-D)/I):(I=(A-D)/M,nl(I,Math.round(I),M/1e3)?I=Math.round(I):I=Math.ceil(I));const L=Math.max(af(M),af(D));$=Math.pow(10,at(a)?L:a),D=Math.round(D*$)/$,A=Math.round(A*$)/$;let N=0;for(k&&(d&&D!==o?(t.push({value:o}),Ds=t?s:a,r=a=>l=i?l:a;if(e){const a=Gn(s),u=Gn(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=VS(s,l);return e.bounds==="ticks"&&Ag(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return El(e,this.chart.options.locale,this.options.ticks.format)}}class Qa extends Io{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ct(e)?e:0,this.max=Ct(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Vn(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}}Qa.id="linear";Qa.defaults={ticks:{callback:Ko.formatters.numeric}};function fc(n){return n/Math.pow(10,Math.floor(Dn(n)))===1}function HS(n,e){const t=Math.floor(Dn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Cn(n.min,Math.pow(10,Math.floor(Dn(e.min)))),o=Math.floor(Dn(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:fc(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=Ct(e)?Math.max(0,e):null,this.max=Ct(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(Dn(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=HS(t,this);return e.bounds==="ticks"&&Ag(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":El(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Dn(e),this._valueRange=Dn(this.max)-Dn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Dn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}Sb.id="logarithmic";Sb.defaults={ticks:{callback:Ko.formatters.logarithmic,major:{enabled:!0}}};function aa(n){const e=n.ticks;if(e.display&&n.display){const t=Pn(e.backdropPadding);return Xe(e.font&&e.font.size,Qe.font.size)+t.height}return 0}function zS(n,e,t){return t=_t(t)?t:[t],{w:h2(n,e.string,t),h:t.length*e.lineHeight}}function cc(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 BS(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?Tt/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 WS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=aa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Tt/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function ZS(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=vn(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:m}=n._pointLabelItems[s],{backdropColor:h}=l;if(!at(h)){const _=ys(l.borderRadius),v=Pn(l.backdropPadding);t.fillStyle=h;const k=f-v.left,y=c-v.top,T=d-f+v.width,C=m-c+v.height;Object.values(_).some(M=>M!==0)?(t.beginPath(),Mo(t,{x:k,y,w:T,h:C,radius:_}),t.fill()):t.fillRect(k,y,T,C)}$o(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function Tb(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,ct);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=yt(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?BS(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=ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return bn(e*t+Vn(i))}getDistanceFromCenterForValue(e){if(at(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(at(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 c=s.setContext(this.getContext(f-1));GS(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=vn(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Pn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}$o(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Zo.id="radialLinear";Zo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ko.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Zo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Zo.descriptors={angleLines:{_fallback:"grid"}};const Go={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},fn=Object.keys(Go);function QS(n,e){return n-e}function dc(n,e){if(at(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)),Ct(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ms(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function pc(n,e,t,i){const s=fn.length;for(let l=fn.indexOf(n);l=fn.indexOf(t);l--){const o=fn[l];if(Go[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return fn[t?fn.indexOf(t):0]}function e3(n){for(let e=fn.indexOf(n)+1,t=fn.length;e=e?t[i]:t[s];n[l]=!0}}function t3(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 hc(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=Yt(t,0,o),i=Yt(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||pc(l.minUnit,t,i,this._getLabelCapacity(t)),r=Xe(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ms(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d_-v).map(_=>+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,m=this._adapter.format(e,s||(d?f:u)),h=l.ticks.callback;return h?yt(h,[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}=Yi(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}=Yi(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 Cb extends Pl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=no(t,this.min),this._tableRange=no(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=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{t||(t=je(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function i3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=O(),s=B(i)},m(l,o){S(l,e,o),S(l,t,o),S(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&&w(e),l&&w(t),l&&w(s)}}}function s3(n){let e;return{c(){e=B("Loading...")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function l3(n){let e,t,i,s,l,o=n[2]&&_c();function r(f,c){return f[2]?s3:i3}let a=r(n),u=a(n);return{c(){e=b("div"),o&&o.c(),t=O(),i=b("canvas"),s=O(),l=b("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Pr(i,"height","250px"),Pr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&E(o,1):(o=_c(),o.c(),E(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){E(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function o3(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),pe.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let h of m)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),pe.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Ao.register(Ei,Jo,Yo,Qa,Pl,OS,FS),t(6,o=new Ao(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color: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 d(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,d]}class r3 extends ye{constructor(e){super(),ve(this,e,o3,l3,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ua={},a3={get exports(){return ua},set exports(n){ua=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 y(T){return T instanceof a?new a(T.type,y(T.content),T.alias):Array.isArray(T)?T.map(y):T.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(y){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==y)return T[C]}return null}},isActive:function(y,T,C){for(var M="no-"+T;y;){var $=y.classList;if($.contains(T))return!0;if($.contains(M))return!1;y=y.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,T){var C=r.util.clone(r.languages[y]);for(var M in T)C[M]=T[M];return C},insertBefore:function(y,T,C,M){M=M||r.languages;var $=M[y],D={};for(var A in $)if($.hasOwnProperty(A)){if(A==T)for(var I in C)C.hasOwnProperty(I)&&(D[I]=C[I]);C.hasOwnProperty(A)||(D[A]=$[A])}var L=M[y];return M[y]=D,r.languages.DFS(r.languages,function(N,F){F===L&&N!=y&&(this[N]=D)}),D},DFS:function y(T,C,M,$){$=$||{};var D=r.util.objId;for(var A in T)if(T.hasOwnProperty(A)){C.call(T,A,T[A],M||A);var I=T[A],L=r.util.type(I);L==="Object"&&!$[D(I)]?($[D(I)]=!0,y(I,C,null,$)):L==="Array"&&!$[D(I)]&&($[D(I)]=!0,y(I,C,A,$))}}},plugins:{},highlightAll:function(y,T){r.highlightAllUnder(document,y,T)},highlightAllUnder:function(y,T,C){var M={callback:C,container:y,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 $=0,D;D=M.elements[$++];)r.highlightElement(D,T===!0,M.callback)},highlightElement:function(y,T,C){var M=r.util.getLanguage(y),$=r.languages[M];r.util.setLanguage(y,M);var D=y.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var A=y.textContent,I={element:y,language:M,grammar:$,code:A};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),D=I.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if(T&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(y,T,C){var M={code:y,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(y,T){var C=T.rest;if(C){for(var M in C)T[M]=C[M];delete T.rest}var $=new c;return d($,$.head,y),f(y,$,T,$.head,0),h($)},hooks:{all:{},add:function(y,T){var C=r.hooks.all;C[y]=C[y]||[],C[y].push(T)},run:function(y,T){var C=r.hooks.all[y];if(!(!C||!C.length))for(var M=0,$;$=C[M++];)$(T)}},Token:a};i.Prism=r;function a(y,T,C,M){this.type=y,this.content=T,this.alias=C,this.length=(M||"").length|0}a.stringify=function y(T,C){if(typeof T=="string")return T;if(Array.isArray(T)){var M="";return T.forEach(function(L){M+=y(L,C)}),M}var $={type:T.type,content:y(T.content,C),tag:"span",classes:["token",T.type],attributes:{},language:C},D=T.alias;D&&(Array.isArray(D)?Array.prototype.push.apply($.classes,D):$.classes.push(D)),r.hooks.run("wrap",$);var A="";for(var I in $.attributes)A+=" "+I+'="'+($.attributes[I]||"").replace(/"/g,""")+'"';return"<"+$.tag+' class="'+$.classes.join(" ")+'"'+A+">"+$.content+""};function u(y,T,C,M){y.lastIndex=T;var $=y.exec(C);if($&&M&&$[1]){var D=$[1].length;$.index+=D,$[0]=$[0].slice(D)}return $}function f(y,T,C,M,$,D){for(var A in C)if(!(!C.hasOwnProperty(A)||!C[A])){var I=C[A];I=Array.isArray(I)?I:[I];for(var L=0;L=D.reach);J+=ne.value.length,ne=ne.next){var ue=ne.value;if(T.length>y.length)return;if(!(ue instanceof a)){var Z=1,de;if(K){if(de=u(X,J,y,R),!de||de.index>=y.length)break;var Re=de.index,ge=de.index+de[0].length,Ce=J;for(Ce+=ne.value.length;Re>=Ce;)ne=ne.next,Ce+=ne.value.length;if(Ce-=ne.value.length,J=Ce,ne.value instanceof a)continue;for(var Ne=ne;Ne!==T.tail&&(CeD.reach&&(D.reach=lt);var ce=ne.prev;Se&&(ce=d(T,ce,Se),J+=Se.length),m(T,ce,Z);var He=new a(A,F?r.tokenize(be,F):be,x,be);if(ne=d(T,ce,He),We&&d(T,ne,We),Z>1){var te={cause:A+","+L,reach:lt};f(y,T,C,ne.prev,J,te),D&&te.reach>D.reach&&(D.reach=te.reach)}}}}}}function c(){var y={value:null,prev:null,next:null},T={value:null,prev:y,next:null};y.next=T,this.head=y,this.tail=T,this.length=0}function d(y,T,C){var M=T.next,$={value:C,prev:T,next:M};return T.next=$,M.prev=$,y.length++,$}function m(y,T,C){for(var M=T.next,$=0;$/,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(_,v){return"✖ Error "+_+" while fetching file: "+v},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(_,v,k){var y=new XMLHttpRequest;y.open("GET",_,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?v(y.responseText):y.status>=400?k(s(y.status,y.statusText)):k(l))},y.send(null)}function m(_){var v=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(_||"");if(v){var k=Number(v[1]),y=v[2],T=v[3];return y?T?[k,Number(T)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(_){_.selector+=", "+c}),t.hooks.add("before-sanity-check",function(_){var v=_.element;if(v.matches(c)){_.code="",v.setAttribute(r,a);var k=v.appendChild(document.createElement("CODE"));k.textContent=i;var y=v.getAttribute("data-src"),T=_.language;if(T==="none"){var C=(/\.(\w+)$/.exec(y)||[,"none"])[1];T=o[C]||C}t.util.setLanguage(k,T),t.util.setLanguage(v,T);var M=t.plugins.autoloader;M&&M.loadLanguages(T),d(y,function($){v.setAttribute(r,u);var D=m(v.getAttribute("data-range"));if(D){var A=$.split(/\r\n?|\n/g),I=D[0],L=D[1]==null?A.length:D[1];I<0&&(I+=A.length),I=Math.max(0,Math.min(I-1,A.length)),L<0&&(L+=A.length),L=Math.max(0,Math.min(L,A.length)),$=A.slice(I,L).join(` `),v.hasAttribute("data-start")||v.setAttribute("data-start",String(I+1))}k.textContent=$,t.highlightElement(k)},function($){v.setAttribute(r,f),k.textContent=$})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(c),y=0,T;T=k[y++];)t.highlightElement(T)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(a3);const Js=ua;var bc={},u3={get exports(){return bc},set exports(n){bc=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[d]=` `+f[d],c=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 c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",h="",_=!1,v=0;v>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),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 f3(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),g(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:G,o:G,d(s){s&&w(e)}}}function c3(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class $b extends ye{constructor(e){super(),ve(this,e,c3,f3,he,{class:0,content:2,language:3})}}const d3=n=>({}),vc=n=>({}),p3=n=>({}),yc=n=>({});function kc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T=n[4]&&!n[2]&&wc(n);const C=n[19].header,M=Nt(C,n,n[18],yc);let $=n[4]&&n[2]&&Sc(n);const D=n[19].default,A=Nt(D,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],vc);return{c(){e=b("div"),t=b("div"),s=O(),l=b("div"),o=b("div"),T&&T.c(),r=O(),M&&M.c(),a=O(),$&&$.c(),u=O(),f=b("div"),A&&A.c(),c=O(),d=b("div"),L&&L.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,F){S(N,e,F),g(e,t),g(e,s),g(e,l),g(l,o),T&&T.m(o,null),g(o,r),M&&M.m(o,null),g(o,a),$&&$.m(o,null),g(l,u),g(l,f),A&&A.m(f,null),n[21](f),g(l,c),g(l,d),L&&L.m(d,null),v=!0,k||(y=[Y(t,"click",dt(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,F){n=N,n[4]&&!n[2]?T?T.p(n,F):(T=wc(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),M&&M.p&&(!v||F[0]&262144)&&Rt(M,C,n,n[18],v?Ft(C,n[18],F,p3):qt(n[18]),yc),n[4]&&n[2]?$?$.p(n,F):($=Sc(n),$.c(),$.m(o,null)):$&&($.d(1),$=null),A&&A.p&&(!v||F[0]&262144)&&Rt(A,D,n,n[18],v?Ft(D,n[18],F,null):qt(n[18]),null),L&&L.p&&(!v||F[0]&262144)&&Rt(L,I,n,n[18],v?Ft(I,n[18],F,d3):qt(n[18]),vc),(!v||F[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!v||F[0]&262)&&Q(l,"popup",n[2]),(!v||F[0]&4)&&Q(e,"padded",n[2]),(!v||F[0]&1)&&Q(e,"active",n[0])},i(N){v||(N&&xe(()=>{i||(i=je(t,yo,{duration:hs,opacity:0},!0)),i.run(1)}),E(M,N),E(A,N),E(L,N),xe(()=>{_&&_.end(1),h=b_(l,An,n[2]?{duration:hs,y:-10}:{duration:hs,x:50}),h.start()}),v=!0)},o(N){N&&(i||(i=je(t,yo,{duration:hs,opacity:0},!1)),i.run(0)),P(M,N),P(A,N),P(L,N),h&&h.invalidate(),_=v_(l,An,n[2]?{duration:hs,y:10}:{duration:hs,x:50}),v=!1},d(N){N&&w(e),N&&i&&i.end(),T&&T.d(),M&&M.d(N),$&&$.d(),A&&A.d(N),n[21](null),L&&L.d(N),N&&_&&_.end(),k=!1,Pe(y)}}}function wc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=Y(e,"click",dt(n[5])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Sc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){S(s,e,l),t||(i=Y(e,"click",dt(n[5])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function m3(n){let e,t,i,s,l=n[0]&&kc(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(o,r){S(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&E(l,1)):(l=kc(o),l.c(),E(l,1),l.m(e,null)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){t||(E(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,Pe(s)}}}let Hi,wr=[];function Mb(){return Hi=Hi||document.querySelector(".overlays"),Hi||(Hi=document.createElement("div"),Hi.classList.add("overlays"),document.body.appendChild(Hi)),Hi}let hs=150;function Tc(){return 1e3+Mb().querySelectorAll(".overlay-panel-container.active").length}function h3(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=$t(),h="op_"+H.randomString(10);let _,v,k,y,T="",C=o;function M(){typeof c=="function"&&c()===!1||t(0,o=!0)}function $(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function A(J){t(17,C=J),J?(k=document.activeElement,_==null||_.focus(),m("show")):(clearTimeout(y),k==null||k.focus(),m("hide")),await sn(),I()}function I(){_&&(o?t(6,_.style.zIndex=Tc(),_):t(6,_.style="",_))}function L(){H.pushUnique(wr,h),document.body.classList.add("overlay-active")}function N(){H.removeByValue(wr,h),wr.length||document.body.classList.remove("overlay-active")}function F(J){o&&f&&J.code=="Escape"&&!H.isInput(J.target)&&_&&_.style.zIndex==Tc()&&(J.preventDefault(),$())}function R(J){o&&K(v)}function K(J,ue){ue&&t(8,T=""),J&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!J)return;if(J.scrollHeight-J.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}J.scrollTop==0?t(8,T+=" scroll-top-reached"):J.scrollTop+J.offsetHeight==J.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100)))}Zt(()=>(Mb().appendChild(_),()=>{var J;clearTimeout(y),N(),(J=_==null?void 0:_.classList)==null||J.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const x=()=>a?$():!0;function U(J){se[J?"unshift":"push"](()=>{v=J,t(7,v)})}const X=J=>K(J.target);function ne(J){se[J?"unshift":"push"](()=>{_=J,t(6,_)})}return n.$$set=J=>{"class"in J&&t(1,l=J.class),"active"in J&&t(0,o=J.active),"popup"in J&&t(2,r=J.popup),"overlayClose"in J&&t(3,a=J.overlayClose),"btnClose"in J&&t(4,u=J.btnClose),"escClose"in J&&t(12,f=J.escClose),"beforeOpen"in J&&t(13,c=J.beforeOpen),"beforeHide"in J&&t(14,d=J.beforeHide),"$$scope"in J&&t(18,s=J.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&C!=o&&A(o),n.$$.dirty[0]&128&&K(v,!0),n.$$.dirty[0]&64&&_&&I(),n.$$.dirty[0]&1&&(o?L():N())},[o,l,r,a,u,$,_,v,T,F,R,K,f,c,d,M,D,C,s,i,x,U,X,ne]}class Nn extends ye{constructor(e){super(),ve(this,e,h3,m3,he,{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 _3(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function g3(n){let e,t=n[2].referer+"",i,s;return{c(){e=b("a"),i=B(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),g(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&w(e)}}}function b3(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function v3(n){let e,t;return e=new $b({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function y3(n){var De;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,m,h,_=n[2].status+"",v,k,y,T,C,M,$=((De=n[2].method)==null?void 0:De.toUpperCase())+"",D,A,I,L,N,F,R=n[2].auth+"",K,x,U,X,ne,J,ue=n[2].url+"",Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He=n[2].remoteIp+"",te,Fe,ot,Vt,Ae,ie,we=n[2].userIp+"",nt,et,bt,Gt,di,ft,Wn=n[2].userAgent+"",ss,Ll,pi,ls,Nl,Pi,os,rn,Ze,rs,ti,as,Li,Ni,Ht,Xt;function Fl(Ee,$e){return Ee[2].referer?g3:_3}let z=Fl(n),W=z(n);const ee=[v3,b3],oe=[];function Te(Ee,$e){return $e&4&&(os=null),os==null&&(os=!H.isEmpty(Ee[2].meta)),os?0:1}return rn=Te(n,-1),Ze=oe[rn]=ee[rn](n),Ht=new ui({props:{date:n[2].created}}),{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="ID",l=O(),o=b("td"),a=B(r),u=O(),f=b("tr"),c=b("td"),c.textContent="Status",d=O(),m=b("td"),h=b("span"),v=B(_),k=O(),y=b("tr"),T=b("td"),T.textContent="Method",C=O(),M=b("td"),D=B($),A=O(),I=b("tr"),L=b("td"),L.textContent="Auth",N=O(),F=b("td"),K=B(R),x=O(),U=b("tr"),X=b("td"),X.textContent="URL",ne=O(),J=b("td"),Z=B(ue),de=O(),ge=b("tr"),Ce=b("td"),Ce.textContent="Referer",Ne=O(),Re=b("td"),W.c(),be=O(),Se=b("tr"),We=b("td"),We.textContent="Remote IP",lt=O(),ce=b("td"),te=B(He),Fe=O(),ot=b("tr"),Vt=b("td"),Vt.textContent="User IP",Ae=O(),ie=b("td"),nt=B(we),et=O(),bt=b("tr"),Gt=b("td"),Gt.textContent="UserAgent",di=O(),ft=b("td"),ss=B(Wn),Ll=O(),pi=b("tr"),ls=b("td"),ls.textContent="Meta",Nl=O(),Pi=b("td"),Ze.c(),rs=O(),ti=b("tr"),as=b("td"),as.textContent="Created",Li=O(),Ni=b("td"),V(Ht.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(h,"class","label"),Q(h,"label-danger",n[2].status>=400),p(T,"class","min-width txt-hint txt-bold"),p(L,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Ce,"class","min-width txt-hint txt-bold"),p(We,"class","min-width txt-hint txt-bold"),p(Vt,"class","min-width txt-hint txt-bold"),p(Gt,"class","min-width txt-hint txt-bold"),p(ls,"class","min-width txt-hint txt-bold"),p(as,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Ee,$e){S(Ee,e,$e),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(o,a),g(t,u),g(t,f),g(f,c),g(f,d),g(f,m),g(m,h),g(h,v),g(t,k),g(t,y),g(y,T),g(y,C),g(y,M),g(M,D),g(t,A),g(t,I),g(I,L),g(I,N),g(I,F),g(F,K),g(t,x),g(t,U),g(U,X),g(U,ne),g(U,J),g(J,Z),g(t,de),g(t,ge),g(ge,Ce),g(ge,Ne),g(ge,Re),W.m(Re,null),g(t,be),g(t,Se),g(Se,We),g(Se,lt),g(Se,ce),g(ce,te),g(t,Fe),g(t,ot),g(ot,Vt),g(ot,Ae),g(ot,ie),g(ie,nt),g(t,et),g(t,bt),g(bt,Gt),g(bt,di),g(bt,ft),g(ft,ss),g(t,Ll),g(t,pi),g(pi,ls),g(pi,Nl),g(pi,Pi),oe[rn].m(Pi,null),g(t,rs),g(t,ti),g(ti,as),g(ti,Li),g(ti,Ni),q(Ht,Ni,null),Xt=!0},p(Ee,$e){var Ve;(!Xt||$e&4)&&r!==(r=Ee[2].id+"")&&le(a,r),(!Xt||$e&4)&&_!==(_=Ee[2].status+"")&&le(v,_),(!Xt||$e&4)&&Q(h,"label-danger",Ee[2].status>=400),(!Xt||$e&4)&&$!==($=((Ve=Ee[2].method)==null?void 0:Ve.toUpperCase())+"")&&le(D,$),(!Xt||$e&4)&&R!==(R=Ee[2].auth+"")&&le(K,R),(!Xt||$e&4)&&ue!==(ue=Ee[2].url+"")&&le(Z,ue),z===(z=Fl(Ee))&&W?W.p(Ee,$e):(W.d(1),W=z(Ee),W&&(W.c(),W.m(Re,null))),(!Xt||$e&4)&&He!==(He=Ee[2].remoteIp+"")&&le(te,He),(!Xt||$e&4)&&we!==(we=Ee[2].userIp+"")&&le(nt,we),(!Xt||$e&4)&&Wn!==(Wn=Ee[2].userAgent+"")&&le(ss,Wn);let Be=rn;rn=Te(Ee,$e),rn===Be?oe[rn].p(Ee,$e):(re(),P(oe[Be],1,1,()=>{oe[Be]=null}),ae(),Ze=oe[rn],Ze?Ze.p(Ee,$e):(Ze=oe[rn]=ee[rn](Ee),Ze.c()),E(Ze,1),Ze.m(Pi,null));const Le={};$e&4&&(Le.date=Ee[2].created),Ht.$set(Le)},i(Ee){Xt||(E(Ze),E(Ht.$$.fragment,Ee),Xt=!0)},o(Ee){P(Ze),P(Ht.$$.fragment,Ee),Xt=!1},d(Ee){Ee&&w(e),W.d(),oe[rn].d(),j(Ht)}}}function k3(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function w3(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function S3(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[w3],header:[k3],default:[y3]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),j(e,s)}}}function T3(n,e,t){let i,s=new qr;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){se[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){ze.call(this,n,c)}function f(c){ze.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class C3 extends ye{constructor(e){super(),ve(this,e,T3,S3,he,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function $3(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){S(u,e,f),e.checked=n[0],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cc(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 r3({props:l}),se.push(()=>_e(e,"filter",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $c(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new $y({props:l}),se.push(()=>_e(e,"filter",s)),e.$on("select",n[12]),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function M3(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y=n[3],T,C=n[3],M,$;r=new Da({}),r.$on("refresh",n[7]),d=new me({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[$3,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),h=new Uo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),h.$on("submit",n[9]);let D=Cc(n),A=$c(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),s=b("div"),l=B(n[5]),o=O(),V(r.$$.fragment),a=O(),u=b("div"),f=O(),c=b("div"),V(d.$$.fragment),m=O(),V(h.$$.fragment),_=O(),v=b("div"),k=O(),D.c(),T=O(),A.c(),M=Me(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(v,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(t,o),q(r,t,null),g(t,a),g(t,u),g(t,f),g(t,c),q(d,c,null),g(e,m),q(h,e,null),g(e,_),g(e,v),g(e,k),D.m(e,null),S(I,T,L),A.m(I,L),S(I,M,L),$=!0},p(I,L){(!$||L&32)&&le(l,I[5]);const N={};L&49153&&(N.$$scope={dirty:L,ctx:I}),d.$set(N);const F={};L&4&&(F.value=I[2]),h.$set(F),L&8&&he(y,y=I[3])?(re(),P(D,1,1,G),ae(),D=Cc(I),D.c(),E(D,1),D.m(e,null)):D.p(I,L),L&8&&he(C,C=I[3])?(re(),P(A,1,1,G),ae(),A=$c(I),A.c(),E(A,1),A.m(M.parentNode,M)):A.p(I,L)},i(I){$||(E(r.$$.fragment,I),E(d.$$.fragment,I),E(h.$$.fragment,I),E(D),E(A),$=!0)},o(I){P(r.$$.fragment,I),P(d.$$.fragment,I),P(h.$$.fragment,I),P(D),P(A),$=!1},d(I){I&&w(e),j(r),j(d),j(h),D.d(I),I&&w(T),I&&w(M),A.d(I)}}}function O3(n){let e,t,i,s;e=new wn({props:{$$slots:{default:[M3]},$$scope:{ctx:n}}});let l={};return i=new C3({props:l}),n[13](i),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(o,r){q(e,o,r),S(o,t,r),q(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||(E(e.$$.fragment,o),E(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[13](null),j(i,o)}}}const Mc="includeAdminLogs";function D3(n,e,t){var k;let i,s;Ye(n,St,y=>t(5,s=y)),Kt(St,s="Request logs",s);let l,o="",r=((k=window.localStorage)==null?void 0:k.getItem(Mc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=y=>t(2,o=y.detail);function m(y){o=y,t(2,o)}function h(y){o=y,t(2,o)}const _=y=>l==null?void 0:l.show(y==null?void 0:y.detail);function v(y){se[y?"unshift":"push"](()=>{l=y,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(Mc,r<<0)},[r,l,o,a,i,s,u,f,c,d,m,h,_,v]}class E3 extends ye{constructor(e){super(),ve(this,e,D3,O3,he,{})}}const Ai=Ln([]),Mi=Ln({}),Po=Ln(!1);function A3(n){Ai.update(e=>{const t=H.findByKey(e,"id",n);return t?Mi.set(t):e.length&&Mi.set(e[0]),e})}function I3(n){Ai.update(e=>(H.removeByKey(e,"id",n.id),Mi.update(t=>t.id===n.id?e[0]:t),e))}async function Ob(n=null){Po.set(!0);try{let e=await pe.collections.getFullList(200,{sort:"+name"});e=H.sortCollections(e),Ai.set(e);const t=n&&H.findByKey(e,"id",n);t?Mi.set(t):e.length&&Mi.set(e[0])}catch(e){pe.errorResponseHandler(e)}Po.set(!1)}const xa=Ln({});function cn(n,e,t){xa.set({text:n,yesCallback:e,noCallback:t})}function Db(){xa.set({})}function Oc(n){let e,t,i,s;const l=n[14].default,o=Nt(l,n,n[13],null);return{c(){e=b("div"),o&&o.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(r,a){S(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&8192)&&Rt(o,l,r,r[13],s?Ft(l,r[13],a,null):qt(r[13]),null),(!s||a&2)&&p(e,"class",r[1]),(!s||a&3)&&Q(e,"active",r[0])},i(r){s||(E(o,r),r&&xe(()=>{i&&i.end(1),t=b_(e,An,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=v_(e,An,{duration:150,y:2})),s=!1},d(r){r&&w(e),o&&o.d(r),r&&i&&i.end()}}}function P3(n){let e,t,i,s,l=n[0]&&Oc(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","toggler-container")},m(o,r){S(o,e,r),l&&l.m(e,null),n[15](e),t=!0,i||(s=[Y(window,"click",n[3]),Y(window,"keydown",n[4]),Y(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&E(l,1)):(l=Oc(o),l.c(),E(l,1),l.m(e,null)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){t||(E(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[15](null),i=!1,Pe(s)}}}function L3(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f,c;const d=$t();function m(){t(0,o=!1)}function h(){t(0,o=!0)}function _(){o?m():h()}function v(I){return!f||I.classList.contains(a)||(c==null?void 0:c.contains(I))&&!f.contains(I)||f.contains(I)&&I.closest&&I.closest("."+a)}function k(I){(!o||v(I.target))&&(I.preventDefault(),I.stopPropagation(),_())}function y(I){(I.code==="Enter"||I.code==="Space")&&(!o||v(I.target))&&(I.preventDefault(),I.stopPropagation(),_())}function T(I){o&&!(f!=null&&f.contains(I.target))&&!(c!=null&&c.contains(I.target))&&m()}function C(I){o&&r&&I.code==="Escape"&&(I.preventDefault(),m())}function M(I){return T(I)}function $(I){D(),t(12,c=I||(f==null?void 0:f.parentNode)),c&&(f==null||f.addEventListener("click",k),c.addEventListener("click",k),c.addEventListener("keydown",y))}function D(){c&&(f==null||f.removeEventListener("click",k),c.removeEventListener("click",k),c.removeEventListener("keydown",y))}Zt(()=>($(),()=>D()));function A(I){se[I?"unshift":"push"](()=>{f=I,t(2,f)})}return n.$$set=I=>{"trigger"in I&&t(6,l=I.trigger),"active"in I&&t(0,o=I.active),"escClose"in I&&t(7,r=I.escClose),"closableClass"in I&&t(8,a=I.closableClass),"class"in I&&t(1,u=I.class),"$$scope"in I&&t(13,s=I.$$scope)},n.$$.update=()=>{var I,L;n.$$.dirty&68&&f&&$(l),n.$$.dirty&4097&&(o?((I=c==null?void 0:c.classList)==null||I.add("active"),d("show")):((L=c==null?void 0:c.classList)==null||L.remove("active"),d("hide")))},[o,u,f,T,C,M,l,r,a,m,h,_,c,s,i,A]}class ei extends ye{constructor(e){super(),ve(this,e,L3,P3,he,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const N3=n=>({active:n&1}),Dc=n=>({active:n[0]});function Ec(n){let e,t,i;const s=n[15].default,l=Nt(s,n,n[14],null);return{c(){e=b("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Rt(l,s,o,o[14],i?Ft(s,o[14],r,null):qt(o[14]),null)},i(o){i||(E(l,o),o&&xe(()=>{t||(t=je(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=je(e,At,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function F3(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Nt(a,n,n[14],Dc);let f=n[0]&&Ec(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=O(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){S(c,e,d),g(e,t),u&&u.m(t,null),g(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",dt(n[17])),Y(t,"drop",dt(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",dt(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Rt(u,a,c,c[14],l?Ft(a,c[14],d,N3):qt(c[14]),Dc),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&E(f,1)):(f=Ec(c),f.c(),E(f,1),f.m(e,null)):f&&(re(),P(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(E(u,c),E(f),l=!0)},o(c){P(u,c),P(f),l=!1},d(c){c&&w(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Pe(r)}}}function R3(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=$t();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function _(){y(),t(0,f=!0),l("expand")}function v(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?v():_()}function y(){if(d&&o.closest(".accordions")){const L=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of L)N.click()}}Zt(()=>()=>clearTimeout(r));function T(L){ze.call(this,n,L)}const C=()=>c&&k(),M=L=>{u&&(t(7,m=!1),y(),l("drop",L))},$=L=>u&&l("dragstart",L),D=L=>{u&&(t(7,m=!0),l("dragenter",L))},A=L=>{u&&(t(7,m=!1),l("dragleave",L))};function I(L){se[L?"unshift":"push"](()=>{o=L,t(6,o)})}return n.$$set=L=>{"class"in L&&t(1,a=L.class),"draggable"in L&&t(2,u=L.draggable),"active"in L&&t(0,f=L.active),"interactive"in L&&t(3,c=L.interactive),"single"in L&&t(9,d=L.single),"$$scope"in L&&t(14,s=L.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,y,o,m,l,d,h,_,v,r,s,i,T,C,M,$,D,A,I]}class ks extends ye{constructor(e){super(),ve(this,e,R3,F3,he,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}const q3=n=>({}),Ac=n=>({});function Ic(n,e,t){const i=n.slice();return i[46]=e[t],i}const j3=n=>({}),Pc=n=>({});function Lc(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function Nc(n){let e,t,i;return{c(){e=b("div"),t=B(n[2]),i=O(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5])},m(s,l){S(s,e,l),g(e,t),g(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&32&&Q(e,"link-hint",!s[5])},d(s){s&&w(e)}}}function V3(n){let e,t=n[46]+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function H3(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{j(f,1)}),ae()}l?(e=jt(l,o()),V(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Fc(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[Ie(Ue.call(null,e,"Clear")),Y(e,"click",kn(dt(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Pe(i)}}}function Rc(n){let e,t,i,s,l,o;const r=[H3,V3],a=[];function u(c,d){return c[8]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&Fc(n);return{c(){e=b("div"),i.c(),s=O(),f&&f.c(),l=O(),p(e,"class","option")},m(c,d){S(c,e,d),a[t].m(e,null),g(e,s),f&&f.m(e,null),g(e,l),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),P(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=Fc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(E(i),o=!0)},o(c){P(i),o=!1},d(c){c&&w(e),a[t].d(),f&&f.d()}}}function qc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[U3]},$$scope:{ctx:n}};return e=new ei({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){V(e.$$.fragment)},m(s,l){q(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||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[39](null),j(e,s)}}}function jc(n){let e,t,i,s,l,o,r,a,u=n[15].length&&Vc(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',s=O(),l=b("input"),o=O(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){S(f,e,c),g(e,t),g(t,i),g(t,s),g(t,l),fe(l,n[15]),g(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[36]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&32768&&l.value!==f[15]&&fe(l,f[15]),f[15].length?u?u.p(f,c):(u=Vc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&w(e),u&&u.d(),r=!1,a()}}}function Vc(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",kn(dt(n[21]))),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function Hc(n){let e,t=n[1]&&zc(n);return{c(){t&&t.c(),e=Me()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=zc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function zc(n){let e,t;return{c(){e=b("div"),t=B(n[1]),p(e,"class","txt-missing")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&w(e)}}}function z3(n){let e=n[46]+"",t;return{c(){t=B(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&le(t,e)},i:G,o:G,d(i){i&&w(t)}}}function B3(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{j(f,1)}),ae()}l?(e=jt(l,o()),V(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Bc(n){let e,t,i,s,l,o,r;const a=[B3,z3],u=[];function f(m,h){return m[10]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[37](n[46],...m)}function d(...m){return n[38](n[46],...m)}return{c(){e=b("div"),i.c(),s=O(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[7]),Q(e,"selected",n[19](n[46]))},m(m,h){S(m,e,h),u[t].m(e,null),g(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=f(n),t===_?u[t].p(n,h):(re(),P(u[_],1,1,()=>{u[_]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),E(i,1),i.m(e,s)),(!l||h[0]&128)&&Q(e,"closable",n[7]),(!l||h[0]&1572864)&&Q(e,"selected",n[19](n[46]))},i(m){l||(E(i),l=!0)},o(m){P(i),l=!1},d(m){m&&w(e),u[t].d(),o=!1,Pe(r)}}}function U3(n){let e,t,i,s,l,o=n[12]&&jc(n);const r=n[33].beforeOptions,a=Nt(r,n,n[42],Pc);let u=n[20],f=[];for(let _=0;_P(f[_],1,1,()=>{f[_]=null});let d=null;u.length||(d=Hc(n));const m=n[33].afterOptions,h=Nt(m,n,n[42],Ac);return{c(){o&&o.c(),e=O(),a&&a.c(),t=O(),i=b("div");for(let _=0;_P(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Nc(n));let c=!n[5]&&qc(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()):c?(c.p(d,m),m[0]&32&&E(c,1)):(c=qc(d),c.c(),E(c,1),c.m(e,null)),(!o||m[0]&8192&&l!==(l="select "+d[13]))&&p(e,"class",l),(!o||m[0]&8208)&&Q(e,"multiple",d[4]),(!o||m[0]&8224)&&Q(e,"disabled",d[5])},i(d){if(!o){for(let m=0;mot(Vt,Fe))||[]}function Z(te,Fe){te.preventDefault(),_&&d?K(Fe):R(Fe)}function de(te,Fe){(te.code==="Enter"||te.code==="Space")&&Z(te,Fe)}function ge(){J(),setTimeout(()=>{const te=L==null?void 0:L.querySelector(".dropdown-item.option.selected");te&&(te.focus(),te.scrollIntoView({block:"nearest"}))},0)}function Ce(te){te.stopPropagation(),!m&&(A==null||A.toggle())}Zt(()=>{const te=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of te)Fe.addEventListener("click",Ce);return()=>{for(const Fe of te)Fe.removeEventListener("click",Ce)}});const Ne=te=>F(te);function Re(te){se[te?"unshift":"push"](()=>{N=te,t(18,N)})}function be(){I=this.value,t(15,I)}const Se=(te,Fe)=>Z(Fe,te),We=(te,Fe)=>de(Fe,te);function lt(te){se[te?"unshift":"push"](()=>{A=te,t(16,A)})}function ce(te){ze.call(this,n,te)}function He(te){se[te?"unshift":"push"](()=>{L=te,t(17,L)})}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,c=te.items),"multiple"in te&&t(4,d=te.multiple),"disabled"in te&&t(5,m=te.disabled),"selected"in te&&t(0,h=te.selected),"toggle"in te&&t(6,_=te.toggle),"closable"in te&&t(7,v=te.closable),"labelComponent"in te&&t(8,k=te.labelComponent),"labelComponentProps"in te&&t(9,y=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,$=te.searchFunc),"class"in te&&t(13,D=te.class),"$$scope"in te&&t(42,o=te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&c&&(ne(),J()),n.$$.dirty[0]&67141632&&t(20,i=ue(c,I)),n.$$.dirty[0]&1&&t(19,s=function(te){const Fe=H.toArray(h);return H.inArray(Fe,te)})},[h,a,u,f,d,m,_,v,k,y,T,C,M,D,F,I,A,L,N,s,i,J,Z,de,ge,r,c,$,R,K,x,U,X,l,Ne,Re,be,Se,We,lt,ce,He,o]}class eu extends ye{constructor(e){super(),ve(this,e,K3,W3,he,{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 Uc(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&w(e)}}}function J3(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&&Uc(n);return{c(){l&&l.c(),e=O(),t=b("span"),s=B(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),g(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Uc(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:G,o:G,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function Z3(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Wc extends ye{constructor(e){super(),ve(this,e,Z3,J3,he,{item:0})}}const G3=n=>({}),Yc=n=>({});function X3(n){let e;const t=n[8].afterOptions,i=Nt(t,n,n[12],Yc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Rt(i,t,s,s[12],e?Ft(t,s[12],l,G3):qt(s[12]),Yc)},i(s){e||(E(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function Q3(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:[X3]},$$scope:{ctx:n}};for(let r=0;r_e(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?on(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&xn(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function x3(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Et(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Wc}=e,{optionComponent:c=Wc}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=H.toArray(T,!0);let C=[];for(let M of T){const $=H.findByKey(r,d,M);$&&C.push($)}T.length&&!C.length||t(0,u=a?C:C[0])}async function _(T){let C=H.toArray(T,!0).map(M=>M[d]);r.length&&t(6,m=a?C:C[0])}function v(T){u=T,t(0,u)}function k(T){ze.call(this,n,T)}function y(T){ze.call(this,n,T)}return n.$$set=T=>{e=Je(Je({},e),Qn(T)),t(5,s=Et(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,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(u)},[u,r,a,f,c,s,m,d,l,v,k,y,o]}class is extends ye{constructor(e){super(),ve(this,e,x3,Q3,he,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function eT(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;r_e(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&14?on(s,[a&2&&{class:"field-type-select "+r[1]},a&4&&{items:r[2]},a&8&&xn(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function tT(n,e,t){const i=["value","class"];let s=Et(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Plain text",value:"text",icon:H.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:H.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:H.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:H.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:H.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:H.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:H.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:H.getFieldTypeIcon("select")},{label:"File",value:"file",icon:H.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:H.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:H.getFieldTypeIcon("json")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=Je(Je({},e),Qn(u)),t(3,s=Et(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class nT extends ye{constructor(e){super(),ve(this,e,tT,eT,he,{value:0,class:1})}}function iT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Min length"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].min),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].min&&fe(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function sT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Max length"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].max),a||(u=Y(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].max&&fe(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function lT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=B("Regex pattern"),s=O(),l=b("input"),r=O(),a=b("div"),a.innerHTML="Valid Go regular expression, eg. ^\\w+$.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),fe(l,n[0].pattern),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&fe(l,c[0].pattern)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function oT(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[iT,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[sT,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[lT,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){S(c,e,d),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),f=!0},p(c,[d]){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&97&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&97&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&97&&(_.$$scope={dirty:d,ctx:c}),u.$set(_)},i(c){f||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&w(e),j(i),j(o),j(u)}}}function rT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=pt(this.value),t(0,s)}function o(){s.max=pt(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class aT extends ye{constructor(e){super(),ve(this,e,rT,oT,he,{key:1,options:0})}}function uT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Min"),s=O(),l=b("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].min),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].min&&fe(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function fT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Max"),s=O(),l=b("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].max),a||(u=Y(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].max&&fe(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function cT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[uT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[fT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function dT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=pt(this.value),t(0,s)}function o(){s.max=pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class pT extends ye{constructor(e){super(),ve(this,e,dT,cT,he,{key:1,options:0})}}function mT(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class hT extends ye{constructor(e){super(),ve(this,e,mT,null,he,{key:0,options:1})}}function _T(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=H.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=Je(Je({},e),Qn(u)),t(3,l=Et(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 Ns extends ye{constructor(e){super(),ve(this,e,gT,_T,he,{value:0,separator:1})}}function bT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[2](v)}let _={id:n[4],disabled:!H.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(_.value=n[0].exceptDomains),r=new Ns({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Ue.call(null,s,{text:`List of domains that are NOT allowed. This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]),k&1&&(y.disabled=!H.isEmpty(v[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=v[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function vT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[3](v)}let _={id:n[4]+".options.onlyDomains",disabled:!H.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new Ns({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Ue.call(null,s,{text:`List of domains that are ONLY allowed. This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]+".options.onlyDomains"))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]+".options.onlyDomains"),k&1&&(y.disabled=!H.isEmpty(v[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=v[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function yT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[bT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[vT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function kT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class Eb extends ye{constructor(e){super(),ve(this,e,kT,yT,he,{key:1,options:0})}}function wT(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new Eb({props:r}),se.push(()=>_e(e,"key",l)),se.push(()=>_e(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],ke(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],ke(()=>i=!1)),e.$set(f)},i(a){s||(E(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function ST(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class TT extends ye{constructor(e){super(),ve(this,e,ST,wT,he,{key:0,options:1})}}function CT(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class $T extends ye{constructor(e){super(),ve(this,e,CT,null,he,{key:0,options:1})}}var Sr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",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},gl={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},an=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},$n=function(n){return n===!0?1:0};function Kc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Tr=function(n){return n instanceof Array?n:[n]};function Qt(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function st(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function io(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Ab(n,e){if(e(n))return n;if(n.parentNode)return Ab(n.parentNode,e)}function so(n,e){var t=st("div","numInputWrapper"),i=st("input","numInput "+n),s=st("span","arrowUp"),l=st("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 _n(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Cr=function(){},Lo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},MT={D:Cr,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*$n(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:Cr,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:Cr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Wi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ol={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ol.w(n,e,t)]},F:function(n,e,t){return Lo(ol.n(n,e,t)-1,!1,e)},G:function(n,e,t){return an(ol.h(n,e,t))},H:function(n){return an(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[$n(n.getHours()>11)]},M:function(n,e){return Lo(n.getMonth(),!0,e)},S:function(n){return an(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return an(n.getFullYear(),4)},d:function(n){return an(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return an(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return an(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)}},Ib=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?gl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return ol[c]&&m[d-1]!=="\\"?ol[c](r,f,t):c!=="\\"?c:""}).join("")}},fa=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?gl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ws).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var h=void 0,_=[],v=0,k=0,y="";vMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ee=Mr(t.config);W.setHours(ee.hours,ee.minutes,ee.seconds,W.getMilliseconds()),t.selectedDates=[W],t.latestSelectedDateObj=W}z!==void 0&&z.type!=="blur"&&Fl(z);var oe=t._input.value;c(),Ht(),t._input.value!==oe&&t._debouncedChange()}function u(z,W){return z%12+12*$n(W===t.l10n.amPM[1])}function f(z){switch(z%24){case 0:case 12:return 12;default:return z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,W=(parseInt(t.minuteElement.value,10)||0)%60,ee=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(z=u(z,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&gn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&gn(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 De=$r(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ee=$r(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),$e=$r(z,W,ee);if($e>Ee&&$e=12)]),t.secondElement!==void 0&&(t.secondElement.value=an(ee)))}function h(z){var W=_n(z),ee=parseInt(W.value)+(z.delta||0);(ee/1e3>1||z.key==="Enter"&&!/[^\d]/.test(ee.toString()))&&be(ee)}function _(z,W,ee,oe){if(W instanceof Array)return W.forEach(function(Te){return _(z,Te,ee,oe)});if(z instanceof Array)return z.forEach(function(Te){return _(Te,W,ee,oe)});z.addEventListener(W,ee,oe),t._handlers.push({remove:function(){return z.removeEventListener(W,ee,oe)}})}function v(){Ze("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ee){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ee+"]"),function(oe){return _(oe,"click",t[ee])})}),t.isMobile){os();return}var z=Kc(te,50);if(t._debouncedChange=Kc(v,AT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ee){t.config.mode==="range"&&He(_n(ee))}),_(t._input,"keydown",ce),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",ce),!t.config.inline&&!t.config.static&&_(window,"resize",z),window.ontouchstart!==void 0?_(window.document,"touchstart",Re):_(window.document,"mousedown",Re),_(window.document,"focus",Re,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",Xt),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",di)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var W=function(ee){return _n(ee).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],W),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ee){a(ee)})}t.config.allowInput&&_(t._input,"blur",lt)}function y(z,W){var ee=z!==void 0?t.parseDate(z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(z);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 De=st("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(De,t.element),De.appendChild(t.element),t.altInput&&De.appendChild(t.altInput),De.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function $(z,W,ee,oe){var Te=Se(W,!0),De=st("span",z,W.getDate().toString());return De.dateObj=W,De.$i=oe,De.setAttribute("aria-label",t.formatDate(W,t.config.ariaDateFormat)),z.indexOf("hidden")===-1&&gn(W,t.now)===0&&(t.todayDateElem=De,De.classList.add("today"),De.setAttribute("aria-current","date")),Te?(De.tabIndex=-1,ti(W)&&(De.classList.add("selected"),t.selectedDateElem=De,t.config.mode==="range"&&(Qt(De,"startRange",t.selectedDates[0]&&gn(W,t.selectedDates[0],!0)===0),Qt(De,"endRange",t.selectedDates[1]&&gn(W,t.selectedDates[1],!0)===0),z==="nextMonthDay"&&De.classList.add("inRange")))):De.classList.add("flatpickr-disabled"),t.config.mode==="range"&&as(W)&&!ti(W)&&De.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&z!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(W)+""),Ze("onDayCreate",De),De}function D(z){z.focus(),t.config.mode==="range"&&He(z)}function A(z){for(var W=z>0?0:t.config.showMonths-1,ee=z>0?t.config.showMonths:-1,oe=W;oe!=ee;oe+=z)for(var Te=t.daysContainer.children[oe],De=z>0?0:Te.children.length-1,Ee=z>0?Te.children.length:-1,$e=De;$e!=Ee;$e+=z){var Be=Te.children[$e];if(Be.className.indexOf("hidden")===-1&&Se(Be.dateObj))return Be}}function I(z,W){for(var ee=z.className.indexOf("Month")===-1?z.dateObj.getMonth():t.currentMonth,oe=W>0?t.config.showMonths:-1,Te=W>0?1:-1,De=ee-t.currentMonth;De!=oe;De+=Te)for(var Ee=t.daysContainer.children[De],$e=ee-t.currentMonth===De?z.$i+W:W<0?Ee.children.length-1:0,Be=Ee.children.length,Le=$e;Le>=0&&Le0?Be:-1);Le+=Te){var Ve=Ee.children[Le];if(Ve.className.indexOf("hidden")===-1&&Se(Ve.dateObj)&&Math.abs(z.$i-Le)>=Math.abs(W))return D(Ve)}t.changeMonth(Te),L(A(Te),0)}function L(z,W){var ee=l(),oe=We(ee||document.body),Te=z!==void 0?z:oe?ee:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:A(W>0?1:-1);Te===void 0?t._input.focus():oe?I(Te,W):D(Te)}function N(z,W){for(var ee=(new Date(z,W,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((W-1+12)%12,z),Te=t.utils.getDaysInMonth(W,z),De=window.document.createDocumentFragment(),Ee=t.config.showMonths>1,$e=Ee?"prevMonthDay hidden":"prevMonthDay",Be=Ee?"nextMonthDay hidden":"nextMonthDay",Le=oe+1-ee,Ve=0;Le<=oe;Le++,Ve++)De.appendChild($("flatpickr-day "+$e,new Date(z,W-1,Le),Le,Ve));for(Le=1;Le<=Te;Le++,Ve++)De.appendChild($("flatpickr-day",new Date(z,W,Le),Le,Ve));for(var mt=Te+1;mt<=42-ee&&(t.config.showMonths===1||Ve%7!==0);mt++,Ve++)De.appendChild($("flatpickr-day "+Be,new Date(z,W+1,mt%Te),mt,Ve));var Yn=st("div","dayContainer");return Yn.appendChild(De),Yn}function F(){if(t.daysContainer!==void 0){io(t.daysContainer),t.weekNumbers&&io(t.weekNumbers);for(var z=document.createDocumentFragment(),W=0;W1||t.config.monthSelectorType!=="dropdown")){var z=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 W=0;W<12;W++)if(z(W)){var ee=st("option","flatpickr-monthDropdown-month");ee.value=new Date(t.currentYear,W).getMonth().toString(),ee.textContent=Lo(W,t.config.shorthandCurrentMonth,t.l10n),ee.tabIndex=-1,t.currentMonth===W&&(ee.selected=!0),t.monthsDropdownContainer.appendChild(ee)}}}function K(){var z=st("div","flatpickr-month"),W=window.document.createDocumentFragment(),ee;t.config.showMonths>1||t.config.monthSelectorType==="static"?ee=st("span","cur-month"):(t.monthsDropdownContainer=st("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Ee){var $e=_n(Ee),Be=parseInt($e.value,10);t.changeMonth(Be-t.currentMonth),Ze("onMonthChange")}),R(),ee=t.monthsDropdownContainer);var oe=so("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 De=st("div","flatpickr-current-month");return De.appendChild(ee),De.appendChild(oe),W.appendChild(De),z.appendChild(W),{container:z,yearElement:Te,monthElement:ee}}function x(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var z=t.config.showMonths;z--;){var W=K();t.yearElements.push(W.yearElement),t.monthElements.push(W.monthElement),t.monthNav.appendChild(W.container)}t.monthNav.appendChild(t.nextMonthNav)}function U(){return t.monthNav=st("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=st("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=st("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,x(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(z){t.__hidePrevMonthArrow!==z&&(Qt(t.prevMonthNav,"flatpickr-disabled",z),t.__hidePrevMonthArrow=z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(z){t.__hideNextMonthArrow!==z&&(Qt(t.nextMonthNav,"flatpickr-disabled",z),t.__hideNextMonthArrow=z)}}),t.currentYearElement=t.yearElements[0],Li(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var z=Mr(t.config);t.timeContainer=st("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var W=st("span","flatpickr-time-separator",":"),ee=so("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ee.getElementsByTagName("input")[0];var oe=so("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?z.hours:f(z.hours)),t.minuteElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ee),t.timeContainer.appendChild(W),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=so("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():z.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(st("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=st("span","flatpickr-am-pm",t.l10n.amPM[$n((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ne(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=st("div","flatpickr-weekdays");for(var z=t.config.showMonths;z--;){var W=st("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(W)}return J(),t.weekdayContainer}function J(){if(t.weekdayContainer){var z=t.l10n.firstDayOfWeek,W=Jc(t.l10n.weekdays.shorthand);z>0&&z `+W.join("")+` `}}function ue(){t.calendarContainer.classList.add("hasWeeks");var z=st("div","flatpickr-weekwrapper");z.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=st("div","flatpickr-weeks");return z.appendChild(W),{weekWrapper:z,weekNumbers:W}}function Z(z,W){W===void 0&&(W=!0);var ee=W?z:z-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),R()),F(),Ze("onMonthChange"),Li())}function de(z,W){if(z===void 0&&(z=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Mr(t.config),oe=ee.hours,Te=ee.minutes,De=ee.seconds;m(oe,Te,De)}t.redraw(),z&&Ze("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Ce(){t.config!==void 0&&Ze("onDestroy");for(var z=t._handlers.length;z--;)t._handlers[z].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ee){try{delete t[ee]}catch{}})}function Ne(z){return t.calendarContainer.contains(z)}function Re(z){if(t.isOpen&&!t.config.inline){var W=_n(z),ee=Ne(W),oe=W===t.input||W===t.altInput||t.element.contains(W)||z.path&&z.path.indexOf&&(~z.path.indexOf(t.input)||~z.path.indexOf(t.altInput)),Te=!oe&&!ee&&!Ne(z.relatedTarget),De=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(W)});Te&&De&&(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 be(z){if(!(!z||t.config.minDate&&zt.config.maxDate.getFullYear())){var W=z,ee=t.currentYear!==W;t.currentYear=W||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ee&&(t.redraw(),Ze("onYearChange"),R())}}function Se(z,W){var ee;W===void 0&&(W=!0);var oe=t.parseDate(z,void 0,W);if(t.config.minDate&&oe&&gn(oe,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&oe&&gn(oe,t.config.maxDate,W!==void 0?W:!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,De=(ee=t.config.enable)!==null&&ee!==void 0?ee:t.config.disable,Ee=0,$e=void 0;Ee=$e.from.getTime()&&oe.getTime()<=$e.to.getTime())return Te}return!Te}function We(z){return t.daysContainer!==void 0?z.className.indexOf("hidden")===-1&&z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(z):!1}function lt(z){var W=z.target===t._input,ee=t._input.value.trimEnd()!==Ni();W&&ee&&!(z.relatedTarget&&Ne(z.relatedTarget))&&t.setDate(t._input.value,!0,z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function ce(z){var W=_n(z),ee=t.config.wrap?n.contains(W):W===t._input,oe=t.config.allowInput,Te=t.isOpen&&(!oe||!ee),De=t.config.inline&&ee&&!oe;if(z.keyCode===13&&ee){if(oe)return t.setDate(t._input.value,!0,W===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),W.blur();t.open()}else if(Ne(W)||Te||De){var Ee=!!t.timeContainer&&t.timeContainer.contains(W);switch(z.keyCode){case 13:Ee?(z.preventDefault(),a(),Gt()):di(z);break;case 27:z.preventDefault(),Gt();break;case 8:case 46:ee&&!t.config.allowInput&&(z.preventDefault(),t.clear());break;case 37:case 39:if(!Ee&&!ee){z.preventDefault();var $e=l();if(t.daysContainer!==void 0&&(oe===!1||$e&&We($e))){var Be=z.keyCode===39?1:-1;z.ctrlKey?(z.stopPropagation(),Z(Be),L(A(1),0)):L(void 0,Be)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:z.preventDefault();var Le=z.keyCode===40?1:-1;t.daysContainer&&W.$i!==void 0||W===t.input||W===t.altInput?z.ctrlKey?(z.stopPropagation(),be(t.currentYear-Le),L(A(1),0)):Ee||L(void 0,Le*7):W===t.currentYearElement?be(t.currentYear-Le):t.config.enableTime&&(!Ee&&t.hourElement&&t.hourElement.focus(),a(z),t._debouncedChange());break;case 9:if(Ee){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(hn){return hn}),mt=Ve.indexOf(W);if(mt!==-1){var Yn=Ve[mt+(z.shiftKey?-1:1)];z.preventDefault(),(Yn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(W)&&z.shiftKey&&(z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&W===t.amPM)switch(z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Ht();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ht();break}(ee||Ne(W))&&Ze("onKeyDown",z)}function He(z,W){if(W===void 0&&(W="flatpickr-day"),!(t.selectedDates.length!==1||z&&(!z.classList.contains(W)||z.classList.contains("flatpickr-disabled")))){for(var ee=z?z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ee,t.selectedDates[0].getTime()),De=Math.max(ee,t.selectedDates[0].getTime()),Ee=!1,$e=0,Be=0,Le=Te;LeTe&&Le$e)?$e=Le:Le>oe&&(!Be||Le ."+W));Ve.forEach(function(mt){var Yn=mt.dateObj,hn=Yn.getTime(),Fs=$e>0&&hn<$e||Be>0&&hn>Be;if(Fs){mt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(us){mt.classList.remove(us)});return}else if(Ee&&!Fs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(us){mt.classList.remove(us)}),z!==void 0&&(z.classList.add(ee<=t.selectedDates[0].getTime()?"startRange":"endRange"),oeee&&hn===oe&&mt.classList.add("endRange"),hn>=$e&&(Be===0||hn<=Be)&&OT(hn,oe,ee)&&mt.classList.add("inRange"))})}}function te(){t.isOpen&&!t.config.static&&!t.config.inline&&we()}function Fe(z,W){if(W===void 0&&(W=t._positionElement),t.isMobile===!0){if(z){z.preventDefault();var ee=_n(z);ee&&ee.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Ze("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"),Ze("onOpen"),we(W)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(z===void 0||!t.timeContainer.contains(z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ot(z){return function(W){var ee=t.config["_"+z+"Date"]=t.parseDate(W,t.config.dateFormat),oe=t.config["_"+(z==="min"?"max":"min")+"Date"];ee!==void 0&&(t[z==="min"?"minDateHasTime":"maxDateHasTime"]=ee.getHours()>0||ee.getMinutes()>0||ee.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return Se(Te)}),!t.selectedDates.length&&z==="min"&&d(ee),Ht()),t.daysContainer&&(bt(),ee!==void 0?t.currentYearElement[z]=ee.getFullYear().toString():t.currentYearElement.removeAttribute(z),t.currentYearElement.disabled=!!oe&&ee!==void 0&&oe.getFullYear()===ee.getFullYear())}}function Vt(){var z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],W=Ut(Ut({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ee={};t.config.parseDate=W.parseDate,t.config.formatDate=W.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=pi(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=pi(Ve)}});var oe=W.mode==="time";if(!W.dateFormat&&(W.enableTime||oe)){var Te=Dt.defaultConfig.dateFormat||ws.dateFormat;ee.dateFormat=W.noCalendar||oe?"H:i"+(W.enableSeconds?":S":""):Te+" H:i"+(W.enableSeconds?":S":"")}if(W.altInput&&(W.enableTime||oe)&&!W.altFormat){var De=Dt.defaultConfig.altFormat||ws.altFormat;ee.altFormat=W.noCalendar||oe?"h:i"+(W.enableSeconds?":S K":" K"):De+(" h:i"+(W.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ot("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ot("max")});var Ee=function(Ve){return function(mt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(mt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ee("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ee("max")}),W.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ee,W);for(var $e=0;$e-1?t.config[Le]=Tr(Be[Le]).map(o).concat(t.config[Le]):typeof W[Le]>"u"&&(t.config[Le]=Be[Le])}W.altInputClass||(t.config.altInputClass=Ae().className+" "+t.config.altInputClass),Ze("onParseConfig")}function Ae(){return t.config.wrap?n.querySelector("[data-input]"):n}function ie(){typeof t.config.locale!="object"&&typeof Dt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Ut(Ut({},Dt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Dt.l10ns[t.config.locale]:void 0),Wi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Wi.l="("+t.l10n.weekdays.longhand.join("|")+")",Wi.M="("+t.l10n.months.shorthand.join("|")+")",Wi.F="("+t.l10n.months.longhand.join("|")+")",Wi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var z=Ut(Ut({},e),JSON.parse(JSON.stringify(n.dataset||{})));z.time_24hr===void 0&&Dt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Ib(t),t.parseDate=fa({config:t.config,l10n:t.l10n})}function we(z){if(typeof t.config.position=="function")return void t.config.position(t,z);if(t.calendarContainer!==void 0){Ze("onPreCalendarPosition");var W=z||t._positionElement,ee=Array.prototype.reduce.call(t.calendarContainer.children,function(Ub,Wb){return Ub+Wb.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),De=Te[0],Ee=Te.length>1?Te[1]:null,$e=W.getBoundingClientRect(),Be=window.innerHeight-$e.bottom,Le=De==="above"||De!=="below"&&Beee,Ve=window.pageYOffset+$e.top+(Le?-ee-2:W.offsetHeight+2);if(Qt(t.calendarContainer,"arrowTop",!Le),Qt(t.calendarContainer,"arrowBottom",Le),!t.config.inline){var mt=window.pageXOffset+$e.left,Yn=!1,hn=!1;Ee==="center"?(mt-=(oe-$e.width)/2,Yn=!0):Ee==="right"&&(mt-=oe-$e.width,hn=!0),Qt(t.calendarContainer,"arrowLeft",!Yn&&!hn),Qt(t.calendarContainer,"arrowCenter",Yn),Qt(t.calendarContainer,"arrowRight",hn);var Fs=window.document.body.offsetWidth-(window.pageXOffset+$e.right),us=mt+oe>window.document.body.offsetWidth,Rb=Fs+oe>window.document.body.offsetWidth;if(Qt(t.calendarContainer,"rightMost",us),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!us)t.calendarContainer.style.left=mt+"px",t.calendarContainer.style.right="auto";else if(!Rb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Fs+"px";else{var Qo=nt();if(Qo===void 0)return;var qb=window.document.body.offsetWidth,jb=Math.max(0,qb/2-oe/2),Vb=".flatpickr-calendar.centerMost:before",Hb=".flatpickr-calendar.centerMost:after",zb=Qo.cssRules.length,Bb="{left:"+$e.left+"px;right:auto;}";Qt(t.calendarContainer,"rightMost",!1),Qt(t.calendarContainer,"centerMost",!0),Qo.insertRule(Vb+","+Hb+Bb,zb),t.calendarContainer.style.left=jb+"px",t.calendarContainer.style.right="auto"}}}}function nt(){for(var z=null,W=0;Wt.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 Ee=ti(Te);Ee?t.selectedDates.splice(parseInt(Ee),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),gn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,mt){return Ve.getTime()-mt.getTime()}));if(c(),De){var $e=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),$e&&(Ze("onYearChange"),R()),Ze("onMonthChange")}if(Li(),F(),Ht(),!De&&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 Be=t.config.mode==="single"&&!t.config.enableTime,Le=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Be||Le)&&Gt()}v()}}var ft={locale:[ie,J],showMonths:[x,r,ne],minDate:[y],maxDate:[y],positionElement:[Pi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Wn(z,W){if(z!==null&&typeof z=="object"){Object.assign(t.config,z);for(var ee in z)ft[ee]!==void 0&&ft[ee].forEach(function(oe){return oe()})}else t.config[z]=W,ft[z]!==void 0?ft[z].forEach(function(oe){return oe()}):Sr.indexOf(z)>-1&&(t.config[z]=Tr(W));t.redraw(),Ht(!0)}function ss(z,W){var ee=[];if(z instanceof Array)ee=z.map(function(oe){return t.parseDate(oe,W)});else if(z instanceof Date||typeof z=="number")ee=[t.parseDate(z,W)];else if(typeof z=="string")switch(t.config.mode){case"single":case"time":ee=[t.parseDate(z,W)];break;case"multiple":ee=z.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,W)});break;case"range":ee=z.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,W)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(z)));t.selectedDates=t.config.allowInvalidPreload?ee:ee.filter(function(oe){return oe instanceof Date&&Se(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Te){return oe.getTime()-Te.getTime()})}function Ll(z,W,ee){if(W===void 0&&(W=!1),ee===void 0&&(ee=t.config.dateFormat),z!==0&&!z||z instanceof Array&&z.length===0)return t.clear(W);ss(z,ee),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),y(void 0,W),d(),t.selectedDates.length===0&&t.clear(!1),Ht(W),W&&Ze("onChange")}function pi(z){return z.slice().map(function(W){return typeof W=="string"||typeof W=="number"||W instanceof Date?t.parseDate(W,void 0,!0):W&&typeof W=="object"&&W.from&&W.to?{from:t.parseDate(W.from,void 0),to:t.parseDate(W.to,void 0)}:W}).filter(function(W){return W})}function ls(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);z&&ss(z,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 Nl(){if(t.input=Ae(),!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=st(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"),Pi()}function Pi(){t._positionElement=t.config.positionElement||t._input}function os(){var z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=st("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=z==="datetime-local"?"Y-m-d\\TH:i:S":z==="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{}_(t.mobileInput,"change",function(W){t.setDate(_n(W).value,!1,t.mobileFormatStr),Ze("onChange"),Ze("onClose")})}function rn(z){if(t.isOpen===!0)return t.close();t.open(z)}function Ze(z,W){if(t.config!==void 0){var ee=t.config[z];if(ee!==void 0&&ee.length>0)for(var oe=0;ee[oe]&&oe=0&&gn(z,t.selectedDates[1])<=0}function Li(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(z,W){var ee=new Date(t.currentYear,t.currentMonth,1);ee.setMonth(t.currentMonth+W),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[W].textContent=Lo(ee.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ee.getMonth().toString(),z.value=ee.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 Ni(z){var W=z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ee){return t.formatDate(ee,W)}).filter(function(ee,oe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ee)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ht(z){z===void 0&&(z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ni(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ni(t.config.altFormat)),z!==!1&&Ze("onValueUpdate")}function Xt(z){var W=_n(z),ee=t.prevMonthNav.contains(W),oe=t.nextMonthNav.contains(W);ee||oe?Z(ee?-1:1):t.yearElements.indexOf(W)>=0?W.select():W.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):W.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Fl(z){z.preventDefault();var W=z.type==="keydown",ee=_n(z),oe=ee;t.amPM!==void 0&&ee===t.amPM&&(t.amPM.textContent=t.l10n.amPM[$n(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(oe.getAttribute("min")),De=parseFloat(oe.getAttribute("max")),Ee=parseFloat(oe.getAttribute("step")),$e=parseInt(oe.value,10),Be=z.delta||(W?z.which===38?1:-1:0),Le=$e+Ee*Be;if(typeof oe.value<"u"&&oe.value.length===2){var Ve=oe===t.hourElement,mt=oe===t.minuteElement;LeDe&&(Le=oe===t.hourElement?Le-De-$n(!t.amPM):Te,mt&&C(void 0,1,t.hourElement)),t.amPM&&Ve&&(Ee===1?Le+$e===23:Math.abs(Le-$e)>Ee)&&(t.amPM.textContent=t.l10n.amPM[$n(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=an(Le)}}return s(),t}function Ss(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function FT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Et(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;Zt(()=>{const C=f??h,M=k(d);return M.onReady.push(($,D,A)=>{a===void 0&&y($,D,A),sn().then(()=>{t(8,m=!0)})}),t(3,_=Dt(C,Object.assign(M,f?{wrap:!0}:{}))),()=>{_.destroy()}});const v=$t();function k(C={}){C=Object.assign({},C);for(const M of r){const $=(D,A,I)=>{v(NT(M),[D,A,I])};M in C?(Array.isArray(C[M])||(C[M]=[C[M]]),C[M].push($)):C[M]=[$]}return C.onChange&&!C.onChange.includes(y)&&C.onChange.push(y),C}function y(C,M,$){const D=Zc($,C);!Gc(a,D)&&(a||D)&&t(2,a=D),t(4,u=M)}function T(C){se[C?"unshift":"push"](()=>{h=C,t(0,h)})}return n.$$set=C=>{e=Je(Je({},e),Qn(C)),t(1,s=Et(e,i)),"value"in C&&t(2,a=C.value),"formattedValue"in C&&t(4,u=C.formattedValue),"element"in C&&t(5,f=C.element),"dateFormat"in C&&t(6,c=C.dateFormat),"options"in C&&t(7,d=C.options),"input"in C&&t(0,h=C.input),"flatpickr"in C&&t(3,_=C.flatpickr),"$$scope"in C&&t(9,o=C.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(Gc(a,Zc(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[C,M]of Object.entries(k(d)))_.set(C,M)},[h,s,a,_,u,f,c,d,m,o,l,T]}class tu extends ye{constructor(e){super(),ve(this,e,FT,LT,he,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function RT(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:H.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new tu({props:u}),se.push(()=>_e(l,"formattedValue",a)),{c(){e=b("label"),t=B("Min date (UTC)"),s=O(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function qT(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:H.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new tu({props:u}),se.push(()=>_e(l,"formattedValue",a)),{c(){e=b("label"),t=B("Max date (UTC)"),s=O(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function jT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[RT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[qT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function VT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class HT extends ye{constructor(e){super(),ve(this,e,VT,jT,he,{key:1,options:0})}}function zT(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new Ns({props:c}),se.push(()=>_e(l,"value",f)),{c(){e=b("label"),t=B("Choices"),s=O(),V(l.$$.fragment),r=O(),a=b("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),q(l,d,m),S(d,r,m),S(d,a,m),u=!0},p(d,m){(!u||m&16&&i!==(i=d[4]))&&p(e,"for",i);const h={};m&16&&(h.id=d[4]),!o&&m&1&&(o=!0,h.value=d[0].values,ke(()=>o=!1)),l.$set(h)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&w(e),d&&w(s),j(l,d),d&&w(r),d&&w(a)}}}function BT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Max select"),s=O(),l=b("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].maxSelect),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].maxSelect&&fe(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function UT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[zT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[BT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function WT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&H.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class YT extends ye{constructor(e){super(),ve(this,e,WT,UT,he,{key:1,options:0})}}function KT(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function JT(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Xc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D='"{"a":1,"b":2}"',A,I,L,N,F,R,K,x,U,X,ne,J,ue;return{c(){e=b("div"),t=b("div"),i=b("div"),s=B("In order to support seamlessly both "),l=b("code"),l.textContent="application/json",o=B(` and `),r=b("code"),r.textContent="multipart/form-data",a=B(` requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=B(` field is a `),c=b("strong"),c.textContent="plain string",d=B(`: `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",_=O(),v=b("li"),v.innerHTML=""false" is converted to the json false",k=O(),y=b("li"),y.innerHTML=""null" is converted to the json null",T=O(),C=b("li"),C.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",M=O(),$=b("li"),A=B(D),I=B(" is converted to the json "),L=b("code"),L.textContent='{"a":1,"b":2}',N=O(),F=b("li"),F.textContent="numeric strings are converted to json number",R=O(),K=b("li"),K.textContent="double quoted strings are left as they are (aka. without normalizations)",x=O(),U=b("li"),U.textContent="any other string (empty string too) is double quoted",X=B(` Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside an object, eg.`),ne=b("code"),ne.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Z,de){S(Z,e,de),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(m,h),g(m,_),g(m,v),g(m,k),g(m,y),g(m,T),g(m,C),g(m,M),g(m,$),g($,A),g($,I),g($,L),g(m,N),g(m,F),g(m,R),g(m,K),g(m,x),g(m,U),g(i,X),g(i,ne),ue=!0},i(Z){ue||(Z&&xe(()=>{J||(J=je(e,At,{duration:150},!0)),J.run(1)}),ue=!0)},o(Z){Z&&(J||(J=je(e,At,{duration:150},!1)),J.run(0)),ue=!1},d(Z){Z&&w(e),Z&&J&&J.end()}}}function ZT(n){let e,t,i,s,l,o,r;function a(d,m){return d[0]?JT:KT}let u=a(n),f=u(n),c=n[0]&&Xc();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=O(),f.c(),s=O(),c&&c.c(),l=Me(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){S(d,e,m),g(e,t),g(e,i),f.m(e,null),S(d,s,m),c&&c.m(d,m),S(d,l,m),o||(r=Y(e,"click",n[3]),o=!0)},p(d,[m]){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[0]?c?m&1&&E(c,1):(c=Xc(),c.c(),E(c,1),c.m(l.parentNode,l)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){E(c)},o(d){P(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function GT(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class XT extends ye{constructor(e){super(),ve(this,e,GT,ZT,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function QT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=B(t),s=O(),l=b("small"),r=B(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),S(a,l,u),g(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:G,o:G,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function xT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Qc extends ye{constructor(e){super(),ve(this,e,xT,QT,he,{item:0})}}const eC=[{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 tC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Max file size (bytes)"),s=O(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"min","0")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].maxSize),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].maxSize&&fe(l,u[0].maxSize)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function nC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Max files"),s=O(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"min",""),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].maxSelect),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].maxSelect&&fe(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=O(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=O(),l=b("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=O(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){S(f,e,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),S(f,o,c),S(f,r,c),a||(u=[Y(e,"click",n[6]),Y(i,"click",n[7]),Y(l,"click",n[8]),Y(r,"click",n[9])],a=!0)},p:G,d(f){f&&w(e),f&&w(t),f&&w(i),f&&w(s),f&&w(l),f&&w(o),f&&w(r),a=!1,Pe(u)}}}function sC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T;function C($){n[5]($)}let M={id:n[12],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[2],labelComponent:Qc,optionComponent:Qc};return n[0].mimeTypes!==void 0&&(M.keyOfSelected=n[0].mimeTypes),r=new is({props:M}),se.push(()=>_e(r,"keyOfSelected",C)),v=new ei({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[iC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),c=b("button"),d=b("span"),d.textContent="Choose presets",m=O(),h=b("i"),_=O(),V(v.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m($,D){S($,e,D),g(e,t),g(e,i),g(e,s),S($,o,D),q(r,$,D),S($,u,D),S($,f,D),g(f,c),g(c,d),g(c,m),g(c,h),g(c,_),q(v,c,null),k=!0,y||(T=Ie(Ue.call(null,s,{text:`Allow files ONLY with the listed mime types. Leave empty for no restriction.`,position:"top"})),y=!0)},p($,D){(!k||D&4096&&l!==(l=$[12]))&&p(e,"for",l);const A={};D&4096&&(A.id=$[12]),D&4&&(A.items=$[2]),!a&&D&1&&(a=!0,A.keyOfSelected=$[0].mimeTypes,ke(()=>a=!1)),r.$set(A);const I={};D&8193&&(I.$$scope={dirty:D,ctx:$}),v.$set(I)},i($){k||(E(r.$$.fragment,$),E(v.$$.fragment,$),k=!0)},o($){P(r.$$.fragment,$),P(v.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(o),j(r,$),$&&w(u),$&&w(f),j(v),y=!1,T()}}}function lC(n){let e;return{c(){e=b("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
  • `,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function oC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M;function $(A){n[10](A)}let D={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(D.value=n[0].thumbs),r=new Ns({props:D}),se.push(()=>_e(r,"value",$)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[lC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=O(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=O(),v=b("i"),k=O(),V(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(v,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(A,I){S(A,e,I),g(e,t),g(e,i),g(e,s),S(A,o,I),q(r,A,I),S(A,u,I),S(A,f,I),g(f,c),g(f,d),g(f,m),g(m,h),g(m,_),g(m,v),g(m,k),q(y,m,null),T=!0,C||(M=Ie(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,I){(!T||I&4096&&l!==(l=A[12]))&&p(e,"for",l);const L={};I&4096&&(L.id=A[12]),!a&&I&1&&(a=!0,L.value=A[0].thumbs,ke(()=>a=!1)),r.$set(L);const N={};I&8192&&(N.$$scope={dirty:I,ctx:A}),y.$set(N)},i(A){T||(E(r.$$.fragment,A),E(y.$$.fragment,A),T=!0)},o(A){P(r.$$.fragment,A),P(y.$$.fragment,A),T=!1},d(A){A&&w(e),A&&w(o),j(r,A),A&&w(u),A&&w(f),j(y),C=!1,M()}}}function rC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[tC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[nC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[sC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[oC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(h,_){S(h,e,_),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(h,[_]){const v={};_&2&&(v.name="schema."+h[1]+".options.maxSize"),_&12289&&(v.$$scope={dirty:_,ctx:h}),i.$set(v);const k={};_&2&&(k.name="schema."+h[1]+".options.maxSelect"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&2&&(y.name="schema."+h[1]+".options.mimeTypes"),_&12293&&(y.$$scope={dirty:_,ctx:h}),u.$set(y);const T={};_&2&&(T.name="schema."+h[1]+".options.thumbs"),_&12289&&(T.$$scope={dirty:_,ctx:h}),d.$set(T)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(u.$$.fragment,h),E(d.$$.fragment,h),m=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),m=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function aC(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=eC.slice();function o(){if(H.isEmpty(s.mimeTypes))return;const _=[];for(const v of s.mimeTypes)l.find(k=>k.mimeType===v)||_.push({mimeType:v});_.length&&t(2,l=l.concat(_))}function r(){s.maxSize=pt(this.value),t(0,s)}function a(){s.maxSelect=pt(this.value),t(0,s)}function u(_){n.$$.not_equal(s.mimeTypes,_)&&(s.mimeTypes=_,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},d=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},m=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function h(_){n.$$.not_equal(s.thumbs,_)&&(s.thumbs=_,t(0,s))}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"options"in _&&t(0,s=_.options)},n.$$.update=()=>{n.$$.dirty&1&&(H.isEmpty(s)?t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]}):o())},[s,i,l,r,a,u,f,c,d,m,h]}class uC extends ye{constructor(e){super(),ve(this,e,aC,rC,he,{key:1,options:0})}}function fC(n){let e,t,i,s,l;return{c(){e=b("hr"),t=O(),i=b("button"),i.innerHTML=` New collection`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[10]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function cC(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[23],searchable:n[3].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3],$$slots:{afterOptions:[fC]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Collection"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),c&8&&(d.searchable=f[3].length>5),c&8&&(d.items=f[3]),c&16777232&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function dC(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[23],items:n[6]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Relation type"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function xc(n){let e,t,i,s,l,o;return t=new me({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[pC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[mC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),i=O(),s=b("div"),V(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&25165825&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&25165825&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(E(t.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Min select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].minSelect&&fe(l,u[0].minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].minSelect||2)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||2)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].maxSelect&&fe(l,f[0].maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function hC(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[15](h)}let m={multiple:!0,searchable:!0,id:n[23],selectPlaceholder:"Auto",items:n[5]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new eu({props:m}),se.push(()=>_e(r,"selected",d)),{c(){e=b("label"),t=b("span"),t.textContent="Display fields",i=O(),s=b("i"),o=O(),V(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23])},m(h,_){S(h,e,_),g(e,t),g(e,i),g(e,s),S(h,o,_),q(r,h,_),u=!0,f||(c=Ie(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(h,_){(!u||_&8388608&&l!==(l=h[23]))&&p(e,"for",l);const v={};_&8388608&&(v.id=h[23]),_&32&&(v.items=h[5]),!a&&_&1&&(a=!0,v.selected=h[0].displayFields,ke(()=>a=!1)),r.$set(v)},i(h){u||(E(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),j(r,h),f=!1,c()}}}function _C(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[7]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Delete main record on relation delete"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function gC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[cC,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",$$slots:{default:[dC,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}});let k=!n[2]&&xc(n);f=new me({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[hC,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[_C,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}});let y={};return _=new nu({props:y}),n[17](_),_.$on("save",n[18]),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),k&&k.c(),a=O(),u=b("div"),V(f.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),V(_.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(e,"class","grid")},m(T,C){S(T,e,C),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),k&&k.m(e,null),g(e,a),g(e,u),q(f,u,null),g(e,c),g(e,d),q(m,d,null),S(T,h,C),q(_,T,C),v=!0},p(T,[C]){const M={};C&2&&(M.name="schema."+T[1]+".options.collectionId"),C&25165849&&(M.$$scope={dirty:C,ctx:T}),i.$set(M);const $={};C&25165828&&($.$$scope={dirty:C,ctx:T}),o.$set($),T[2]?k&&(re(),P(k,1,1,()=>{k=null}),ae()):k?(k.p(T,C),C&4&&E(k,1)):(k=xc(T),k.c(),E(k,1),k.m(e,a));const D={};C&2&&(D.name="schema."+T[1]+".options.displayFields"),C&25165857&&(D.$$scope={dirty:C,ctx:T}),f.$set(D);const A={};C&2&&(A.name="schema."+T[1]+".options.cascadeDelete"),C&25165825&&(A.$$scope={dirty:C,ctx:T}),m.$set(A);const I={};_.$set(I)},i(T){v||(E(i.$$.fragment,T),E(o.$$.fragment,T),E(k),E(f.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),v=!0)},o(T){P(i.$$.fragment,T),P(o.$$.fragment,T),P(k),P(f.$$.fragment,T),P(m.$$.fragment,T),P(_.$$.fragment,T),v=!1},d(T){T&&w(e),j(i),j(o),k&&k.d(),j(f),j(m),T&&w(h),n[17](null),j(_,T)}}}function bC(n,e,t){let i,s;Ye(n,Ai,L=>t(3,s=L));let{key:l=""}=e,{options:o={}}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}],a=[{label:"False",value:!1},{label:"True",value:!0}],u=["id","created","updated"],f=["username","email","emailVisibility","verified"];let c=null,d=[],m=null,h=(o==null?void 0:o.maxSelect)==1,_=h;function v(){var L;if(t(5,d=u.slice(0)),!!i){i.isAuth&&t(5,d=d.concat(f));for(const N of i.schema)d.push(N.name);if(((L=o==null?void 0:o.displayFields)==null?void 0:L.length)>0)for(let N=o.displayFields.length-1;N>=0;N--)d.includes(o.displayFields[N])||o.displayFields.splice(N,1)}}const k=()=>c==null?void 0:c.show();function y(L){n.$$.not_equal(o.collectionId,L)&&(o.collectionId=L,t(0,o),t(2,h),t(9,_))}function T(L){h=L,t(2,h),t(0,o),t(9,_)}function C(){o.minSelect=pt(this.value),t(0,o),t(2,h),t(9,_)}function M(){o.maxSelect=pt(this.value),t(0,o),t(2,h),t(9,_)}function $(L){n.$$.not_equal(o.displayFields,L)&&(o.displayFields=L,t(0,o),t(2,h),t(9,_))}function D(L){n.$$.not_equal(o.cascadeDelete,L)&&(o.cascadeDelete=L,t(0,o),t(2,h),t(9,_))}function A(L){se[L?"unshift":"push"](()=>{c=L,t(4,c)})}const I=L=>{var N,F;(F=(N=L==null?void 0:L.detail)==null?void 0:N.collection)!=null&&F.id&&t(0,o.collectionId=L.detail.collection.id,o)};return n.$$set=L=>{"key"in L&&t(1,l=L.key),"options"in L&&t(0,o=L.options)},n.$$.update=()=>{n.$$.dirty&5&&H.isEmpty(o)&&(t(0,o={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]}),t(2,h=!0),t(9,_=h)),n.$$.dirty&516&&_!=h&&(t(9,_=h),h?(t(0,o.minSelect=null,o),t(0,o.maxSelect=1,o)):t(0,o.maxSelect=null,o)),n.$$.dirty&9&&(i=s.find(L=>L.id==o.collectionId)||null),n.$$.dirty&257&&m!=o.collectionId&&(t(8,m=o.collectionId),v())},[o,l,h,s,c,d,r,a,m,_,k,y,T,C,M,$,D,A,I]}class vC extends ye{constructor(e){super(),ve(this,e,bC,gC,he,{key:1,options:0})}}function yC(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:n[43],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new nT({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Type"),s=O(),V(l.$$.fragment),p(e,"for",i=n[43])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&4096&&i!==(i=f[43]))&&p(e,"for",i);const d={};c[1]&4096&&(d.id=f[43]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ed(n){let e,t,i;return{c(){e=b("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){S(s,e,l),i=!0},i(s){i||(xe(()=>{t||(t=je(e,An,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=je(e,An,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function kC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[5]&&ed();return{c(){e=b("label"),t=b("span"),t.textContent="Name",i=O(),h&&h.c(),l=O(),o=b("input"),p(t,"class","txt"),p(e,"for",s=n[43]),p(o,"type","text"),p(o,"id",r=n[43]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(_,v){S(_,e,v),g(e,t),g(e,i),h&&h.m(e,null),S(_,l,v),S(_,o,v),c=!0,n[0].id||o.focus(),d||(m=Y(o,"input",n[18]),d=!0)},p(_,v){_[5]?h&&(re(),P(h,1,1,()=>{h=null}),ae()):h?v[0]&32&&E(h,1):(h=ed(),h.c(),E(h,1),h.m(e,null)),(!c||v[1]&4096&&s!==(s=_[43]))&&p(e,"for",s),(!c||v[1]&4096&&r!==(r=_[43]))&&p(o,"id",r),(!c||v[0]&1&&a!==(a=_[0].id&&_[0].system))&&(o.disabled=a),(!c||v[0]&1&&u!==(u=!_[0].id))&&(o.autofocus=u),(!c||v[0]&1&&f!==(f=_[0].name)&&o.value!==f)&&(o.value=f)},i(_){c||(E(h),c=!0)},o(_){P(h),c=!1},d(_){_&&w(e),h&&h.d(),_&&w(l),_&&w(o),d=!1,m()}}}function wC(n){let e,t,i;function s(o){n[29](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new vC({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function SC(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new uC({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TC(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new XT({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function CC(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new YT({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $C(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new HT({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function MC(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new $T({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function OC(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new TT({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function DC(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new Eb({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function EC(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new hT({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function AC(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new pT({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function IC(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new aT({props:l}),se.push(()=>_e(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PC(n){let e,t,i,s,l,o=gs(n[0])+"",r,a,u,f,c,d,m;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),r=B(o),a=O(),u=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(l,"class","txt"),p(u,"class","ri-information-line link-hint"),p(s,"for",c=n[43])},m(h,_){S(h,e,_),e.checked=n[0].required,S(h,i,_),S(h,s,_),g(s,l),g(l,r),g(s,a),g(s,u),d||(m=[Y(e,"change",n[30]),Ie(f=Ue.call(null,u,{text:`Requires the field value to be ${gs(n[0])} (aka. not ${H.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,_){_[1]&4096&&t!==(t=h[43])&&p(e,"id",t),_[0]&1&&(e.checked=h[0].required),_[0]&1&&o!==(o=gs(h[0])+"")&&le(r,o),f&&Bt(f.update)&&_[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])} (aka. not ${H.zeroDefaultStr(h[0])}).`,position:"right"}),_[1]&4096&&c!==(c=h[43])&&p(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Pe(m)}}}function td(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[LC,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function LC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(s,"for",o=n[43])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function nd(n){let e,t,i,s,l,o,r,a,u,f;a=new ei({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[NC]},$$scope:{ctx:n}}});let c=n[8]&&id(n);return{c(){e=b("div"),t=b("div"),i=O(),s=b("div"),l=b("button"),o=b("i"),r=O(),V(a.$$.fragment),u=O(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,m){S(d,e,m),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),q(a,l,null),g(s,u),c&&c.m(s,null),f=!0},p(d,m){const h={};m[1]&8192&&(h.$$scope={dirty:m,ctx:d}),a.$set(h),d[8]?c?c.p(d,m):(c=id(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(E(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function NC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function id(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Done',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[3])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function FC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$;s=new me({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[yC,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:` form-field required `+(n[5]?"":"invalid")+` `+(n[0].id&&n[0].system?"disabled":"")+` `,name:"schema."+n[1]+".name",$$slots:{default:[kC,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});const D=[IC,AC,EC,DC,OC,MC,$C,CC,TC,SC,wC],A=[];function I(F,R){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:-1}~(f=I(n))&&(c=A[f]=D[f](n)),h=new me({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[PC,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&td(n),N=!n[0].toDelete&&nd(n);return{c(){e=b("form"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),a=O(),u=b("div"),c&&c.c(),d=O(),m=b("div"),V(h.$$.fragment),_=O(),v=b("div"),L&&L.c(),k=O(),N&&N.c(),y=O(),T=b("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(v,"class","col-sm-4 flex"),p(t,"class","grid"),p(T,"type","submit"),p(T,"class","hidden"),p(T,"tabindex","-1"),p(e,"class","field-form")},m(F,R){S(F,e,R),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),~f&&A[f].m(u,null),g(t,d),g(t,m),q(h,m,null),g(t,_),g(t,v),L&&L.m(v,null),g(t,k),N&&N.m(t,null),g(e,y),g(e,T),C=!0,M||($=[Y(e,"dragstart",jC),Y(e,"submit",dt(n[32]))],M=!0)},p(F,R){const K={};R[0]&1&&(K.class="form-field required "+(F[0].id?"readonly":"")),R[0]&2&&(K.name="schema."+F[1]+".type"),R[0]&1|R[1]&12288&&(K.$$scope={dirty:R,ctx:F}),s.$set(K);const x={};R[0]&33&&(x.class=` form-field required `+(F[5]?"":"invalid")+` `+(F[0].id&&F[0].system?"disabled":"")+` `),R[0]&2&&(x.name="schema."+F[1]+".name"),R[0]&33|R[1]&12288&&(x.$$scope={dirty:R,ctx:F}),r.$set(x);let U=f;f=I(F),f===U?~f&&A[f].p(F,R):(c&&(re(),P(A[U],1,1,()=>{A[U]=null}),ae()),~f?(c=A[f],c?c.p(F,R):(c=A[f]=D[f](F),c.c()),E(c,1),c.m(u,null)):c=null);const X={};R[0]&1|R[1]&12288&&(X.$$scope={dirty:R,ctx:F}),h.$set(X),F[0].type!=="file"?L?(L.p(F,R),R[0]&1&&E(L,1)):(L=td(F),L.c(),E(L,1),L.m(v,null)):L&&(re(),P(L,1,1,()=>{L=null}),ae()),F[0].toDelete?N&&(re(),P(N,1,1,()=>{N=null}),ae()):N?(N.p(F,R),R[0]&1&&E(N,1)):(N=nd(F),N.c(),E(N,1),N.m(t,null))},i(F){C||(E(s.$$.fragment,F),E(r.$$.fragment,F),E(c),E(h.$$.fragment,F),E(L),E(N),C=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(h.$$.fragment,F),P(L),P(N),C=!1},d(F){F&&w(e),j(s),j(r),~f&&A[f].d(),j(h),L&&L.d(),N&&N.d(),M=!1,Pe($)}}}function sd(n){let e,t,i,s,l=n[0].system&&ld(),o=!n[0].id&&od(n),r=n[0].required&&rd(n),a=n[0].unique&&ad();return{c(){e=b("div"),l&&l.c(),t=O(),o&&o.c(),i=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=ld(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=od(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=rd(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ad(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function ld(n){let e;return{c(){e=b("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function od(n){let e;return{c(){e=b("span"),e.textContent="New",p(e,"class","label"),Q(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&Q(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function rd(n){let e,t=gs(n[0])+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function ad(n){let e;return{c(){e=b("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ud(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[16])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function RC(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,_,v,k=!n[0].toDelete&&sd(n),y=n[7]&&!n[0].system&&ud(),T=n[0].toDelete&&fd(n);return{c(){e=b("div"),t=b("span"),i=b("i"),l=O(),o=b("strong"),a=B(r),f=O(),k&&k.c(),c=O(),d=b("div"),m=O(),y&&y.c(),h=O(),T&&T.c(),_=Me(),p(i,"class",s=Si(H.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),Q(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),S(C,f,M),k&&k.m(C,M),S(C,c,M),S(C,d,M),S(C,m,M),y&&y.m(C,M),S(C,h,M),T&&T.m(C,M),S(C,_,M),v=!0},p(C,M){(!v||M[0]&1&&s!==(s=Si(H.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!v||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&le(a,r),(!v||M[0]&1&&u!==(u=C[0].name))&&p(o,"title",u),(!v||M[0]&1)&&Q(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?k&&(k.d(1),k=null):k?k.p(C,M):(k=sd(C),k.c(),k.m(c.parentNode,c)),C[7]&&!C[0].system?y?M[0]&129&&E(y,1):(y=ud(),y.c(),E(y,1),y.m(h.parentNode,h)):y&&(re(),P(y,1,1,()=>{y=null}),ae()),C[0].toDelete?T?T.p(C,M):(T=fd(C),T.c(),T.m(_.parentNode,_)):T&&(T.d(1),T=null)},i(C){v||(E(y),v=!0)},o(C){P(y),v=!1},d(C){C&&w(e),C&&w(f),k&&k.d(C),C&&w(c),C&&w(d),C&&w(m),y&&y.d(C),C&&w(h),T&&T.d(C),C&&w(_)}}}function qC(n){let e,t;const i=[{draggable:!0},{single:!0},{interactive:n[8]},{class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion"},n[11]];let s={$$slots:{header:[RC],default:[FC]},$$scope:{ctx:n}};for(let l=0;l{n.stopPropagation(),n.preventDefault(),n.stopImmediatePropagation()};function VC(n,e,t){let i,s,l,o;const r=["key","field","disabled","excludeNames","expand","collapse"];let a=Et(e,r),u;Ye(n,fi,ce=>t(15,u=ce));const f=$t();let{key:c="0"}=e,{field:d=new mn}=e,{disabled:m=!1}=e,{excludeNames:h=[]}=e,_,v=d.type;function k(){_==null||_.expand()}function y(){_==null||_.collapse()}function T(){d.id?t(0,d.toDelete=!0,d):(y(),f("remove"))}function C(ce){if(ce=(""+ce).toLowerCase(),!ce)return!1;for(const He of h)if(He.toLowerCase()===ce)return!1;return!0}function M(ce){return H.slugify(ce)}Zt(()=>{d!=null&&d.onMountExpand&&(t(0,d.onMountExpand=!1,d),k())});const $=()=>{t(0,d.toDelete=!1,d)};function D(ce){n.$$.not_equal(d.type,ce)&&(d.type=ce,t(0,d),t(14,v),t(4,_))}const A=ce=>{t(0,d.name=M(ce.target.value),d),ce.target.value=d.name};function I(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function L(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function N(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function F(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function R(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function K(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function x(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function U(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function X(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function ne(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function J(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function ue(){d.required=this.checked,t(0,d),t(14,v),t(4,_)}function Z(){d.unique=this.checked,t(0,d),t(14,v),t(4,_)}const de=()=>{i&&y()};function ge(ce){se[ce?"unshift":"push"](()=>{_=ce,t(4,_)})}function Ce(ce){ze.call(this,n,ce)}function Ne(ce){ze.call(this,n,ce)}function Re(ce){ze.call(this,n,ce)}function be(ce){ze.call(this,n,ce)}function Se(ce){ze.call(this,n,ce)}function We(ce){ze.call(this,n,ce)}function lt(ce){ze.call(this,n,ce)}return n.$$set=ce=>{e=Je(Je({},e),Qn(ce)),t(11,a=Et(e,r)),"key"in ce&&t(1,c=ce.key),"field"in ce&&t(0,d=ce.field),"disabled"in ce&&t(2,m=ce.disabled),"excludeNames"in ce&&t(12,h=ce.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&16385&&v!=d.type&&(t(14,v=d.type),t(0,d.options={},d),t(0,d.unique=!1,d)),n.$$.dirty[0]&17&&d.toDelete&&(_&&y(),d.originalName&&d.name!==d.originalName&&t(0,d.name=d.originalName,d)),n.$$.dirty[0]&1&&!d.originalName&&d.name&&t(0,d.originalName=d.name,d),n.$$.dirty[0]&1&&typeof d.toDelete>"u"&&t(0,d.toDelete=!1,d),n.$$.dirty[0]&1&&d.required&&t(0,d.nullable=!1,d),n.$$.dirty[0]&1&&t(6,i=!H.isEmpty(d.name)&&d.type),n.$$.dirty[0]&80&&(i||_&&k()),n.$$.dirty[0]&69&&t(8,s=!m&&!d.system&&!d.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=C(d.name)),n.$$.dirty[0]&32802&&t(7,o=!l||!H.isEmpty(H.getNestedVal(u,`schema.${c}`)))},[d,c,m,y,_,l,i,o,s,T,M,a,h,k,v,u,$,D,A,I,L,N,F,R,K,x,U,X,ne,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt]}class HC extends ye{constructor(e){super(),ve(this,e,VC,qC,he,{key:1,field:0,disabled:2,excludeNames:12,expand:13,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[13]}get collapse(){return this.$$.ctx[3]}}function cd(n,e,t){const i=n.slice();return i[13]=e[t],i[14]=e,i[15]=t,i}function dd(n){let e,t,i,s,l,o,r,a;return{c(){e=B(`, `),t=b("code"),t.textContent="username",i=B(` , `),s=b("code"),s.textContent="email",l=B(` , `),o=b("code"),o.textContent="emailVisibility",r=B(` , `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function pd(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new HC({props:f}),se.push(()=>_e(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Me(),V(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),q(i,c,d),l=!0},p(c,d){e=c;const m={};d&1&&(m.key=e[15]),d&3&&(m.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,m.field=e[13],ke(()=>s=!1)),i.$set(m)},i(c){l||(E(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function zC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,_,v,k,y,T,C,M,$,D,A,I,L=n[0].isAuth&&dd(),N=n[0].schema;const F=R=>R[13];for(let R=0;Rk.name===v)}function f(v){let k=[];if(v.toDelete)return k;for(let y of i.schema)y===v||y.toDelete||k.push(y.name);return k}function c(v,k){if(!v)return;v.dataTransfer.dropEffect="move";const y=parseInt(v.dataTransfer.getData("text/plain")),T=i.schema;yo(v),h=(v,k)=>BC(k==null?void 0:k.detail,v),_=(v,k)=>c(k==null?void 0:k.detail,v);return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new pn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,m,h,_]}class WC extends ye{constructor(e){super(),ve(this,e,UC,zC,he,{collection:0})}}const YC=n=>({isAdminOnly:n&256}),md=n=>({isAdminOnly:n[8]});function KC(n){let e,t;return e=new me({props:{class:"form-field rule-field m-0 "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[e$,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field m-0 "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function JC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function ZC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` Set Admins only`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1izx0et")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function GC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` Enable custom rule`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-1izx0et")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function XC(n){let e;return{c(){e=B("Leave empty to grant everyone access.")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function QC(n){let e,t,i,s,l;return{c(){e=B(`Only admins will be able to perform this action ( `),t=b("button"),t.textContent="unlock to change",i=B(` ).`),p(t,"type","button"),p(t,"class","link-primary")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(t,"click",n[9]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function xC(n){let e;function t(l,o){return l[8]?QC:XC}let i=t(n),s=i(n);return{c(){e=b("p"),s.c()},m(l,o){S(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&w(e),s.d()}}}function e$(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,m,h,_;function v(I,L){return I[8]?GC:ZC}let k=v(n),y=k(n);function T(I){n[13](I)}var C=n[6];function M(I){let L={id:I[17],baseCollection:I[1],disabled:I[8]};return I[0]!==void 0&&(L.value=I[0]),{props:L}}C&&(c=jt(C,M(n)),n[12](c),se.push(()=>_e(c,"value",T)));const $=n[11].default,D=Nt($,n,n[14],md),A=D||xC(n);return{c(){e=b("label"),t=b("span"),i=B(n[2]),s=O(),l=b("span"),r=B(o),a=O(),y.c(),f=O(),c&&V(c.$$.fragment),m=O(),h=b("div"),A&&A.c(),p(t,"class","txt"),Q(t,"txt-hint",n[8]),p(l,"class","label label-sm svelte-1izx0et"),p(e,"for",u=n[17]),p(e,"class","svelte-1izx0et"),p(h,"class","help-block")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(e,s),g(e,l),g(l,r),g(e,a),y.m(e,null),S(I,f,L),c&&q(c,I,L),S(I,m,L),S(I,h,L),A&&A.m(h,null),_=!0},p(I,L){(!_||L&4)&&le(i,I[2]),(!_||L&256)&&Q(t,"txt-hint",I[8]),(!_||L&256)&&o!==(o=I[8]?"Admins only":"Custom rule")&&le(r,o),k===(k=v(I))&&y?y.p(I,L):(y.d(1),y=k(I),y&&(y.c(),y.m(e,null))),(!_||L&131072&&u!==(u=I[17]))&&p(e,"for",u);const N={};if(L&131072&&(N.id=I[17]),L&2&&(N.baseCollection=I[1]),L&256&&(N.disabled=I[8]),!d&&L&1&&(d=!0,N.value=I[0],ke(()=>d=!1)),C!==(C=I[6])){if(c){re();const F=c;P(F.$$.fragment,1,0,()=>{j(F,1)}),ae()}C?(c=jt(C,M(I)),I[12](c),se.push(()=>_e(c,"value",T)),V(c.$$.fragment),E(c.$$.fragment,1),q(c,m.parentNode,m)):c=null}else C&&c.$set(N);D?D.p&&(!_||L&16640)&&Rt(D,$,I,I[14],_?Ft($,I[14],L,YC):qt(I[14]),md):A&&A.p&&(!_||L&256)&&A.p(I,_?L:-1)},i(I){_||(c&&E(c.$$.fragment,I),E(A,I),_=!0)},o(I){c&&P(c.$$.fragment,I),P(A,I),_=!1},d(I){I&&w(e),y.d(),I&&w(f),n[12](null),c&&j(c,I),I&&w(m),I&&w(h),A&&A.d(I)}}}function t$(n){let e,t,i,s;const l=[JC,KC],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Me()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let hd;function n$(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,m=hd,h=!1;_();async function _(){m||h||(t(7,h=!0),t(6,m=(await rt(()=>import("./FilterAutocompleteInput-179cf2f2.js"),["./FilterAutocompleteInput-179cf2f2.js","./index-a6ccb683.js"],import.meta.url)).default),hd=m,t(7,h=!1))}async function v(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y(C){se[C?"unshift":"push"](()=>{c=C,t(5,c)})}function T(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"$$scope"in C&&t(14,l=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,v,k,s,y,T,l]}class Ts extends ye{constructor(e){super(),ve(this,e,n$,t$,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function _d(n,e,t){const i=n.slice();return i[10]=e[t],i}function gd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I=n[2],L=[];for(let N=0;N@request filter:",c=O(),d=b("div"),d.innerHTML=`@request.method @request.query.* @request.data.* @request.auth.*`,m=O(),h=b("hr"),_=O(),v=b("p"),v.innerHTML="You could also add constraints and query other collections using the @collection filter:",k=O(),y=b("div"),y.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=O(),C=b("hr"),M=O(),$=b("p"),$.innerHTML=`Example rule:
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(v,"class","m-b-0"),p(y,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,F){S(N,e,F),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let R=0;R{D||(D=je(e,At,{duration:150},!0)),D.run(1)}),A=!0)},o(N){N&&(D||(D=je(e,At,{duration:150},!1)),D.run(0)),A=!1},d(N){N&&w(e),ht(L,N),N&&D&&D.end()}}}function bd(n){let e,t=n[10]+"",i;return{c(){e=b("code"),i=B(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function vd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;function v($){n[6]($)}let k={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new Ts({props:k}),se.push(()=>_e(i,"rule",v));function y($){n[7]($)}let T={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(T.rule=n[0].updateRule),a=new Ts({props:T}),se.push(()=>_e(a,"rule",y));function C($){n[8]($)}let M={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),m=new Ts({props:M}),se.push(()=>_e(m,"rule",C)),{c(){e=b("hr"),t=O(),V(i.$$.fragment),l=O(),o=b("hr"),r=O(),V(a.$$.fragment),f=O(),c=b("hr"),d=O(),V(m.$$.fragment),p(e,"class","m-t-sm m-b-sm"),p(o,"class","m-t-sm m-b-sm"),p(c,"class","m-t-sm m-b-sm")},m($,D){S($,e,D),S($,t,D),q(i,$,D),S($,l,D),S($,o,D),S($,r,D),q(a,$,D),S($,f,D),S($,c,D),S($,d,D),q(m,$,D),_=!0},p($,D){const A={};D&1&&(A.collection=$[0]),!s&&D&1&&(s=!0,A.rule=$[0].createRule,ke(()=>s=!1)),i.$set(A);const I={};D&1&&(I.collection=$[0]),!u&&D&1&&(u=!0,I.rule=$[0].updateRule,ke(()=>u=!1)),a.$set(I);const L={};D&1&&(L.collection=$[0]),!h&&D&1&&(h=!0,L.rule=$[0].deleteRule,ke(()=>h=!1)),m.$set(L)},i($){_||(E(i.$$.fragment,$),E(a.$$.fragment,$),E(m.$$.fragment,$),_=!0)},o($){P(i.$$.fragment,$),P(a.$$.fragment,$),P(m.$$.fragment,$),_=!1},d($){$&&w(e),$&&w(t),j(i,$),$&&w(l),$&&w(o),$&&w(r),j(a,$),$&&w(f),$&&w(c),$&&w(d),j(m,$)}}}function yd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[i$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new Ts({props:r}),se.push(()=>_e(i,"rule",o)),{c(){e=b("hr"),t=O(),V(i.$$.fragment),p(e,"class","m-t-sm m-b-sm")},m(a,u){S(a,e,u),S(a,t,u),q(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&8192&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,ke(()=>s=!1)),i.$set(f)},i(a){l||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function i$(n){let e,t,i;return{c(){e=b("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=O(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:G,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function s$(n){var K,x;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D=n[1]&&gd(n);function A(U){n[4](U)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new Ts({props:I}),se.push(()=>_e(f,"rule",A));function L(U){n[5](U)}let N={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),_=new Ts({props:N}),se.push(()=>_e(_,"rule",L));let F=!((K=n[0])!=null&&K.isView)&&vd(n),R=((x=n[0])==null?void 0:x.isAuth)&&yd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators .`,s=O(),l=b("button"),r=B(o),a=O(),D&&D.c(),u=O(),V(f.$$.fragment),d=O(),m=b("hr"),h=O(),V(_.$$.fragment),k=O(),F&&F.c(),y=O(),R&&R.c(),T=Me(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base handle"),Q(e,"fade",!n[1]),p(m,"class","m-t-sm m-b-sm")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),D&&D.m(e,null),S(U,u,X),q(f,U,X),S(U,d,X),S(U,m,X),S(U,h,X),q(_,U,X),S(U,k,X),F&&F.m(U,X),S(U,y,X),R&&R.m(U,X),S(U,T,X),C=!0,M||($=Y(l,"click",n[3]),M=!0)},p(U,[X]){var ue,Z;(!C||X&2)&&o!==(o=U[1]?"Hide available fields":"Show available fields")&&le(r,o),U[1]?D?(D.p(U,X),X&2&&E(D,1)):(D=gd(U),D.c(),E(D,1),D.m(e,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),(!C||X&2)&&Q(e,"fade",!U[1]);const ne={};X&1&&(ne.collection=U[0]),!c&&X&1&&(c=!0,ne.rule=U[0].listRule,ke(()=>c=!1)),f.$set(ne);const J={};X&1&&(J.collection=U[0]),!v&&X&1&&(v=!0,J.rule=U[0].viewRule,ke(()=>v=!1)),_.$set(J),(ue=U[0])!=null&&ue.isView?F&&(re(),P(F,1,1,()=>{F=null}),ae()):F?(F.p(U,X),X&1&&E(F,1)):(F=vd(U),F.c(),E(F,1),F.m(y.parentNode,y)),(Z=U[0])!=null&&Z.isAuth?R?(R.p(U,X),X&1&&E(R,1)):(R=yd(U),R.c(),E(R,1),R.m(T.parentNode,T)):R&&(re(),P(R,1,1,()=>{R=null}),ae())},i(U){C||(E(D),E(f.$$.fragment,U),E(_.$$.fragment,U),E(F),E(R),C=!0)},o(U){P(D),P(f.$$.fragment,U),P(_.$$.fragment,U),P(F),P(R),C=!1},d(U){U&&w(e),D&&D.d(),U&&w(u),j(f,U),U&&w(d),U&&w(m),U&&w(h),j(_,U),U&&w(k),F&&F.d(U),U&&w(y),R&&R.d(U),U&&w(T),M=!1,$()}}}function l$(n,e,t){let i,{collection:s=new pn}=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 c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(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=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class o$ extends ye{constructor(e){super(),ve(this,e,l$,s$,he,{collection:0})}}function kd(n,e,t){const i=n.slice();return i[9]=e[t],i}function r$(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",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=jt(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=Me()},m(a,u){e&&q(e,a,u),S(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)),o!==(o=a[1])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function a$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function wd(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.
  • `,u=O(),_&&_.c(),f=Me(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),m[l].m(v,k),S(v,r,k),S(v,a,k),S(v,u,k),_&&_.m(v,k),S(v,f,k),c=!0},p(v,k){(!c||k&256&&i!==(i=v[8]))&&p(e,"for",i);let y=l;l=h(v),l===y?m[l].p(v,k):(re(),P(m[y],1,1,()=>{m[y]=null}),ae(),o=m[l],o?o.p(v,k):(o=m[l]=d[l](v),o.c()),E(o,1),o.m(r.parentNode,r)),v[3].length?_?_.p(v,k):(_=wd(v),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(v){c||(E(o),c=!0)},o(v){P(o),c=!1},d(v){v&&w(e),v&&w(s),m[l].d(v),v&&w(r),v&&w(a),v&&w(u),_&&_.d(v),v&&w(f)}}}function f$(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[u$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function c$(n,e,t){let i;Ye(n,fi,c=>t(4,i=c));let{collection:s=new pn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=H.getNestedVal(c,"schema",null);if(H.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=H.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);H.removeByValue(m,"id"),H.removeByValue(m,"created"),H.removeByValue(m,"updated");for(let _ in d)for(let v in d[_]){const k=d[_][v].message,y=m[_]||_;r.push(H.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-403c50dc.js"),["./CodeEditor-403c50dc.js","./index-a6ccb683.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&Qi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class d$ extends ye{constructor(e){super(),ve(this,e,c$,f$,he,{collection:0})}}function p$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function m$(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[p$,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function h$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function _$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function g$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowUsernameAuth?_$:h$}let u=a(n),f=u(n),c=n[3]&&Td();return{c(){e=b("div"),e.innerHTML=` Username/Password`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Me(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?m&8&&E(c,1):(c=Td(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function b$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[v$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[y$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(H.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(H.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(E(i.$$.fragment,u),E(o.$$.fragment,u),u&&xe(()=>{r||(r=je(e,At,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=je(e,At,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function v$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[7](v)}let _={id:n[12],disabled:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Ns({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(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"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!H.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function y$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[8](v)}let _={id:n[12],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Ns({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(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"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!H.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function k$(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[b$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Cd(n);return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=Me()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&E(l,1)):(l=Cd(o),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function w$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function S$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $d(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function T$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?S$:w$}let u=a(n),f=u(n),c=n[2]&&$d();return{c(){e=b("div"),e.innerHTML=` Email/Password`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Me(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?m&4&&E(c,1):(c=$d(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function C$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Md(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,At,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function $$(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[C$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Md();return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=Me()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&E(l,1):(l=Md(),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function M$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function O$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Od(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function D$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?O$:M$}let u=a(n),f=u(n),c=n[1]&&Od();return{c(){e=b("div"),e.innerHTML=` OAuth2`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Me(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?m&2&&E(c,1):(c=Od(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function E$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Minimum password length"),s=O(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&fe(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function A$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.textContent="Always require email",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(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(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function I$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return s=new ks({props:{single:!0,$$slots:{header:[g$],default:[m$]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[T$],default:[k$]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[D$],default:[$$]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[E$,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),v=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[A$,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=O(),i=b("div"),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),f=b("hr"),c=O(),d=b("h4"),d.textContent="General",m=O(),V(h.$$.fragment),_=O(),V(v.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(y,T){S(y,e,T),S(y,t,T),S(y,i,T),q(s,i,null),g(i,l),q(o,i,null),g(i,r),q(a,i,null),S(y,u,T),S(y,f,T),S(y,c,T),S(y,d,T),S(y,m,T),q(h,y,T),S(y,_,T),q(v,y,T),k=!0},p(y,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:y}),s.$set(C);const M={};T&8197&&(M.$$scope={dirty:T,ctx:y}),o.$set(M);const $={};T&8195&&($.$$scope={dirty:T,ctx:y}),a.$set($);const D={};T&12289&&(D.$$scope={dirty:T,ctx:y}),h.$set(D);const A={};T&12289&&(A.$$scope={dirty:T,ctx:y}),v.$set(A)},i(y){k||(E(s.$$.fragment,y),E(o.$$.fragment,y),E(a.$$.fragment,y),E(h.$$.fragment,y),E(v.$$.fragment,y),k=!0)},o(y){P(s.$$.fragment,y),P(o.$$.fragment,y),P(a.$$.fragment,y),P(h.$$.fragment,y),P(v.$$.fragment,y),k=!1},d(y){y&&w(e),y&&w(t),y&&w(i),j(s),j(o),j(a),y&&w(u),y&&w(f),y&&w(c),y&&w(d),y&&w(m),j(h,y),y&&w(_),j(v,y)}}}function P$(n,e,t){let i,s,l,o;Ye(n,fi,_=>t(4,o=_));let{collection:r=new pn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function c(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,v,k,y;n.$$.dirty&1&&r.isAuth&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!H.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,h]}class L$ extends ye{constructor(e){super(),ve(this,e,P$,I$,he,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ad(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Id(n){var r;let e,t,i,s,l=n[2]&&Pd(n),o=!((r=n[1])!=null&&r.isView)&&Ld(n);return{c(){e=b("h6"),e.textContent="Changes:",t=O(),i=b("ul"),l&&l.c(),s=O(),o&&o.c(),p(i,"class","changes-list svelte-1ghly2p")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(a,u){var f;a[2]?l?l.p(a,u):(l=Pd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[1])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Ld(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Pd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=b("li"),t=b("div"),i=B(`Renamed collection `),s=b("strong"),o=B(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=B(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&2&&l!==(l=m[1].originalName+"")&&le(o,l),h&2&&c!==(c=m[1].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Ld(n){let e,t,i=n[5],s=[];for(let r=0;r
    ',i=O(),s=b("div"),l=b("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=O(),u&&u.c(),r=O(),f&&f.c(),a=Me(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[4].length?u||(u=Ad(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[6]?f?f.p(c,d):(f=Id(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function F$(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function R$(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Cancel',t=O(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[9]),Y(i,"click",n[10])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function q$(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[R$],header:[F$],default:[N$]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&1048694&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function j$(n,e,t){let i,s,l,o;const r=$t();let a,u;async function f(y){t(1,u=y),await sn(),!i&&!s.length&&!l.length?d():a==null||a.show()}function c(){a==null||a.hide()}function d(){c(),r("confirm")}const m=()=>c(),h=()=>d();function _(y){se[y?"unshift":"push"](()=>{a=y,t(3,a)})}function v(y){ze.call(this,n,y)}function k(y){ze.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=(u==null?void 0:u.originalName)!=(u==null?void 0:u.name)),n.$$.dirty&2&&t(5,s=(u==null?void 0:u.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(4,l=(u==null?void 0:u.schema.filter(y=>y.id&&y.toDelete))||[]),n.$$.dirty&6&&t(6,o=i||!(u!=null&&u.isView))},[c,u,i,a,l,s,o,d,f,m,h,_,v,k]}class V$ extends ye{constructor(e){super(),ve(this,e,j$,q$,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Rd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function H$(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(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function z$(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new d$({props:l}),se.push(()=>_e(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function qd(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new o$({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),q(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||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function jd(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 L$({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(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)&&Q(e,"active",r[3]===Es)},i(r){s||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function B$(n){let e,t,i,s,l,o,r;const a=[z$,H$],u=[];function f(m,h){return m[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===bl&&qd(n),d=n[2].isAuth&&jd(n);return{c(){e=b("div"),t=b("div"),s.c(),l=O(),c&&c.c(),o=O(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===yi),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){S(m,e,h),g(e,t),u[i].m(t,null),g(e,l),c&&c.m(e,null),g(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=f(m),i===_?u[i].p(m,h):(re(),P(u[_],1,1,()=>{u[_]=null}),ae(),s=u[i],s?s.p(m,h):(s=u[i]=a[i](m),s.c()),E(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",m[3]===yi),m[3]===bl?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=qd(m),c.c(),E(c,1),c.m(e,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae()),m[2].isAuth?d?(d.p(m,h),h[0]&4&&E(d,1)):(d=jd(m),d.c(),E(d,1),d.m(e,null)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(m){r||(E(s),E(c),E(d),r=!0)},o(m){P(s),P(c),P(d),r=!1},d(m){m&&w(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Vd(n){let e,t,i,s,l,o,r;return o=new ei({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[U$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=O(),i=b("button"),s=b("i"),l=O(),V(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),g(i,s),g(i,l),q(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||(E(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function U$(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML=` Duplicate`,t=O(),i=b("button"),i.innerHTML=` Delete`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(dt(n[24])))],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function Hd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[W$]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),V(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(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||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function zd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=O(),l=b("span"),r=B(o),a=B(" collection"),u=O(),p(t,"class",i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(m,h){S(m,e,h),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function W$(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s{N=null}),ae()),(!A||K[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",C),(!A||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?F||(F=Bd(),F.c(),F.m(D.parentNode,D)):F&&(F.d(1),F=null)},i(R){A||(E(N),A=!0)},o(R){P(N),A=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),N&&N.d(),R&&w($),F&&F.d(R),R&&w(D),I=!1,L()}}}function Ud(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{i||(i=je(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=je(e,It,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Wd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Yd(n){var a,u,f;let e,t,i,s=!H.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&&Kd();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(c,d){S(c,e,d),g(e,t),g(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[30]),l=!0)},p(c,d){var m,h,_;d[0]&32&&(s=!H.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),s?r?d[0]&32&&E(r,1):(r=Kd(),r.c(),E(r,1),r.m(e,null)):r&&(re(),P(r,1,1,()=>{r=null}),ae()),d[0]&8&&Q(e,"active",c[3]===Es)},d(c){c&&w(e),r&&r.d(),l=!1,o()}}}function Kd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function K$(n){var x,U,X,ne,J,ue,Z,de;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,m,h=(x=n[2])!=null&&x.isView?"Query":"Fields",_,v,k=!H.isEmpty(n[11]),y,T,C,M,$=!H.isEmpty((U=n[5])==null?void 0:U.listRule)||!H.isEmpty((X=n[5])==null?void 0:X.viewRule)||!H.isEmpty((ne=n[5])==null?void 0:ne.createRule)||!H.isEmpty((J=n[5])==null?void 0:J.updateRule)||!H.isEmpty((ue=n[5])==null?void 0:ue.deleteRule)||!H.isEmpty((de=(Z=n[5])==null?void 0:Z.options)==null?void 0:de.manageRule),D,A,I,L,N=!n[2].isNew&&!n[2].system&&Vd(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[Y$,({uniqueId:ge})=>({46:ge}),({uniqueId:ge})=>[0,ge?32768:0]]},$$scope:{ctx:n}}});let F=k&&Ud(n),R=$&&Wd(),K=n[2].isAuth&&Yd(n);return{c(){e=b("h4"),i=B(t),s=O(),N&&N.c(),l=O(),o=b("form"),V(r.$$.fragment),a=O(),u=b("input"),f=O(),c=b("div"),d=b("button"),m=b("span"),_=B(h),v=O(),F&&F.c(),y=O(),T=b("button"),C=b("span"),C.textContent="API Rules",M=O(),R&&R.c(),D=O(),K&&K.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===yi),p(C,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),Q(T,"active",n[3]===bl),p(c,"class","tabs-header stretched")},m(ge,Ce){S(ge,e,Ce),g(e,i),S(ge,s,Ce),N&&N.m(ge,Ce),S(ge,l,Ce),S(ge,o,Ce),q(r,o,null),g(o,a),g(o,u),S(ge,f,Ce),S(ge,c,Ce),g(c,d),g(d,m),g(m,_),g(d,v),F&&F.m(d,null),g(c,y),g(c,T),g(T,C),g(T,M),R&&R.m(T,null),g(c,D),K&&K.m(c,null),A=!0,I||(L=[Y(o,"submit",dt(n[27])),Y(d,"click",n[28]),Y(T,"click",n[29])],I=!0)},p(ge,Ce){var Re,be,Se,We,lt,ce,He,te;(!A||Ce[0]&4)&&t!==(t=ge[2].isNew?"New collection":"Edit collection")&&le(i,t),!ge[2].isNew&&!ge[2].system?N?(N.p(ge,Ce),Ce[0]&4&&E(N,1)):(N=Vd(ge),N.c(),E(N,1),N.m(l.parentNode,l)):N&&(re(),P(N,1,1,()=>{N=null}),ae());const Ne={};Ce[0]&8192&&(Ne.class="form-field collection-field-name required m-b-0 "+(ge[13]?"disabled":"")),Ce[0]&8260|Ce[1]&1081344&&(Ne.$$scope={dirty:Ce,ctx:ge}),r.$set(Ne),(!A||Ce[0]&4)&&h!==(h=(Re=ge[2])!=null&&Re.isView?"Query":"Fields")&&le(_,h),Ce[0]&2048&&(k=!H.isEmpty(ge[11])),k?F?(F.p(ge,Ce),Ce[0]&2048&&E(F,1)):(F=Ud(ge),F.c(),E(F,1),F.m(d,null)):F&&(re(),P(F,1,1,()=>{F=null}),ae()),(!A||Ce[0]&8)&&Q(d,"active",ge[3]===yi),Ce[0]&32&&($=!H.isEmpty((be=ge[5])==null?void 0:be.listRule)||!H.isEmpty((Se=ge[5])==null?void 0:Se.viewRule)||!H.isEmpty((We=ge[5])==null?void 0:We.createRule)||!H.isEmpty((lt=ge[5])==null?void 0:lt.updateRule)||!H.isEmpty((ce=ge[5])==null?void 0:ce.deleteRule)||!H.isEmpty((te=(He=ge[5])==null?void 0:He.options)==null?void 0:te.manageRule)),$?R?Ce[0]&32&&E(R,1):(R=Wd(),R.c(),E(R,1),R.m(T,null)):R&&(re(),P(R,1,1,()=>{R=null}),ae()),(!A||Ce[0]&8)&&Q(T,"active",ge[3]===bl),ge[2].isAuth?K?K.p(ge,Ce):(K=Yd(ge),K.c(),K.m(c,null)):K&&(K.d(1),K=null)},i(ge){A||(E(N),E(r.$$.fragment,ge),E(F),E(R),A=!0)},o(ge){P(N),P(r.$$.fragment,ge),P(F),P(R),A=!1},d(ge){ge&&w(e),ge&&w(s),N&&N.d(ge),ge&&w(l),ge&&w(o),j(r),ge&&w(f),ge&&w(c),F&&F.d(),R&&R.d(),K&&K.d(),I=!1,Pe(L)}}}function J$(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),r=B(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=[Y(e,"click",n[21]),Y(s,"click",n[22])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function Z$(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",beforeHide:n[35],$$slots:{footer:[J$],header:[K$],default:[B$]},$$scope:{ctx:n}};e=new Nn({props:l}),n[36](e),e.$on("hide",n[37]),e.$on("show",n[38]);let o={};return i=new V$({props:o}),n[39](i),i.$on("confirm",n[40]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,a){const u={};a[0]&1040&&(u.beforeHide=r[35]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[36](null),j(e,r),r&&w(t),n[39](null),j(i,r)}}}const yi="schema",bl="api_rules",Es="options",G$="base",Jd="auth",Zd="view";function Or(n){return JSON.stringify(n)}function X$(n,e,t){let i,s,l,o;Ye(n,fi,te=>t(5,o=te));const r={};r[G$]="Base",r[Zd]="View",r[Jd]="Auth";const a=$t();let u,f,c=null,d=new pn,m=!1,h=!1,_=yi,v=Or(d),k="";function y(te){t(3,_=te)}function T(te){return M(te),t(10,h=!0),y(yi),u==null?void 0:u.show()}function C(){return u==null?void 0:u.hide()}async function M(te){Bn({}),typeof te<"u"?(c=te,t(2,d=te==null?void 0:te.clone())):(c=null,t(2,d=new pn)),t(2,d.schema=d.schema||[],d),t(2,d.originalName=d.name||"",d),await sn(),t(20,v=Or(d))}function $(){if(d.isNew)return D();f==null||f.show(d)}function D(){if(m)return;t(9,m=!0);const te=A();let Fe;d.isNew?Fe=pe.collections.create(te):Fe=pe.collections.update(d.id,te),Fe.then(ot=>{$a(),Ob(ot.id),t(10,h=!1),C(),zt(d.isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:d.isNew,collection:ot})}).catch(ot=>{pe.errorResponseHandler(ot)}).finally(()=>{t(9,m=!1)})}function A(){const te=d.export();te.schema=te.schema.slice(0);for(let Fe=te.schema.length-1;Fe>=0;Fe--)te.schema[Fe].toDelete&&te.schema.splice(Fe,1);return te}function I(){c!=null&&c.id&&cn(`Do you really want to delete collection "${c==null?void 0:c.name}" and all its records?`,()=>pe.collections.delete(c==null?void 0:c.id).then(()=>{C(),zt(`Successfully deleted collection "${c==null?void 0:c.name}".`),a("delete",c),I3(c)}).catch(te=>{pe.errorResponseHandler(te)}))}function L(te){t(2,d.type=te,d),Qi("schema")}function N(){s?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const te=c==null?void 0:c.clone();if(te&&(te.id="",te.created="",te.updated="",te.name+="_duplicate",!H.isEmpty(te.schema)))for(const Fe of te.schema)Fe.id="";T(te),await sn(),t(20,v="")}const R=()=>C(),K=()=>$(),x=()=>N(),U=()=>I(),X=te=>{t(2,d.name=H.slugify(te.target.value),d),te.target.value=d.name},ne=te=>L(te),J=()=>{l&&$()},ue=()=>y(yi),Z=()=>y(bl),de=()=>y(Es);function ge(te){d=te,t(2,d)}function Ce(te){d=te,t(2,d)}function Ne(te){d=te,t(2,d)}function Re(te){d=te,t(2,d)}const be=()=>s&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,h=!1),C()}),!1):!0;function Se(te){se[te?"unshift":"push"](()=>{u=te,t(7,u)})}function We(te){ze.call(this,n,te)}function lt(te){ze.call(this,n,te)}function ce(te){se[te?"unshift":"push"](()=>{f=te,t(8,f)})}const He=()=>D();return n.$$.update=()=>{var te;n.$$.dirty[0]&32&&(o.schema||(te=o.options)!=null&&te.query?t(11,k=H.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&d.type===Zd&&(t(2,d.createRule=null,d),t(2,d.updateRule=null,d),t(2,d.deleteRule=null,d)),n.$$.dirty[0]&4&&t(13,i=!d.isNew&&d.system),n.$$.dirty[0]&1048580&&t(4,s=v!=Or(d)),n.$$.dirty[0]&20&&t(12,l=d.isNew||s),n.$$.dirty[0]&12&&_===Es&&d.type!==Jd&&y(yi)},[y,C,d,_,s,o,r,u,f,m,h,k,l,i,$,D,I,L,N,T,v,R,K,x,U,X,ne,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He]}class nu extends ye{constructor(e){super(),ve(this,e,X$,Z$,he,{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 Gd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Xd(n){let e,t=n[1].length&&Qd();return{c(){t&&t.c(),e=Me()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1].length?t||(t=Qd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Qd(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xd(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,c,d;return{key:n,first:null,c(){var m;t=b("a"),i=b("i"),l=O(),o=b("span"),a=B(r),u=O(),p(i,"class",s=H.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",f="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),Q(t,"active",((m=e[5])==null?void 0:m.id)===e[15].id),this.first=t},m(m,h){S(m,t,h),g(t,i),g(t,l),g(t,o),g(o,a),g(t,u),c||(d=Ie(xt.call(null,t)),c=!0)},p(m,h){var _;e=m,h&8&&s!==(s=H.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),h&8&&r!==(r=e[15].name+"")&&le(a,r),h&8&&f!==(f="/collections?collectionId="+e[15].id)&&p(t,"href",f),h&40&&Q(t,"active",((_=e[5])==null?void 0:_.id)===e[15].id)},d(m){m&&w(t),c=!1,d()}}}function ep(n){let e,t,i,s;return{c(){e=b("footer"),t=b("button"),t.innerHTML=` New collection`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function Q$(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,_,v,k,y,T,C=n[3];const M=I=>I[15].id;for(let I=0;I',o=O(),r=b("input"),a=O(),u=b("hr"),f=O(),c=b("div");for(let I=0;I20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),fe(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let N=0;N20),I[7]?D&&(D.d(1),D=null):D?D.p(I,L):(D=ep(I),D.c(),D.m(e,null));const N={};v.$set(N)},i(I){k||(E(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function e4(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Po,y=>t(6,a=y)),Ye(n,$s,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const _=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var T;(T=y.detail)!=null&&T.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&x$(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,h,_,v,k]}class t4 extends ye{constructor(e){super(),ve(this,e,e4,Q$,he,{})}}function tp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function np(n){n[18]=n[19].default}function ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function sp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&sp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Me(),c&&c.c(),s=O(),l=b("button"),r=B(o),a=O(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),g(l,r),g(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=sp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function op(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:s4,then:i4,catch:n4,value:19,blocks:[,,,]};return ru(t=n[15].component,s),{c(){e=Me(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&ru(t,s)||s1(s,n,o)},i(l){i||(E(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function n4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function i4(n){np(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=O()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){np(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(E(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function s4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function rp(n,e){let t,i,s,l=e[5]===e[14]&&op(e);return{key:n,first:null,c(){t=Me(),l&&l.c(),i=Me(),this.first=t},m(o,r){S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&E(l,1)):(l=op(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(E(l),s=!0)},o(o){P(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function l4(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=Object.entries(n[3]);const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function r4(n){let e,t,i={class:"docs-panel",$$slots:{footer:[o4],default:[l4]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function a4(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-a2767961.js"),["./ListApiDocs-a2767961.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-fb467639.js"),["./ViewApiDocs-fb467639.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-24a855fe.js"),["./CreateApiDocs-24a855fe.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-38bf0782.js"),["./UpdateApiDocs-38bf0782.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-07144611.js"),["./DeleteApiDocs-07144611.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-6434a81c.js"),["./RealtimeApiDocs-6434a81c.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-64f68d02.js"),["./AuthWithPasswordDocs-64f68d02.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-a6e13aba.js"),["./AuthWithOAuth2Docs-a6e13aba.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-8fc753c7.js"),["./AuthRefreshDocs-8fc753c7.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-8689ce20.js"),["./RequestVerificationDocs-8689ce20.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-75b15cb9.js"),["./ConfirmVerificationDocs-75b15cb9.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-e94936fa.js"),["./RequestPasswordResetDocs-e94936fa.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-c814ce2f.js"),["./ConfirmPasswordResetDocs-c814ce2f.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-d1a728ea.js"),["./RequestEmailChangeDocs-d1a728ea.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-aaf7e4cf.js"),["./ConfirmEmailChangeDocs-aaf7e4cf.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-0d0e6b79.js"),["./AuthMethodsDocs-0d0e6b79.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-d3cc5b29.js"),["./ListExternalAuthsDocs-d3cc5b29.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-3c6ac5e8.js"),["./UnlinkExternalAuthDocs-3c6ac5e8.js","./SdkTabs-5e85fa43.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new pn,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){se[k?"unshift":"push"](()=>{l=k,t(4,l)})}function _(k){ze.call(this,n,k)}function v(k){ze.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,c,o,a,l,r,i,u,d,m,h,_,v]}class u4 extends ye{constructor(e){super(),ve(this,e,a4,r4,he,{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 f4(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Username",o=O(),r=b("input"),p(t,"class",H.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","text"),p(r,"requried",a=!n[0].isNew),p(r,"placeholder",u=n[0].isNew?"Leave empty to auto generate...":n[3]),p(r,"id",f=n[12])},m(m,h){S(m,e,h),g(e,t),g(e,i),g(e,s),S(m,o,h),S(m,r,h),fe(r,n[0].username),c||(d=Y(r,"input",n[4]),c=!0)},p(m,h){h&4096&&l!==(l=m[12])&&p(e,"for",l),h&1&&a!==(a=!m[0].isNew)&&p(r,"requried",a),h&1&&u!==(u=m[0].isNew?"Leave empty to auto generate...":m[3])&&p(r,"placeholder",u),h&4096&&f!==(f=m[12])&&p(r,"id",f),h&1&&r.value!==m[0].username&&fe(r,m[0].username)},d(m){m&&w(e),m&&w(o),m&&w(r),c=!1,d()}}}function c4(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,h,_,v,k,y,T,C;return{c(){var M;e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Email",o=O(),r=b("div"),a=b("button"),u=b("span"),f=B("Public: "),d=B(c),h=O(),_=b("input"),p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[12]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=v=n[0].isNew,p(_,"autocomplete","off"),p(_,"id",k=n[12]),_.required=y=(M=n[1].options)==null?void 0:M.requireEmail,p(_,"class","svelte-1751a4d")},m(M,$){S(M,e,$),g(e,t),g(e,i),g(e,s),S(M,o,$),S(M,r,$),g(r,a),g(a,u),g(u,f),g(u,d),S(M,h,$),S(M,_,$),fe(_,n[0].email),n[0].isNew&&_.focus(),T||(C=[Ie(Ue.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",n[5]),Y(_,"input",n[6])],T=!0)},p(M,$){var D;$&4096&&l!==(l=M[12])&&p(e,"for",l),$&1&&c!==(c=M[0].emailVisibility?"On":"Off")&&le(d,c),$&1&&m!==(m="btn btn-sm btn-transparent "+(M[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),$&1&&v!==(v=M[0].isNew)&&(_.autofocus=v),$&4096&&k!==(k=M[12])&&p(_,"id",k),$&2&&y!==(y=(D=M[1].options)==null?void 0:D.requireEmail)&&(_.required=y),$&1&&_.value!==M[0].email&&fe(_,M[0].email)},d(M){M&&w(e),M&&w(o),M&&w(r),M&&w(h),M&&w(_),T=!1,Pe(C)}}}function ap(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[d4,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function d4(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[2],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function up(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[p4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[m4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&12289&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&12289&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&Q(t,"p-t-xs",f[2])},i(f){u||(E(s.$$.fragment,f),E(r.$$.fragment,f),f&&xe(()=>{a||(a=je(e,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=je(e,At,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function p4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].password),u||(f=Y(r,"input",n[8]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].password&&fe(r,c[0].password)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function m4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[9]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&fe(r,c[0].passwordConfirm)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function h4(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].verified,S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"change",n[10]),Y(e,"change",dt(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function _4(n){var v;let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new me({props:{class:"form-field "+(n[0].isNew?"":"required"),name:"username",$$slots:{default:[f4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((v=n[1].options)!=null&&v.requireEmail?"required":""),name:"email",$$slots:{default:[c4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}});let h=!n[0].isNew&&ap(n),_=(n[0].isNew||n[2])&&up(n);return d=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[h4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),h&&h.c(),u=O(),_&&_.c(),f=O(),c=b("div"),V(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(k,y){S(k,e,y),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),h&&h.m(a,null),g(a,u),_&&_.m(a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(k,[y]){var $;const T={};y&1&&(T.class="form-field "+(k[0].isNew?"":"required")),y&12289&&(T.$$scope={dirty:y,ctx:k}),i.$set(T);const C={};y&2&&(C.class="form-field "+(($=k[1].options)!=null&&$.requireEmail?"required":"")),y&12291&&(C.$$scope={dirty:y,ctx:k}),o.$set(C),k[0].isNew?h&&(re(),P(h,1,1,()=>{h=null}),ae()):h?(h.p(k,y),y&1&&E(h,1)):(h=ap(k),h.c(),E(h,1),h.m(a,u)),k[0].isNew||k[2]?_?(_.p(k,y),y&5&&E(_,1)):(_=up(k),_.c(),E(_,1),_.m(a,null)):_&&(re(),P(_,1,1,()=>{_=null}),ae());const M={};y&12289&&(M.$$scope={dirty:y,ctx:k}),d.$set(M)},i(k){m||(E(i.$$.fragment,k),E(o.$$.fragment,k),E(h),E(_),E(d.$$.fragment,k),m=!0)},o(k){P(i.$$.fragment,k),P(o.$$.fragment,k),P(h),P(_),P(d.$$.fragment,k),m=!1},d(k){k&&w(e),j(i),j(o),h&&h.d(),_&&_.d(),j(d)}}}function g4(n,e,t){let{collection:i=new pn}=e,{record:s=new Ti}=e,l=s.username||null,o=!1;function r(){s.username=this.value,t(0,s),t(2,o)}const a=()=>t(0,s.emailVisibility=!s.emailVisibility,s);function u(){s.email=this.value,t(0,s),t(2,o)}function f(){o=this.checked,t(2,o)}function c(){s.password=this.value,t(0,s),t(2,o)}function d(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function m(){s.verified=this.checked,t(0,s),t(2,o)}const h=_=>{s.isNew||cn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!_.target.checked,s)})};return n.$$set=_=>{"collection"in _&&t(1,i=_.collection),"record"in _&&t(0,s=_.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),Qi("password"),Qi("passwordConfirm")))},[s,i,o,l,r,a,u,f,c,d,m,h]}class b4 extends ye{constructor(e){super(),ve(this,e,g4,_4,he,{collection:1,record:0})}}function v4(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 h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Zt(()=>(u(),()=>clearTimeout(a)));function c(m){se[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(3,s=Et(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,c,d]}class k4 extends ye{constructor(e){super(),ve(this,e,y4,v4,he,{value:0,maxHeight:4})}}function w4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),f=new k4({props:h}),se.push(()=>_e(f,"value",m)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),V(f.$$.fragment),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),q(f,_,v),d=!0},p(_,v){(!d||v&2&&i!==(i=H.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||v&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||v&8&&a!==(a=_[3]))&&p(e,"for",a);const k={};v&8&&(k.id=_[3]),v&2&&(k.required=_[1].required),!c&&v&1&&(c=!0,k.value=_[0],ke(()=>c=!1)),f.$set(k)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){P(f.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(u),j(f,_)}}}function S4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[w4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function T4(n,e,t){let{field:i=new mn}=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 C4 extends ye{constructor(e){super(),ve(this,e,T4,S4,he,{field:1,value:0})}}function $4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,_,v;return{c(){var k,y;e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("input"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",m=(k=n[1].options)==null?void 0:k.min),p(f,"max",h=(y=n[1].options)==null?void 0:y.max),p(f,"step","any")},m(k,y){S(k,e,y),g(e,t),g(e,s),g(e,l),g(l,r),S(k,u,y),S(k,f,y),fe(f,n[0]),_||(v=Y(f,"input",n[2]),_=!0)},p(k,y){var T,C;y&2&&i!==(i=H.getFieldTypeIcon(k[1].type))&&p(t,"class",i),y&2&&o!==(o=k[1].name+"")&&le(r,o),y&8&&a!==(a=k[3])&&p(e,"for",a),y&8&&c!==(c=k[3])&&p(f,"id",c),y&2&&d!==(d=k[1].required)&&(f.required=d),y&2&&m!==(m=(T=k[1].options)==null?void 0:T.min)&&p(f,"min",m),y&2&&h!==(h=(C=k[1].options)==null?void 0:C.max)&&p(f,"max",h),y&1&&pt(f.value)!==k[0]&&fe(f,k[0])},d(k){k&&w(e),k&&w(u),k&&w(f),_=!1,v()}}}function M4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function O4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(){s=pt(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 D4 extends ye{constructor(e){super(),ve(this,e,O4,M4,he,{field:1,value:0})}}function E4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=b("input"),i=O(),s=b("label"),o=B(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){S(f,e,c),e.checked=n[0],S(f,i,c),S(f,s,c),g(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&le(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function A4(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[E4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function I4(n,e,t){let{field:i=new mn}=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 P4 extends ye{constructor(e){super(),ve(this,e,I4,A4,he,{field:1,value:0})}}function L4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("input"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),fe(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(_,v){v&2&&i!==(i=H.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&8&&a!==(a=_[3])&&p(e,"for",a),v&8&&c!==(c=_[3])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&1&&f.value!==_[0]&&fe(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function N4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[L4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function F4(n,e,t){let{field:i=new mn}=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 R4 extends ye{constructor(e){super(),ve(this,e,F4,N4,he,{field:1,value:0})}}function q4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("input"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),fe(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(_,v){v&2&&i!==(i=H.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&8&&a!==(a=_[3])&&p(e,"for",a),v&8&&c!==(c=_[3])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&1&&fe(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function j4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[q4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function V4(n,e,t){let{field:i=new mn}=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 H4 extends ye{constructor(e){super(),ve(this,e,V4,j4,he,{field:1,value:0})}}function fp(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){S(l,e,o),g(e,t),i||(s=[Ie(Ue.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:G,d(l){l&&w(e),i=!1,Pe(s)}}}function z4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,_,v=n[0]&&!n[1].required&&fp(n);function k(C){n[6](C)}function y(C){n[7](C)}let T={id:n[8],options:H.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new tu({props:T}),se.push(()=>_e(d,"value",k)),se.push(()=>_e(d,"formattedValue",y)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),a=B(" (UTC)"),f=O(),v&&v.c(),c=O(),V(d.$$.fragment),p(t,"class",i=Si(H.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(C,M){S(C,e,M),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),S(C,f,M),v&&v.m(C,M),S(C,c,M),q(d,C,M),_=!0},p(C,M){(!_||M&2&&i!==(i=Si(H.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||M&2)&&o!==(o=C[1].name+"")&&le(r,o),(!_||M&256&&u!==(u=C[8]))&&p(e,"for",u),C[0]&&!C[1].required?v?v.p(C,M):(v=fp(C),v.c(),v.m(c.parentNode,c)):v&&(v.d(1),v=null);const $={};M&256&&($.id=C[8]),!m&&M&4&&(m=!0,$.value=C[2],ke(()=>m=!1)),!h&&M&1&&(h=!0,$.formattedValue=C[0],ke(()=>h=!1)),d.$set($)},i(C){_||(E(d.$$.fragment,C),_=!0)},o(C){P(d.$$.fragment,C),_=!1},d(C){C&&w(e),C&&w(f),v&&v.d(C),C&&w(c),j(d,C)}}}function B4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[z4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function U4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.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 W4 extends ye{constructor(e){super(),ve(this,e,U4,B4,he,{field:1,value:0})}}function cp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=b("div"),t=B("Select up to "),s=B(i),l=B(" items."),p(e,"class","help-block")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function Y4(n){var y,T,C,M,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;function _(D){n[3](D)}let v={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((y=n[0])==null?void 0:y.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&&(v.selected=n[0]),f=new eu({props:v}),se.push(()=>_e(f,"selected",_));let k=(($=n[1].options)==null?void 0:$.maxSelect)>1&&cp(n);return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),V(f.$$.fragment),d=O(),k&&k.c(),m=Me(),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,A){S(D,e,A),g(e,t),g(e,s),g(e,l),g(l,r),S(D,u,A),q(f,D,A),S(D,d,A),k&&k.m(D,A),S(D,m,A),h=!0},p(D,A){var L,N,F,R,K;(!h||A&2&&i!==(i=H.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!h||A&2)&&o!==(o=D[1].name+"")&&le(r,o),(!h||A&16&&a!==(a=D[4]))&&p(e,"for",a);const I={};A&16&&(I.id=D[4]),A&6&&(I.toggle=!D[1].required||D[2]),A&4&&(I.multiple=D[2]),A&7&&(I.closable=!D[2]||((L=D[0])==null?void 0:L.length)>=((N=D[1].options)==null?void 0:N.maxSelect)),A&2&&(I.items=(F=D[1].options)==null?void 0:F.values),A&2&&(I.searchable=((R=D[1].options)==null?void 0:R.values)>5),!c&&A&1&&(c=!0,I.selected=D[0],ke(()=>c=!1)),f.$set(I),((K=D[1].options)==null?void 0:K.maxSelect)>1?k?k.p(D,A):(k=cp(D),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(D){h||(E(f.$$.fragment,D),h=!0)},o(D){P(f.$$.fragment,D),h=!1},d(D){D&&w(e),D&&w(u),j(f,D),D&&w(d),k&&k.d(D),D&&w(m)}}}function K4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function J4(n,e,t){let i,{field:s=new mn}=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 Z4 extends ye{constructor(e){super(),ve(this,e,J4,K4,he,{field:1,value:0})}}function G4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("textarea"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4]),p(f,"id",c=n[4]),p(f,"class","txt-mono"),f.required=d=n[1].required,f.value=n[2]},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),m||(h=Y(f,"input",n[3]),m=!0)},p(_,v){v&2&&i!==(i=H.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&16&&a!==(a=_[4])&&p(e,"for",a),v&16&&c!==(c=_[4])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&4&&(f.value=_[2])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function X4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[G4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Q4(n,e,t){let{field:i=new mn}=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 x4 extends ye{constructor(e){super(),ve(this,e,Q4,X4,he,{field:1,value:0})}}function eM(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&w(e)}}}function tM(n){let e,t,i;return{c(){e=b("img"),Hn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){S(s,e,l)},p(s,l){l&4&&!Hn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&w(e)}}}function nM(n){let e;function t(l,o){return l[2]?tM:eM}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function iM(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),H.hasImageExtension(s==null?void 0:s.name)&&H.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 sM extends ye{constructor(e){super(),ve(this,e,iM,nM,he,{file:0,size:1})}}function dp(n){let e;function t(l,o){return l[4]==="image"?oM:lM}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function lM(n){let e,t;return{c(){e=b("object"),t=B("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&w(e)}}}function oM(n){let e,t,i;return{c(){e=b("img"),Hn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){S(s,e,l)},p(s,l){l&2&&!Hn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&w(e)}}}function rM(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&dp(n);return{c(){i&&i.c(),t=Me()},m(l,o){i&&i.m(l,o),S(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=dp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function aM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=Y(e,"click",dt(n[0])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function uM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("a"),t=B(n[2]),i=O(),s=b("i"),l=O(),o=b("div"),r=O(),a=b("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,l,d),S(c,o,d),S(c,r,d),S(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&w(e),c&&w(l),c&&w(o),c&&w(r),c&&w(a),u=!1,f()}}}function fM(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[uM],header:[aM],default:[rM]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[6](e),e.$on("show",n[7]),e.$on("hide",n[8]),{c(){V(e.$$.fragment)},m(s,l){q(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||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function cM(n,e,t){let i,s,l,o="";function r(d){d!==""&&(t(1,o=d),l==null||l.show())}function a(){return l==null?void 0:l.hide()}function u(d){se[d?"unshift":"push"](()=>{l=d,t(3,l)})}function f(d){ze.call(this,n,d)}function c(d){ze.call(this,n,d)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=o.substring(o.lastIndexOf("/")+1)),n.$$.dirty&4&&t(4,s=H.getFileType(i))},[a,o,i,l,s,r,u,f,c]}class dM extends ye{constructor(e){super(),ve(this,e,cM,fM,he,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function pM(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function mM(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function hM(n){let e,t,i,s,l;return{c(){e=b("img"),Hn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){S(o,e,r),s||(l=Y(e,"error",n[7]),s=!0)},p(o,r){r&16&&!Hn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&w(e),s=!1,l()}}}function _M(n){let e,t,i,s,l,o,r,a;function u(m,h){return m[2]==="image"?hM:m[2]==="video"||m[2]==="audio"?mM:pM}let f=u(n),c=f(n),d={};return l=new dM({props:d}),n[10](l),{c(){e=b("a"),c.c(),s=O(),V(l.$$.fragment),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[5]?"Preview":"Download")+" "+n[0])},m(m,h){S(m,e,h),c.m(e,null),S(m,s,h),q(l,m,h),o=!0,r||(a=Y(e,"click",kn(n[9])),r=!0)},p(m,[h]){f===(f=u(m))&&c?c.p(m,h):(c.d(1),c=f(m),c&&(c.c(),c.m(e,null))),(!o||h&2&&t!==(t="thumb "+(m[1]?`thumb-${m[1]}`:"")))&&p(e,"class",t),(!o||h&33&&i!==(i=(m[5]?"Preview":"Download")+" "+m[0]))&&p(e,"title",i);const _={};l.$set(_)},i(m){o||(E(l.$$.fragment,m),o=!0)},o(m){P(l.$$.fragment,m),o=!1},d(m){m&&w(e),c.d(),m&&w(s),n[10](null),j(l,m),r=!1,a()}}}function gM(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f=pe.getFileUrl(l,o);function c(){t(4,u="")}const d=h=>{s&&(h.preventDefault(),a==null||a.show(f))};function m(h){se[h?"unshift":"push"](()=>{a=h,t(3,a)})}return n.$$set=h=>{"record"in h&&t(8,l=h.record),"filename"in h&&t(0,o=h.filename),"size"in h&&t(1,r=h.size)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getFileType(o)),n.$$.dirty&5&&t(5,s=["image","audio","video"].includes(i)||o.endsWith(".pdf"))},t(4,u=f?f+"?thumb=100x100":""),[o,r,i,a,u,s,f,c,l,d,m]}class iu extends ye{constructor(e){super(),ve(this,e,gM,_M,he,{record:8,filename:0,size:1})}}function pp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function mp(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 bM(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){S(l,e,o),t||(i=[Ie(Ue.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Pe(i)}}}function vM(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){S(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function hp(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,m,h,_;s=new iu({props:{record:e[2],filename:e[25]}});function v(T,C){return C&18&&(h=null),h==null&&(h=!!T[1].includes(T[24])),h?vM:bM}let k=v(e,-1),y=k(e);return{key:n,first:null,c(){t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),r=b("a"),u=B(a),d=O(),m=b("div"),y.c(),Q(i,"fade",e[1].includes(e[24])),p(r,"href",f=pe.getFileUrl(e[2],e[25])),p(r,"class",c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")),p(r,"title","Download"),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","content"),p(m,"class","actions"),p(t,"class","list-item"),this.first=t},m(T,C){S(T,t,C),g(t,i),q(s,i,null),g(t,l),g(t,o),g(o,r),g(r,u),g(t,d),g(t,m),y.m(m,null),_=!0},p(T,C){e=T;const M={};C&4&&(M.record=e[2]),C&16&&(M.filename=e[25]),s.$set(M),(!_||C&18)&&Q(i,"fade",e[1].includes(e[24])),(!_||C&16)&&a!==(a=e[25]+"")&&le(u,a),(!_||C&20&&f!==(f=pe.getFileUrl(e[2],e[25])))&&p(r,"href",f),(!_||C&18&&c!==(c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")))&&p(r,"class",c),k===(k=v(e,C))&&y?y.p(e,C):(y.d(1),y=k(e),y&&(y.c(),y.m(m,null)))},i(T){_||(E(s.$$.fragment,T),_=!0)},o(T){P(s.$$.fragment,T),_=!1},d(T){T&&w(t),j(s),y.d()}}}function _p(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,m,h,_,v;i=new sM({props:{file:n[22]}});function k(){return n[15](n[24])}return{c(){e=b("div"),t=b("figure"),V(i.$$.fragment),s=O(),l=b("div"),o=b("small"),o.textContent="New",r=O(),a=b("span"),f=B(u),d=O(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[22].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(y,T){S(y,e,T),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(l,r),g(l,a),g(a,f),g(e,d),g(e,m),h=!0,_||(v=[Ie(Ue.call(null,m,"Remove file")),Y(m,"click",k)],_=!0)},p(y,T){n=y;const C={};T&1&&(C.file=n[22]),i.$set(C),(!h||T&1)&&u!==(u=n[22].name+"")&&le(f,u),(!h||T&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(y){h||(E(i.$$.fragment,y),h=!0)},o(y){P(i.$$.fragment,y),h=!1},d(y){y&&w(e),j(i),_=!1,Pe(v)}}}function yM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,m,h,_,v,k,y,T,C,M,$,D,A,I=n[4];const L=K=>K[25]+K[2].id;for(let K=0;KP(F[K],1,1,()=>{F[K]=null});return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("div");for(let K=0;K({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function wM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new mn}=e,c,d;function m(A){H.removeByValue(u,A),t(1,u)}function h(A){H.pushUnique(u,A),t(1,u)}function _(A){H.isEmpty(a[A])||a.splice(A,1),t(0,a)}function v(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const k=A=>m(A),y=A=>h(A),T=A=>_(A);function C(A){se[A?"unshift":"push"](()=>{c=A,t(6,c)})}const M=()=>{for(let A of c.files)a.push(A);t(0,a),t(6,c.value=null,c)},$=()=>c==null?void 0:c.click();function D(A){se[A?"unshift":"push"](()=>{d=A,t(7,d)})}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,I;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=H.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=H.toArray(u))),n.$$.dirty&8&&t(5,i=((A=f.options)==null?void 0:A.maxSelect)>1),n.$$.dirty&4128&&H.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=H.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((I=f.options)==null?void 0:I.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&v()},[a,u,o,f,s,i,c,d,l,m,h,_,r,k,y,T,C,M,$,D]}class SM extends ye{constructor(e){super(),ve(this,e,wM,kM,he,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function gp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function TM(n,e){e=gp(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=gp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const CM=n=>({dragging:n&2,dragover:n&4}),bp=n=>({dragging:n[1],dragover:n[2]});function $M(n){let e,t,i,s;const l=n[8].default,o=Nt(l,n,n[7],bp);return{c(){e=b("div"),o&&o.c(),p(e,"draggable",!0),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[1]),Q(e,"dragover",n[2])},m(r,a){S(r,e,a),o&&o.m(e,null),t=!0,i||(s=[Y(e,"dragover",dt(n[9])),Y(e,"dragleave",dt(n[10])),Y(e,"dragend",n[11]),Y(e,"dragstart",n[12]),Y(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Rt(o,l,r,r[7],t?Ft(l,r[7],a,CM):qt(r[7]),bp),(!t||a&2)&&Q(e,"dragging",r[1]),(!t||a&4)&&Q(e,"dragover",r[2])},i(r){t||(E(o,r),t=!0)},o(r){P(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,Pe(s)}}}function MM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=$t();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function c(y,T){!y&&!a||(t(1,u=!0),y.dataTransfer.effectAllowed="move",y.dataTransfer.dropEffect="move",y.dataTransfer.setData("text/plain",T))}function d(y,T){if(!y&&!a)return;t(2,f=!1),t(1,u=!1),y.dataTransfer.dropEffect="move";const C=parseInt(y.dataTransfer.getData("text/plain"));C{t(2,f=!0)},h=()=>{t(2,f=!1)},_=()=>{t(2,f=!1),t(1,u=!1)},v=y=>c(y,o),k=y=>d(y,o);return n.$$set=y=>{"index"in y&&t(0,o=y.index),"list"in y&&t(5,r=y.list),"disabled"in y&&t(6,a=y.disabled),"$$scope"in y&&t(7,s=y.$$scope)},[o,u,f,c,d,r,a,s,i,m,h,_,v,k]}class OM extends ye{constructor(e){super(),ve(this,e,MM,$M,he,{index:0,list:5,disabled:6})}}function vp(n,e,t){const i=n.slice();return i[6]=e[t],i}function yp(n){let e,t;return e=new iu({props:{record:n[0],filename:n[0][n[6]],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[0][i[6]]),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function kp(n){let e,t,i=n[0][n[6]]&&yp(n);return{c(){i&&i.c(),e=Me()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,l){s[0][s[6]]?i?(i.p(s,l),l&3&&E(i,1)):(i=yp(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function DM(n){let e,t,i,s,l,o,r=H.truncate(H.displayValue(n[0],n[2]),70)+"",a,u,f,c,d=n[1],m=[];for(let _=0;_P(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),s=O();for(let _=0;_t(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(c=>c.name==u&&c.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 ye{constructor(e){super(),ve(this,e,EM,DM,he,{record:0,displayFields:3})}}function wp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Sp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function Tp(n){let e,t;function i(o,r){return o[11]?IM:AM}let s=i(n),l=s(n);return{c(){e=b("div"),l.c(),t=O(),p(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function AM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Cp(n);return{c(){e=b("span"),e.textContent="No records found.",t=O(),s&&s.c(),i=Me(),p(e,"class","txt txt-hint")},m(o,r){S(o,e,r),S(o,t,r),s&&s.m(o,r),S(o,i,r)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=Cp(o),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(o){o&&w(e),o&&w(t),s&&s.d(o),o&&w(i)}}}function IM(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Cp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function PM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function LM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $p(n,e){let t,i,s,l,o,r,a,u,f,c,d;function m(T,C){return T[6]?LM:PM}let h=m(e),_=h(e);l=new Xo({props:{record:e[49],displayFields:e[13]}});function v(){return e[32](e[49])}function k(){return e[33](e[49])}function y(...T){return e[34](e[49],...T)}return{key:n,first:null,c(){t=b("div"),_.c(),i=O(),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),a=b("button"),a.innerHTML='',u=O(),p(s,"class","content"),p(a,"type","button"),p(a,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(r,"class","actions nonintrusive"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m(T,C){S(T,t,C),_.m(t,null),g(t,i),g(t,s),q(l,s,null),g(t,o),g(t,r),g(r,a),g(t,u),f=!0,c||(d=[Ie(Ue.call(null,a,"Edit")),Y(a,"keydown",kn(e[27])),Y(a,"click",kn(v)),Y(t,"click",k),Y(t,"keydown",y)],c=!0)},p(T,C){e=T,h!==(h=m(e))&&(_.d(1),_=h(e),_&&(_.c(),_.m(t,i)));const M={};C[0]&8&&(M.record=e[49]),C[0]&8192&&(M.displayFields=e[13]),l.$set(M),(!f||C[0]&264)&&Q(t,"selected",e[6]),(!f||C[0]&808)&&Q(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i(T){f||(E(l.$$.fragment,T),f=!0)},o(T){P(l.$$.fragment,T),f=!1},d(T){T&&w(t),_.d(),j(l),c=!1,Pe(d)}}}function Mp(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=B("("),i=B(t),s=B(" of MAX "),l=B(n[5]),o=B(")")},m(r,a){S(r,e,a),S(r,i,a),S(r,s,a),S(r,l,a),S(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&32&&le(l,r[5])},d(r){r&&w(e),r&&w(i),r&&w(s),r&&w(l),r&&w(o)}}}function NM(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function FM(n){let e,t,i=n[6],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=b("div");for(let o=0;o',l=O(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){S(f,e,c),q(t,e,null),g(e,i),g(e,s),S(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),c[0]&8192&&(d.displayFields=n[13]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(E(t.$$.fragment,f),o=!0)},o(f){P(t.$$.fragment,f),o=!1},d(f){f&&w(e),j(t),f&&w(l),r=!1,a()}}}function Op(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[RM,({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 OM({props:l}),se.push(()=>_e(e,"list",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function qM(n){let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,m,h,_,v,k,y,T;t=new Uo({props:{value:n[2],autocompleteCollection:n[12]}}),t.$on("submit",n[30]);let C=n[3];const M=N=>N[49].id;for(let N=0;N1&&Mp(n);const A=[FM,NM],I=[];function L(N,F){return N[6].length?0:1}return h=L(n),_=I[h]=A[h](n),{c(){e=b("div"),V(t.$$.fragment),i=O(),s=b("button"),s.innerHTML='
    New record
    ',l=O(),o=b("div");for(let N=0;N1?D?D.p(N,F):(D=Mp(N),D.c(),D.m(c,null)):D&&(D.d(1),D=null);let K=h;h=L(N),h===K?I[h].p(N,F):(re(),P(I[K],1,1,()=>{I[K]=null}),ae(),_=I[h],_?_.p(N,F):(_=I[h]=A[h](N),_.c()),E(_,1),_.m(v.parentNode,v))},i(N){if(!k){E(t.$$.fragment,N);for(let F=0;FCancel',t=O(),i=b("button"),i.innerHTML='Save selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function HM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[VM],header:[jM],default:[qM]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ae));const h=$t(),_="picker_"+H.randomString(5);let{value:v}=e,{field:k}=e,y,T,C="",M=[],$=[],D=1,A=0,I=!1,L=!1;function N(){return t(2,C=""),t(3,M=[]),t(6,$=[]),R(),K(!0),y==null?void 0:y.show()}function F(){return y==null?void 0:y.hide()}async function R(){const Ae=H.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Dr))et.push(`id="${bt}"`);nt.push(pe.collection(s).getFullList(Dr,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,$=[]);for(const et of Ae){const bt=H.findByKey(ie,"id",et);bt&&$.push(bt)}C.trim()||t(3,M=H.filterDuplicatesByKey($.concat(M)))}catch(et){pe.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(C.trim()?t(3,M=[]):t(3,M=H.toArray($).slice()));try{const ie=Ae?1:D+1,we=await pe.collection(s).getList(ie,Dr,{filter:C,sort:"-created",$cancelKey:_+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(we.items))),D=we.page,t(23,A=we.totalItems)}catch(ie){pe.errorResponseHandler(ie)}t(4,I=!1)}}function x(Ae){i==1?t(6,$=[Ae]):u&&(H.pushOrReplaceByKey($,Ae),t(6,$))}function U(Ae){H.removeByKey($,"id",Ae.id),t(6,$)}function X(Ae){f(Ae)?U(Ae):x(Ae)}function ne(){var Ae;i!=1?t(20,v=$.map(ie=>ie.id)):t(20,v=((Ae=$==null?void 0:$[0])==null?void 0:Ae.id)||""),h("save",$),F()}function J(Ae){ze.call(this,n,Ae)}const ue=()=>F(),Z=()=>ne(),de=Ae=>t(2,C=Ae.detail),ge=()=>T==null?void 0:T.show(),Ce=Ae=>T==null?void 0:T.show(Ae),Ne=Ae=>X(Ae),Re=(Ae,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),X(Ae))},be=()=>t(2,C=""),Se=()=>{a&&!I&&K()},We=Ae=>U(Ae);function lt(Ae){$=Ae,t(6,$)}function ce(Ae){se[Ae?"unshift":"push"](()=>{y=Ae,t(1,y)})}function He(Ae){ze.call(this,n,Ae)}function te(Ae){ze.call(this,n,Ae)}function Fe(Ae){se[Ae?"unshift":"push"](()=>{T=Ae,t(7,T)})}const ot=Ae=>{H.removeByKey(M,"id",Ae.detail.id),M.unshift(Ae.detail),t(3,M),x(Ae.detail)},Vt=Ae=>{H.removeByKey(M,"id",Ae.detail.id),t(3,M),U(Ae.detail)};return n.$$set=Ae=>{e=Je(Je({},e),Qn(Ae)),t(19,d=Et(e,c)),"value"in Ae&&t(20,v=Ae.value),"field"in Ae&&t(21,k=Ae.field)},n.$$.update=()=>{var Ae,ie,we;n.$$.dirty[0]&2097152&&t(5,i=((Ae=k==null?void 0:k.options)==null?void 0:Ae.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(ie=k==null?void 0:k.options)==null?void 0:ie.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(we=k==null?void 0:k.options)==null?void 0:we.displayFields),n.$$.dirty[0]&100663296&&t(12,o=m.find(nt=>nt.id==s)||null),n.$$.dirty[0]&16777222&&typeof C<"u"&&!L&&y!=null&&y.isActive()&&K(!0),n.$$.dirty[0]&16777232&&t(11,r=I||L),n.$$.dirty[0]&8388616&&t(10,a=A>M.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>$.length),n.$$.dirty[0]&64&&t(8,f=function(nt){return H.findByKey($,"id",nt.id)})},[F,y,C,M,I,i,$,T,f,u,a,r,o,l,K,x,U,X,ne,d,v,k,N,A,L,s,m,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt]}class BM extends ye{constructor(e){super(),ve(this,e,zM,HM,he,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Dp(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ep(n,e,t){const i=n.slice();return i[18]=e[t],i}function Ap(n){let e,t=n[5]&&Ip(n);return{c(){t&&t.c(),e=Me()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=Ip(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Ip(n){let e,t=H.toArray(n[0]).slice(0,10),i=[];for(let s=0;s `,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Lp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),o=b("button"),o.innerHTML='',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(m,h){S(m,e,h),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(e,r),a=!0,u||(f=[Ie(Ue.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var v;n=m;const _={};h&16&&(_.record=n[15]),h&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_)},i(m){a||(E(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function UM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y=n[4],T=[];for(let $=0;$P(T[$],1,1,()=>{T[$]=null});let M=null;return y.length||(M=Ap(n)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("div"),c=b("div");for(let $=0;$ Open picker`,p(t,"class",i=Si(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m($,D){S($,e,D),g(e,t),g(e,s),g(e,l),g(l,r),S($,u,D),S($,f,D),g(f,c);for(let A=0;A({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new me({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new BM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(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||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const Np=100;function YM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var C,M;const k=H.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 y=k.slice(),T=[];for(;y.length>0;){const $=[];for(const D of y.splice(0,Np))$.push(`id="${D}"`);T.push(pe.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(Np,{filter:$.join("||"),$autoCancel:!1}))}try{let $=[];await Promise.all(T).then(D=>{$=$.concat(...D)});for(const D of k){const A=H.findByKey($,"id",D);A&&a.push(A)}t(4,a)}catch($){pe.errorResponseHandler($)}t(5,u=!1)}function c(k){var y;H.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):((y=a[0])==null?void 0:y.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,c,d,m,h,_,v]}class KM extends ye{constructor(e){super(),ve(this,e,YM,WM,he,{value:0,picker:1,field:2})}}const JM=["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"],ZM=(n,e)=>{JM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function GM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Pr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function XM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function QM(n){let e;function t(l,o){return l[1]?XM:GM}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:G,o:G,d(l){l&&w(e),s.d(),n[19](null)}}}const Pb=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),xM=()=>{let n={listeners:[],scriptId:Pb("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 e5=xM();function t5(n,e,t){var i;let{id:s=Pb("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:m=""}=e,{cssClass:h="tinymce-wrapper"}=e,_,v,k,y="",T=o;const C=$t(),M=()=>{const N=(()=>typeof window<"u"?window:global)();return N&&N.tinymce?N.tinymce:null},$=()=>{const L=Object.assign(Object.assign({},f),{target:v,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:N=>{t(14,k=N),N.on("init",()=>{N.setContent(d),N.on(c,()=>{t(15,y=N.getContent()),y!==d&&(t(5,d=y),t(6,m=N.getContent({format:"text"})))})}),ZM(N,C),typeof f.setup=="function"&&f.setup(N)}});t(4,v.style.visibility="",v),M().init(L)};Zt(()=>{if(M()!==null)$();else{const L=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;e5.load(_.ownerDocument,L,()=>{$()})}}),h_(()=>{var L;k&&((L=M())===null||L===void 0||L.remove(k))});function D(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function A(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function I(L){se[L?"unshift":"push"](()=>{_=L,t(3,_)})}return n.$$set=L=>{"id"in L&&t(0,s=L.id),"inline"in L&&t(1,l=L.inline),"disabled"in L&&t(7,o=L.disabled),"apiKey"in L&&t(8,r=L.apiKey),"channel"in L&&t(9,a=L.channel),"scriptSrc"in L&&t(10,u=L.scriptSrc),"conf"in L&&t(11,f=L.conf),"modelEvents"in L&&t(12,c=L.modelEvents),"value"in L&&t(5,d=L.value),"text"in L&&t(6,m=L.text),"cssClass"in L&&t(2,h=L.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&y!==d&&(k.setContent(d),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,h,_,v,d,m,o,r,a,u,f,c,i,k,y,T,D,A,I]}class Lb extends ye{constructor(e){super(),ve(this,e,t5,QM,he,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function n5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:H.defaultEditorOptions()};return n[0]!==void 0&&(h.value=n[0]),f=new Lb({props:h}),se.push(()=>_e(f,"value",m)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),V(f.$$.fragment),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),q(f,_,v),d=!0},p(_,v){(!d||v&2&&i!==(i=H.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||v&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||v&8&&a!==(a=_[3]))&&p(e,"for",a);const k={};v&8&&(k.id=_[3]),!c&&v&1&&(c=!0,k.value=_[0],ke(()=>c=!1)),f.$set(k)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){P(f.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(u),j(f,_)}}}function i5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[n5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function s5(n,e,t){let{field:i=new mn}=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 l5 extends ye{constructor(e){super(),ve(this,e,s5,i5,he,{field:1,value:0})}}function o5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&fe(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function r5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&fe(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function a5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("User API URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&fe(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function u5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[o5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[r5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[a5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Selfhosted endpoints (optional)",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),u=O(),f=b("div"),V(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function f5(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 Fp extends ye{constructor(e){super(),ve(this,e,f5,u5,he,{key:1,config:0})}}function c5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&fe(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function d5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","text"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&fe(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function p5(n){let e,t,i,s,l,o,r,a,u;return l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[c5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[d5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(i,"class","grid")},m(f,c){S(f,e,c),S(f,t,c),S(f,i,c),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),u=!0},p(f,[c]){const d={};c&1&&(d.class="form-field "+(f[0].enabled?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&49&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&1&&(m.class="form-field "+(f[0].enabled?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&49&&(m.$$scope={dirty:c,ctx:f}),a.$set(m)},i(f){u||(E(l.$$.fragment,f),E(a.$$.fragment,f),u=!0)},o(f){P(l.$$.fragment,f),P(a.$$.fragment,f),u=!1},d(f){f&&w(e),f&&w(t),f&&w(i),j(l),j(a)}}}function m5(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 h5 extends ye{constructor(e){super(),ve(this,e,m5,p5,he,{key:1,config:0})}}function _5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&fe(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function g5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&fe(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function b5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("User API URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].userApiUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[4]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].userApiUrl&&fe(l,d[0].userApiUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function v5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[_5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[g5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[b5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Endpoints",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),u=O(),f=b("div"),V(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(f,"class","col-lg-12"),p(i,"class","grid")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&1&&(_.class="form-field "+(m[0].enabled?"required":"")),h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&1&&(v.class="form-field "+(m[0].enabled?"required":"")),h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&1&&(k.class="form-field "+(m[0].enabled?"required":"")),h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function y5(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 Er extends ye{constructor(e){super(),ve(this,e,y5,v5,he,{key:1,config:0})}}const vl={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",optionsComponent:Fp},discordAuth:{title:"Discord",icon:"ri-discord-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:h5},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:Fp},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},oidcAuth:{title:"OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",optionsComponent:Er},oidc2Auth:{title:"(2) OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",hidden:!0,optionsComponent:Er},oidc3Auth:{title:"(3) OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",hidden:!0,optionsComponent:Er}};function Rp(n,e,t){const i=n.slice();return i[9]=e[t],i}function k5(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function w5(n){let e,t=n[1],i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function qp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,m,h,_,v,k;function y(){return n[6](n[9])}return{c(){e=b("div"),t=b("i"),s=O(),l=b("span"),r=B(o),a=O(),u=b("div"),f=B("ID: "),d=B(c),m=O(),h=b("button"),h.innerHTML='',_=O(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,C){S(T,e,C),g(e,t),g(e,s),g(e,l),g(l,r),g(e,a),g(e,u),g(u,f),g(u,d),g(e,m),g(e,h),g(e,_),v||(k=Y(h,"click",y),v=!0)},p(T,C){n=T,C&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),C&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),C&2&&c!==(c=n[9].providerId+"")&&le(d,c)},d(T){T&&w(e),v=!1,k()}}}function T5(n){let e;function t(l,o){var r;return l[2]?S5:(r=l[0])!=null&&r.id&&l[1].length?w5:k5}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function C5(n,e,t){const i=$t();let{record:s}=e,l=[],o=!1;function r(d){var m;return((m=vl[d+"Auth"])==null?void 0:m.title)||H.sentenize(d,!1)}function a(d){var m;return((m=vl[d+"Auth"])==null?void 0:m.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await pe.collection(s.collectionId).listExternalAuths(s.id))}catch(d){pe.errorResponseHandler(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||cn(`Do you really want to unlink the ${r(d)} provider?`,()=>pe.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{zt(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(m=>{pe.errorResponseHandler(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class $5 extends ye{constructor(e){super(),ve(this,e,C5,T5,he,{record:0})}}function jp(n,e,t){const i=n.slice();return i[51]=e[t],i[52]=e,i[53]=t,i}function Vp(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[M5,({uniqueId:i})=>({54:i}),({uniqueId:i})=>[0,i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&25165824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function M5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",l=O(),o=b("span"),a=O(),u=b("div"),f=b("i"),d=O(),m=b("input"),p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[54]),p(f,"class","ri-calendar-event-line txt-disabled"),p(u,"class","form-field-addon"),p(m,"type","text"),p(m,"id",h=n[54]),m.value=_=n[2].id,m.readOnly=!0},m(y,T){S(y,e,T),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),S(y,a,T),S(y,u,T),g(u,f),S(y,d,T),S(y,m,T),v||(k=Ie(c=Ue.call(null,f,{text:`Created: ${n[2].created} Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,T){T[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${y[2].created} Updated: ${y[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),T[0]&4&&_!==(_=y[2].id)&&m.value!==_&&(m.value=_)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),v=!1,k()}}}function Hp(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new b4({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&zp();return{c(){V(e.$$.fragment),i=O(),a&&a.c(),s=Me()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,_;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=zp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(E(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function zp(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function O5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new KM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function D5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new SM({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(E(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function E5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new x4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function A5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Z4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function I5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new W4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function P5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new l5({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function L5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new H4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function N5(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new R4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function F5(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new P4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function R5(n){let e,t,i;function s(o){n[31](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new D4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function q5(n){let e,t,i;function s(o){n[30](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new C4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Bp(n,e){let t,i,s,l,o;const r=[q5,R5,F5,N5,L5,P5,I5,A5,E5,D5,O5],a=[];function u(f,c){return f[51].type==="text"?0:f[51].type==="number"?1:f[51].type==="bool"?2:f[51].type==="email"?3:f[51].type==="url"?4:f[51].type==="editor"?5:f[51].type==="date"?6:f[51].type==="select"?7:f[51].type==="json"?8:f[51].type==="file"?9:f[51].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Me(),s&&s.c(),l=Me(),this.first=t},m(f,c){S(f,t,c),~i&&a[i].m(f,c),S(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(re(),P(a[d],1,1,()=>{a[d]=null}),ae()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),E(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(E(s),o=!0)},o(f){P(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function Up(n){let e,t,i;return t=new $5({props:{record:n[2]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[10]===yl)},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&4&&(o.record=s[2]),t.$set(o),(!i||l[0]&1024)&&Q(e,"active",s[10]===yl)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function j5(n){var v,k;let e,t,i,s,l=[],o=new Map,r,a,u,f,c=!n[2].isNew&&Vp(n),d=((v=n[0])==null?void 0:v.isAuth)&&Hp(n),m=((k=n[0])==null?void 0:k.schema)||[];const h=y=>y[51].name;for(let y=0;y{c=null}),ae()):c?(c.p(y,T),T[0]&4&&E(c,1)):(c=Vp(y),c.c(),E(c,1),c.m(t,i)),(C=y[0])!=null&&C.isAuth?d?(d.p(y,T),T[0]&1&&E(d,1)):(d=Hp(y),d.c(),E(d,1),d.m(t,s)):d&&(re(),P(d,1,1,()=>{d=null}),ae()),T[0]&29&&(m=((M=y[0])==null?void 0:M.schema)||[],re(),l=wt(l,T,h,1,y,m,o,t,ln,Bp,null,jp),ae()),(!a||T[0]&1024)&&Q(t,"active",y[10]===Gi),y[0].isAuth&&!y[2].isNew?_?(_.p(y,T),T[0]&5&&E(_,1)):(_=Up(y),_.c(),E(_,1),_.m(e,null)):_&&(re(),P(_,1,1,()=>{_=null}),ae())},i(y){if(!a){E(c),E(d);for(let T=0;T Send verification email`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Kp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` Send password reset email`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function V5(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Yp(n),u=n[0].isAuth&&n[7].email&&Kp(n);return{c(){a&&a.c(),e=O(),u&&u.c(),t=O(),i=b("button"),i.innerHTML=` Duplicate`,s=O(),l=b("button"),l.innerHTML=` Delete`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[Y(i,"click",n[25]),Y(l,"click",kn(dt(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Yp(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=Kp(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Pe(r)}}}function Jp(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=O(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[10]===Gi),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[Y(t,"click",n[27]),Y(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===Gi),a[0]&1024&&Q(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Pe(o)}}}function H5(n){var _;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Wp(n),h=n[0].isAuth&&!n[2].isNew&&Jp(n);return{c(){e=b("h4"),i=B(t),s=O(),l=b("strong"),r=B(o),a=B(" record"),u=O(),m&&m.c(),f=O(),h&&h.c(),c=Me()},m(v,k){S(v,e,k),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),S(v,u,k),m&&m.m(v,k),S(v,f,k),h&&h.m(v,k),S(v,c,k),d=!0},p(v,k){var y;(!d||k[0]&4)&&t!==(t=v[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=v[0])==null?void 0:y.name)+"")&&le(r,o),v[2].isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(v,k),k[0]&4&&E(m,1)):(m=Wp(v),m.c(),E(m,1),m.m(f.parentNode,f)),v[0].isAuth&&!v[2].isNew?h?h.p(v,k):(h=Jp(v),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(v){d||(E(m),d=!0)},o(v){P(m),d=!1},d(v){v&&w(e),v&&w(u),m&&m.d(v),v&&w(f),h&&h.d(v),v&&w(c)}}}function z5(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),r=B(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[13]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=Y(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function B5(n){var s;let e,t,i={class:` record-panel `+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+` `+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+` `,beforeHide:n[43],$$slots:{footer:[z5],header:[H5],default:[j5]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=` record-panel `+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+` `+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+` `),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function Zp(n){return JSON.stringify(n)}function U5(n,e,t){let i,s,l,o;const r=$t(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ti,m=!1,h=!1,_={},v={},k="",y=Gi;function T(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M(ie){Bn({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ti),t(3,_={}),t(4,v={}),await sn(),t(20,k=Zp(d))}function $(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=A();let we;d.isNew?we=pe.collection(u.id).create(ie):we=pe.collection(u.id).update(d.id,ie),we.then(nt=>{zt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),C(),r("save",nt)}).catch(nt=>{pe.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>pe.collection(c.collectionId).delete(c.id).then(()=>{C(),zt("Successfully deleted record."),r("delete",c)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function A(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.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 et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),H.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=H.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=H.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>pe.collection(u.id).requestVerification(c.email).then(()=>{zt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>pe.collection(u.id).requestPasswordReset(c.email).then(()=>{zt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function N(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}T(ie),await sn(),t(20,k="")}const R=()=>C(),K=()=>I(),x=()=>L(),U=()=>N(),X=()=>D(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function ue(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ge(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ce(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function be(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function He(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),C()}),!1):(Bn({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){ze.call(this,n,ie)}function Ae(ie){ze.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=H.hasNonEmptyProps(_)||H.hasNonEmptyProps(v)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=Zp(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,C,d,_,v,l,f,c,m,h,y,o,i,a,$,D,I,L,N,T,k,s,R,K,x,U,X,ne,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt,Ae]}class Nb extends ye{constructor(e){super(),ve(this,e,U5,B5,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function Gp(n,e,t){const i=n.slice();return i[15]=e[t],i[7]=t,i}function Xp(n,e,t){const i=n.slice();return i[12]=e[t],i}function Qp(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function xp(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function W5(n){const e=n.slice(),t=H.toArray(e[3]);e[8]=t;const i=H.toArray(e[0].expand[e[1].name]);e[9]=i;const s=e[2]?20:200;return e[10]=s,e}function Y5(n){let e,t=H.truncate(n[3],2e3)+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","block txt-break")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=H.truncate(s[3],2e3)+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function K5(n){let e,t=H.truncate(n[3])+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=H.truncate(n[3]))},m(l,o){S(l,e,o),g(e,i)},p(l,o){o&8&&t!==(t=H.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=H.truncate(l[3]))&&p(e,"title",s)},i:G,o:G,d(l){l&&w(e)}}}function J5(n){let e,t=[],i=new Map,s,l=H.toArray(n[3]);const o=r=>r[7]+r[15];for(let r=0;rn[10]&&im();return{c(){e=b("div"),i.c(),s=O(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){S(f,e,c),r[t].m(e,null),g(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),P(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),E(i,1),i.m(e,s)),f[8].length>f[10]?u||(u=im(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function G5(n){let e,t=[],i=new Map,s=H.toArray(n[3]);const l=o=>o[7]+o[5];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()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function x5(n){let e,t=H.truncate(n[3])+"",i,s,l;return{c(){e=b("a"),i=B(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),g(e,i),s||(l=[Ie(Ue.call(null,e,"Open in new tab")),Y(e,"click",kn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=H.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function eO(n){let e,t;return{c(){e=b("span"),t=B(n[3]),p(e,"class","txt")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&8&&le(t,i[3])},i:G,o:G,d(i){i&&w(e)}}}function tO(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function nO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function iO(n){let e,t=(n[2]?H.truncate(JSON.stringify(n[3])):H.truncate(JSON.stringify(n[3],null,2),2e3,!0))+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&12&&t!==(t=(s[2]?H.truncate(JSON.stringify(s[3])):H.truncate(JSON.stringify(s[3],null,2),2e3,!0))+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function em(n,e){let t,i,s;return i=new iu({props:{record:e[0],filename:e[15],size:"sm"}}),{key:n,first:null,c(){t=Me(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&8&&(r.filename=e[15]),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function sO(n){let e,t=n[8].slice(0,n[10]),i=[];for(let s=0;sr[7]+r[5];for(let r=0;r{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),E(i,1),i.m(s.parentNode,s))},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function uO(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){ze.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 Fb extends ye{constructor(e){super(),ve(this,e,uO,aO,he,{record:0,field:1,short:2})}}function fO(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ie(i=Ue.call(null,e,n[2]?"":"Copy")),Y(e,"click",kn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Bt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function cO(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&&(H.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 su extends ye{constructor(e){super(),ve(this,e,cO,fO,he,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function lm(n,e,t){const i=n.slice();return i[10]=e[t],i}function om(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new Fb({props:{field:n[10],record:n[3]}}),{c(){e=b("tr"),t=b("td"),s=B(i),l=O(),o=b("td"),V(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(u,f){S(u,e,f),g(e,t),g(t,s),g(e,l),g(e,o),q(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(E(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),j(r)}}}function rm(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=O(),s=b("td"),V(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function am(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=O(),s=b("td"),V(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function dO(n){var $;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,m,h,_,v;a=new su({props:{value:n[3].id}});let k=($=n[0])==null?void 0:$.schema,y=[];for(let D=0;DP(y[D],1,1,()=>{y[D]=null});let C=n[3].created&&rm(n),M=n[3].updated&&am(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="id",l=O(),o=b("td"),r=b("div"),V(a.$$.fragment),u=O(),f=b("span"),d=B(c),m=O();for(let D=0;D{C=null}),ae()),D[3].updated?M?(M.p(D,A),A&8&&E(M,1)):(M=am(D),M.c(),E(M,1),M.m(t,null)):M&&(re(),P(M,1,1,()=>{M=null}),ae())},i(D){if(!v){E(a.$$.fragment,D);for(let A=0;AClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[6]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function hO(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[mO],header:[pO],default:[dO]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){V(e.$$.fragment)},m(s,l){q(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||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),j(e,s)}}}function _O(n,e,t){let i,{collection:s}=e,l,o=new Ti;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 c(m){ze.call(this,n,m)}function d(m){ze.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(h=>h.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class gO extends ye{constructor(e){super(),ve(this,e,_O,hO,he,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function um(n,e,t){const i=n.slice();return i[55]=e[t],i}function fm(n,e,t){const i=n.slice();return i[58]=e[t],i}function cm(n,e,t){const i=n.slice();return i[58]=e[t],i}function dm(n,e,t){const i=n.slice();return i[51]=e[t],i}function pm(n){let e;function t(l,o){return l[12]?vO:bO}let i=t(n),s=i(n);return{c(){e=b("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){S(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&w(e),s.d()}}}function bO(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=O(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),o||(r=Y(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&&w(e),o=!1,r()}}}function vO(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function mm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[yO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function yO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function hm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&_m(n),r=i&&gm(n);return{c(){o&&o.c(),t=O(),r&&r.c(),s=Me()},m(a,u){o&&o.m(a,u),S(a,t,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,u){u[0]&128&&(e=!a[7].includes("@username")),e?o?(o.p(a,u),u[0]&128&&E(o,1)):(o=_m(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&E(r,1)):(r=gm(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){l||(E(o),E(r),l=!0)},o(a){P(o),P(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function _m(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[kO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function kO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="username",p(t,"class",H.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function gm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[wO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function wO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function SO(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=b("div"),t=b("i"),s=O(),l=b("span"),r=B(o),p(t,"class",i=H.getFieldTypeIcon(n[58].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),g(l,r)},p(a,u){u[0]&262144&&i!==(i=H.getFieldTypeIcon(a[58].type))&&p(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&w(e)}}}function bm(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:[SO]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Wt({props:r}),se.push(()=>_e(i,"sort",o)),{key:n,first:null,c(){t=Me(),V(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),q(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||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),j(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:[TO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function ym(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[CO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(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||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function CO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="updated",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function km(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){S(t,e,i),n[35](e)},p:G,d(t){t&&w(e),n[35](null)}}}function wm(n){let e;function t(l,o){return l[12]?MO:$O}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function $O(n){let e,t,i,s,l;function o(u,f){var c,d;if((c=u[1])!=null&&c.length)return DO;if(!((d=u[2])!=null&&d.isView))return OO}let r=o(n),a=r&&r(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",s=O(),a&&a.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),g(e,t),g(t,i),g(t,s),a&&a.m(t,null),g(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&&w(e),a&&a.d()}}}function MO(n){let e;return{c(){e=b("tr"),e.innerHTML=` `},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function OO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` New record`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function DO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Sm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(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)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Tm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new su({props:{value:n[55].id}});let c=n[2].isAuth&&Cm(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),a=B(r),u=O(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Cm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(E(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Cm(n){let e;function t(l,o){return l[55].verified?AO:EO}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function EO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function AO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function $m(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Mm(n),o=i&&Om(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=Me()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Mm(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=Om(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Mm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?PO:IO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function IO(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function PO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Om(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?NO:LO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function LO(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function NO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Dm(n,e){let t,i,s,l;return i=new Fb({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),p(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),q(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))&&p(t,"class",s)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Em(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Am(n){let e,t,i;return t=new ui({props:{date:n[55].updated}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Im(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),c,d=e[9]&&!e[7].includes("@updated"),m,h,_,v,k,y,T=!e[2].isView&&Sm(e),C=s&&Tm(e),M=e[2].isAuth&&$m(e),$=e[18];const D=F=>F[58].name;for(let F=0;F<$.length;F+=1){let R=fm(e,$,F),K=D(R);a.set(K,r[F]=Dm(K,R))}let A=f&&Em(e),I=d&&Am(e);function L(){return e[37](e[55])}function N(...F){return e[38](e[55],...F)}return{key:n,first:null,c(){t=b("tr"),T&&T.c(),i=O(),C&&C.c(),l=O(),M&&M.c(),o=O();for(let F=0;F',_=O(),p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,R){S(F,t,R),T&&T.m(t,null),g(t,i),C&&C.m(t,null),g(t,l),M&&M.m(t,null),g(t,o);for(let K=0;K{C=null}),ae()),e[2].isAuth?M?M.p(e,R):(M=$m(e),M.c(),M.m(t,o)):M&&(M.d(1),M=null),R[0]&262160&&($=e[18],re(),r=wt(r,R,D,1,e,$,a,t,ln,Dm,u,fm),ae()),R[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?A?(A.p(e,R),R[0]&1152&&E(A,1)):(A=Em(e),A.c(),E(A,1),A.m(t,c)):A&&(re(),P(A,1,1,()=>{A=null}),ae()),R[0]&640&&(d=e[9]&&!e[7].includes("@updated")),d?I?(I.p(e,R),R[0]&640&&E(I,1)):(I=Am(e),I.c(),E(I,1),I.m(t,m)):I&&(re(),P(I,1,1,()=>{I=null}),ae())},i(F){if(!v){E(C);for(let R=0;R<$.length;R+=1)E(r[R]);E(A),E(I),v=!0}},o(F){P(C);for(let R=0;RU[58].name;for(let U=0;UU[2].isView?U[55]:U[55].id;for(let U=0;U{$=null}),ae()),U[2].isAuth?D?(D.p(U,X),X[0]&4&&E(D,1)):(D=hm(U),D.c(),E(D,1),D.m(i,r)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),X[0]&262145&&(A=U[18],re(),a=wt(a,X,I,1,U,A,u,i,ln,bm,f,cm),ae()),X[0]&1152&&(c=U[10]&&!U[7].includes("@created")),c?L?(L.p(U,X),X[0]&1152&&E(L,1)):(L=vm(U),L.c(),E(L,1),L.m(i,d)):L&&(re(),P(L,1,1,()=>{L=null}),ae()),X[0]&640&&(m=U[9]&&!U[7].includes("@updated")),m?N?(N.p(U,X),X[0]&640&&E(N,1)):(N=ym(U),N.c(),E(N,1),N.m(i,h)):N&&(re(),P(N,1,1,()=>{N=null}),ae()),U[15].length?F?F.p(U,X):(F=km(U),F.c(),F.m(_,null)):F&&(F.d(1),F=null),X[0]&4986582&&(R=U[4],re(),y=wt(y,X,K,1,U,R,T,k,ln,Im,null,um),ae(),!R.length&&x?x.p(U,X):R.length?x&&(x.d(1),x=null):(x=wm(U),x.c(),x.m(k,null))),(!C||X[0]&4096)&&Q(e,"table-loading",U[12])},i(U){if(!C){E($),E(D);for(let X=0;X({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Me(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(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||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function qO(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||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Nm(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=b("small"),t=B("Showing "),s=B(i),l=B(" of "),o=B(n[5]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),g(e,t),g(e,s),g(e,l),g(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&&w(e)}}}function Fm(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),s=B("Load more ("),o=B(l),r=B(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[12]),Q(t,"btn-disabled",n[12]),p(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=Y(t,"click",n[41]),a=!0)},p(f,c){c[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),c[0]&4096&&Q(t,"btn-loading",f[12]),c[0]&4096&&Q(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function Rm(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,c,d,m,h,_,v,k,y;return{c(){e=b("div"),t=b("div"),i=B("Selected "),s=b("strong"),l=B(n[8]),o=O(),a=B(r),u=O(),f=b("button"),f.innerHTML='Reset',c=O(),d=b("div"),m=O(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[13]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),Q(h,"btn-loading",n[13]),Q(h,"btn-disabled",n[13]),p(e,"class","bulkbar")},m(T,C){S(T,e,C),g(e,t),g(t,i),g(t,s),g(s,l),g(t,o),g(t,a),g(e,u),g(e,f),g(e,c),g(e,d),g(e,m),g(e,h),v=!0,k||(y=[Y(f,"click",n[42]),Y(h,"click",n[43])],k=!0)},p(T,C){(!v||C[0]&256)&&le(l,T[8]),(!v||C[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!v||C[0]&8192)&&Q(f,"btn-disabled",T[13]),(!v||C[0]&8192)&&Q(h,"btn-loading",T[13]),(!v||C[0]&8192)&&Q(h,"btn-disabled",T[13])},i(T){v||(T&&xe(()=>{_||(_=je(e,An,{duration:150,y:5},!0)),_.run(1)}),v=!0)},o(T){T&&(_||(_=je(e,An,{duration:150,y:5},!1)),_.run(0)),v=!1},d(T){T&&w(e),T&&_&&_.end(),k=!1,Pe(y)}}}function VO(n){let e,t,i,s,l,o;e=new Ea({props:{class:"table-wrapper",$$slots:{before:[jO],default:[FO]},$$scope:{ctx:n}}});let r=n[4].length&&Nm(n),a=n[4].length&&n[17]&&Fm(n),u=n[8]&&Rm(n);return{c(){V(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),s=O(),u&&u.c(),l=Me()},m(f,c){q(e,f,c),S(f,t,c),r&&r.m(f,c),S(f,i,c),a&&a.m(f,c),S(f,s,c),u&&u.m(f,c),S(f,l,c),o=!0},p(f,c){const d={};c[0]&382679|c[2]&2&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),f[4].length?r?r.p(f,c):(r=Nm(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,c):(a=Fm(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,c),c[0]&256&&E(u,1)):(u=Rm(f),u.c(),E(u,1),u.m(l.parentNode,l)):u&&(re(),P(u,1,1,()=>{u=null}),ae())},i(f){o||(E(e.$$.fragment,f),E(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){j(e,f),f&&w(t),r&&r.d(f),f&&w(i),a&&a.d(f),f&&w(s),u&&u.d(f),f&&w(l)}}}const HO=/^([\+\-])?(\w+)$/;function zO(n,e,t){let i,s,l,o,r,a,u,f;const c=$t();let{collection:d}=e,{sort:m=""}=e,{filter:h=""}=e,_=[],v=1,k=0,y={},T=!0,C=!1,M=0,$,D=[],A=[];function I(){d!=null&&d.id&&localStorage.setItem((d==null?void 0:d.id)+"@hiddenCollumns",JSON.stringify(D))}function L(){if(t(7,D=[]),!!(d!=null&&d.id))try{const ie=localStorage.getItem(d.id+"@hiddenCollumns");ie&&t(7,D=JSON.parse(ie)||[])}catch{}}async function N(){const ie=v;for(let we=1;we<=ie;we++)(we===1||o)&&await F(we,!1)}async function F(ie=1,we=!0){var Gt,di;if(!(d!=null&&d.id))return;t(12,T=!0);let nt=m;const et=nt.match(HO),bt=et?s.find(ft=>ft.name===et[2]):null;if(et&&((di=(Gt=bt==null?void 0:bt.options)==null?void 0:Gt.displayFields)==null?void 0:di.length)>0){const ft=[];for(const Wn of bt.options.displayFields)ft.push((et[1]||"")+et[2]+"."+Wn);nt=ft.join(",")}return pe.collection(d.id).getList(ie,30,{sort:nt,filter:h,expand:s.map(ft=>ft.name).join(","),$cancelKey:"records_list"}).then(async ft=>{if(ie<=1&&R(),t(12,T=!1),t(11,v=ft.page),t(5,k=ft.totalItems),c("load",_.concat(ft.items)),we){const Wn=++M;for(;ft.items.length&&M==Wn;)t(4,_=_.concat(ft.items.splice(0,15))),await H.yieldToMain()}else t(4,_=_.concat(ft.items))}).catch(ft=>{ft!=null&&ft.isAbort||(t(12,T=!1),console.warn(ft),R(),pe.errorResponseHandler(ft,!1))})}function R(){t(4,_=[]),t(11,v=1),t(5,k=0),t(6,y={})}function K(){a?x():U()}function x(){t(6,y={})}function U(){for(const ie of _)t(6,y[ie.id]=ie,y);t(6,y)}function X(ie){y[ie.id]?delete y[ie.id]:t(6,y[ie.id]=ie,y),t(6,y)}function ne(){cn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,J)}async function J(){if(C||!r||!(d!=null&&d.id))return;let ie=[];for(const we of Object.keys(y))ie.push(pe.collection(d.id).delete(we));return t(13,C=!0),Promise.all(ie).then(()=>{zt(`Successfully deleted the selected ${r===1?"record":"records"}.`),x()}).catch(we=>{pe.errorResponseHandler(we)}).finally(()=>(t(13,C=!1),N()))}function ue(ie){ze.call(this,n,ie)}const Z=(ie,we)=>{we.target.checked?H.removeByValue(D,ie.id):H.pushUnique(D,ie.id),t(7,D)},de=()=>K();function ge(ie){m=ie,t(0,m)}function Ce(ie){m=ie,t(0,m)}function Ne(ie){m=ie,t(0,m)}function Re(ie){m=ie,t(0,m)}function be(ie){m=ie,t(0,m)}function Se(ie){m=ie,t(0,m)}function We(ie){se[ie?"unshift":"push"](()=>{$=ie,t(14,$)})}const lt=ie=>X(ie),ce=ie=>c("select",ie),He=(ie,we)=>{we.code==="Enter"&&(we.preventDefault(),c("select",ie))},te=()=>t(1,h=""),Fe=()=>c("new"),ot=()=>F(v+1),Vt=()=>x(),Ae=()=>ne();return n.$$set=ie=>{"collection"in ie&&t(2,d=ie.collection),"sort"in ie&&t(0,m=ie.sort),"filter"in ie&&t(1,h=ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&d!=null&&d.id&&(L(),R()),n.$$.dirty[0]&4&&t(25,i=(d==null?void 0:d.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter(ie=>ie.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter(ie=>!D.includes(ie.id))),n.$$.dirty[0]&7&&d!=null&&d.id&&m!==-1&&h!==-1&&F(1),n.$$.dirty[0]&48&&t(17,o=k>_.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(y).length),n.$$.dirty[0]&272&&t(16,a=_.length&&r===_.length),n.$$.dirty[0]&128&&D!==-1&&I(),n.$$.dirty[0]&20&&t(10,u=!(d!=null&&d.isView)||_.length>0&&_[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(d!=null&&d.isView)||_.length>0&&_[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,A=[].concat(d.isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(ie=>({id:ie.id,name:ie.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,h,d,F,_,k,y,D,r,f,u,v,T,C,$,A,a,o,l,c,K,x,X,ne,N,i,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt,Ae]}class BO extends ye{constructor(e){super(),ve(this,e,zO,VO,he,{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 UO(n){let e,t,i,s;return e=new t4({}),i=new wn({props:{$$slots:{default:[KO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(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||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function WO(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[GO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function YO(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[XO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function qm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ie(Ue.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[15])],t=!0)},p:G,d(s){s&&w(e),t=!1,Pe(i)}}}function jm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` New record`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function KO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I,L,N=!n[10]&&qm(n);c=new Da({}),c.$on("refresh",n[16]);let F=!n[2].isView&&jm(n);k=new Uo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let x={collection:n[2]};return n[0]!==void 0&&(x.filter=n[0]),n[1]!==void 0&&(x.sort=n[1]),M=new BO({props:x}),n[20](M),se.push(()=>_e(M,"filter",R)),se.push(()=>_e(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=O(),l=b("div"),r=B(o),a=O(),u=b("div"),N&&N.c(),f=O(),V(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=` API Preview`,_=O(),F&&F.c(),v=O(),V(k.$$.fragment),y=O(),T=b("div"),C=O(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-base")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),N&&N.m(u,null),g(u,f),q(c,u,null),g(e,d),g(e,m),g(m,h),g(m,_),F&&F.m(m,null),S(U,v,X),q(k,U,X),S(U,y,X),S(U,T,X),S(U,C,X),q(M,U,X),A=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,X){(!A||X[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?N&&(N.d(1),N=null):N?N.p(U,X):(N=qm(U),N.c(),N.m(u,f)),U[2].isView?F&&(F.d(1),F=null):F?F.p(U,X):(F=jm(U),F.c(),F.m(m,null));const ne={};X[0]&1&&(ne.value=U[0]),X[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};X[0]&4&&(J.collection=U[2]),!$&&X[0]&1&&($=!0,J.filter=U[0],ke(()=>$=!1)),!D&&X[0]&2&&(D=!0,J.sort=U[1],ke(()=>D=!1)),M.$set(J)},i(U){A||(E(c.$$.fragment,U),E(k.$$.fragment,U),E(M.$$.fragment,U),A=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),A=!1},d(U){U&&w(e),N&&N.d(),j(c),F&&F.d(),U&&w(v),j(k,U),U&&w(y),U&&w(T),U&&w(C),n[20](null),j(M,U),I=!1,L()}}}function JO(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=` Create new collection`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function ZO(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function GO(n){let e,t,i;function s(r,a){return r[10]?ZO:JO}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function XO(n){let e;return{c(){e=b("div"),e.innerHTML=`

    Loading collections...

    `,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function QO(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[YO,WO,UO],m=[];function h(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new nu({props:_}),n[25](s);let v={};o=new u4({props:v}),n[26](o);let k={collection:n[2]};a=new Nb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new gO({props:y}),n[30](f),{c(){t.c(),i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),q(s,T,C),S(T,l,C),q(o,T,C),S(T,r,C),q(a,T,C),S(T,u,C),q(f,T,C),c=!0},p(T,C){let M=e;e=h(T),e===M?m[e].p(T,C):(re(),P(m[M],1,1,()=>{m[M]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const $={};s.$set($);const D={};o.$set(D);const A={};C[0]&4&&(A.collection=T[2]),a.$set(A);const I={};C[0]&4&&(I.collection=T[2]),f.$set(I)},i(T){c||(E(t),E(s.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(f.$$.fragment,T),c=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),c=!1},d(T){m[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function xO(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,St,Z=>t(31,l=Z)),Ye(n,Po,Z=>t(3,o=Z)),Ye(n,ha,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,$s,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Ob(y);const C=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),$=()=>_==null?void 0:_.load(),D=()=>d==null?void 0:d.show(s),A=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function N(Z){v=Z,t(0,v)}function F(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function x(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function X(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function ue(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}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")!=y&&A3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&T(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Oi("/collections?"+Z)}n.$$.dirty[0]&4&&Kt(St,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,C,M,$,D,A,I,L,N,F,R,K,x,U,X,ne,J,ue]}class eD extends ye{constructor(e){super(),ve(this,e,xO,QO,he,{},null,[-1,-1])}}function tD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=O(),l=b("a"),l.innerHTML=` Application`,o=O(),r=b("a"),r.innerHTML=` Mail settings`,a=O(),u=b("a"),u.innerHTML=` Files storage`,f=O(),c=b("div"),c.innerHTML='Sync',d=O(),m=b("a"),m.innerHTML=` Export collections`,h=O(),_=b("a"),_.innerHTML=` Import collections`,v=O(),k=b("div"),k.textContent="Authentication",y=O(),T=b("a"),T.innerHTML=` Auth providers`,C=O(),M=b("a"),M.innerHTML=` Token options`,$=O(),D=b("a"),D.innerHTML=` Admins`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(k,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(D,"href","/settings/admins"),p(D,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),g(t,f),g(t,c),g(t,d),g(t,m),g(t,h),g(t,_),g(t,v),g(t,k),g(t,y),g(t,T),g(t,C),g(t,M),g(t,$),g(t,D),A||(I=[Ie(qn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(qn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(qn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(qn.call(null,m,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,m)),Ie(qn.call(null,_,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,_)),Ie(qn.call(null,T,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,T)),Ie(qn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(qn.call(null,D,{path:"/settings/admins/?.*"})),Ie(xt.call(null,D))],A=!0)},p:G,i:G,o:G,d(L){L&&w(e),A=!1,Pe(I)}}}class Ii extends ye{constructor(e){super(),ve(this,e,null,tD,he,{})}}function Vm(n,e,t){const i=n.slice();return i[30]=e[t],i}function Hm(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[nD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function nD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",o=O(),r=b("div"),a=b("i"),f=O(),c=b("input"),p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=m=n[1].id,c.readOnly=!0},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),S(v,r,k),g(r,a),S(v,f,k),S(v,c,k),h||(_=Ie(u=Ue.call(null,a,{text:`Created: ${n[1].created} Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&p(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created} Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c,"id",d),k[0]&2&&m!==(m=v[1].id)&&c.value!==m&&(c.value=m)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(c),h=!1,_()}}}function zm(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=b("button"),t=b("img"),s=O(),Hn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),g(e,t),g(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function iD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Email",o=O(),r=b("input"),p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&fe(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Bm(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[sD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function sD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Um(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[lD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[oD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&536871424|c[1]&4&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(E(s.$$.fragment,f),E(r.$$.fragment,f),f&&xe(()=>{a||(a=je(t,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=je(t,At,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function lD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&fe(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function oD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&fe(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function rD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[1].isNew&&Hm(n),_=[0,1,2,3,4,5,6,7,8,9],v=[];for(let T=0;T<10;T+=1)v[T]=zm(Vm(n,_,T));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[iD,({uniqueId:T})=>({29:T}),({uniqueId:T})=>[T?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].isNew&&Bm(n),y=(n[1].isNew||n[4])&&Um(n);return{c(){e=b("form"),h&&h.c(),t=O(),i=b("div"),s=b("p"),s.textContent="Avatar",l=O(),o=b("div");for(let T=0;T<10;T+=1)v[T].c();r=O(),V(a.$$.fragment),u=O(),k&&k.c(),f=O(),y&&y.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,C){S(T,e,C),h&&h.m(e,null),g(e,t),g(e,i),g(i,s),g(i,l),g(i,o);for(let M=0;M<10;M+=1)v[M].m(o,null);g(e,r),q(a,e,null),g(e,u),k&&k.m(e,null),g(e,f),y&&y.m(e,null),c=!0,d||(m=Y(e,"submit",dt(n[12])),d=!0)},p(T,C){if(T[1].isNew?h&&(re(),P(h,1,1,()=>{h=null}),ae()):h?(h.p(T,C),C[0]&2&&E(h,1)):(h=Hm(T),h.c(),E(h,1),h.m(e,t)),C[0]&4){_=[0,1,2,3,4,5,6,7,8,9];let $;for($=0;$<10;$+=1){const D=Vm(T,_,$);v[$]?v[$].p(D,C):(v[$]=zm(D),v[$].c(),v[$].m(o,null))}for(;$<10;$+=1)v[$].d(1)}const M={};C[0]&536870920|C[1]&4&&(M.$$scope={dirty:C,ctx:T}),a.$set(M),T[1].isNew?k&&(re(),P(k,1,1,()=>{k=null}),ae()):k?(k.p(T,C),C[0]&2&&E(k,1)):(k=Bm(T),k.c(),E(k,1),k.m(e,f)),T[1].isNew||T[4]?y?(y.p(T,C),C[0]&18&&E(y,1)):(y=Um(T),y.c(),E(y,1),y.m(e,null)):y&&(re(),P(y,1,1,()=>{y=null}),ae())},i(T){c||(E(h),E(a.$$.fragment,T),E(k),E(y),c=!0)},o(T){P(h),P(a.$$.fragment,T),P(k),P(y),c=!1},d(T){T&&w(e),h&&h.d(),ht(v,T),j(a),k&&k.d(),y&&y.d(),d=!1,m()}}}function aD(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=B(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New admin":"Edit admin")&&le(i,t)},d(s){s&&w(e)}}}function Wm(n){let e,t,i,s,l,o,r,a,u;return o=new ei({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[uD]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=O(),s=b("i"),l=O(),V(o.$$.fragment),r=O(),a=b("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){S(f,e,c),g(e,t),g(e,i),g(e,s),g(e,l),q(o,e,null),S(f,r,c),S(f,a,c),u=!0},p(f,c){const d={};c[1]&4&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(E(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&w(e),j(o),f&&w(r),f&&w(a)}}}function uD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` Delete`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function fD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Wm(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",s=O(),l=b("button"),o=b("span"),a=B(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,_){m&&m.m(h,_),S(h,e,_),S(h,t,_),g(t,i),S(h,s,_),S(h,l,_),g(l,o),g(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,_){h[1].isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(h,_),_[0]&2&&E(m,1)):(m=Wm(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=h[6]),(!f||_[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||_[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||_[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(E(m),f=!0)},o(h){P(m),f=!1},d(h){m&&m.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function cD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[fD],header:[aD],default:[rD]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){V(e.$$.fragment)},m(s,l){q(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||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function dD(n,e,t){let i;const s=$t(),l="admin_"+H.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function _(U){return k(U),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(U){t(1,r=U!=null&&U.clone?U.clone():new Xi),y()}function y(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,m=""),Bn({})}function T(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||h)&&(U.password=d,U.passwordConfirm=m);let X;r.isNew?X=pe.admins.create(U):X=pe.admins.update(r.id,U),X.then(async ne=>{var J;t(7,u=!1),v(),zt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((J=pe.authStore.model)==null?void 0:J.id)===ne.id&&pe.authStore.save(pe.authStore.token,ne)}).catch(ne=>{pe.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>pe.admins.delete(r.id).then(()=>{t(7,u=!1),v(),zt("Successfully deleted admin."),s("delete",r)}).catch(U=>{pe.errorResponseHandler(U)}))}const M=()=>C(),$=()=>v(),D=U=>t(2,f=U);function A(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function N(){m=this.value,t(9,m)}const F=()=>i&&u?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function R(U){se[U?"unshift":"push"](()=>{o=U,t(5,o)})}function K(U){ze.call(this,n,U)}function x(U){ze.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[v,r,f,c,h,o,a,u,d,m,i,l,T,C,_,M,$,D,A,I,L,N,F,R,K,x]}class pD extends ye{constructor(e){super(),ve(this,e,dD,cD,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Ym(n,e,t){const i=n.slice();return i[24]=e[t],i}function mD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function hD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function _D(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function gD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="updated",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Km(n){let e;function t(l,o){return l[5]?vD:bD}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function bD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Jm(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Jm(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function vD(n){let e;return{c(){e=b("tr"),e.innerHTML=` `},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Jm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Zm(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gm(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,_,v,k,y,T=e[24].email+"",C,M,$,D,A,I,L,N,F,R,K,x,U,X;f=new su({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&Zm();A=new ui({props:{date:e[24].created}}),N=new ui({props:{date:e[24].updated}});function J(){return e[15](e[24])}function ue(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("figure"),l=b("img"),r=O(),a=b("td"),u=b("div"),V(f.$$.fragment),c=O(),d=b("span"),h=B(m),_=O(),ne&&ne.c(),v=O(),k=b("td"),y=b("span"),C=B(T),$=O(),D=b("td"),V(A.$$.fragment),I=O(),L=b("td"),V(N.$$.fragment),F=O(),R=b("td"),R.innerHTML='',K=O(),Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(y,"class","txt txt-ellipsis"),p(y,"title",M=e[24].email),p(k,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(L,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,de){S(Z,t,de),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,u),q(f,u,null),g(u,c),g(u,d),g(d,h),g(a,_),ne&&ne.m(a,null),g(t,v),g(t,k),g(k,y),g(y,C),g(t,$),g(t,D),q(A,D,null),g(t,I),g(t,L),q(N,L,null),g(t,F),g(t,R),g(t,K),x=!0,U||(X=[Y(t,"click",J),Y(t,"keydown",ue)],U=!0)},p(Z,de){e=Z,(!x||de&16&&!Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ge={};de&16&&(ge.value=e[24].id),f.$set(ge),(!x||de&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?ne||(ne=Zm(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!x||de&16)&&T!==(T=e[24].email+"")&&le(C,T),(!x||de&16&&M!==(M=e[24].email))&&p(y,"title",M);const Ce={};de&16&&(Ce.date=e[24].created),A.$set(Ce);const Ne={};de&16&&(Ne.date=e[24].updated),N.$set(Ne)},i(Z){x||(E(f.$$.fragment,Z),E(A.$$.fragment,Z),E(N.$$.fragment,Z),x=!0)},o(Z){P(f.$$.fragment,Z),P(A.$$.fragment,Z),P(N.$$.fragment,Z),x=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(A),j(N),U=!1,Pe(X)}}}function yD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M=[],$=new Map,D;function A(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[mD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Wt({props:I}),se.push(()=>_e(o,"sort",A));function L(J){n[12](J)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[hD]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Wt({props:N}),se.push(()=>_e(u,"sort",L));function F(J){n[13](J)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[_D]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),se.push(()=>_e(d,"sort",F));function K(J){n[14](J)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[gD]},$$scope:{ctx:n}};n[2]!==void 0&&(x.sort=n[2]),_=new Wt({props:x}),se.push(()=>_e(_,"sort",K));let U=n[4];const X=J=>J[24].id;for(let J=0;Jr=!1)),o.$set(Z);const de={};ue&134217728&&(de.$$scope={dirty:ue,ctx:J}),!f&&ue&4&&(f=!0,de.sort=J[2],ke(()=>f=!1)),u.$set(de);const ge={};ue&134217728&&(ge.$$scope={dirty:ue,ctx:J}),!m&&ue&4&&(m=!0,ge.sort=J[2],ke(()=>m=!1)),d.$set(ge);const Ce={};ue&134217728&&(Ce.$$scope={dirty:ue,ctx:J}),!v&&ue&4&&(v=!0,Ce.sort=J[2],ke(()=>v=!1)),_.$set(Ce),ue&186&&(U=J[4],re(),M=wt(M,ue,X,1,J,U,$,C,ln,Gm,null,Ym),ae(),!U.length&&ne?ne.p(J,ue):U.length?ne&&(ne.d(1),ne=null):(ne=Km(J),ne.c(),ne.m(C,null))),(!D||ue&32)&&Q(e,"table-loading",J[5])},i(J){if(!D){E(o.$$.fragment,J),E(u.$$.fragment,J),E(d.$$.fragment,J),E(_.$$.fragment,J);for(let ue=0;ue New admin`,m=O(),V(h.$$.fragment),_=O(),v=b("div"),k=O(),V(y.$$.fragment),T=O(),A&&A.c(),C=Me(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(v,"class","clearfix m-b-base")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),q(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),S(I,m,L),q(h,I,L),S(I,_,L),S(I,v,L),S(I,k,L),q(y,I,L),S(I,T,L),A&&A.m(I,L),S(I,C,L),M=!0,$||(D=Y(d,"click",n[9]),$=!0)},p(I,L){(!M||L&64)&&le(o,I[6]);const N={};L&2&&(N.value=I[1]),h.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),y.$set(F),I[4].length?A?A.p(I,L):(A=Xm(I),A.c(),A.m(C.parentNode,C)):A&&(A.d(1),A=null)},i(I){M||(E(a.$$.fragment,I),E(h.$$.fragment,I),E(y.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(y.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(m),j(h,I),I&&w(_),I&&w(v),I&&w(k),j(y,I),I&&w(T),A&&A.d(I),I&&w(C),$=!1,D()}}}function wD(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[kD]},$$scope:{ctx:n}}});let r={};return l=new pD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function SD(n,e,t){let i,s,l;Ye(n,ha,N=>t(21,i=N)),Ye(n,St,N=>t(6,s=N)),Ye(n,Oa,N=>t(7,l=N)),Kt(St,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),pe.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),pe.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),v=N=>t(1,f=N.detail);function k(N){c=N,t(2,c)}function y(N){c=N,t(2,c)}function T(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),$=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},D=()=>t(1,f="");function A(N){se[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Oi("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,h,_,v,k,y,T,C,M,$,D,A,I,L]}class TD extends ye{constructor(e){super(),ve(this,e,SD,wD,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function CD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Email"),s=O(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $D(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Password"),s=O(),l=b("input"),r=O(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[1]),S(d,r,m),S(d,a,m),g(a,u),f||(c=[Y(l,"input",n[5]),Ie(xt.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&fe(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Pe(c)}}}function MD(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[CD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[$D,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),a=b("button"),a.innerHTML=`Login `,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),g(e,a),u=!0,f||(c=Y(e,"submit",dt(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(E(s.$$.fragment,d),E(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function OD(n){let e,t;return e=new Mg({props:{$$slots:{default:[MD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function DD(n,e,t){let i;Ye(n,ha,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),pe.admins.authWithPassword(l,o).then(()=>{$a(),Oi("/")}).catch(()=>{cl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class ED extends ye{constructor(e){super(),ve(this,e,DD,OD,he,{})}}function AD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[PD,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[LD,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[ND,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[FD,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let $=n[3]&&Qm(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),c=O(),d=b("div"),m=b("div"),h=O(),$&&$.c(),_=O(),v=b("button"),k=b("span"),k.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(k,"class","txt"),p(v,"type","submit"),p(v,"class","btn btn-expanded"),v.disabled=y=!n[3]||n[2],Q(v,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(D,A){S(D,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),q(a,e,null),g(e,u),q(f,e,null),g(e,c),g(e,d),g(d,m),g(d,h),$&&$.m(d,null),g(d,_),g(d,v),g(v,k),T=!0,C||(M=Y(v,"click",n[13]),C=!0)},p(D,A){const I={};A&1572865&&(I.$$scope={dirty:A,ctx:D}),i.$set(I);const L={};A&1572865&&(L.$$scope={dirty:A,ctx:D}),o.$set(L);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:D}),a.$set(N);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:D}),f.$set(F),D[3]?$?$.p(D,A):($=Qm(D),$.c(),$.m(d,_)):$&&($.d(1),$=null),(!T||A&12&&y!==(y=!D[3]||D[2]))&&(v.disabled=y),(!T||A&4)&&Q(v,"btn-loading",D[2])},i(D){T||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(a.$$.fragment,D),E(f.$$.fragment,D),T=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),T=!1},d(D){D&&w(e),j(i),j(o),j(a),j(f),$&&$.d(),C=!1,M()}}}function ID(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function PD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Application name"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&fe(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function LD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Application url"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&fe(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ND(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Logs max days retention"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].logs.maxDays&&fe(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function FD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.textContent="Hide collection create and edit controls",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){S(c,e,d),e.checked=n[0].meta.hideControls,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(Ue.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function Qm(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function RD(n){let e,t,i,s,l,o,r,a,u;const f=[ID,AD],c=[];function d(m,h){return m[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=b("header"),e.innerHTML=``,t=O(),i=b("div"),s=b("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",dt(n[4])),a=!0)},p(m,h){let _=l;l=d(m),l===_?c[l].p(m,h):(re(),P(c[_],1,1,()=>{c[_]=null}),ae(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),E(o,1),o.m(s,null))},i(m){r||(E(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),c[l].d(),a=!1,u()}}}function qD(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[RD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function jD(n,e,t){let i,s,l,o;Ye(n,$s,$=>t(14,s=$)),Ye(n,vo,$=>t(15,l=$)),Ye(n,St,$=>t(16,o=$)),Kt(St,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const $=await pe.settings.getAll()||{};h($)}catch($){pe.errorResponseHandler($)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const $=await pe.settings.update(H.filterRedactedProps(a));h($),zt("Successfully saved application settings.")}catch($){pe.errorResponseHandler($)}t(2,f=!1)}}function h($={}){var D,A;Kt(vo,l=(D=$==null?void 0:$.meta)==null?void 0:D.appName,l),Kt($s,s=!!((A=$==null?void 0:$.meta)!=null&&A.hideControls),s),t(0,a={meta:($==null?void 0:$.meta)||{},logs:($==null?void 0:$.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=pt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>_(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,_,r,c,v,k,y,T,C,M]}class VD extends ye{constructor(e){super(),ve(this,e,jD,qD,he,{})}}function HD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=O(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Xn(s,a)},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(Ue.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Xn(s,a=on(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Pe(o)}}}function BD(n){let e;function t(l,o){return l[3]?zD:HD}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function UD(n,e,t){const i=["value","mask"];let s=Et(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(5,s=Et(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,c,d]}class lu extends ye{constructor(e){super(),ve(this,e,UD,BD,he,{value:0,mask:1})}}function WD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=B("Subject"),s=O(),l=b("input"),r=O(),a=b("div"),u=B(`Available placeholder parameters: `),f=b("button"),f.textContent=`{APP_NAME} `,c=B(`, `),d=b("button"),d.textContent=`{APP_URL} `,m=B("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),S(v,l,k),fe(l,n[0].subject),S(v,r,k),S(v,a,k),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),h||(_=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&p(e,"for",i),k[1]&1&&o!==(o=v[31])&&p(l,"id",o),k[0]&1&&l.value!==v[0].subject&&fe(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),h=!1,Pe(_)}}}function YD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=B("Action URL"),s=O(),l=b("input"),r=O(),a=b("div"),u=B(`Available placeholder parameters: `),f=b("button"),f.textContent=`{APP_NAME} `,c=B(`, `),d=b("button"),d.textContent=`{APP_URL} `,m=B(`, `),h=b("button"),h.textContent=`{TOKEN} `,_=B("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(y,T){S(y,e,T),g(e,t),S(y,s,T),S(y,l,T),fe(l,n[0].actionUrl),S(y,r,T),S(y,a,T),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),v||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],v=!0)},p(y,T){T[1]&1&&i!==(i=y[31])&&p(e,"for",i),T[1]&1&&o!==(o=y[31])&&p(l,"id",o),T[0]&1&&l.value!==y[0].actionUrl&&fe(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),v=!1,Pe(k)}}}function KD(n){let e,t,i,s;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),fe(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&fe(e,l[0].body)},i:G,o:G,d(l){l&&w(e),i=!1,s()}}}function JD(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=jt(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&V(e.$$.fragment),i=Me()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),o!==(o=a[4])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>_e(e,"value",l)),V(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function ZD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C;const M=[JD,KD],$=[];function D(A,I){return A[4]&&!A[5]?0:1}return l=D(n),o=$[l]=M[l](n),{c(){e=b("label"),t=B("Body (HTML)"),s=O(),o.c(),r=O(),a=b("div"),u=B(`Available placeholder parameters: `),f=b("button"),f.textContent=`{APP_NAME} `,c=B(`, `),d=b("button"),d.textContent=`{APP_URL} `,m=B(`, `),h=b("button"),h.textContent=`{TOKEN} `,_=B(`, `),v=b("button"),v.textContent=`{ACTION_URL} `,k=B("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(A,I){S(A,e,I),g(e,t),S(A,s,I),$[l].m(A,I),S(A,r,I),S(A,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,T||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],T=!0)},p(A,I){(!y||I[1]&1&&i!==(i=A[31]))&&p(e,"for",i);let L=l;l=D(A),l===L?$[l].p(A,I):(re(),P($[L],1,1,()=>{$[L]=null}),ae(),o=$[l],o?o.p(A,I):(o=$[l]=M[l](A),o.c()),E(o,1),o.m(r.parentNode,r))},i(A){y||(E(o),y=!0)},o(A){P(o),y=!1},d(A){A&&w(e),A&&w(s),$[l].d(A),A&&w(r),A&&w(a),T=!1,Pe(C)}}}function GD(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[WD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[YD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[ZD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function xm(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function XD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&xm();return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),l=B(n[2]),o=O(),r=b("div"),a=O(),f&&f.c(),u=Me(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&E(f,1):(f=xm(),f.c(),E(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function QD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[XD],default:[GD]},$$scope:{ctx:n}};for(let l=0;lt(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=eh,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-403c50dc.js"),["./CodeEditor-403c50dc.js","./index-a6ccb683.js"],import.meta.url)).default),eh=c,t(5,d=!1))}function k(J){H.copyToClipboard(J),Cg(`Copied ${J} to clipboard`,2e3)}v();function y(){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 $=()=>k("{APP_NAME}"),D=()=>k("{APP_URL}"),A=()=>k("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function L(){u.body=this.value,t(0,u)}const N=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),K=()=>k("{ACTION_URL}");function x(J){se[J?"unshift":"push"](()=>{f=J,t(3,f)})}function U(J){ze.call(this,n,J)}function X(J){ze.call(this,n,J)}function ne(J){ze.call(this,n,J)}return n.$$set=J=>{e=Je(Je({},e),Qn(J)),t(8,l=Et(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Qi(r))},[u,r,a,f,c,d,i,k,l,m,h,_,o,y,T,C,M,$,D,A,I,L,N,F,R,K,x,U,X,ne]}class Ar extends ye{constructor(e){super(),ve(this,e,xD,QD,he,{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 th(n,e,t){const i=n.slice();return i[22]=e[t],i}function nh(n,e){let t,i,s,l,o,r=e[22].label+"",a,u,f,c,d;return{key:n,first:null,c(){t=b("div"),i=b("input"),l=O(),o=b("label"),a=B(r),f=O(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[21]+e[22].value),i.__value=e[22].value,i.value=i.__value,e[12][0].push(i),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),this.first=t},m(m,h){S(m,t,h),g(t,i),i.checked=i.__value===e[2],g(t,l),g(t,o),g(o,a),g(t,f),c||(d=Y(i,"change",e[11]),c=!0)},p(m,h){e=m,h&2097152&&s!==(s=e[21]+e[22].value)&&p(i,"id",s),h&4&&(i.checked=i.__value===e[2]),h&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(m){m&&w(t),e[12][0].splice(e[12][0].indexOf(i),1),c=!1,d()}}}function eE(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[tE,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=O(),V(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){S(a,e,u),q(t,e,null),g(e,i),q(s,e,null),l=!0,o||(r=Y(e,"submit",dt(n[14])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(E(t.$$.fragment,a),E(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),j(t),j(s),o=!1,r()}}}function iE(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function sE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=O(),s=b("button"),l=b("i"),o=O(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"click",n[0]),Y(s,"click",n[10])],u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function lE(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[15],popup:!0,$$slots:{footer:[sE],header:[iE],default:[nE]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[15]),l&33554486&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}const Ir="last_email_test",ih="email_test_request";function oE(n,e,t){let i;const s=$t(),l="email_test_"+H.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(Ir),u=o[0].value,f=!1,c=null;function d(A="",I=""){t(1,a=A||localStorage.getItem(Ir)),t(2,u=I||o[0].value),Bn({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Ir,a),clearTimeout(c),c=setTimeout(()=>{pe.cancelRequest(ih),cl("Test email send timeout.")},3e4);try{await pe.settings.testEmail(a,u,{$cancelKey:ih}),zt("Successfully sent test email."),s("submit"),t(4,f=!1),await sn(),m()}catch(A){t(4,f=!1),pe.errorResponseHandler(A)}clearTimeout(c)}}const _=[[]],v=()=>h();function k(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const T=()=>h(),C=()=>!f;function M(A){se[A?"unshift":"push"](()=>{r=A,t(3,r)})}function $(A){ze.call(this,n,A)}function D(A){ze.call(this,n,A)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,h,d,v,k,_,y,T,C,M,$,D]}class rE extends ye{constructor(e){super(),ve(this,e,oE,lE,he,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function aE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I,L;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[fE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[cE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});function N(Z){n[14](Z)}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 Ar({props:F}),se.push(()=>_e(u,"config",N));function R(Z){n[15](Z)}let K={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(K.config=n[0].meta.resetPasswordTemplate),d=new Ar({props:K}),se.push(()=>_e(d,"config",R));function x(Z){n[16](Z)}let U={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(U.config=n[0].meta.confirmEmailChangeTemplate),_=new Ar({props:U}),se.push(()=>_e(_,"config",x)),C=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[dE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&sh(n);function ne(Z,de){return Z[4]?yE:vE}let J=ne(n),ue=J(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),c=O(),V(d.$$.fragment),h=O(),V(_.$$.fragment),k=O(),y=b("hr"),T=O(),V(C.$$.fragment),M=O(),X&&X.c(),$=O(),D=b("div"),A=b("div"),I=O(),ue.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(A,"class","flex-fill"),p(D,"class","flex")},m(Z,de){S(Z,e,de),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),S(Z,r,de),S(Z,a,de),q(u,a,null),g(a,c),q(d,a,null),g(a,h),q(_,a,null),S(Z,k,de),S(Z,y,de),S(Z,T,de),q(C,Z,de),S(Z,M,de),X&&X.m(Z,de),S(Z,$,de),S(Z,D,de),g(D,A),g(D,I),ue.m(D,null),L=!0},p(Z,de){const ge={};de[0]&1|de[1]&3&&(ge.$$scope={dirty:de,ctx:Z}),i.$set(ge);const Ce={};de[0]&1|de[1]&3&&(Ce.$$scope={dirty:de,ctx:Z}),o.$set(Ce);const Ne={};!f&&de[0]&1&&(f=!0,Ne.config=Z[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(Ne);const Re={};!m&&de[0]&1&&(m=!0,Re.config=Z[0].meta.resetPasswordTemplate,ke(()=>m=!1)),d.$set(Re);const be={};!v&&de[0]&1&&(v=!0,be.config=Z[0].meta.confirmEmailChangeTemplate,ke(()=>v=!1)),_.$set(be);const Se={};de[0]&1|de[1]&3&&(Se.$$scope={dirty:de,ctx:Z}),C.$set(Se),Z[0].smtp.enabled?X?(X.p(Z,de),de[0]&1&&E(X,1)):(X=sh(Z),X.c(),E(X,1),X.m($.parentNode,$)):X&&(re(),P(X,1,1,()=>{X=null}),ae()),J===(J=ne(Z))&&ue?ue.p(Z,de):(ue.d(1),ue=J(Z),ue&&(ue.c(),ue.m(D,null)))},i(Z){L||(E(i.$$.fragment,Z),E(o.$$.fragment,Z),E(u.$$.fragment,Z),E(d.$$.fragment,Z),E(_.$$.fragment,Z),E(C.$$.fragment,Z),E(X),L=!0)},o(Z){P(i.$$.fragment,Z),P(o.$$.fragment,Z),P(u.$$.fragment,Z),P(d.$$.fragment,Z),P(_.$$.fragment,Z),P(C.$$.fragment,Z),P(X),L=!1},d(Z){Z&&w(e),j(i),j(o),Z&&w(r),Z&&w(a),j(u),j(d),j(_),Z&&w(k),Z&&w(y),Z&&w(T),j(C,Z),Z&&w(M),X&&X.d(Z),Z&&w($),Z&&w(D),ue.d()}}}function uE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function fE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Sender name"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderName),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&fe(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function cE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Sender address"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","email"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&fe(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function dE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.innerHTML="Use SMTP mail server (recommended)",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[31])},m(c,d){S(c,e,d),e.checked=n[0].smtp.enabled,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[17]),Ie(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(c,d){d[1]&1&&t!==(t=c[31])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function sh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$;return i=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[pE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[mE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[hE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[_E,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[gE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[bE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),v=O(),k=b("div"),V(y.$$.fragment),T=O(),C=b("div"),p(t,"class","col-lg-4"),p(l,"class","col-lg-2"),p(a,"class","col-lg-3"),p(c,"class","col-lg-3"),p(h,"class","col-lg-6"),p(k,"class","col-lg-6"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(D,A){S(D,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,T),g(e,C),$=!0},p(D,A){const I={};A[0]&1|A[1]&3&&(I.$$scope={dirty:A,ctx:D}),i.$set(I);const L={};A[0]&1|A[1]&3&&(L.$$scope={dirty:A,ctx:D}),o.$set(L);const N={};A[0]&1|A[1]&3&&(N.$$scope={dirty:A,ctx:D}),u.$set(N);const F={};A[0]&1|A[1]&3&&(F.$$scope={dirty:A,ctx:D}),d.$set(F);const R={};A[0]&1|A[1]&3&&(R.$$scope={dirty:A,ctx:D}),_.$set(R);const K={};A[0]&1|A[1]&3&&(K.$$scope={dirty:A,ctx:D}),y.$set(K)},i(D){$||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(u.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(y.$$.fragment,D),D&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),$=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function pE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("SMTP server host"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.host),r||(a=Y(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&fe(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Port"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.port),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&pt(l.value)!==u[0].smtp.port&&fe(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function hE(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 is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("TLS encryption"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function _E(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 is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("AUTH method"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function gE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Username"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.username),r||(a=Y(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&fe(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function bE(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 lu({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Password"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function vE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` Send test email`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function yE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function kE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[uE,aE],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[5]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[27])),_=!0)},p(C,M){(!h||M[0]&32)&&le(o,C[5]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function wE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[kE]},$$scope:{ctx:n}}});let r={};return l=new rE({props:r}),n[28](l),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function SE(n,e,t){let i,s,l;Ye(n,St,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt(St,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ne=await pe.settings.getAll()||{};_(ne)}catch(ne){pe.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await pe.settings.update(H.filterRedactedProps(f));_(ne),Bn({}),zt("Successfully saved mail settings.")}catch(ne){pe.errorResponseHandler(ne)}t(3,d=!1)}}function _(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function T(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function C(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function $(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=pt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),x=()=>a==null?void 0:a.show(),U=()=>h();function X(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,v,u,i,k,y,T,C,M,$,D,A,I,L,N,F,R,K,x,U,X]}class TE extends ye{constructor(e){super(),ve(this,e,SE,wE,he,{},null,[-1,-1])}}function CE(n){var C,M;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[ME,({uniqueId:$})=>({25:$}),({uniqueId:$})=>$?33554432:0]},$$scope:{ctx:n}}});let v=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&lh(n),k=n[1].s3.enabled&&oh(n),y=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&rh(n),T=n[6]&&ah(n);return{c(){V(e.$$.fragment),t=O(),v&&v.c(),i=O(),k&&k.c(),s=O(),l=b("div"),o=b("div"),r=O(),y&&y.c(),a=O(),T&&T.c(),u=O(),f=b("button"),c=b("span"),c.textContent="Save changes",p(o,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],Q(f,"btn-loading",n[3]),p(l,"class","flex")},m($,D){q(e,$,D),S($,t,D),v&&v.m($,D),S($,i,D),k&&k.m($,D),S($,s,D),S($,l,D),g(l,o),g(l,r),y&&y.m(l,null),g(l,a),T&&T.m(l,null),g(l,u),g(l,f),g(f,c),m=!0,h||(_=Y(f,"click",n[19]),h=!0)},p($,D){var I,L;const A={};D&100663298&&(A.$$scope={dirty:D,ctx:$}),e.$set(A),((I=$[0].s3)==null?void 0:I.enabled)!=$[1].s3.enabled?v?(v.p($,D),D&3&&E(v,1)):(v=lh($),v.c(),E(v,1),v.m(i.parentNode,i)):v&&(re(),P(v,1,1,()=>{v=null}),ae()),$[1].s3.enabled?k?(k.p($,D),D&2&&E(k,1)):(k=oh($),k.c(),E(k,1),k.m(s.parentNode,s)):k&&(re(),P(k,1,1,()=>{k=null}),ae()),(L=$[1].s3)!=null&&L.enabled&&!$[6]&&!$[3]?y?y.p($,D):(y=rh($),y.c(),y.m(l,a)):y&&(y.d(1),y=null),$[6]?T?T.p($,D):(T=ah($),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!m||D&72&&d!==(d=!$[6]||$[3]))&&(f.disabled=d),(!m||D&8)&&Q(f,"btn-loading",$[3])},i($){m||(E(e.$$.fragment,$),E(v),E(k),m=!0)},o($){P(e.$$.fragment,$),P(v),P(k),m=!1},d($){j(e,$),$&&w(t),v&&v.d($),$&&w(i),k&&k.d($),$&&w(s),$&&w(l),y&&y.d(),T&&T.d(),h=!1,_()}}}function $E(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function ME(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[25]),e.required=!0,p(s,"for",o=n[25])},m(u,f){S(u,e,f),e.checked=n[1].s3.enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function lh(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,v,k,y,T,C,M,$,D,A;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',s=O(),l=b("div"),o=B(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),u=B(a),f=B(` to the `),c=b("strong"),m=B(d),h=B(`. `),_=b("br"),v=B(` There are numerous command line tools that can help you, such as: `),k=b("a"),k.textContent=`rclone `,y=B(`, `),T=b("a"),T.textContent=`s5cmd `,C=B(", etc."),M=O(),$=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p($,"class","clearfix m-t-base")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(c,m),g(l,h),g(l,_),g(l,v),g(l,k),g(l,y),g(l,T),g(l,C),g(e,M),g(e,$),A=!0},p(L,N){var F;(!A||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!A||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(L){A||(L&&xe(()=>{D||(D=je(e,At,{duration:150},!0)),D.run(1)}),A=!0)},o(L){L&&(D||(D=je(e,At,{duration:150},!1)),D.run(0)),A=!1},d(L){L&&w(e),L&&D&&D.end()}}}function oh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$;return i=new me({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[OE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[DE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"s3.region",$$slots:{default:[EE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[AE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[IE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[PE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),v=O(),k=b("div"),V(y.$$.fragment),T=O(),C=b("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(D,A){S(D,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,T),g(e,C),$=!0},p(D,A){const I={};A&100663298&&(I.$$scope={dirty:A,ctx:D}),i.$set(I);const L={};A&100663298&&(L.$$scope={dirty:A,ctx:D}),o.$set(L);const N={};A&100663298&&(N.$$scope={dirty:A,ctx:D}),u.$set(N);const F={};A&100663298&&(F.$$scope={dirty:A,ctx:D}),d.$set(F);const R={};A&100663298&&(R.$$scope={dirty:A,ctx:D}),_.$set(R);const K={};A&100663298&&(K.$$scope={dirty:A,ctx:D}),y.$set(K)},i(D){$||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(u.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(y.$$.fragment,D),D&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),$=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function OE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Endpoint"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&fe(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Bucket"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&fe(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function EE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Region"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.region),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.region&&fe(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function AE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Access key"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.accessKey),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&fe(l,u[1].s3.accessKey)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function IE(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 lu({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Secret"),s=O(),V(l.$$.fragment),p(e,"for",i=n[25])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&33554432&&i!==(i=f[25]))&&p(e,"for",i);const d={};c&33554432&&(d.id=f[25]),!o&&c&2&&(o=!0,d.value=f[1].s3.secret,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function PE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.textContent="Force path-style addressing",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[25])},m(c,d){S(c,e,d),e.checked=n[1].s3.forcePathStyle,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[17]),Ie(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(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&2&&(e.checked=c[1].s3.forcePathStyle),d&33554432&&a!==(a=c[25])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function rh(n){let e;function t(l,o){return l[4]?FE:l[5]?NE:LE}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function LE(n){let e;return{c(){e=b("div"),e.innerHTML=` S3 connected successfully`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function NE(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=` Failed to establish S3 connection`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function FE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function ah(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function RE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[$E,CE],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[7]),r=O(),a=b("div"),u=b("form"),f=b("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.

    `,c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[20])),_=!0)},p(C,M){(!h||M&128)&&le(o,C[7]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function qE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[RE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function jE(n,e,t){let i,s,l;Ye(n,St,F=>t(7,l=F)),Kt(St,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const F=await pe.settings.getAll()||{};_(F)}catch(F){pe.errorResponseHandler(F)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{pe.cancelRequest(lo);const F=await pe.settings.update(H.filterRedactedProps(r));Bn({}),await _(F),$a(),c?Ev("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(F){pe.errorResponseHandler(F)}t(3,u=!1)}}async function _(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){pe.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{pe.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await pe.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){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 $(){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 I=()=>v(),L=()=>h(),N=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,v,i,y,T,C,M,$,D,A,I,L,N]}class VE extends ye{constructor(e){super(),ve(this,e,jE,qE,he,{})}}function HE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function zE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Client ID"),s=O(),l=b("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&p(e,"for",i),c&2097152&&o!==(o=f[21])&&p(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&fe(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function BE(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 lu({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Client Secret"),s=O(),V(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function uh(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=jt(o,r(n)),se.push(()=>_e(t,"config",l))),{c(){e=b("div"),t&&V(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&q(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)),o!==(o=a[4])){if(t){re();const c=t;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(t=jt(o,r(a)),se.push(()=>_e(t,"config",l)),V(t.$$.fragment),E(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&E(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;t=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[HE,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientId",$$slots:{default:[zE,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientSecret",$$slots:{default:[BE,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}});let y=n[4]&&uh(n);return{c(){e=b("div"),V(t.$$.fragment),i=O(),s=b("button"),s.innerHTML='Clear all fields',l=O(),o=b("div"),r=b("div"),a=O(),u=b("div"),V(f.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),y&&y.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(e,"class","flex"),p(r,"class","col-12 spacing"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(o,"class","grid")},m(T,C){S(T,e,C),q(t,e,null),g(e,i),g(e,s),S(T,l,C),S(T,o,C),g(o,r),g(o,a),g(o,u),q(f,u,null),g(o,c),g(o,d),q(m,d,null),g(o,h),y&&y.m(o,null),_=!0,v||(k=Y(s,"click",n[7]),v=!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 $={};C&1&&($.class="form-field "+(T[0].enabled?"required":"")),C&2&&($.name=T[1]+".clientId"),C&6291457&&($.$$scope={dirty:C,ctx:T}),f.$set($);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]?y?(y.p(T,C),C&16&&E(y,1)):(y=uh(T),y.c(),E(y,1),y.m(o,null)):y&&(re(),P(y,1,1,()=>{y=null}),ae())},i(T){_||(E(t.$$.fragment,T),E(f.$$.fragment,T),E(m.$$.fragment,T),E(y),_=!0)},o(T){P(t.$$.fragment,T),P(f.$$.fragment,T),P(m.$$.fragment,T),P(y),_=!1},d(T){T&&w(e),j(t),T&&w(l),T&&w(o),j(f),j(m),y&&y.d(),v=!1,k()}}}function fh(n){let e;return{c(){e=b("i"),p(e,"class",n[3])},m(t,i){S(t,e,i)},p(t,i){i&8&&p(e,"class",t[3])},d(t){t&&w(e)}}}function ch(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function WE(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function YE(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function KE(n){let e,t,i,s,l,o,r=n[1].substring(0,n[1].length-4)+"",a,u,f,c,d,m,h=n[3]&&fh(n),_=n[6]&&ch();function v(T,C){return T[0].enabled?YE:WE}let k=v(n),y=k(n);return{c(){e=b("div"),h&&h.c(),t=O(),i=b("span"),s=B(n[2]),l=O(),o=b("code"),a=B(r),u=O(),f=b("div"),c=O(),_&&_.c(),d=O(),y.c(),m=Me(),p(i,"class","txt"),p(o,"title","Provider key"),p(e,"class","inline-flex"),p(f,"class","flex-fill")},m(T,C){S(T,e,C),h&&h.m(e,null),g(e,t),g(e,i),g(i,s),g(e,l),g(e,o),g(o,a),S(T,u,C),S(T,f,C),S(T,c,C),_&&_.m(T,C),S(T,d,C),y.m(T,C),S(T,m,C)},p(T,C){T[3]?h?h.p(T,C):(h=fh(T),h.c(),h.m(e,t)):h&&(h.d(1),h=null),C&4&&le(s,T[2]),C&2&&r!==(r=T[1].substring(0,T[1].length-4)+"")&&le(a,r),T[6]?_?C&64&&E(_,1):(_=ch(),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(re(),P(_,1,1,()=>{_=null}),ae()),k!==(k=v(T))&&(y.d(1),y=k(T),y&&(y.c(),y.m(m.parentNode,m)))},d(T){T&&w(e),h&&h.d(),T&&w(u),T&&w(f),T&&w(c),_&&_.d(T),T&&w(d),y.d(T),T&&w(m)}}}function JE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[KE],default:[UE]},$$scope:{ctx:n}};for(let l=0;lt(12,o=I));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{optionsComponent:c}=e,d;function m(){d==null||d.expand()}function h(){d==null||d.collapse()}function _(){d==null||d.collapseSiblings()}function v(){for(let I in f)t(0,f[I]="",f);t(0,f.enabled=!1,f)}function k(){f.enabled=this.checked,t(0,f)}function y(){f.clientId=this.value,t(0,f)}function T(I){n.$$.not_equal(f.clientSecret,I)&&(f.clientSecret=I,t(0,f))}function C(I){f=I,t(0,f)}function M(I){se[I?"unshift":"push"](()=>{d=I,t(5,d)})}function $(I){ze.call(this,n,I)}function D(I){ze.call(this,n,I)}function A(I){ze.call(this,n,I)}return n.$$set=I=>{e=Je(Je({},e),Qn(I)),t(8,l=Et(e,s)),"key"in I&&t(1,r=I.key),"title"in I&&t(2,a=I.title),"icon"in I&&t(3,u=I.icon),"config"in I&&t(0,f=I.config),"optionsComponent"in I&&t(4,c=I.optionsComponent)},n.$$.update=()=>{n.$$.dirty&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||Qi(r))},[f,r,a,u,c,d,i,v,l,m,h,_,o,k,y,T,C,M,$,D,A]}class GE extends ye{constructor(e){super(),ve(this,e,ZE,JE,he,{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 dh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i[19]=e,i[20]=t,i}function XE(n){let e,t,i,s,l,o,r,a,u,f,c,d=Object.entries(vl),m=[];for(let k=0;kP(m[k],1,1,()=>{m[k]=null});let _=!n[4]&&hh(n),v=n[5]&&_h(n);return{c(){e=b("div");for(let k=0;kn[11](e,t),o=()=>n[11](null,t);function r(u){n[12](u,n[17])}let a={single:!0,key:n[17],title:n[18].title,icon:n[18].icon||"ri-fingerprint-line",optionsComponent:n[18].optionsComponent};return n[0][n[17]]!==void 0&&(a.config=n[0][n[17]]),e=new GE({props:a}),l(),se.push(()=>_e(e,"config",r)),{c(){V(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,f){n=u,t!==n[17]&&(o(),t=n[17],l());const c={};!i&&f&1&&(i=!0,c.config=n[0][n[17]],ke(()=>i=!1)),e.$set(c)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){o(),j(e,u)}}}function mh(n){var s;let e,t,i=(n[4]||!n[18].hidden||((s=n[0][n[17]])==null?void 0:s.enabled))&&ph(n);return{c(){i&&i.c(),e=Me()},m(l,o){i&&i.m(l,o),S(l,e,o),t=!0},p(l,o){var r;l[4]||!l[18].hidden||(r=l[0][l[17]])!=null&&r.enabled?i?(i.p(l,o),o&17&&E(i,1)):(i=ph(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(l){t||(E(i),t=!0)},o(l){P(i),t=!1},d(l){i&&i.d(l),l&&w(e)}}}function hh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` Show all`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[13]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function _h(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function xE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[QE,XE],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[6]),r=O(),a=b("div"),u=b("form"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[7])),_=!0)},p(C,M){(!h||M&64)&&le(o,C[6]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function eA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[xE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&2097279&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function tA(n,e,t){let i,s,l;Ye(n,St,C=>t(6,l=C)),Kt(St,l="Auth providers",l);let o={},r={},a={},u=!1,f=!1,c=!1;d();async function d(){t(2,u=!0);try{const C=await pe.settings.getAll()||{};h(C)}catch(C){pe.errorResponseHandler(C)}t(2,u=!1)}async function m(){var C;if(!(f||!s)){t(3,f=!0);try{const M=await pe.settings.update(H.filterRedactedProps(a));h(M),Bn({}),(C=o[Object.keys(o)[0]])==null||C.collapseSiblings(),zt("Successfully updated auth providers.")}catch(M){pe.errorResponseHandler(M)}t(3,f=!1)}}function h(C){C=C||{},t(0,a={});for(const M in vl)t(0,a[M]=Object.assign({enabled:!1},C[M]),a);t(9,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(C,M){se[C?"unshift":"push"](()=>{o[M]=C,t(1,o)})}function k(C,M){n.$$.not_equal(a[M],C)&&(a[M]=C,t(0,a))}const y=()=>t(4,c=!0),T=()=>_();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(r)),n.$$.dirty&1025&&t(5,s=i!=JSON.stringify(a))},[a,o,u,f,c,s,l,m,_,r,i,v,k,y,T]}class nA extends ye{constructor(e){super(),ve(this,e,tA,eA,he,{})}}function gh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function iA(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,m,h=n[5];const _=k=>k[16].key;for(let k=0;k({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Me(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(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||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function vh(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function oA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[sA,iA],y=[];function T(C,M){return C[1]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[4]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Adjust common token options.

    ",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[6])),_=!0)},p(C,M){(!h||M&16)&&le(o,C[4]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function rA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[oA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function aA(n,e,t){let i,s,l;Ye(n,St,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"}];Kt(St,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const T=await pe.settings.getAll()||{};m(T)}catch(T){pe.errorResponseHandler(T)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const T=await pe.settings.update(H.filterRedactedProps(a));m(T),zt("Successfully saved tokens options.")}catch(T){pe.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 h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(T){a[T.key].duration=pt(this.value),t(0,a)}const v=T=>{a[T.key].secret?(delete a[T.key].secret,t(0,a)):t(0,a[T.key].secret=H.randomString(50),a)},k=()=>h(),y=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,h,r,i,_,v,k,y]}class uA extends ye{constructor(e){super(),ve(this,e,aA,rA,he,{})}}function fA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h;return o=new $b({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

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

    `,t=O(),i=b("div"),s=b("button"),s.innerHTML='Copy',l=O(),V(o.$$.fragment),r=O(),a=b("div"),u=b("div"),f=O(),c=b("button"),c.innerHTML=` Download as JSON`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,v){S(_,e,v),S(_,t,v),S(_,i,v),g(i,s),g(i,l),q(o,i,null),n[8](i),S(_,r,v),S(_,a,v),g(a,u),g(a,f),g(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){d||(E(o.$$.fragment,_),d=!0)},o(_){P(o.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(t),_&&w(i),j(o),n[8](null),_&&w(r),_&&w(a),m=!1,Pe(h)}}}function cA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function dA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[cA,fA],h=[];function _(v,k){return v[1]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[3]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=_(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function pA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[dA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function mA(n,e,t){let i,s;Ye(n,St,v=>t(3,s=v)),Kt(St,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await pe.collections.getFullList(100,{$cancelKey:l}));for(let v of r)delete v.created,delete v.updated}catch(v){pe.errorResponseHandler(v)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function c(){H.copyToClipboard(i),Cg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,_]}class hA extends ye{constructor(e){super(),ve(this,e,mA,pA,he,{})}}function yh(n,e,t){const i=n.slice();return i[14]=e[t],i}function kh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function wh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Sh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Th(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function $h(n,e,t){const i=n.slice();return i[30]=e[t],i}function _A(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Mh(),a=n[0].name!==n[1].name&&Oh(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=b("strong"),o=B(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Mh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Oh(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&&w(e),r&&r.d(),a&&a.d()}}}function gA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),l=B(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(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&&w(e),r&&w(t),r&&w(i)}}}function bA(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Added",t=O(),i=b("strong"),l=B(s),p(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(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&&w(e),r&&w(t),r&&w(i)}}}function Mh(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Oh(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=B(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Dh(n){var v,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((v=n[0])==null?void 0:v[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",_;return{c(){var y,T,C,M,$,D;e=b("tr"),t=b("td"),i=b("span"),l=B(s),o=O(),r=b("td"),a=b("pre"),f=B(u),c=O(),d=b("td"),m=b("pre"),_=B(h),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),Q(r,"changed-old-col",!n[10]&&un((y=n[0])==null?void 0:y[n[30]],(T=n[1])==null?void 0:T[n[30]])),Q(r,"changed-none-col",n[10]),p(m,"class","txt"),p(d,"class","svelte-lmkr38"),Q(d,"changed-new-col",!n[5]&&un((C=n[0])==null?void 0:C[n[30]],(M=n[1])==null?void 0:M[n[30]])),Q(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",un(($=n[0])==null?void 0:$[n[30]],(D=n[1])==null?void 0:D[n[30]]))},m(y,T){S(y,e,T),g(e,t),g(t,i),g(i,l),g(e,o),g(e,r),g(r,a),g(a,f),g(e,c),g(e,d),g(d,m),g(m,_)},p(y,T){var C,M,$,D,A,I,L,N;T[0]&1&&u!==(u=y[12]((C=y[0])==null?void 0:C[y[30]])+"")&&le(f,u),T[0]&3075&&Q(r,"changed-old-col",!y[10]&&un((M=y[0])==null?void 0:M[y[30]],($=y[1])==null?void 0:$[y[30]])),T[0]&1024&&Q(r,"changed-none-col",y[10]),T[0]&2&&h!==(h=y[12]((D=y[1])==null?void 0:D[y[30]])+"")&&le(_,h),T[0]&2083&&Q(d,"changed-new-col",!y[5]&&un((A=y[0])==null?void 0:A[y[30]],(I=y[1])==null?void 0:I[y[30]])),T[0]&32&&Q(d,"changed-none-col",y[5]),T[0]&2051&&Q(e,"txt-primary",un((L=y[0])==null?void 0:L[y[30]],(N=y[1])==null?void 0:N[y[30]]))},d(y){y&&w(e)}}}function Eh(n){let e,t=n[6],i=[];for(let s=0;sProps Old New`,l=O(),o=b("tbody");for(let C=0;C!["schema","created","updated"].includes(k));function _(){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(y=>k.id==y.id))))}function v(k){return typeof k>"u"?"":H.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")&&_(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(y=>k.id==y.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(y=>y.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(y=>y.id==k.id))),n.$$.dirty[0]&7&&t(9,l=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,h,v]}class kA extends ye{constructor(e){super(),ve(this,e,yA,vA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function qh(n,e,t){const i=n.slice();return i[17]=e[t],i}function jh(n){let e,t;return e=new kA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function wA(n){let e,t,i=n[2],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await pe.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch(C){pe.errorResponseHandler(C)}t(4,u=!1),c()}}const _=()=>m(),v=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function y(C){ze.call(this,n,C)}function T(C){ze.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,_,v,k,y,T]}class MA extends ye{constructor(e){super(),ve(this,e,$A,CA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Vh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[35]=e[t],i}function zh(n,e,t){const i=n.slice();return i[32]=e[t],i}function OA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[EA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let A=!1,I=n[6]&&n[1].length&&!n[7]&&Uh(),L=n[6]&&n[1].length&&n[7]&&Wh(n),N=n[13].length&&n_(n),F=!!n[0]&&i_(n);return{c(){e=b("input"),t=O(),i=b("div"),s=b("p"),l=B(`Paste below the collections configuration you want to import or `),o=b("button"),o.innerHTML='Load from JSON file',r=O(),V(a.$$.fragment),u=O(),f=O(),I&&I.c(),c=O(),L&&L.c(),d=O(),N&&N.c(),m=O(),h=b("div"),F&&F.c(),_=O(),v=b("div"),k=O(),y=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(v,"class","flex-fill"),p(T,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=C=!n[14],p(h,"class","flex m-t-base")},m(R,K){S(R,e,K),n[19](e),S(R,t,K),S(R,i,K),g(i,s),g(s,l),g(s,o),S(R,r,K),q(a,R,K),S(R,u,K),S(R,f,K),I&&I.m(R,K),S(R,c,K),L&&L.m(R,K),S(R,d,K),N&&N.m(R,K),S(R,m,K),S(R,h,K),F&&F.m(h,null),g(h,_),g(h,v),g(h,k),g(h,y),g(y,T),M=!0,$||(D=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],$=!0)},p(R,K){(!M||K[0]&4096)&&Q(o,"btn-loading",R[12]);const x={};K[0]&64&&(x.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(x.$$scope={dirty:K,ctx:R}),a.$set(x),R[6]&&R[1].length&&!R[7]?I||(I=Uh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=Wh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?N?N.p(R,K):(N=n_(R),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),R[0]?F?F.p(R,K):(F=i_(R),F.c(),F.m(h,_)):F&&(F.d(1),F=null),(!M||K[0]&16384&&C!==(C=!R[14]))&&(y.disabled=C)},i(R){M||(E(a.$$.fragment,R),E(A),M=!0)},o(R){P(a.$$.fragment,R),P(A),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),N&&N.d(R),R&&w(m),R&&w(h),F&&F.d(),$=!1,Pe(D)}}}function DA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function Bh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function EA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Bh();return{c(){e=b("label"),t=B("Collections"),s=O(),l=b("textarea"),r=O(),c&&c.c(),a=Me(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&fe(l,d[0]),d[0]&&!d[6]?c||(c=Bh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Uh(n){let e;return{c(){e=b("div"),e.innerHTML=`
    Your collections configuration is already up-to-date!
    `,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wh(n){let e,t,i,s,l,o=n[9].length&&Yh(n),r=n[4].length&&Zh(n),a=n[8].length&&xh(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Yh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Zh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=xh(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Yh(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=O(),s=b("div"),s.innerHTML=`Some of the imported collections shares the same name and/or fields but are imported with different IDs. You can replace them in the import if you want to.`,l=O(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:G,d(u){u&&w(e),r=!1,a()}}}function i_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function AA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[DA,OA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[15]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function IA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[AA]},$$scope:{ctx:n}}});let r={};return l=new MA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function PA(n,e,t){let i,s,l,o,r,a,u;Ye(n,St,J=>t(15,u=J)),Kt(St,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;T();async function T(){t(5,y=!0);try{t(2,_=await pe.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){pe.errorResponseHandler(J)}t(5,y=!1)}function C(){if(t(4,k=[]),!!i)for(let J of h){const ue=H.findByKey(_,"id",J.id);!(ue!=null&&ue.id)||!H.hasCollectionChanges(ue,J,v)||k.push({new:J,old:ue})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=H.filterDuplicatesByKey(J.schema)}function $(){var J,ue;for(let Z of h){const de=H.findByKey(_,"name",Z.name)||H.findByKey(_,"id",Z.id);if(!de)continue;const ge=Z.id,Ce=de.id;Z.id=Ce;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const be of Re){const Se=H.findByKey(Ne,"name",be.name);Se&&Se.id&&(be.id=Se.id)}for(let be of h)if(Array.isArray(be.schema))for(let Se of be.schema)(J=Se.options)!=null&&J.collectionId&&((ue=Se.options)==null?void 0:ue.collectionId)===ge&&(Se.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function D(J){t(12,m=!0);const ue=new FileReader;ue.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(cl("Invalid collections configuration."),A())},ue.onerror=Z=>{console.warn(Z),cl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(J)}function A(){t(0,d=""),t(10,f.value="",f),Bn({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>$(),x=()=>A(),U=()=>c==null?void 0:c.show(_,h,v);function X(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!H.findByKey(h,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(J=>i&&!H.findByKey(_,"id",J.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof v<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!y&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(J=>{let ue=H.findByKey(_,"name",J.name)||H.findByKey(_,"id",J.id);if(!ue)return!1;if(ue.id!=J.id)return!0;const Z=Array.isArray(ue.schema)?ue.schema:[],de=Array.isArray(J.schema)?J.schema:[];for(const ge of de){if(H.findByKey(Z,"id",ge.id))continue;const Ne=H.findByKey(Z,"name",ge.name);if(Ne&&ge.id!=Ne.id)return!0}return!1}))},[d,h,_,v,k,y,i,o,l,s,f,c,m,a,r,u,$,D,A,I,L,N,F,R,K,x,U,X,ne]}class LA extends ye{constructor(e){super(),ve(this,e,PA,IA,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Oi("/"):!0}],NA={"/login":Mt({component:ED,conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Mt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-25f0bcb9.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-ed1597f0.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Mt({component:eD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Mt({component:E3,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Mt({component:VD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Mt({component:TD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Mt({component:TE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Mt({component:VE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Mt({component:nA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Mt({component:uA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Mt({component:hA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Mt({component:LA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-0900e85b.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-0900e85b.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-0f164e97.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-0f164e97.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-30c6246d.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-30c6246d.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":Mt({component:Xv,userData:{showAppSidebar:!1}})};function FA(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Bo}=i;return{delay:f,duration:Bt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const _=h*a,v=h*u,k=m+h*e.width/t.width,y=m+h*e.height/t.height;return`transform: ${l} translate(${_}px, ${v}px) scale(${k}, ${y});`}}}function s_(n,e,t){const i=n.slice();return i[2]=e[t],i}function RA(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function jA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function VA(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function l_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m=G,h,_,v;function k(M,$){return M[2].type==="info"?VA:M[2].type==="success"?jA:M[2].type==="warning"?qA:RA}let y=k(e),T=y(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),s=O(),l=b("div"),r=B(o),a=O(),u=b("button"),u.innerHTML='',f=O(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,$){S(M,t,$),g(t,i),T.m(i,null),g(t,s),g(t,l),g(l,r),g(t,a),g(t,u),g(t,f),h=!0,_||(v=Y(u,"click",dt(C)),_=!0)},p(M,$){e=M,y!==(y=k(e))&&(T.d(1),T=y(e),T&&(T.c(),T.m(i,null))),(!h||$&1)&&o!==(o=e[2].message+"")&&le(r,o),(!h||$&1)&&Q(t,"alert-info",e[2].type=="info"),(!h||$&1)&&Q(t,"alert-success",e[2].type=="success"),(!h||$&1)&&Q(t,"alert-danger",e[2].type=="error"),(!h||$&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){t1(t),m(),m_(t,d)},a(){m(),m=e1(t,d,FA,{duration:150})},i(M){h||(xe(()=>{c||(c=je(t,yo,{duration:150},!0)),c.run(1)}),h=!0)},o(M){c||(c=je(t,yo,{duration:150},!1)),c.run(0),h=!1},d(M){M&&w(t),T.d(),M&&c&&c.end(),_=!1,v()}}}function HA(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=>$g(l)]}class BA extends ye{constructor(e){super(),ve(this,e,zA,HA,he,{})}}function UA(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=b("h4"),i=B(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){S(l,e,o),g(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&&w(e)}}}function WA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=O(),s=b("button"),l=b("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){S(a,e,u),g(e,t),S(a,i,u),S(a,s,u),g(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function YA(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:[WA],header:[UA]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(s,l){q(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||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function KA(n,e,t){let i;Ye(n,xa,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){se[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await sn(),t(3,o=!1),Db()};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 JA extends ye{constructor(e){super(),ve(this,e,KA,YA,he,{})}}function o_(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return _=new ei({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[ZA]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=O(),s=b("nav"),l=b("a"),l.innerHTML='',o=O(),r=b("a"),r.innerHTML='',a=O(),u=b("a"),u.innerHTML='',f=O(),c=b("figure"),d=b("img"),h=O(),V(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),Hn(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,C){S(T,e,C),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(e,f),g(e,c),g(c,d),g(c,h),q(_,c,null),v=!0,k||(y=[Ie(xt.call(null,t)),Ie(xt.call(null,l)),Ie(qn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ie(Ue.call(null,l,{text:"Collections",position:"right"})),Ie(xt.call(null,r)),Ie(qn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ie(Ue.call(null,r,{text:"Logs",position:"right"})),Ie(xt.call(null,u)),Ie(qn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ie(Ue.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(T,C){var $;(!v||C&1&&!Hn(d.src,m="./images/avatars/avatar"+((($=T[0])==null?void 0:$.avatar)||0)+".svg"))&&p(d,"src",m);const M={};C&1024&&(M.$$scope={dirty:C,ctx:T}),_.$set(M)},i(T){v||(E(_.$$.fragment,T),v=!0)},o(T){P(_.$$.fragment,T),v=!1},d(T){T&&w(e),j(_),k=!1,Pe(y)}}}function ZA(n){let e,t,i,s,l,o,r;return{c(){e=b("a"),e.innerHTML=` Manage admins`,t=O(),i=b("hr"),s=O(),l=b("button"),l.innerHTML=` Logout`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:G,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function GA(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&o_(n);return o=new p1({props:{routes:NA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new BA({}),f=new JA({}),{c(){t=O(),i=b("div"),d&&d.c(),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&E(d,1)):(d=o_(h),d.c(),E(d,1),d.m(i,s)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(h){c||(E(d),E(o.$$.fragment,h),E(a.$$.fragment,h),E(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function XA(n,e,t){let i,s,l,o;Ye(n,$s,m=>t(8,i=m)),Ye(n,vo,m=>t(2,s=m)),Ye(n,Oa,m=>t(0,l=m)),Ye(n,St,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt(St,o="",o),Bn({}),Db())}function f(){Oi("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await pe.settings.getAll({$cancelKey:"initialAppSettings"});Kt(vo,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt($s,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){pe.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class QA extends ye{constructor(e){super(),ve(this,e,XA,GA,he,{})}}new QA({target:document.getElementById("app")});export{Pe as A,zt as B,H as C,Oi as D,Me as E,Mg as F,ga as G,hu as H,Ye as I,Ai as J,$t as K,Zt as L,se as M,$b as N,wt as O,es as P,ln as Q,pn as R,ye as S,Pr as T,P as a,O as b,V as c,j as d,b as e,p as f,S as g,g as h,ve as i,Ie as j,re as k,xt as l,q as m,ae as n,w as o,pe as p,me as q,Q as r,he as s,E as t,Y as u,dt as v,B as w,le as x,G as y,fe as z};