378 lines
769 KiB
JavaScript
378 lines
769 KiB
JavaScript
const __=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 oe(){}const _l=n=>n;function pt(n,e){for(const t in e)n[t]=e[t];return n}function jp(n){return n()}function Ya(){return Object.create(null)}function st(n){n.forEach(jp)}function Wn(n){return typeof n=="function"}function Ee(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function Xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function b_(n){return Object.keys(n).length===0}function qp(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function At(n,e,t){n.$$.on_destroy.push(qp(e,t))}function Mn(n,e,t,i){if(n){const s=Vp(n,e,t,i);return n[0](s)}}function Vp(n,e,t,i){return n[1]&&i?pt(t.ctx.slice(),n[1](i(e))):t.ctx}function Tn(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Dn(n,e,t,i,s,l){if(s){const o=Vp(e,t,i,l);n.p(o,s)}}function On(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function ri(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Kt(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Ka(n){return n==null?"":n}function bn(n,e,t){return n.set(t),e}function Qe(n){return n&&Wn(n.destroy)?n.destroy:oe}const zp=typeof window<"u";let Po=zp?()=>window.performance.now():()=>Date.now(),sa=zp?n=>requestAnimationFrame(n):oe;const gs=new Set;function Bp(n){gs.forEach(e=>{e.c(n)||(gs.delete(e),e.f())}),gs.size!==0&&sa(Bp)}function Lo(n){let e;return gs.size===0&&sa(Bp),{promise:new Promise(t=>{gs.add(e={c:n,f:t})}),abort(){gs.delete(e)}}}function m(n,e){n.appendChild(e)}function Up(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function v_(n){const e=_("style");return y_(Up(n),e),e.sheet}function y_(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function jn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function R(n){return document.createTextNode(n)}function T(){return R(" ")}function rt(){return R("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Bt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function qn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Wp(n){return function(e){e.target===this&&n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function oi(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:h(n,i,e[i])}function Ot(n){return n===""?null:+n}function k_(n){return Array.from(n.childNodes)}function me(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Ce(n,e){n.value=e==null?"":e}function Za(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ee(n,e,t){n.classList[t?"add":"remove"](e)}function Yp(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const ao=new Map;let uo=0;function w_(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function S_(n,e){const t={stylesheet:v_(e),rules:{}};return ao.set(n,t),t}function ol(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
|
||
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
|
||
`}const f=u+`100% {${o(t,1-t)}}
|
||
}`,c=`__svelte_${w_(f)}_${r}`,d=Up(n),{stylesheet:p,rules:g}=ao.get(d)||S_(d,n);g[c]||(g[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,uo+=1,c}function rl(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(", "),uo-=s,uo||$_())}function $_(){sa(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function C_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=_l,start:a=Po()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,g;function v(){c&&(g=ol(n,0,1,o,l,r,c)),l||(p=!0)}function b(){c&&rl(n,g),d=!1}return Lo(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),b()),!d)return!1;if(p){const C=y-a,$=0+1*r(C/o);f($,1-$)}return!0}),v(),f(0,1),b}function M_(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,Kp(n,s)}}function Kp(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 al;function Js(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Yn(n){Fo().$$.on_mount.push(n)}function T_(n){Fo().$$.after_update.push(n)}function D_(n){Fo().$$.on_destroy.push(n)}function un(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Yp(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ht(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Us=[],he=[],no=[],Cr=[],Zp=Promise.resolve();let Mr=!1;function Jp(){Mr||(Mr=!0,Zp.then(Gp))}function ai(){return Jp(),Zp}function Dt(n){no.push(n)}function He(n){Cr.push(n)}const Jo=new Set;let Fl=0;function Gp(){const n=al;do{for(;Fl<Us.length;){const e=Us[Fl];Fl++,Js(e),O_(e.$$)}for(Js(null),Us.length=0,Fl=0;he.length;)he.pop()();for(let e=0;e<no.length;e+=1){const t=no[e];Jo.has(t)||(Jo.add(t),t())}no.length=0}while(Us.length);for(;Cr.length;)Cr.pop()();Mr=!1,Jo.clear(),Js(n)}function O_(n){if(n.fragment!==null){n.update(),st(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let Ps;function la(){return Ps||(Ps=Promise.resolve(),Ps.then(()=>{Ps=null})),Ps}function Qi(n,e,t){n.dispatchEvent(Yp(`${e?"intro":"outro"}${t}`))}const io=new Set;let ii;function De(){ii={r:0,c:[],p:ii}}function Oe(){ii.r||st(ii.c),ii=ii.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ii.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const oa={duration:0};function Xp(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:p=_l,tick:g=oe,css:v}=i||oa;v&&(l=ol(n,0,1,d,c,p,v,r++)),g(0,1);const b=Po()+c,y=b+d;o&&o.abort(),s=!0,Dt(()=>Qi(n,!0,"start")),o=Lo(C=>{if(s){if(C>=y)return g(1,0),Qi(n,!0,"end"),a(),s=!1;if(C>=b){const $=p((C-b)/d);g($,1-$)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Wn(i)?(i=i(),la().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Qp(n,e,t){let i=e(n,t),s=!0,l;const o=ii;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=_l,tick:c=oe,css:d}=i||oa;d&&(l=ol(n,1,0,u,a,f,d));const p=Po()+a,g=p+u;Dt(()=>Qi(n,!1,"start")),Lo(v=>{if(s){if(v>=g)return c(0,1),Qi(n,!1,"end"),--o.r||st(o.c),!1;if(v>=p){const b=f((v-p)/u);c(1-b,b)}}return s})}return Wn(i)?la().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function ut(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&rl(n,a)}function f(d,p){const g=d.b-l;return p*=Math.abs(g),{a:l,b:d.b,d:g,duration:p,start:d.start,end:d.start+p,group:d.group}}function c(d){const{delay:p=0,duration:g=300,easing:v=_l,tick:b=oe,css:y}=s||oa,C={start:Po()+p,b:d};d||(C.group=ii,ii.r+=1),o||r?r=C:(y&&(u(),a=ol(n,l,d,g,p,v,y)),d&&b(0,1),o=f(C,g),Dt(()=>Qi(n,d,"start")),Lo($=>{if(r&&$>r.start&&(o=f(r,g),r=null,Qi(n,o.b,"start"),y&&(u(),a=ol(n,l,o.b,o.duration,0,v,s.css))),o){if($>=o.end)b(l=o.b,1-l),Qi(n,o.b,"end"),r||(o.b?u():--o.group.r||st(o.group.c)),o=null;else if($>=o.start){const S=$-o.start;l=o.a+o.d*v(S/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Wn(s)?la().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function rn(n,e){n.d(1),e.delete(n.key)}function Nt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function E_(n,e){n.f(),Nt(n,e)}function ft(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,p=l.length,g=d;const v={};for(;g--;)v[n[g].key]=g;const b=[],y=new Map,C=new Map;for(g=p;g--;){const D=c(s,l,g),E=t(D);let O=o.get(E);O?i&&O.p(D,e):(O=u(E,D),O.c()),y.set(E,b[g]=O),E in v&&C.set(E,Math.abs(g-v[E]))}const $=new Set,S=new Set;function M(D){A(D,1),D.m(r,f),o.set(D.key,D),f=D.first,p--}for(;d&&p;){const D=b[p-1],E=n[d-1],O=D.key,F=E.key;D===E?(f=D.first,d--,p--):y.has(F)?!o.has(O)||$.has(O)?M(D):S.has(F)?d--:C.get(O)>C.get(F)?(S.add(O),M(D)):($.add(F),d--):(a(E,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;p;)M(b[p-1]);return b}function pn(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 ui(n){return typeof n=="object"&&n!==null?n:{}}function Ie(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function q(n,e,t,i){const{fragment:s,on_mount:l,on_destroy:o,after_update:r}=n.$$;s&&s.m(e,t),i||Dt(()=>{const a=l.map(jp).filter(Wn);o?o.push(...a):st(a),n.$$.on_mount=[]}),r.forEach(Dt)}function V(n,e){const t=n.$$;t.fragment!==null&&(st(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function A_(n,e){n.$$.dirty[0]===-1&&(Us.push(n),Jp(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ae(n,e,t,i,s,l,o,r=[-1]){const a=al;Js(n);const u=n.$$={fragment:null,ctx:null,props:l,update:oe,not_equal:s,bound:Ya(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Ya(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(c,d,...p)=>{const g=p.length?p[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&A_(n,c)),d}):[],u.update(),f=!0,st(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=k_(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),q(n,e.target,e.anchor,e.customElement),Gp()}Js(a)}class Pe{$destroy(){V(this,1),this.$destroy=oe}$on(e,t){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&&!b_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function sn(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const cs=[];function xp(n,e){return{subscribe:xn(n,e).subscribe}}function xn(n,e=oe){let t;const i=new Set;function s(r){if(Ee(n,r)&&(n=r,t)){const a=!cs.length;for(const u of i)u[1](),cs.push(u,n);if(a){for(let u=0;u<cs.length;u+=2)cs[u][0](cs[u+1]);cs.length=0}}}function l(r){s(r(n))}function o(r,a=oe){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||oe),r(n),()=>{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function em(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return xp(t,o=>{let r=!1;const a=[];let u=0,f=oe;const c=()=>{if(u)return;f();const p=e(i?a[0]:a,o);l?o(p):f=Wn(p)?p:oe},d=s.map((p,g)=>qp(p,v=>{a[g]=v,u&=~(1<<g),r&&c()},()=>{u|=1<<g}));return r=!0,c(),function(){st(d),f()}})}function tm(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=!!~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function P_(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=pt(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[7])),{c(){e&&z(e.$$.fragment),t=rt()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&4?pn(s,[ui(r[2])]):{};if(l!==(l=r[0])){if(e){De();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),Oe()}l?(e=new l(o()),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function L_(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=pt(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[6])),{c(){e&&z(e.$$.fragment),t=rt()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&6?pn(s,[a&2&&{params:r[1]},a&4&&ui(r[2])]):{};if(l!==(l=r[0])){if(e){De();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),Oe()}l?(e=new l(o()),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function F_(n){let e,t,i,s;const l=[L_,P_],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=rt()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(De(),P(o[f],1,1,()=>{o[f]=null}),Oe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function Ja(){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 Io=xp(null,function(e){e(Ja());const t=()=>{e(Ja())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});em(Io,n=>n.location);em(Io,n=>n.querystring);const Ga=xn(void 0);async function Ms(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ai();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 $n(n,e){if(e=Qa(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return Xa(n,e),{update(t){t=Qa(t),Xa(n,t)}}}function Xa(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||I_(i.currentTarget.getAttribute("href"))})}function Qa(n){return n&&typeof n=="string"?{href:n}:n||{}}function I_(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0,void 0),window.location.hash=n}function N_(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:E,keys:O}=tm(M);this.path=M,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=E,this._keys=O}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const F=M.match(s);if(F&&F[0])M=M.substr(F[0].length)||"/";else return null}}const D=this._pattern.exec(M);if(D===null)return null;if(this._keys===!1)return D;const E={};let O=0;for(;O<this._keys.length;){try{E[this._keys[O]]=decodeURIComponent(D[O+1]||"")||null}catch{E[this._keys[O]]=null}O++}return E}async checkConditions(M){for(let D=0;D<this.conditions.length;D++)if(!await this.conditions[D](M))return!1;return!0}}const r=[];i instanceof Map?i.forEach((S,M)=>{r.push(new o(M,S))}):Object.keys(i).forEach(S=>{r.push(new o(S,i[S]))});let a=null,u=null,f={};const c=un();async function d(S,M){await ai(),c(S,M)}let p=null,g=null;l&&(g=S=>{S.state&&S.state.__svelte_spa_router_scrollY?p=S.state:p=null},window.addEventListener("popstate",g),T_(()=>{p?window.scrollTo(p.__svelte_spa_router_scrollX,p.__svelte_spa_router_scrollY):window.scrollTo(0,0)}));let v=null,b=null;const y=Io.subscribe(async S=>{v=S;let M=0;for(;M<r.length;){const D=r[M].match(S.location);if(!D){M++;continue}const E={route:r[M].path,location:S.location,querystring:S.querystring,userData:r[M].userData,params:D&&typeof D=="object"&&Object.keys(D).length?D:null};if(!await r[M].checkConditions(E)){t(0,a=null),b=null,d("conditionsFailed",E);return}d("routeLoading",Object.assign({},E));const O=r[M].component;if(b!=O){O.loading?(t(0,a=O.loading),b=O,t(1,u=O.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},E,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const F=await O();if(S!=v)return;t(0,a=F&&F.default||F),b=O}D&&typeof D=="object"&&Object.keys(D).length?t(1,u=D):t(1,u=null),t(2,f=r[M].props),d("routeLoaded",Object.assign({},E,{component:a,name:a.name,params:u})).then(()=>{Ga.set(u)});return}t(0,a=null),b=null,Ga.set(void 0)});D_(()=>{y(),g&&window.removeEventListener("popstate",g)});function C(S){ht.call(this,n,S)}function $(S){ht.call(this,n,S)}return n.$$set=S=>{"routes"in S&&t(3,i=S.routes),"prefix"in S&&t(4,s=S.prefix),"restoreScrollState"in S&&t(5,l=S.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,C,$]}class R_ extends Pe{constructor(e){super(),Ae(this,e,N_,F_,Ee,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let nm;function im(n){const e=n.pattern.test(nm);xa(n,n.className,e),xa(n,n.inactiveClassName,!e)}function xa(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Io.subscribe(n=>{nm=n.location+(n.querystring?"?"+n.querystring:""),so.map(im)});function ni(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"?tm(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),im(i),{destroy(){so.splice(so.indexOf(i),1)}}}const H_="modulepreload",j_=function(n){return"/_/"+n},eu={},Ji=function(e,t,i){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=j_(s),s in eu)return;eu[s]=!0;const l=s.endsWith(".css"),o=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const r=document.createElement("link");if(r.rel=l?"stylesheet":H_,l||(r.as="script",r.crossOrigin=""),r.href=s,document.head.appendChild(r),l)return new Promise((a,u)=>{r.addEventListener("load",a),r.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())};var Tr=function(n,e){return Tr=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])},Tr(n,e)};function an(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}Tr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Dr=function(){return Dr=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++)for(var s in e=arguments[t])Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n},Dr.apply(this,arguments)};function Gs(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){var f;u.done?s(u.value):(f=u.value,f instanceof t?f:new t(function(c){c(f)})).then(o,r)}a((i=i.apply(n,e||[])).next())})}function Xs(n,e){var t,i,s,l,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(a){return function(u){return function(f){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(s=2&f[0]?i.return:f[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,f[1])).done)return s;switch(i=0,s&&(f=[2&f[0],s.value]),f[0]){case 0:case 1:s=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,i=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||f[0]!==6&&f[0]!==2)){o=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){o.label=f[1];break}if(f[0]===6&&o.label<s[1]){o.label=s[1],s=f;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(f);break}s[2]&&o.ops.pop(),o.trys.pop();continue}f=e.call(n,o)}catch(c){f=[6,c],i=0}finally{t=s=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([a,u])}}}var sm,Go=function(n){function e(t){var i,s=this;return(s=n.call(this,"ClientResponseError")||this).url="",s.status=0,s.data={},s.isAbort=!1,s.originalError=null,t instanceof Error&&!(t instanceof s.constructor)&&(s.originalError=t),t!==null&&typeof t=="object"&&(s.url=typeof t.url=="string"?t.url:"",s.status=typeof t.status=="number"?t.status:0,s.data=t.data!==null&&typeof t.data=="object"?t.data:{}),typeof DOMException<"u"&&t instanceof DOMException&&(s.isAbort=!0),s.name="ClientResponseError "+s.status,s.message=((i=s.data)===null||i===void 0?void 0:i.message)||"Something went wrong while processing your request.",s}return an(e,n),e.prototype.toJSON=function(){return Dr({},this)},e}(Error);sm=typeof atob=="function"?atob:function(n){return Buffer.from(n,"base64").toString("binary")};var q_=function(){function n(){}return n.getPayload=function(e){if(e)try{var t=decodeURIComponent(sm(e.split(".")[1]).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(t)||{}}catch{}return{}},n.isExpired=function(e,t){t===void 0&&(t=0);var i=n.getPayload(e);return!(Object.keys(i).length>0&&(!i.exp||i.exp-t>Date.now()/1e3))},n}(),bl=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){this.id=e.id!==void 0?e.id:"",this.created=e.created!==void 0?e.created:"",this.updated=e.updated!==void 0?e.updated:""},Object.defineProperty(n.prototype,"isNew",{get:function(){return!this.id||this.id==="00000000-0000-0000-0000-000000000000"},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new this.constructor(JSON.parse(JSON.stringify(this)))},n.prototype.export=function(){return Object.assign({},this)},n}(),fo=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t);for(var i=0,s=Object.entries(t);i<s.length;i++){var l=s[i],o=l[0],r=l[1];this[o]=r}this["@collectionId"]=t["@collectionId"]!==void 0?t["@collectionId"]:"",this["@collectionName"]=t["@collectionName"]!==void 0?t["@collectionName"]:"",this["@expand"]=t["@expand"]!==void 0?t["@expand"]:{}},e}(bl),co=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.email=typeof t.email=="string"?t.email:"",this.verified=!!t.verified,this.lastResetSentAt=typeof t.lastResetSentAt=="string"?t.lastResetSentAt:"",this.lastVerificationSentAt=typeof t.lastVerificationSentAt=="string"?t.lastVerificationSentAt:"",this.profile=t.profile?new fo(t.profile):null},e}(bl),ks=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.avatar=typeof t.avatar=="number"?t.avatar:0,this.email=typeof t.email=="string"?t.email:"",this.lastResetSentAt=typeof t.lastResetSentAt=="string"?t.lastResetSentAt:""},e}(bl),lm=function(){function n(e){e===void 0&&(e="pocketbase_auth"),this.fallback={},this.storageKey=e}return Object.defineProperty(n.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){var e,t=this._storageGet(this.storageKey)||{};return t===null||typeof t!="object"||t.model===null||typeof t.model!="object"?{}:((e=t.model)===null||e===void 0?void 0:e.verified)!==void 0?new co(t.model):new ks(t.model)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!q_.isExpired(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this._storageSet(this.storageKey,{token:e,model:t})},n.prototype.clear=function(){return this._storageRemove(this.storageKey)},n.prototype._storageGet=function(e){var t;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var i=((t=window==null?void 0:window.localStorage)===null||t===void 0?void 0:t.getItem(e))||"";try{return JSON.parse(i)}catch{return i}}return this.fallback[e]},n.prototype._storageSet=function(e,t){var i;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var s=t;typeof t!="string"&&(s=JSON.stringify(t)),(i=window==null?void 0:window.localStorage)===null||i===void 0||i.setItem(e,s)}else this.fallback[e]=t},n.prototype._storageRemove=function(e){var t;typeof window<"u"&&((t=window==null?void 0:window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.fallback[e]},n}(),No=function(n){this.client=n},V_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.getAll=function(t){return t===void 0&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then(function(i){return i||{}})},e.prototype.update=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send("/api/settings",{method:"PATCH",params:i,body:t}).then(function(s){return s||{}})},e}(No),om=function(n,e,t,i){this.page=n>0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.items=i||[]},rm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(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 Gs(l,void 0,void 0,function(){return Xs(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,p=c.totalItems;return o=o.concat(d),d.length&&p>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u<f.length;u++){var c=f[u];a.push(o.decode(c))}}return new om((r==null?void 0:r.page)||1,(r==null?void 0:r.perPage)||0,(r==null?void 0:r.totalItems)||0,a)})},e.prototype._getOne=function(t,i,s){var l=this;return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"GET",params:s}).then(function(o){return l.decode(o)})},e.prototype._create=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),this.client.send(t,{method:"POST",params:s,body:i}).then(function(o){return l.decode(o)})},e.prototype._update=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"PATCH",params:l,body:s}).then(function(r){return o.decode(r)})},e.prototype._delete=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"DELETE",params:l,body:s}).then(function(){return!0})},e}(No),ra=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.getFullList=function(t,i){return t===void 0&&(t=100),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.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,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._delete(this.baseCrudPath(),t,i,s)},e}(rm),z_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.decode=function(t){return new ks(t)},e.prototype.baseCrudPath=function(){return"/api/admins"},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.admin)||{});return(t==null?void 0:t.token)&&(t==null?void 0:t.admin)&&this.client.AuthStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:i})},e.prototype.authViaEmail=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({email:t,password:i},s),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:l,body:s,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:i,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(this.authResponse.bind(this))},e}(ra),B_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.decode=function(t){return new co(t)},e.prototype.baseCrudPath=function(){return"/api/users"},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.user)||{});return(t==null?void 0:t.token)&&(t==null?void 0:t.user)&&this.client.AuthStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",user:i})},e.prototype.listAuthMethods=function(t){return t===void 0&&(t={}),this.client.send(this.baseCrudPath()+"/auth-methods",{method:"GET",params:t}).then(function(i){return Object.assign({},i,{emailPassword:!!(i!=null&&i.emailPassword),authProviders:Array.isArray(i==null?void 0:i.authProviders)?i==null?void 0:i.authProviders:[]})})},e.prototype.authViaEmail=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({email:t,password:i},s),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:l,body:s,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.authViaOAuth2=function(t,i,s,l,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),o=Object.assign({provider:t,code:i,codeVerifier:s,redirectUrl:l},o),this.client.send(this.baseCrudPath()+"/auth-via-oauth2",{method:"POST",params:r,body:o,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:i,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(this.authResponse.bind(this))},e.prototype.requestVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCrudPath()+"/request-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({token:t},i),this.client.send(this.baseCrudPath()+"/confirm-verification",{method:"POST",params:s,body:i}).then(this.authResponse.bind(this))},e.prototype.requestEmailChange=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({newEmail:t},i),this.client.send(this.baseCrudPath()+"/request-email-change",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmEmailChange=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({token:t,password:i},s),this.client.send(this.baseCrudPath()+"/confirm-email-change",{method:"POST",params:l,body:s}).then(this.authResponse.bind(this))},e}(ra),vn=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){this.id=e.id!==void 0?e.id:"",this.name=e.name!==void 0?e.name:"",this.type=e.type!==void 0?e.type:"text",this.system=!!e.system,this.required=!!e.required,this.unique=!!e.unique,this.options=typeof e.options=="object"&&e.options!==null?e.options:{}},n}(),An=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.name=typeof t.name=="string"?t.name:"",this.system=!!t.system,this.listRule=typeof t.listRule=="string"?t.listRule:null,this.viewRule=typeof t.viewRule=="string"?t.viewRule:null,this.createRule=typeof t.createRule=="string"?t.createRule:null,this.updateRule=typeof t.updateRule=="string"?t.updateRule:null,this.deleteRule=typeof t.deleteRule=="string"?t.deleteRule:null,t.schema=Array.isArray(t.schema)?t.schema:[],this.schema=[];for(var i=0,s=t.schema;i<s.length;i++){var l=s[i];this.schema.push(new vn(l))}},e}(bl),U_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.decode=function(t){return new An(t)},e.prototype.baseCrudPath=function(){return"/api/collections"},e}(ra),W_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.decode=function(t){return new fo(t)},e.prototype.baseCrudPath=function(t){return"/api/collections/"+encodeURIComponent(t)+"/records"},e.prototype.getFileUrl=function(t,i,s){s===void 0&&(s={});var l=[];l.push(this.client.baseUrl.replace(/\/+$/gm,"")),l.push("api"),l.push("files"),l.push(t["@collectionId"]),l.push(t.id),l.push(i);var o=l.join("/");if(Object.keys(s).length){var r=new URLSearchParams(s);o+=(o.includes("?")?"&":"?")+r}return o},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.getFullList=function(t,i,s){return i===void 0&&(i=100),s===void 0&&(s={}),this._getFullList(this.baseCrudPath(t),i,s)},e.prototype.getList=function(t,i,s,l){return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),this._getList(this.baseCrudPath(t),i,s,l)},e.prototype.getOne=function(t,i,s){return s===void 0&&(s={}),this._getOne(this.baseCrudPath(t),i,s)},e.prototype.create=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._create(this.baseCrudPath(t),i,s)},e.prototype.update=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),this._update(this.baseCrudPath(t),i,s,l)},e.prototype.delete=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),this._delete(this.baseCrudPath(t),i,s,l)},e}(rm)),Or=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.url=typeof t.url=="string"?t.url:"",this.method=typeof t.method=="string"?t.method:"GET",this.status=typeof t.status=="number"?t.status:200,this.auth=typeof t.auth=="string"?t.auth:"guest",this.ip=typeof t.ip=="string"?t.ip:"",this.referer=typeof t.referer=="string"?t.referer:"",this.userAgent=typeof t.userAgent=="string"?t.userAgent:"",this.meta=typeof t.meta=="object"&&t.meta!==null?t.meta:{}},e}(bl),Y_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return an(e,n),e.prototype.getRequestsList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),s=Object.assign({page:t,perPage:i},s),this.client.send("/api/logs/requests",{method:"GET",params:s}).then(function(l){var o=[];if(l!=null&&l.items){l.items=(l==null?void 0:l.items)||[];for(var r=0,a=l.items;r<a.length;r++){var u=a[r];o.push(new Or(u))}}return new om((l==null?void 0:l.page)||1,(l==null?void 0:l.perPage)||0,(l==null?void 0:l.totalItems)||0,o)})},e.prototype.getRequest=function(t,i){return i===void 0&&(i={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:i}).then(function(s){return new Or(s)})},e.prototype.getRequestsStats=function(t){return t===void 0&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then(function(i){return i})},e}(No),K_=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t}return an(e,n),e.prototype.subscribe=function(t,i){var s;return Gs(this,void 0,void 0,function(){return Xs(this,function(l){switch(l.label){case 0:if(!t)throw new Error("subscription must be set.");return this.subscriptions[t]&&((s=this.eventSource)===null||s===void 0||s.removeEventListener(t,this.subscriptions[t])),this.subscriptions[t]=function(o){var r,a=o;try{r=JSON.parse(a==null?void 0:a.data)}catch{}i(r||{})},this.eventSource?[3,1]:(this.connect(),[3,3]);case 1:return this.clientId?[4,this.submitSubscriptions()]:[3,3];case 2:l.sent(),l.label=3;case 3:return[2]}})})},e.prototype.unsubscribe=function(t){var i;return Gs(this,void 0,void 0,function(){return Xs(this,function(s){switch(s.label){case 0:if(t){if(!this.subscriptions[t])return[2];(i=this.eventSource)===null||i===void 0||i.removeEventListener(t,this.subscriptions[t]),delete this.subscriptions[t]}else this.removeSubscriptionListeners(),this.subscriptions={};return this.clientId?[4,this.submitSubscriptions()]:[3,2];case 1:s.sent(),s.label=2;case 2:return Object.keys(this.subscriptions).length||this.disconnect(),[2]}})})},e.prototype.submitSubscriptions=function(){return Gs(this,void 0,void 0,function(){return Xs(this,function(t){return this.addSubscriptionListeners(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:Object.keys(this.subscriptions)}}).then(function(){return!0})]})})},e.prototype.addSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeSubscriptionListeners(),this.subscriptions)this.eventSource.addEventListener(t,this.subscriptions[t])},e.prototype.removeSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)this.eventSource.removeEventListener(t,this.subscriptions[t])},e.prototype.connectHandler=function(t){var i=t;this.clientId=i==null?void 0:i.lastEventId,this.submitSubscriptions()},e.prototype.connect=function(){var t=this;this.disconnect(),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.addEventListener("PB_CONNECT",function(i){return t.connectHandler(i)})},e.prototype.disconnect=function(){var t,i,s=this;this.removeSubscriptionListeners(),(t=this.eventSource)===null||t===void 0||t.removeEventListener("PB_CONNECT",function(l){return s.connectHandler(l)}),(i=this.eventSource)===null||i===void 0||i.close(),this.eventSource=null,this.clientId=""},e}(No),aa=function(){function n(e,t,i){e===void 0&&(e="/"),t===void 0&&(t="en-US"),this.cancelControllers={},this.baseUrl=e,this.lang=t,this.AuthStore=i||new lm,this.Settings=new V_(this),this.Admins=new z_(this),this.Users=new B_(this),this.Collections=new U_(this),this.Records=new W_(this),this.Logs=new Y_(this),this.Realtime=new K_(this)}return n.prototype.cancelRequest=function(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this},n.prototype.cancelAllRequests=function(){for(var e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this},n.prototype.send=function(e,t){var i,s,l,o,r,a,u,f,c,d=this,p=Object.assign({},t);if(p.body&&p.body.constructor.name!=="FormData"&&(typeof p.body!="string"&&(p.body=JSON.stringify(p.body)),((i=p==null?void 0:p.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(p.headers=Object.assign({},p.headers,{"Content-Type":"application/json"}))),((s=p==null?void 0:p.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(p.headers=Object.assign({},p.headers,{"Accept-Language":this.lang})),((l=this.AuthStore)===null||l===void 0?void 0:l.token)&&((o=p==null?void 0:p.headers)===null||o===void 0?void 0:o.Authorization)===void 0){var g="Admin";((r=this.AuthStore.model)===null||r===void 0?void 0:r.verified)!==void 0&&(g="User"),p.headers=Object.assign({},p.headers,{Authorization:g+" "+this.AuthStore.token})}if(((a=p==null?void 0:p.params)===null||a===void 0?void 0:a.$autoCancel)!==!1){var v=((u=p==null?void 0:p.params)===null||u===void 0?void 0:u.$cancelKey)||(p.method||"GET")+e;this.cancelRequest(v);var b=new AbortController;this.cancelControllers[v]=b,p.signal=b.signal}(f=p==null?void 0:p.params)===null||f===void 0||delete f.$autoCancel,(c=p==null?void 0:p.params)===null||c===void 0||delete c.$cancelKey;var y=this.buildUrl(e);if(p.params!==void 0){var C=this.serializeQueryParams(p.params);C&&(y+=(y.includes("?")?"&":"?")+C),delete p.params}return fetch(y,Object.assign({method:"GET",mode:"cors"},p)).then(function($){return Gs(d,void 0,void 0,function(){var S;return Xs(this,function(M){switch(M.label){case 0:S={},M.label=1;case 1:return M.trys.push([1,3,,4]),[4,$.json()];case 2:return S=M.sent(),[3,4];case 3:return M.sent(),[3,4];case 4:if($.status>=400)throw new Go({url:$.url,status:$.status,data:S});return[2,S]}})})}).catch(function($){throw $ instanceof Go?$:new Go($)})},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];t.push(l+"="+encodeURIComponent(a))}else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")},n}();class is extends Error{}class Z_ extends is{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class J_ extends is{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class G_ extends is{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ws extends is{}class am extends is{constructor(e){super(`Invalid unit ${e}`)}}class Nn extends is{}class $i extends is{constructor(){super("Zone is an abstract class")}}const Ve="numeric",Qn="short",En="long",Er={year:Ve,month:Ve,day:Ve},um={year:Ve,month:Qn,day:Ve},X_={year:Ve,month:Qn,day:Ve,weekday:Qn},fm={year:Ve,month:En,day:Ve},cm={year:Ve,month:En,day:Ve,weekday:En},dm={hour:Ve,minute:Ve},hm={hour:Ve,minute:Ve,second:Ve},pm={hour:Ve,minute:Ve,second:Ve,timeZoneName:Qn},mm={hour:Ve,minute:Ve,second:Ve,timeZoneName:En},gm={hour:Ve,minute:Ve,hourCycle:"h23"},_m={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23"},bm={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23",timeZoneName:Qn},vm={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23",timeZoneName:En},ym={year:Ve,month:Ve,day:Ve,hour:Ve,minute:Ve},km={year:Ve,month:Ve,day:Ve,hour:Ve,minute:Ve,second:Ve},wm={year:Ve,month:Qn,day:Ve,hour:Ve,minute:Ve},Sm={year:Ve,month:Qn,day:Ve,hour:Ve,minute:Ve,second:Ve},Q_={year:Ve,month:Qn,day:Ve,weekday:Qn,hour:Ve,minute:Ve},$m={year:Ve,month:En,day:Ve,hour:Ve,minute:Ve,timeZoneName:Qn},Cm={year:Ve,month:En,day:Ve,hour:Ve,minute:Ve,second:Ve,timeZoneName:Qn},Mm={year:Ve,month:En,day:Ve,weekday:En,hour:Ve,minute:Ve,timeZoneName:En},Tm={year:Ve,month:En,day:Ve,weekday:En,hour:Ve,minute:Ve,second:Ve,timeZoneName:En};function _t(n){return typeof n>"u"}function xi(n){return typeof n=="number"}function Ro(n){return typeof n=="number"&&n%1===0}function x_(n){return typeof n=="string"}function e0(n){return Object.prototype.toString.call(n)==="[object Date]"}function Dm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function t0(n){return Array.isArray(n)?n:[n]}function tu(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 n0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ws(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function gi(n,e,t){return Ro(n)&&n>=e&&n<=t}function i0(n,e){return n-e*Math.floor(n/e)}function Wt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Mi(n){if(!(_t(n)||n===null||n===""))return parseInt(n,10)}function qi(n){if(!(_t(n)||n===null||n===""))return parseFloat(n)}function ua(n){if(!(_t(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function fa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function vl(n){return n%4===0&&(n%100!==0||n%400===0)}function Qs(n){return vl(n)?366:365}function ho(n,e){const t=i0(e-1,12)+1,i=n+(e-t)/12;return t===2?vl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ca(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 po(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 Ar(n){return n>99?n:n>60?1900+n:2e3+n}function Om(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ho(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function Em(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Nn(`Invalid unit value ${n}`);return e}function mo(n,e){const t={};for(const i in n)if(ws(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Em(s)}return t}function xs(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}${Wt(t,2)}:${Wt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Wt(t,2)}${Wt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function jo(n){return n0(n,["hour","minute","second","millisecond"])}const Am=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,s0=["January","February","March","April","May","June","July","August","September","October","November","December"],Pm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l0=["J","F","M","A","M","J","J","A","S","O","N","D"];function Lm(n){switch(n){case"narrow":return[...l0];case"short":return[...Pm];case"long":return[...s0];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 Fm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Im=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],o0=["M","T","W","T","F","S","S"];function Nm(n){switch(n){case"narrow":return[...o0];case"short":return[...Im];case"long":return[...Fm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Rm=["AM","PM"],r0=["Before Christ","Anno Domini"],a0=["BC","AD"],u0=["B","A"];function Hm(n){switch(n){case"narrow":return[...u0];case"short":return[...a0];case"long":return[...r0];default:return null}}function f0(n){return Rm[n.hour<12?0:1]}function c0(n,e){return Nm(e)[n.weekday-1]}function d0(n,e){return Lm(e)[n.month-1]}function h0(n,e){return Hm(e)[n.year<0?0:1]}function p0(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 nu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const m0={D:Er,DD:um,DDD:fm,DDDD:cm,t:dm,tt:hm,ttt:pm,tttt:mm,T:gm,TT:_m,TTT:bm,TTTT:vm,f:ym,ff:wm,fff:$m,ffff:Mm,F:km,FF:Sm,FFF:Cm,FFFF:Tm};class _n{static create(e,t={}){return new _n(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o<e.length;o++){const r=e.charAt(o);r==="'"?(i.length>0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return m0[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 Wt(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=(p,g)=>this.loc.extract(e,p,g),o=p=>e.isOffsetFixed&&e.offset===0&&p.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,p.format):"",r=()=>i?f0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(p,g)=>i?d0(e,p):l(g?{month:p}:{month:p,day:"numeric"},"month"),u=(p,g)=>i?c0(e,p):l(g?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),f=p=>{const g=_n.macroTokenToFormatOpts(p);return g?this.formatWithSystemDefault(e,g):p},c=p=>i?h0(e,p):l({era:p},"era"),d=p=>{switch(p){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(p)}};return nu(_n.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=_n.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 nu(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 yl{get type(){throw new $i}get name(){throw new $i}get ianaName(){return this.name}get isUniversal(){throw new $i}offsetName(e,t){throw new $i}formatOffset(e,t){throw new $i}offset(e){throw new $i}equals(e){throw new $i}get isValid(){throw new $i}}let Xo=null;class da extends yl{static get instance(){return Xo===null&&(Xo=new da),Xo}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Om(e,t,i)}formatOffset(e,t){return xs(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let lo={};function g0(n){return lo[n]||(lo[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"})),lo[n]}const _0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function b0(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 v0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=_0[l];l==="era"?i[r]=o:_t(r)||(i[r]=parseInt(o,10))}return i}let Il={};class bi extends yl{static create(e){return Il[e]||(Il[e]=new bi(e)),Il[e]}static resetCache(){Il={},lo={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=bi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Om(e,t,i,this.name)}formatOffset(e,t){return xs(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=g0(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?v0(i,t):b0(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=ca({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let p=+t;const g=p%1e3;return p-=g>=0?g:1e3+g,(d-p)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Qo=null;class dn extends yl{static get utcInstance(){return Qo===null&&(Qo=new dn(0)),Qo}static instance(e){return e===0?dn.utcInstance:new dn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new dn(Ho(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${xs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${xs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return xs(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 y0 extends yl{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 Ti(n,e){if(_t(n)||n===null)return e;if(n instanceof yl)return n;if(x_(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?dn.utcInstance:dn.parseSpecifier(t)||bi.create(n)}else return xi(n)?dn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new y0(n)}let iu=()=>Date.now(),su="system",lu=null,ou=null,ru=null,au;class Gt{static get now(){return iu}static set now(e){iu=e}static set defaultZone(e){su=e}static get defaultZone(){return Ti(su,da.instance)}static get defaultLocale(){return lu}static set defaultLocale(e){lu=e}static get defaultNumberingSystem(){return ou}static set defaultNumberingSystem(e){ou=e}static get defaultOutputCalendar(){return ru}static set defaultOutputCalendar(e){ru=e}static get throwOnInvalid(){return au}static set throwOnInvalid(e){au=e}static resetCaches(){Rt.resetCache(),bi.resetCache()}}let uu={};function k0(n,e={}){const t=JSON.stringify([n,e]);let i=uu[t];return i||(i=new Intl.ListFormat(n,e),uu[t]=i),i}let Pr={};function Lr(n,e={}){const t=JSON.stringify([n,e]);let i=Pr[t];return i||(i=new Intl.DateTimeFormat(n,e),Pr[t]=i),i}let Fr={};function w0(n,e={}){const t=JSON.stringify([n,e]);let i=Fr[t];return i||(i=new Intl.NumberFormat(n,e),Fr[t]=i),i}let Ir={};function S0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Ir[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Ir[s]=l),l}let Ys=null;function $0(){return Ys||(Ys=new Intl.DateTimeFormat().resolvedOptions().locale,Ys)}function C0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Lr(n).resolvedOptions()}catch{t=Lr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function M0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function T0(n){const e=[];for(let t=1;t<=12;t++){const i=et.utc(2016,t,1);e.push(n(i))}return e}function D0(n){const e=[];for(let t=1;t<=7;t++){const i=et.utc(2016,11,13+t);e.push(n(i))}return e}function Nl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function O0(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 E0{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=w0(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):fa(e,3);return Wt(t,this.padTo)}}}class A0{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&&bi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:et.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=Lr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class P0{constructor(e,t,i){this.opts={style:"long",...i},!t&&Dm()&&(this.rtf=S0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):p0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Rt{static fromOpts(e){return Rt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Gt.defaultLocale,o=l||(s?"en-US":$0()),r=t||Gt.defaultNumberingSystem,a=i||Gt.defaultOutputCalendar;return new Rt(o,r,a,l)}static resetCache(){Ys=null,Pr={},Fr={},Ir={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Rt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=C0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=M0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=O0(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:Rt.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 Nl(this,e,i,Lm,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=T0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Nl(this,e,i,Nm,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=D0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Nl(this,void 0,e,()=>Rm,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[et.utc(2016,11,13,9),et.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Nl(this,e,t,Hm,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[et.utc(-40,1,1),et.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 E0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new A0(e,this.intl,t)}relFormatter(e={}){return new P0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return k0(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 Ts(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ds(...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 Os(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 jm(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=Mi(e[t+s]);return[i,null,t+s]}}const qm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,L0=`(?:${qm.source}?(?:\\[(${Am.source})\\])?)?`,ha=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Vm=RegExp(`${ha.source}${L0}`),pa=RegExp(`(?:T${Vm.source})?`),F0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,I0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,N0=/(\d{4})-?(\d{3})/,R0=jm("weekYear","weekNumber","weekDay"),H0=jm("year","ordinal"),j0=/(\d{4})-(\d\d)-(\d\d)/,zm=RegExp(`${ha.source} ?(?:${qm.source}|(${Am.source}))?`),q0=RegExp(`(?: ${zm.source})?`);function _s(n,e,t){const i=n[e];return _t(i)?t:Mi(i)}function V0(n,e){return[{year:_s(n,e),month:_s(n,e+1,1),day:_s(n,e+2,1)},null,e+3]}function Es(n,e){return[{hours:_s(n,e,0),minutes:_s(n,e+1,0),seconds:_s(n,e+2,0),milliseconds:ua(n[e+3])},null,e+4]}function kl(n,e){const t=!n[e]&&!n[e+1],i=Ho(n[e+1],n[e+2]),s=t?null:dn.instance(i);return[{},s,e+3]}function wl(n,e){const t=n[e]?bi.create(n[e]):null;return[{},t,e+1]}const z0=RegExp(`^T?${ha.source}$`),B0=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function U0(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(p,g=!1)=>p!==void 0&&(g||p&&f)?-p:p;return[{years:d(qi(t)),months:d(qi(i)),weeks:d(qi(s)),days:d(qi(l)),hours:d(qi(o)),minutes:d(qi(r)),seconds:d(qi(a),a==="-0"),milliseconds:d(ua(u),c)}]}const W0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ma(n,e,t,i,s,l,o){const r={year:e.length===2?Ar(Mi(e)):Mi(e),month:Pm.indexOf(t)+1,day:Mi(i),hour:Mi(s),minute:Mi(l)};return o&&(r.second=Mi(o)),n&&(r.weekday=n.length>3?Fm.indexOf(n)+1:Im.indexOf(n)+1),r}const Y0=/^(?:(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 K0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=ma(e,s,i,t,l,o,r);let p;return a?p=W0[a]:u?p=0:p=Ho(f,c),[d,new dn(p)]}function Z0(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const J0=/^(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$/,G0=/^(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$/,X0=/^(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 fu(n){const[,e,t,i,s,l,o,r]=n;return[ma(e,s,i,t,l,o,r),dn.utcInstance]}function Q0(n){const[,e,t,i,s,l,o,r]=n;return[ma(e,r,t,i,s,l,o),dn.utcInstance]}const x0=Ts(F0,pa),eb=Ts(I0,pa),tb=Ts(N0,pa),nb=Ts(Vm),Bm=Ds(V0,Es,kl,wl),ib=Ds(R0,Es,kl,wl),sb=Ds(H0,Es,kl,wl),lb=Ds(Es,kl,wl);function ob(n){return Os(n,[x0,Bm],[eb,ib],[tb,sb],[nb,lb])}function rb(n){return Os(Z0(n),[Y0,K0])}function ab(n){return Os(n,[J0,fu],[G0,fu],[X0,Q0])}function ub(n){return Os(n,[B0,U0])}const fb=Ds(Es);function cb(n){return Os(n,[z0,fb])}const db=Ts(j0,q0),hb=Ts(zm),pb=Ds(Es,kl,wl);function mb(n){return Os(n,[db,Bm],[hb,pb])}const gb="Invalid Duration",Um={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}},_b={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},...Um},Pn=146097/400,ds=146097/4800,bb={years:{quarters:4,months:12,weeks:Pn/7,days:Pn,hours:Pn*24,minutes:Pn*24*60,seconds:Pn*24*60*60,milliseconds:Pn*24*60*60*1e3},quarters:{months:3,weeks:Pn/28,days:Pn/4,hours:Pn*24/4,minutes:Pn*24*60/4,seconds:Pn*24*60*60/4,milliseconds:Pn*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},...Um},Yi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],vb=Yi.slice(0).reverse();function Vi(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 kt(i)}function yb(n){return n<0?Math.floor(n):Math.ceil(n)}function Wm(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?yb(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function kb(n,e){vb.reduce((t,i)=>_t(e[i])?t:(t&&Wm(n,e,t,e,i),i),null)}class kt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Rt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?bb:_b,this.isLuxonDuration=!0}static fromMillis(e,t){return kt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Nn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new kt({values:mo(e,kt.normalizeUnit),loc:Rt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(xi(e))return kt.fromMillis(e);if(kt.isDuration(e))return e;if(typeof e=="object")return kt.fromObject(e);throw new Nn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=ub(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=cb(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the Duration is invalid");const i=e instanceof Jn?e:new Jn(e,t);if(Gt.throwOnInvalid)throw new G_(i);return new kt({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 am(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?_n.create(this.loc,i).formatDurationFromString(this,e):gb}toHuman(e={}){const t=Yi.map(i=>{const s=this.values[i];return _t(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+=fa(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=kt.fromDurationLike(e),i={};for(const s of Yi)(ws(t.values,s)||ws(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Vi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=kt.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]=Em(e(this.values[i],i));return Vi(this,{values:t},!0)}get(e){return this[kt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...mo(e,kt.normalizeUnit)};return Vi(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),Vi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return kb(this.matrix,e),Vi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>kt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Yi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;xi(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Yi.indexOf(u)>Yi.indexOf(o)&&Wm(this.matrix,s,u,t,o)}else xi(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 Vi(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 Vi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Yi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Ls="Invalid Interval";function wb(n,e){return!n||!n.isValid?Ht.invalid("missing or invalid start"):!e||!e.isValid?Ht.invalid("missing or invalid end"):e<n?Ht.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class Ht{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the Interval is invalid");const i=e instanceof Jn?e:new Jn(e,t);if(Gt.throwOnInvalid)throw new J_(i);return new Ht({invalid:i})}static fromDateTimes(e,t){const i=Ns(e),s=Ns(t),l=wb(i,s);return l==null?new Ht({start:i,end:s}):l}static after(e,t){const i=kt.fromDurationLike(t),s=Ns(e);return Ht.fromDateTimes(s,s.plus(i))}static before(e,t){const i=kt.fromDurationLike(t),s=Ns(e);return Ht.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=et.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=et.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return Ht.fromDateTimes(l,r);if(o){const u=kt.fromISO(s,t);if(u.isValid)return Ht.after(l,u)}else if(a){const u=kt.fromISO(i,t);if(u.isValid)return Ht.before(r,u)}}return Ht.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),i=this.end.startOf(e);return Math.floor(i.diff(t,e).get(e))+1}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ht.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ns).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s<this.e;){const o=t[l]||this.e,r=+o>+this.e?this.e:o;i.push(Ht.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=kt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;i<this.e;){const r=this.start.plus(t.mapUnits(a=>a*s));l=+r>+this.e?this.e:r,o.push(Ht.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return t>=i?null:Ht.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return Ht.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(Ht.fromDateTimes(t,a.time)),t=null);return Ht.merge(s)}difference(...e){return Ht.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Ls}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ls}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ls}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ls}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ls}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):kt.invalid(this.invalidReason)}mapEndpoints(e){return Ht.fromDateTimes(e(this.s),e(this.e))}}class Rl{static hasDST(e=Gt.defaultZone){const t=et.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return bi.isValidZone(e)}static normalizeZone(e){return Ti(e,Gt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Rt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Rt.create(t,null,"gregory").eras(e)}static features(){return{relative:Dm()}}}function cu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(kt.fromMillis(i).as("days"))}function Sb(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=cu(r,a);return(u-u%7)/7}],["days",cu]],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 $b(n,e,t,i){let[s,l,o,r]=Sb(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=kt.fromObject(l,i);return u.length>0?kt.fromMillis(a,i).shiftTo(...u).plus(f):f}const ga={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},du={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]},Cb=ga.hanidec.replace(/[\[|\]]/g,"").split("");function Mb(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);if(n[t].search(ga.hanidec)!==-1)e+=Cb.indexOf(n[t]);else for(const s in du){const[l,o]=du[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Kn({numberingSystem:n},e=""){return new RegExp(`${ga[n||"latn"]}${e}`)}const Tb="missing Intl.DateTimeFormat.formatToParts support";function wt(n,e=t=>t){return{regex:n,deser:([t])=>e(Mb(t))}}const Db=String.fromCharCode(160),Ym=`[ ${Db}]`,Km=new RegExp(Ym,"g");function Ob(n){return n.replace(/\./g,"\\.?").replace(Km,Ym)}function hu(n){return n.replace(/\./g,"").replace(Km," ").toLowerCase()}function Zn(n,e){return n===null?null:{regex:RegExp(n.map(Ob).join("|")),deser:([t])=>n.findIndex(i=>hu(t)===hu(i))+e}}function pu(n,e){return{regex:n,deser:([,t,i])=>Ho(t,i),groups:e}}function xo(n){return{regex:n,deser:([e])=>e}}function Eb(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ab(n,e){const t=Kn(e),i=Kn(e,"{2}"),s=Kn(e,"{3}"),l=Kn(e,"{4}"),o=Kn(e,"{6}"),r=Kn(e,"{1,2}"),a=Kn(e,"{1,3}"),u=Kn(e,"{1,6}"),f=Kn(e,"{1,9}"),c=Kn(e,"{2,4}"),d=Kn(e,"{4,6}"),p=b=>({regex:RegExp(Eb(b.val)),deser:([y])=>y,literal:!0}),v=(b=>{if(n.literal)return p(b);switch(b.val){case"G":return Zn(e.eras("short",!1),0);case"GG":return Zn(e.eras("long",!1),0);case"y":return wt(u);case"yy":return wt(c,Ar);case"yyyy":return wt(l);case"yyyyy":return wt(d);case"yyyyyy":return wt(o);case"M":return wt(r);case"MM":return wt(i);case"MMM":return Zn(e.months("short",!0,!1),1);case"MMMM":return Zn(e.months("long",!0,!1),1);case"L":return wt(r);case"LL":return wt(i);case"LLL":return Zn(e.months("short",!1,!1),1);case"LLLL":return Zn(e.months("long",!1,!1),1);case"d":return wt(r);case"dd":return wt(i);case"o":return wt(a);case"ooo":return wt(s);case"HH":return wt(i);case"H":return wt(r);case"hh":return wt(i);case"h":return wt(r);case"mm":return wt(i);case"m":return wt(r);case"q":return wt(r);case"qq":return wt(i);case"s":return wt(r);case"ss":return wt(i);case"S":return wt(a);case"SSS":return wt(s);case"u":return xo(f);case"uu":return xo(r);case"uuu":return wt(t);case"a":return Zn(e.meridiems(),0);case"kkkk":return wt(l);case"kk":return wt(c,Ar);case"W":return wt(r);case"WW":return wt(i);case"E":case"c":return wt(t);case"EEE":return Zn(e.weekdays("short",!1,!1),1);case"EEEE":return Zn(e.weekdays("long",!1,!1),1);case"ccc":return Zn(e.weekdays("short",!0,!1),1);case"cccc":return Zn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return pu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return pu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return xo(/[a-z_+-/]{1,256}?/i);default:return p(b)}})(n)||{invalidReason:Tb};return v.token=n,v}const Pb={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 Lb(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Pb[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Fb(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Ib(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(ws(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 Nb(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 _t(n.z)||(t=bi.create(n.z)),_t(n.Z)||(t||(t=new dn(n.Z)),i=n.Z),_t(n.q)||(n.M=(n.q-1)*3+1),_t(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),_t(n.u)||(n.S=ua(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let er=null;function Rb(){return er||(er=et.fromMillis(1555555555555)),er}function Hb(n,e){if(n.literal)return n;const t=_n.macroTokenToFormatOpts(n.val);if(!t)return n;const l=_n.create(e,t).formatDateTimeParts(Rb()).map(o=>Lb(o,e,t));return l.includes(void 0)?n:l}function jb(n,e){return Array.prototype.concat(...n.map(t=>Hb(t,e)))}function Zm(n,e,t){const i=jb(_n.parseFormat(t),n),s=i.map(o=>Ab(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Fb(s),a=RegExp(o,"i"),[u,f]=Ib(e,a,r),[c,d,p]=f?Nb(f):[null,null,void 0];if(ws(f,"a")&&ws(f,"H"))throw new Ws("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:p}}}function qb(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=Zm(n,e,t);return[i,s,l,o]}const Jm=[0,31,59,90,120,151,181,212,243,273,304,334],Gm=[0,31,60,91,121,152,182,213,244,274,305,335];function Hn(n,e){return new Jn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Xm(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 Qm(n,e,t){return t+(vl(n)?Gm:Jm)[e-1]}function xm(n,e){const t=vl(n)?Gm:Jm,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Nr(n){const{year:e,month:t,day:i}=n,s=Qm(e,t,i),l=Xm(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=po(r)):o>po(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...jo(n)}}function mu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Xm(e,1,4),l=Qs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=Qs(r)):o>l?(r=e+1,o-=Qs(e)):r=e;const{month:a,day:u}=xm(r,o);return{year:r,month:a,day:u,...jo(n)}}function tr(n){const{year:e,month:t,day:i}=n,s=Qm(e,t,i);return{year:e,ordinal:s,...jo(n)}}function gu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=xm(e,t);return{year:e,month:i,day:s,...jo(n)}}function Vb(n){const e=Ro(n.weekYear),t=gi(n.weekNumber,1,po(n.weekYear)),i=gi(n.weekday,1,7);return e?t?i?!1:Hn("weekday",n.weekday):Hn("week",n.week):Hn("weekYear",n.weekYear)}function zb(n){const e=Ro(n.year),t=gi(n.ordinal,1,Qs(n.year));return e?t?!1:Hn("ordinal",n.ordinal):Hn("year",n.year)}function eg(n){const e=Ro(n.year),t=gi(n.month,1,12),i=gi(n.day,1,ho(n.year,n.month));return e?t?i?!1:Hn("day",n.day):Hn("month",n.month):Hn("year",n.year)}function tg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=gi(e,0,23)||e===24&&t===0&&i===0&&s===0,o=gi(t,0,59),r=gi(i,0,59),a=gi(s,0,999);return l?o?r?a?!1:Hn("millisecond",s):Hn("second",i):Hn("minute",t):Hn("hour",e)}const nr="Invalid DateTime",_u=864e13;function Hl(n){return new Jn("unsupported zone",`the zone "${n.name}" is not supported`)}function ir(n){return n.weekData===null&&(n.weekData=Nr(n.c)),n.weekData}function Fs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new et({...t,...e,old:t})}function ng(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 bu(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 oo(n,e,t){return ng(ca(n),e,t)}function vu(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=kt.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=ca(l);let[a,u]=ng(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Is(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=et.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return et.invalid(new Jn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function jl(n,e,t=!0){return n.isValid?_n.create(Rt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function sr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Wt(n.c.year,t?6:4),e?(i+="-",i+=Wt(n.c.month),i+="-",i+=Wt(n.c.day)):(i+=Wt(n.c.month),i+=Wt(n.c.day)),i}function yu(n,e,t,i,s,l){let o=Wt(n.c.hour);return e?(o+=":",o+=Wt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Wt(n.c.minute),(n.c.second!==0||!t)&&(o+=Wt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Wt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Wt(Math.trunc(-n.o/60)),o+=":",o+=Wt(Math.trunc(-n.o%60))):(o+="+",o+=Wt(Math.trunc(n.o/60)),o+=":",o+=Wt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const ig={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Bb={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ub={ordinal:1,hour:0,minute:0,second:0,millisecond:0},sg=["year","month","day","hour","minute","second","millisecond"],Wb=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Yb=["year","ordinal","hour","minute","second","millisecond"];function ku(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 am(n);return e}function wu(n,e){const t=Ti(e.zone,Gt.defaultZone),i=Rt.fromObject(e),s=Gt.now();let l,o;if(_t(n.year))l=s;else{for(const u of sg)_t(n[u])&&(n[u]=ig[u]);const r=eg(n)||tg(n);if(r)return et.invalid(r);const a=t.offset(s);[l,o]=oo(n,a,t)}return new et({ts:l,zone:t,loc:i,o})}function Su(n,e,t){const i=_t(t.round)?!0:t.round,s=(o,r)=>(o=fa(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 $u(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 et{constructor(e){const t=e.zone||Gt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Jn("invalid input"):null)||(t.isValid?null:Hl(t));this.ts=_t(e.ts)?Gt.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=bu(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||Rt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new et({})}static local(){const[e,t]=$u(arguments),[i,s,l,o,r,a,u]=t;return wu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=$u(arguments),[i,s,l,o,r,a,u]=t;return e.zone=dn.utcInstance,wu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=e0(e)?e.valueOf():NaN;if(Number.isNaN(i))return et.invalid("invalid input");const s=Ti(t.zone,Gt.defaultZone);return s.isValid?new et({ts:i,zone:s,loc:Rt.fromObject(t)}):et.invalid(Hl(s))}static fromMillis(e,t={}){if(xi(e))return e<-_u||e>_u?et.invalid("Timestamp out of range"):new et({ts:e,zone:Ti(t.zone,Gt.defaultZone),loc:Rt.fromObject(t)});throw new Nn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(xi(e))return new et({ts:e*1e3,zone:Ti(t.zone,Gt.defaultZone),loc:Rt.fromObject(t)});throw new Nn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ti(t.zone,Gt.defaultZone);if(!i.isValid)return et.invalid(Hl(i));const s=Gt.now(),l=_t(t.specificOffset)?i.offset(s):t.specificOffset,o=mo(e,ku),r=!_t(o.ordinal),a=!_t(o.year),u=!_t(o.month)||!_t(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Rt.fromObject(t);if((f||r)&&c)throw new Ws("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Ws("Can't mix ordinal dates with month/day");const p=c||o.weekday&&!f;let g,v,b=bu(s,l);p?(g=Wb,v=Bb,b=Nr(b)):r?(g=Yb,v=Ub,b=tr(b)):(g=sg,v=ig);let y=!1;for(const O of g){const F=o[O];_t(F)?y?o[O]=v[O]:o[O]=b[O]:y=!0}const C=p?Vb(o):r?zb(o):eg(o),$=C||tg(o);if($)return et.invalid($);const S=p?mu(o):r?gu(o):o,[M,D]=oo(S,l,i),E=new et({ts:M,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==E.weekday?et.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[i,s]=ob(e);return Is(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=rb(e);return Is(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=ab(e);return Is(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(_t(e)||_t(t))throw new Nn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=qb(o,e,t);return f?et.invalid(f):Is(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return et.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=mb(e);return Is(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the DateTime is invalid");const i=e instanceof Jn?e:new Jn(e,t);if(Gt.throwOnInvalid)throw new Z_(i);return new et({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?ir(this).weekYear:NaN}get weekNumber(){return this.isValid?ir(this).weekNumber:NaN}get weekday(){return this.isValid?ir(this).weekday:NaN}get ordinal(){return this.isValid?tr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Rl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Rl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Rl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Rl.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 vl(this.year)}get daysInMonth(){return ho(this.year,this.month)}get daysInYear(){return this.isValid?Qs(this.year):NaN}get weeksInWeekYear(){return this.isValid?po(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=_n.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(dn.instance(e),t)}toLocal(){return this.setZone(Gt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ti(e,Gt.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]=oo(o,l,e)}return Fs(this,{ts:s,zone:e})}else return et.invalid(Hl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Fs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=mo(e,ku),i=!_t(t.weekYear)||!_t(t.weekNumber)||!_t(t.weekday),s=!_t(t.ordinal),l=!_t(t.year),o=!_t(t.month)||!_t(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Ws("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Ws("Can't mix ordinal dates with month/day");let u;i?u=mu({...Nr(this.c),...t}):_t(t.ordinal)?(u={...this.toObject(),...t},_t(t.day)&&(u.day=Math.min(ho(u.year,u.month),u.day))):u=gu({...tr(this.c),...t});const[f,c]=oo(u,this.o,this.zone);return Fs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e);return Fs(this,vu(this,t))}minus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e).negate();return Fs(this,vu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=kt.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?_n.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):nr}toLocaleString(e=Er,t={}){return this.isValid?_n.create(this.loc.clone(t),e).formatDateTime(this):nr}toLocaleParts(e={}){return this.isValid?_n.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=sr(this,o);return r+="T",r+=yu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?sr(this,e==="extended"):null}toISOWeekDate(){return jl(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":"")+yu(this,o==="extended",t,e,i,l):null}toRFC2822(){return jl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return jl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?sr(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")),jl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():nr}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 kt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=t0(t).map(kt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=$b(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(et.now(),e,t)}until(e){return this.isValid?Ht.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||et.fromObject({},{zone:this.zone}),i=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],l=e.unit;return Array.isArray(e.unit)&&(s=e.unit,l=void 0),Su(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Su(e.base||et.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(et.isDateTime))throw new Nn("min requires all arguments be DateTimes");return tu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(et.isDateTime))throw new Nn("max requires all arguments be DateTimes");return tu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return Zm(o,e,t)}static fromStringExplain(e,t,i={}){return et.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Er}static get DATE_MED(){return um}static get DATE_MED_WITH_WEEKDAY(){return X_}static get DATE_FULL(){return fm}static get DATE_HUGE(){return cm}static get TIME_SIMPLE(){return dm}static get TIME_WITH_SECONDS(){return hm}static get TIME_WITH_SHORT_OFFSET(){return pm}static get TIME_WITH_LONG_OFFSET(){return mm}static get TIME_24_SIMPLE(){return gm}static get TIME_24_WITH_SECONDS(){return _m}static get TIME_24_WITH_SHORT_OFFSET(){return bm}static get TIME_24_WITH_LONG_OFFSET(){return vm}static get DATETIME_SHORT(){return ym}static get DATETIME_SHORT_WITH_SECONDS(){return km}static get DATETIME_MED(){return wm}static get DATETIME_MED_WITH_SECONDS(){return Sm}static get DATETIME_MED_WITH_WEEKDAY(){return Q_}static get DATETIME_FULL(){return $m}static get DATETIME_FULL_WITH_SECONDS(){return Cm}static get DATETIME_HUGE(){return Mm}static get DATETIME_HUGE_WITH_SECONDS(){return Tm}}function Ns(n){if(et.isDateTime(n))return n;if(n&&n.valueOf&&xi(n.valueOf()))return et.fromJSDate(n);if(n&&typeof n=="object")return et.fromObject(n);throw new Nn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}class Y{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-01T00:00:00Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||Y.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 Y.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!Y.isEmpty(e[t]))return!0;return!1}static isObjectArrayWithKeys(e,t){if(!Array.isArray(e)||typeof e[0]!="object")return!1;if(e.length==0)return!0;let i=Y.toArray(t);for(let s of i)if(!(s in e[0]))return!1;return!0}static toArray(e,t=!1){return Array.isArray(e)?e:(t||!Y.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){Y.inArray(e,t)||e.push(t)}static findByKey(e,t,i){for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){let 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"){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]=Y.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(!Y.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(!Y.isObject(e)&&!Array.isArray(e)){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)(!Y.isObject(l)&&!Array.isArray(l)||!Y.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)(!Y.isObject(s)&&!Array.isArray(s)||!Y.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):Y.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||Y.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||Y.isObject(e)&&Object.keys(e).length>0)&&Y.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const s={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let o in s)e=e.replace(s[o],o);const l=e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t);return l.charAt(0).toLowerCase()+l.slice(1)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=(e||"").split(t),s=[];for(let l of i)l=l.trim(),Y.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",Y.isEmpty(s)||i.push(s);return i.join(t)}static getDateTime(e){if(typeof e=="string"){const t="yyyy-MM-dd HH:mm:ss",i="yyyy-MM-dd HH:mm:ss.SSS",s=e.length===i.length?i:t;return et.fromFormat(e,s,{zone:"UTC"})}return et.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return Y.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return Y.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 openInWindow(e,t,i,s){t=t||1024,i=i||768,s=s||"popup";let l=window.innerWidth,o=window.innerHeight;t=t>l?l:t,i=i>o?o:i;let r=l/2-t/2,a=o/2-i/2;return window.open(e,s,"width="+t+",height="+i+",top="+a+",left="+r+",resizable,menubar=no")}static getQueryString(e){let t=e.indexOf("?");if(t<0)return"";let i=e.indexOf("#");return e.substring(t+1,i>t?i:e.length)}static getQueryParams(e){let t={},i=Y.getQueryString(e).split("&");for(let s in i){let l=i[s].split("=");if(l.length===2){let o=decodeURIComponent(l[1]);if(o.startsWith("{")||o.startsWith("["))try{o=JSON.parse(o)}catch{}t[decodeURIComponent(l[0])]=o}}return t}static setQueryParams(e,t,i=!0){let s=Y.getQueryString(e),l=i&&s?Y.getQueryParams(e):{},o=Object.assign(l,t),r="";for(let a in o)Y.isEmpty(o[a])||(r&&(r+="&"),r+=encodeURIComponent(a)+"=",Y.isObject(o[a])?r+=encodeURIComponent(JSON.stringify(o[a])):r+=encodeURIComponent(o[a]));return r=r?"?"+r:"",Y.isEmpty(s)?e+r:e.replace("?"+s,r)}static replaceClientQueryParams(e){let t=Y.setQueryParams(window.location.href,e);window.location.replace(t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return/\.jpg|\.jpeg|\.png|\.svg|\.webp|\.avif$/.test(e)}static checkImageUrl(e){return new Promise((t,i)=>{const s=new Image;s.onload=function(){return t(!0)},s.onerror=function(l){return i(l)},s.src=e})}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(Y.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)Y.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):Y.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static dummyCollectionRecord(e){var s,l,o,r,a;const t=(e==null?void 0:e.schema)||[],i={"@collectionId":e==null?void 0:e.id,"@collectionName":e==null?void 0:e.name,id:"RECORD_ID",created:"2022-01-01 01:00:00",updated:"2022-01-01 23:59:59"};for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON (array/object)":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)>1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)>1&&(f=[f])):u.type==="relation"||u.type==="user"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)>1&&(f=[f])):f="test",i[u.name]=f}return i}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"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=e||{},e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":case"user":return((t=e.options)==null?void 0:t.maxSelect)>1?"Array<String>":"String";default:return"String"}}}const _a=xn([]);function hn(n,e=3e3){return og(n,"success",e)}function lg(n,e=4500){return og(n,"error",e)}function og(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{rg(i)},t)};_a.update(s=>(ag(s,i.message),Y.pushOrReplaceByKey(s,i,"message"),s))}function rg(n){_a.update(e=>(ag(e,n),e))}function ag(n,e){let t;typeof e=="string"?t=Y.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),Y.removeByKey(n,"message",t.message))}const ss=xn({});function Ii(n){ss.set(n||{})}function ug(n){ss.update(e=>(Y.deleteByPath(e,n),e))}const ba=xn({});function Rr(n){ba.set(n||{})}aa.prototype.logout=function(n=!0){this.AuthStore.clear(),n&&Ms("/login")};aa.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&&lg(l)}if(Y.isEmpty(s.data)||Ii(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ms("/")};class Kb extends lm{save(e,t){super.save(e,t),t instanceof ks&&Rr(t)}clear(){super.clear(),Rr(null)}}const we=new aa("/","en-US",new Kb("pb_admin_auth"));we.AuthStore.model instanceof ks&&Rr(we.AuthStore.model);function Cu(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=`<figure class="logo"><img src="/_/images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
|
||
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=T(),i=_("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function Zb(n){let e,t,i,s,l,o,r,a,u=!n[0]&&Cu();const f=n[2].default,c=Mn(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),u&&u.c(),l=T(),c&&c.c(),o=T(),r=_("div"),h(t,"class","flex-fill"),h(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),h(r,"class","flex-fill"),h(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,p){w(d,e,p),m(e,t),m(e,i),m(e,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,o),m(e,r),a=!0},p(d,[p]){d[0]?u&&(u.d(1),u=null):u||(u=Cu(),u.c(),u.m(s,l)),c&&c.p&&(!a||p&2)&&Dn(c,f,d,d[1],a?Tn(f,d[1],p,null):On(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){P(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function Jb(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(1,s=o.$$scope)},[l,s,i]}class fg extends Pe{constructor(e){super(),Ae(this,e,Jb,Zb,Ee,{nobranding:0})}}function Mu(n,e,t){const i=n.slice();return i[11]=e[t],i}const Gb=n=>({}),Tu=n=>({uniqueId:n[3]});function Xb(n){let e=(n[11]||go)+"",t;return{c(){t=R(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||go)+"")&&me(t,e)},d(i){i&&k(t)}}}function Qb(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||go)+"",t;return{c(){t=R(e)},m(l,o){w(l,t,o)},p(l,o){var r,a;o&4&&e!==(e=(((r=l[11])==null?void 0:r.message)||((a=l[11])==null?void 0:a.code)||go)+"")&&me(t,e)},d(l){l&&k(t)}}}function Du(n){let e,t;function i(o,r){return typeof o[11]=="object"?Qb:Xb}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),h(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(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&&k(e),l.d()}}}function xb(n){let e,t,i,s,l;const o=n[7].default,r=Mn(o,n,n[6],Tu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Du(Mu(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();h(e,"class",n[0]),ee(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=X(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Dn(r,o,f,f[6],i?Tn(o,f[6],c,Gb):On(f[6]),Tu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const p=Mu(f,a,d);u[d]?u[d].p(p,c):(u[d]=Du(p),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&h(e,"class",f[0]),c&5&&ee(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),jn(u,f),n[9](null),s=!1,l()}}}const go="Invalid value";function e1(n,e,t){let i;At(n,ss,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+Y.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){ug(r)}Yn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){ht.call(this,n,g)}function p(g){he[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=Y.toArray(Y.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,p]}class Le extends Pe{constructor(e){super(),Ae(this,e,e1,xb,Ee,{name:4,class:0})}}function t1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=X(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function n1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[1]),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&h(e,"for",i),d&512&&o!==(o=c[9])&&h(l,"id",o),d&2&&l.value!==c[1]&&Ce(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function i1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Password confirm"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[2]),r||(a=X(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&Ce(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function s1(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return s=new Le({props:{class:"form-field required",name:"email",$$slots:{default:[t1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"password",$$slots:{default:[n1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new Le({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[i1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),f=_("button"),f.innerHTML=`<span class="txt">Create and login</span>
|
||
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),ee(f,"btn-disabled",n[3]),ee(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),q(a,e,null),m(e,u),m(e,f),c=!0,d||(p=X(e,"submit",Bt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&1540&&(C.$$scope={dirty:v,ctx:g}),a.$set(C),v&8&&ee(f,"btn-disabled",g[3]),v&8&&ee(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,p()}}}function l1(n,e,t){const i=un();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await we.Admins.create({email:s,password:l,passwordConfirm:o}),await we.Admins.authViaEmail(s,l),i("submit")}catch(d){we.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 o1 extends Pe{constructor(e){super(),Ae(this,e,l1,s1,Ee,{})}}function Ou(n){let e,t;return e=new fg({props:{$$slots:{default:[r1]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function r1(n){let e,t;return e=new o1({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function a1(n){let e,t,i=n[0]&&Ou(n);return{c(){i&&i.c(),e=rt()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Ou(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(De(),P(i,1,1,()=>{i=null}),Oe())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function u1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){we.logout(!1),t(0,i=!0);return}we.AuthStore.isValid?Ms("/collections"):we.logout()}return[i,async()=>{t(0,i=!1),await ai(),window.location.search=""}]}class f1 extends Pe{constructor(e){super(),Ae(this,e,u1,a1,Ee,{})}}const Zt=xn(""),_o=xn("");function qo(n){const e=n-1;return e*e*e+1}function bo(n,{delay:e=0,duration:t=400,easing:i=_l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Vn(n,{delay:e=0,duration:t=400,easing:i=qo,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 xt(n,{delay:e=0,duration:t=400,easing:i=qo}={}){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:p=>`overflow: hidden;opacity: ${Math.min(p*20,1)*l};height: ${p*o}px;padding-top: ${p*r}px;padding-bottom: ${p*a}px;margin-top: ${p*u}px;margin-bottom: ${p*f}px;border-top-width: ${p*c}px;border-bottom-width: ${p*d}px;`}}function zn(n,{delay:e=0,duration:t=400,easing:i=qo,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 c1(n){let e,t,i,s;return{c(){e=_("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Ce(e,n[7]),i||(s=X(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&Ce(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function d1(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={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=new o(r(n)),he.push(()=>Ie(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=rt()},m(a,u){e&&q(e,a,u),w(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],He(()=>t=!1)),o!==(o=a[4])){if(e){De();const c=e;P(c.$$.fragment,1,0,()=>{V(c,1)}),Oe()}o?(e=new o(r(a)),he.push(()=>Ie(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function Eu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Au();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',h(t,"type","button"),h(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=X(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Au(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(De(),P(r,1,1,()=>{r=null}),Oe())},i(a){s||(A(r),Dt(()=>{i||(i=ut(t,Vn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),i||(i=ut(t,Vn,{duration:150,x:5},!1)),i.run(0),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Au(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ut(e,Vn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=ut(e,Vn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function h1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[d1,c1],p=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=p[o]=d[o](n);let v=(n[0].length||n[7].length)&&Eu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),h(s,"class","ri-search-line"),h(i,"for",n[8]),h(i,"class","m-l-10 txt-xl"),h(t,"class","searchbar"),h(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),p[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[X(t,"submit",Bt(n[10])),X(e,"click",qn(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?p[o].p(b,y):(De(),P(p[C],1,1,()=>{p[C]=null}),Oe(),r=p[o],r?r.p(b,y):(r=p[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Eu(b),v.c(),A(v,1),v.m(t,null)):v&&(De(),P(v,1,1,()=>{v=null}),Oe())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),p[o].d(),v&&v.d(),f=!1,st(c)}}}function p1(n,e,t){const i=un(),s="search_"+Y.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new An}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function p(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ji(()=>import("./FilterAutocompleteInput.ec82b78a.js"),[])).default),t(5,f=!1))}Yn(()=>{v()});function b(M){ht.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){he[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const S=()=>{p(!1),g()};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,p,g,b,y,C,$,S]}class Vo extends Pe{constructor(e){super(),Ae(this,e,p1,h1,Ee,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Hr,zi;const jr="app-tooltip";function Pu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ai(){return zi=zi||document.querySelector("."+jr),zi||(zi=document.createElement("div"),zi.classList.add(jr),document.body.appendChild(zi)),zi}function cg(n,e){let t=Ai();if(!t.classList.contains("active")||!(e!=null&&e.text)){qr();return}t.textContent=e.text,t.className=jr+" active",e.class&&t.classList.add(e.class),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function qr(){clearTimeout(Hr),Ai().classList.remove("active"),Ai().activeNode=void 0}function m1(n,e){Ai().activeNode=n,clearTimeout(Hr),Hr=setTimeout(()=>{Ai().classList.add("active"),cg(n,e)},isNaN(e.delay)?250:e.delay)}function Ct(n,e){let t=Pu(e);function i(){m1(n,t)}function s(){qr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&Y.isFocusable(n))&&n.addEventListener("click",s),Ai(),{update(l){var o,r;t=Pu(l),(r=(o=Ai())==null?void 0:o.activeNode)!=null&&r.contains(n)&&cg(n,t)},destroy(){var l,o;(o=(l=Ai())==null?void 0:l.activeNode)!=null&&o.contains(n)&&qr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function g1(n){let e,t,i,s;return{c(){e=_("button"),e.innerHTML='<i class="ri-refresh-line svelte-b7gb6q"></i>',h(e,"type","button"),h(e,"class","btn btn-secondary btn-circle svelte-b7gb6q"),ee(e,"refreshing",n[1])},m(l,o){w(l,e,o),i||(s=[Qe(t=Ct.call(null,e,n[0])),X(e,"click",n[2])],i=!0)},p(l,[o]){t&&Wn(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&ee(e,"refreshing",l[1])},i:oe,o:oe,d(l){l&&k(e),i=!1,st(s)}}}function _1(n,e,t){const i=un();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)},200))}return Yn(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class zo extends Pe{constructor(e){super(),Ae(this,e,_1,g1,Ee,{tooltip:0})}}function b1(n){let e,t,i,s,l;const o=n[6].default,r=Mn(o,n,n[5],null);return{c(){e=_("th"),r&&r.c(),h(e,"tabindex","0"),h(e,"class",t="col-sort "+n[1]),ee(e,"col-sort-disabled",n[3]),ee(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ee(e,"sort-desc",n[0]==="-"+n[2]),ee(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[X(e,"click",n[7]),X(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Dn(r,o,a,a[5],i?Tn(o,a[5],u,null):On(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&h(e,"class",t),u&10&&ee(e,"col-sort-disabled",a[3]),u&7&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&ee(e,"sort-desc",a[0]==="-"+a[2]),u&7&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,st(l)}}}function v1(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 tn extends Pe{constructor(e){super(),Ae(this,e,v1,b1,Ee,{class:1,name:2,sort:0,disable:3})}}function y1(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function k1(n){let e,t=Y.formatToUTCDate(n[0])+"",i,s,l,o,r;return{c(){e=_("span"),i=R(t),s=R(" UTC"),h(e,"class","txt")},m(a,u){w(a,e,u),m(e,i),m(e,s),o||(r=Qe(l=Ct.call(null,e,Y.formatToLocalDate(n[0])+" Local")),o=!0)},p(a,u){u&1&&t!==(t=Y.formatToUTCDate(a[0])+"")&&me(i,t),l&&Wn(l.update)&&u&1&&l.update.call(null,Y.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),o=!1,r()}}}function w1(n){let e;function t(l,o){return l[0]?k1:y1}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function S1(n,e,t){let{date:i=""}=e;return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i]}class vi extends Pe{constructor(e){super(),Ae(this,e,S1,w1,Ee,{date:0})}}function Lu(n,e,t){const i=n.slice();return i[21]=e[t],i}function $1(n){let e;return{c(){e=_("div"),e.innerHTML=`<i class="ri-global-line"></i>
|
||
<span class="txt">method</span>`,h(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function C1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",h(t,"class",Y.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function M1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",h(t,"class",Y.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function T1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",h(t,"class",Y.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function D1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Fu(n){let e;function t(l,o){return l[6]?E1:O1}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function O1(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Iu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Iu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function E1(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Iu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Nu(n){let e;return{c(){e=_("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ru(n,e){var le,ue,Te;let t,i,s,l=((le=e[21].method)==null?void 0:le.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,p,g,v,b,y,C=(e[21].referer||"N/A")+"",$,S,M,D,E,O=e[21].status+"",F,L,H,j,Q,ne,B,K,W,J,ie=(((ue=e[21].meta)==null?void 0:ue.errorMessage)||((Te=e[21].meta)==null?void 0:Te.errorData))&&Nu();j=new vi({props:{date:e[21].created}});function fe(){return e[16](e[21])}function ye(...Z){return e[17](e[21],...Z)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=R(l),a=T(),u=_("td"),f=_("span"),d=R(c),g=T(),ie&&ie.c(),v=T(),b=_("td"),y=_("span"),$=R(C),M=T(),D=_("td"),E=_("span"),F=R(O),L=T(),H=_("td"),z(j.$$.fragment),Q=T(),ne=_("td"),ne.innerHTML='<i class="ri-arrow-right-line"></i>',B=T(),h(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",p=e[21].url),h(u,"class","col-type-text col-field-url"),h(y,"class","txt txt-ellipsis"),h(y,"title",S=e[21].referer),ee(y,"txt-hint",!e[21].referer),h(b,"class","col-type-text col-field-referer"),h(E,"class","label"),ee(E,"label-danger",e[21].status>=400),h(D,"class","col-type-number col-field-status"),h(H,"class","col-type-date col-field-created"),h(ne,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Z,be){w(Z,t,be),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ie&&ie.m(u,null),m(t,v),m(t,b),m(b,y),m(y,$),m(t,M),m(t,D),m(D,E),m(E,F),m(t,L),m(t,H),q(j,H,null),m(t,Q),m(t,ne),m(t,B),K=!0,W||(J=[X(t,"click",fe),X(t,"keydown",ye)],W=!0)},p(Z,be){var G,_e,je;e=Z,(!K||be&8)&&l!==(l=((G=e[21].method)==null?void 0:G.toUpperCase())+"")&&me(o,l),(!K||be&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&h(s,"class",r),(!K||be&8)&&c!==(c=e[21].url+"")&&me(d,c),(!K||be&8&&p!==(p=e[21].url))&&h(f,"title",p),((_e=e[21].meta)==null?void 0:_e.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?ie||(ie=Nu(),ie.c(),ie.m(u,null)):ie&&(ie.d(1),ie=null),(!K||be&8)&&C!==(C=(e[21].referer||"N/A")+"")&&me($,C),(!K||be&8&&S!==(S=e[21].referer))&&h(y,"title",S),be&8&&ee(y,"txt-hint",!e[21].referer),(!K||be&8)&&O!==(O=e[21].status+"")&&me(F,O),be&8&&ee(E,"label-danger",e[21].status>=400);const x={};be&8&&(x.date=e[21].created),j.$set(x)},i(Z){K||(A(j.$$.fragment,Z),K=!0)},o(Z){P(j.$$.fragment,Z),K=!1},d(Z){Z&&k(t),ie&&ie.d(),V(j),W=!1,st(J)}}}function Hu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&me(s,i),a&16&&me(o,r[4])},d(r){r&&k(e)}}}function ju(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[6]),ee(t,"btn-disabled",n[6]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&me(o,l),c&64&&ee(t,"btn-loading",f[6]),c&64&&ee(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function A1(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E=[],O=new Map,F,L,H,j;function Q(G){n[11](G)}let ne={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[$1]},$$scope:{ctx:n}};n[1]!==void 0&&(ne.sort=n[1]),l=new tn({props:ne}),he.push(()=>Ie(l,"sort",Q));function B(G){n[12](G)}let K={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[C1]},$$scope:{ctx:n}};n[1]!==void 0&&(K.sort=n[1]),a=new tn({props:K}),he.push(()=>Ie(a,"sort",B));function W(G){n[13](G)}let J={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[M1]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),c=new tn({props:J}),he.push(()=>Ie(c,"sort",W));function ie(G){n[14](G)}let fe={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[T1]},$$scope:{ctx:n}};n[1]!==void 0&&(fe.sort=n[1]),g=new tn({props:fe}),he.push(()=>Ie(g,"sort",ie));function ye(G){n[15](G)}let le={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[D1]},$$scope:{ctx:n}};n[1]!==void 0&&(le.sort=n[1]),y=new tn({props:le}),he.push(()=>Ie(y,"sort",ye));let ue=n[3];const Te=G=>G[21].id;for(let G=0;G<ue.length;G+=1){let _e=Lu(n,ue,G),je=Te(_e);O.set(je,E[G]=Ru(je,_e))}let Z=null;ue.length||(Z=Fu(n));let be=n[3].length&&Hu(n),x=n[3].length&&n[7]&&ju(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),z(l.$$.fragment),r=T(),z(a.$$.fragment),f=T(),z(c.$$.fragment),p=T(),z(g.$$.fragment),b=T(),z(y.$$.fragment),$=T(),S=_("th"),M=T(),D=_("tbody");for(let G=0;G<E.length;G+=1)E[G].c();Z&&Z.c(),F=T(),be&&be.c(),L=T(),x&&x.c(),H=rt(),h(S,"class","col-type-action min-width"),h(t,"class","table"),ee(t,"table-loading",n[6]),h(e,"class","table-wrapper")},m(G,_e){w(G,e,_e),m(e,t),m(t,i),m(i,s),q(l,s,null),m(s,r),q(a,s,null),m(s,f),q(c,s,null),m(s,p),q(g,s,null),m(s,b),q(y,s,null),m(s,$),m(s,S),m(t,M),m(t,D);for(let je=0;je<E.length;je+=1)E[je].m(D,null);Z&&Z.m(D,null),w(G,F,_e),be&&be.m(G,_e),w(G,L,_e),x&&x.m(G,_e),w(G,H,_e),j=!0},p(G,[_e]){const je={};_e&16777216&&(je.$$scope={dirty:_e,ctx:G}),!o&&_e&2&&(o=!0,je.sort=G[1],He(()=>o=!1)),l.$set(je);const Fe={};_e&16777216&&(Fe.$$scope={dirty:_e,ctx:G}),!u&&_e&2&&(u=!0,Fe.sort=G[1],He(()=>u=!1)),a.$set(Fe);const Re={};_e&16777216&&(Re.$$scope={dirty:_e,ctx:G}),!d&&_e&2&&(d=!0,Re.sort=G[1],He(()=>d=!1)),c.$set(Re);const re={};_e&16777216&&(re.$$scope={dirty:_e,ctx:G}),!v&&_e&2&&(v=!0,re.sort=G[1],He(()=>v=!1)),g.$set(re);const ae={};_e&16777216&&(ae.$$scope={dirty:_e,ctx:G}),!C&&_e&2&&(C=!0,ae.sort=G[1],He(()=>C=!1)),y.$set(ae),_e&841&&(ue=G[3],De(),E=ft(E,_e,Te,1,G,ue,O,D,Nt,Ru,null,Lu),Oe(),!ue.length&&Z?Z.p(G,_e):ue.length?Z&&(Z.d(1),Z=null):(Z=Fu(G),Z.c(),Z.m(D,null))),_e&64&&ee(t,"table-loading",G[6]),G[3].length?be?be.p(G,_e):(be=Hu(G),be.c(),be.m(L.parentNode,L)):be&&(be.d(1),be=null),G[3].length&&G[7]?x?x.p(G,_e):(x=ju(G),x.c(),x.m(H.parentNode,H)):x&&(x.d(1),x=null)},i(G){if(!j){A(l.$$.fragment,G),A(a.$$.fragment,G),A(c.$$.fragment,G),A(g.$$.fragment,G),A(y.$$.fragment,G);for(let _e=0;_e<ue.length;_e+=1)A(E[_e]);j=!0}},o(G){P(l.$$.fragment,G),P(a.$$.fragment,G),P(c.$$.fragment,G),P(g.$$.fragment,G),P(y.$$.fragment,G);for(let _e=0;_e<E.length;_e+=1)P(E[_e]);j=!1},d(G){G&&k(e),V(l),V(a),V(c),V(g),V(y);for(let _e=0;_e<E.length;_e+=1)E[_e].d();Z&&Z.d(),G&&k(F),be&&be.d(G),G&&k(L),x&&x.d(G),G&&k(H)}}}function P1(n,e,t){let i;const s=un(),l={get:"label-info",post:"label-success",patch:"label-warning",delete:"label-danger"};let{filter:o=""}=e,{presets:r=""}=e,{sort:a="-rowid"}=e,u=[],f=1,c=0,d=!1;async function p(O=1){return t(6,d=!0),we.Logs.getRequestsList(O,40,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(F=>{O<=1&&g(),t(6,d=!1),t(3,u=u.concat(F.items)),t(5,f=F.page),t(4,c=F.totalItems),s("load",u)}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),g(),we.errorResponseHandler(F,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(O){a=O,t(1,a)}function b(O){a=O,t(1,a)}function y(O){a=O,t(1,a)}function C(O){a=O,t(1,a)}function $(O){a=O,t(1,a)}const S=O=>s("select",O),M=(O,F)=>{F.code==="Enter"&&(F.preventDefault(),s("select",O))},D=()=>t(0,o=""),E=()=>p(f+1);return n.$$set=O=>{"filter"in O&&t(0,o=O.filter),"presets"in O&&t(10,r=O.presets),"sort"in O&&t(1,a=O.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),p(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,p,u,c,f,d,i,s,l,r,v,b,y,C,$,S,M,D,E]}class L1 extends Pe{constructor(e){super(),Ae(this,e,P1,A1,Ee,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*!
|
||
* Chart.js v3.8.0
|
||
* https://www.chartjs.org
|
||
* (c) 2022 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/const dg=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function hg(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,dg.call(window,()=>{s=!1,n.apply(e,l)}))}}function F1(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const I1=n=>n==="start"?"left":n==="end"?"right":"center",qu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function di(){}const N1=function(){let n=0;return function(){return n++}}();function Tt(n){return n===null||typeof n>"u"}function It(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 gt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const zt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Fn(n,e){return zt(n)?n:e}function bt(n,e){return typeof n>"u"?e:n}const R1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,pg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function jt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Mt(n,e,t,i){let s,l,o;if(It(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(gt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function vo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function yo(n){if(It(n))return n.map(yo);if(gt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=yo(n[t[s]]);return e}return n}function mg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function H1(n,e,t,i){if(!mg(n))return;const s=e[n],l=t[n];gt(s)&>(l)?ul(s,l,i):e[n]=yo(l)}function ul(n,e,t){const i=It(e)?e:[e],s=i.length;if(!gt(n))return n;t=t||{};const l=t.merger||H1;for(let o=0;o<s;++o){if(e=i[o],!gt(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function el(n,e){return ul(n,e,{merger:j1})}function j1(n,e,t){if(!mg(n))return;const i=e[n],s=t[n];gt(i)&>(s)?el(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=yo(s))}const q1="",V1=".";function Vu(n,e){const t=n.indexOf(V1,e);return t===-1?n.length:t}function Li(n,e){if(e===q1)return n;let t=0,i=Vu(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=Vu(e,t);return n}function va(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Bn=n=>typeof n<"u",Fi=n=>typeof n=="function",zu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function z1(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Vt=Math.PI,Pt=2*Vt,B1=Pt+Vt,ko=Number.POSITIVE_INFINITY,U1=Vt/180,qt=Vt/2,Rs=Vt/4,Bu=Vt*2/3,Rn=Math.log10,si=Math.sign;function Uu(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Rn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function W1(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function fl(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)<t}function Y1(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function gg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Gn(n){return n*(Vt/180)}function ya(n){return n*(180/Vt)}function Wu(n){if(!zt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function _g(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Vt&&(l+=Pt),{angle:l,distance:s}}function Vr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function K1(n,e){return(n-e+B1)%Pt-Vt}function Sn(n){return(n%Pt+Pt)%Pt}function cl(n,e,t,i){const s=Sn(n),l=Sn(e),o=Sn(t),r=Sn(l-s),a=Sn(o-s),u=Sn(s-l),f=Sn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function on(n,e,t){return Math.max(e,Math.min(t,n))}function Z1(n){return on(n,-32768,32767)}function dl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}const ql=n=>n===0||n===1,Yu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Pt/t)),Ku=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Pt/t)+1,nl={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*qt)+1,easeOutSine:n=>Math.sin(n*qt),easeInOutSine:n=>-.5*(Math.cos(Vt*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=>ql(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=>ql(n)?n:Yu(n,.075,.3),easeOutElastic:n=>ql(n)?n:Ku(n,.075,.3),easeInOutElastic(n){return ql(n)?n:n<.5?.5*Yu(n*2,.1125,.45):.5+.5*Ku(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-nl.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?nl.easeInBounce(n*2)*.5:nl.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 Sl(n){return n+.5|0}const Oi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ks(n){return Oi(Sl(n*2.55),0,255)}function Pi(n){return Oi(Sl(n*255),0,255)}function mi(n){return Oi(Sl(n/2.55)/100,0,1)}function Zu(n){return Oi(Sl(n*100),0,100)}const Ln={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zr=[..."0123456789ABCDEF"],J1=n=>zr[n&15],G1=n=>zr[(n&240)>>4]+zr[n&15],Vl=n=>(n&240)>>4===(n&15),X1=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Q1(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Ln[n[1]]*17,g:255&Ln[n[2]]*17,b:255&Ln[n[3]]*17,a:e===5?Ln[n[4]]*17:255}:(e===7||e===9)&&(t={r:Ln[n[1]]<<4|Ln[n[2]],g:Ln[n[3]]<<4|Ln[n[4]],b:Ln[n[5]]<<4|Ln[n[6]],a:e===9?Ln[n[7]]<<4|Ln[n[8]]:255})),t}const x1=(n,e)=>n<255?e(n):"";function ev(n){var e=X1(n)?J1:G1;return n?"#"+e(n.r)+e(n.g)+e(n.b)+x1(n.a,e):void 0}const tv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function bg(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 nv(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 iv(n,e,t){const i=bg(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 sv(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function ka(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=sv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function wa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Pi)}function Sa(n,e,t){return wa(bg,n,e,t)}function lv(n,e,t){return wa(iv,n,e,t)}function ov(n,e,t){return wa(nv,n,e,t)}function vg(n){return(n%360+360)%360}function rv(n){const e=tv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ks(+e[5]):Pi(+e[5]));const s=vg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=lv(s,l,o):e[1]==="hsv"?i=ov(s,l,o):i=Sa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function av(n,e){var t=ka(n);t[0]=vg(t[0]+e),t=Sa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function uv(n){if(!n)return;const e=ka(n),t=e[0],i=Zu(e[1]),s=Zu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${mi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Ju={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"},Gu={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 fv(){const n={},e=Object.keys(Gu),t=Object.keys(Ju);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s],r=r.replace(l,Ju[l]);l=parseInt(Gu[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let zl;function cv(n){zl||(zl=fv(),zl.transparent=[0,0,0,0]);const e=zl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const dv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function hv(n){const e=dv.exec(n);let t=255,i,s,l;if(!!e){if(e[7]!==i){const o=+e[7];t=e[8]?Ks(o):Oi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Ks(i):Oi(i,0,255)),s=255&(e[4]?Ks(s):Oi(s,0,255)),l=255&(e[6]?Ks(l):Oi(l,0,255)),{r:i,g:s,b:l,a:t}}}function pv(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${mi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const lr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,hs=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function mv(n,e,t){const i=hs(mi(n.r)),s=hs(mi(n.g)),l=hs(mi(n.b));return{r:Pi(lr(i+t*(hs(mi(e.r))-i))),g:Pi(lr(s+t*(hs(mi(e.g))-s))),b:Pi(lr(l+t*(hs(mi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Bl(n,e,t){if(n){let i=ka(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Sa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function yg(n,e){return n&&Object.assign(e||{},n)}function Xu(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=Pi(n[3]))):(e=yg(n,{r:0,g:0,b:0,a:1}),e.a=Pi(e.a)),e}function gv(n){return n.charAt(0)==="r"?hv(n):rv(n)}class wo{constructor(e){if(e instanceof wo)return e;const t=typeof e;let i;t==="object"?i=Xu(e):t==="string"&&(i=Q1(e)||cv(e)||gv(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=yg(this._rgb);return e&&(e.a=mi(e.a)),e}set rgb(e){this._rgb=Xu(e)}rgbString(){return this._valid?pv(this._rgb):void 0}hexString(){return this._valid?ev(this._rgb):void 0}hslString(){return this._valid?uv(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=mv(this._rgb,e._rgb,t)),this}clone(){return new wo(this.rgb)}alpha(e){return this._rgb.a=Pi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Sl(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 Bl(this._rgb,2,e),this}darken(e){return Bl(this._rgb,2,-e),this}saturate(e){return Bl(this._rgb,1,e),this}desaturate(e){return Bl(this._rgb,1,-e),this}rotate(e){return av(this._rgb,e),this}}function kg(n){return new wo(n)}function wg(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Qu(n){return wg(n)?n:kg(n)}function or(n){return wg(n)?n:kg(n).saturate(.5).darken(.1).hexString()}const ns=Object.create(null),Br=Object.create(null);function il(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const l=t[i];n=n[l]||(n[l]=Object.create(null))}return n}function rr(n,e,t){return typeof e=="string"?ul(il(n,e),t):ul(il(n,""),e)}class _v{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>or(i.backgroundColor),this.hoverBorderColor=(t,i)=>or(i.borderColor),this.hoverColor=(t,i)=>or(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 rr(this,e,t)}get(e){return il(this,e)}describe(e,t){return rr(Br,e,t)}override(e,t){return rr(ns,e,t)}route(e,t,i,s){const l=il(this,e),o=il(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 gt(a)?Object.assign({},u,a):bt(a,u)},set(a){this[r]=a}}})}}var vt=new _v({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function bv(n){return!n||Tt(n.size)||Tt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function So(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 vv(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;a<r;a++)if(c=t[a],c!=null&&It(c)!==!0)o=So(n,s,l,o,c);else if(It(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!It(d)&&(o=So(n,s,l,o,d));n.restore();const p=l.length/2;if(p>t.length){for(a=0;a<p;a++)delete s[l[a]];l.splice(0,p)}return o}function Bi(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function xu(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Ur(n,e,t,i){let s,l,o,r,a;const u=e.pointStyle,f=e.rotation,c=e.radius;let d=(f||0)*U1;if(u&&typeof u=="object"&&(s=u.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(d),n.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),n.restore();return}if(!(isNaN(c)||c<=0)){switch(n.beginPath(),u){default:n.arc(t,i,c,0,Pt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(d)*c,i-Math.cos(d)*c),d+=Bu,n.lineTo(t+Math.sin(d)*c,i-Math.cos(d)*c),d+=Bu,n.lineTo(t+Math.sin(d)*c,i-Math.cos(d)*c),n.closePath();break;case"rectRounded":a=c*.516,r=c-a,l=Math.cos(d+Rs)*r,o=Math.sin(d+Rs)*r,n.arc(t-l,i-o,a,d-Vt,d-qt),n.arc(t+o,i-l,a,d-qt,d),n.arc(t+l,i+o,a,d,d+qt),n.arc(t-o,i+l,a,d+qt,d+Vt),n.closePath();break;case"rect":if(!f){r=Math.SQRT1_2*c,n.rect(t-r,i-r,2*r,2*r);break}d+=Rs;case"rectRot":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+o,i-l),n.lineTo(t+l,i+o),n.lineTo(t-o,i+l),n.closePath();break;case"crossRot":d+=Rs;case"cross":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o),n.moveTo(t+o,i-l),n.lineTo(t-o,i+l);break;case"star":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o),n.moveTo(t+o,i-l),n.lineTo(t-o,i+l),d+=Rs,l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o),n.moveTo(t+o,i-l),n.lineTo(t-o,i+l);break;case"line":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(d)*c,i+Math.sin(d)*c);break}n.fill(),e.borderWidth>0&&n.stroke()}}function hl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function $a(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Ca(n){n.restore()}function yv(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){const l=(e.x+t.x)/2;n.lineTo(l,e.y),n.lineTo(l,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function kv(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function $o(n,e,t,i,s,l={}){const o=It(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,wv(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),Tt(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),Sv(n,t,i,u,l),i+=s.lineHeight;n.restore()}function wv(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Tt(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function Sv(n,e,t,i,s){if(s.strikethrough||s.underline){const l=n.measureText(i),o=e-l.actualBoundingBoxLeft,r=e+l.actualBoundingBoxRight,a=t-l.actualBoundingBoxAscent,u=t+l.actualBoundingBoxDescent,f=s.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function Co(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-qt,Vt,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,Vt,qt,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,qt,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-qt,!0),n.lineTo(t+o.topLeft,i)}const $v=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Cv=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Mv(n,e){const t=(""+n).match($v);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const Tv=n=>+n||0;function Ma(n,e){const t={},i=gt(e),s=i?Object.keys(e):e,l=gt(n)?i?o=>bt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=Tv(l(o));return t}function Sg(n){return Ma(n,{top:"y",right:"x",bottom:"y",left:"x"})}function bs(n){return Ma(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Un(n){const e=Sg(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Cn(n,e){n=n||{},e=e||vt.font;let t=bt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=bt(n.style,e.style);i&&!(""+i).match(Cv)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:bt(n.family,e.family),lineHeight:Mv(bt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:bt(n.weight,e.weight),string:""};return s.string=bv(s),s}function Ul(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;l<o;++l)if(r=n[l],r!==void 0&&(e!==void 0&&typeof r=="function"&&(r=r(e),s=!1),t!==void 0&&It(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function Dv(n,e,t){const{min:i,max:s}=n,l=pg(e,(s-i)/2),o=(r,a)=>t&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Ni(n,e){return Object.assign(Object.create(n),e)}function Ta(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Xi=(n,e,t)=>Ta(n,t,i=>n[i][e]<t),Ov=(n,e,t)=>Ta(n,t,i=>n[i][e]>=t);function Ev(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const $g=["push","pop","shift","splice","unshift"];function Av(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),$g.forEach(t=>{const i="_onData"+va(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 ef(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)&&($g.forEach(l=>{delete n[l]}),delete n._chartjs)}function Cg(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}function Da(n,e=[""],t=n,i,s=()=>n[0]){Bn(i)||(i=Og("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Da([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 Tg(o,r,()=>jv(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return nf(o).includes(r)},ownKeys(o){return nf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ss(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Mg(n,i),setContext:l=>Ss(n,l,t,i),override:l=>Ss(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return Tg(l,o,()=>Lv(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 Mg(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:Fi(t)?t:()=>t,isIndexable:Fi(i)?i:()=>i}}const Pv=(n,e)=>n?n+va(e):e,Oa=(n,e)=>gt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Tg(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function Lv(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Fi(r)&&o.isScriptable(e)&&(r=Fv(e,r,n,t)),It(r)&&r.length&&(r=Iv(e,r,n,o.isIndexable)),Oa(e,r)&&(r=Ss(r,s,l&&l[e],o)),r}function Fv(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),Oa(n,e)&&(e=Ea(s._scopes,s,n,e)),e}function Iv(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Bn(l.index)&&i(n))e=e[l.index%e.length];else if(gt(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ea(u,s,n,f);e.push(Ss(c,l,o&&o[n],r))}}return e}function Dg(n,e,t){return Fi(n)?n(e,t):n}const Nv=(n,e)=>n===!0?e:typeof n=="string"?Li(e,n):void 0;function Rv(n,e,t,i,s){for(const l of e){const o=Nv(t,l);if(o){n.add(o);const r=Dg(o._fallback,t,s);if(Bn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Bn(i)&&t!==i)return null}return!1}function Ea(n,e,t,i){const s=e._rootScopes,l=Dg(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=tf(r,o,t,l||t,i);return a===null||Bn(l)&&l!==t&&(a=tf(r,o,l,a,i),a===null)?!1:Da(Array.from(r),[""],s,l,()=>Hv(e,t,i))}function tf(n,e,t,i,s){for(;t;)t=Rv(n,e,t,i,s);return t}function Hv(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return It(s)&>(t)?t:s}function jv(n,e,t,i){let s;for(const l of e)if(s=Og(Pv(l,n),t),Bn(s))return Oa(n,s)?Ea(t,i,n,s):s}function Og(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Bn(i))return i}}function nf(n){let e=n._keys;return e||(e=n._keys=qv(n._scopes)),e}function qv(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 Eg(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;r<a;++r)u=r+t,f=e[u],o[r]={r:s.parse(Li(f,l),u)};return o}const Vv=Number.EPSILON||1e-14,$s=(n,e)=>e<n.length&&!n[e].skip&&n[e],Ag=n=>n==="x"?"y":"x";function zv(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Vr(l,s),a=Vr(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 Bv(n,e,t){const i=n.length;let s,l,o,r,a,u=$s(n,0);for(let f=0;f<i-1;++f)if(a=u,u=$s(n,f+1),!(!a||!u)){if(tl(e[f],0,Vv)){t[f]=t[f+1]=0;continue}s=t[f]/e[f],l=t[f+1]/e[f],r=Math.pow(s,2)+Math.pow(l,2),!(r<=9)&&(o=3/Math.sqrt(r),t[f]=s*o*e[f],t[f+1]=l*o*e[f])}}function Uv(n,e,t="x"){const i=Ag(t),s=n.length;let l,o,r,a=$s(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=$s(n,u+1),!r)continue;const f=r[t],c=r[i];o&&(l=(f-o[t])/3,r[`cp1${t}`]=f-l,r[`cp1${i}`]=c-l*e[u]),a&&(l=(a[t]-f)/3,r[`cp2${t}`]=f+l,r[`cp2${i}`]=c+l*e[u])}}function Wv(n,e="x"){const t=Ag(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=$s(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=$s(n,o+1),!!a){if(u){const f=u[e]-a[e];s[o]=f!==0?(u[t]-a[t])/f:0}l[o]=r?u?si(s[o-1])!==si(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Bv(n,s,l),Uv(n,l,e)}function Wl(n,e,t){return Math.max(Math.min(n,t),e)}function Yv(n,e){let t,i,s,l,o,r=hl(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&hl(n[t+1],e),l&&(s=n[t],o&&(s.cp1x=Wl(s.cp1x,e.left,e.right),s.cp1y=Wl(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Wl(s.cp2x,e.left,e.right),s.cp2y=Wl(s.cp2y,e.top,e.bottom)))}function Kv(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")Wv(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;l<o;++l)r=n[l],a=zv(u,r,n[Math.min(l+1,o-(i?0:1))%o],e.tension),r.cp1x=a.previous.x,r.cp1y=a.previous.y,r.cp2x=a.next.x,r.cp2y=a.next.y,u=r}e.capBezierPoints&&Yv(n,t)}function Pg(){return typeof window<"u"&&typeof document<"u"}function Aa(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Mo(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const Bo=n=>window.getComputedStyle(n,null);function Zv(n,e){return Bo(n).getPropertyValue(e)}const Jv=["top","right","bottom","left"];function es(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=Jv[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Gv=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Xv(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Gv(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Ki(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Bo(t),l=s.boxSizing==="border-box",o=es(s,"padding"),r=es(s,"border","width"),{x:a,y:u,box:f}=Xv(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:p,height:g}=e;return l&&(p-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/p*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Qv(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Aa(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Bo(l),a=es(r,"border","width"),u=es(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Mo(r.maxWidth,l,"clientWidth"),s=Mo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||ko,maxHeight:s||ko}}const ar=n=>Math.round(n*10)/10;function xv(n,e,t,i){const s=Bo(n),l=es(s,"margin"),o=Mo(s.maxWidth,n,"clientWidth")||ko,r=Mo(s.maxHeight,n,"clientHeight")||ko,a=Qv(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=es(s,"border","width"),d=es(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=ar(Math.min(u,o,a.maxWidth)),f=ar(Math.min(f,r,a.maxHeight)),u&&!f&&(f=ar(u/2)),{width:u,height:f}}function sf(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 ey=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 lf(n,e){const t=Zv(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Zi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function ty(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 ny(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Zi(n,s,t),r=Zi(s,l,t),a=Zi(l,e,t),u=Zi(o,r,t),f=Zi(r,a,t);return Zi(u,f,t)}const of=new Map;function iy(n,e){e=e||{};const t=n+JSON.stringify(e);let i=of.get(t);return i||(i=new Intl.NumberFormat(n,e),of.set(t,i)),i}function $l(n,e,t){return iy(e,t).format(n)}const sy=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}}},ly=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function ur(n,e,t){return n?sy(e,t):ly()}function oy(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 ry(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Lg(n){return n==="angle"?{between:cl,compare:K1,normalize:Sn}:{between:dl,compare:(e,t)=>e-t,normalize:e=>e}}function rf({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 ay(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=Lg(i),a=e.length;let{start:u,end:f,loop:c}=n,d,p;if(c){for(u+=a,f+=a,d=0,p=a;d<p&&o(r(e[u%a][i]),s,l);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function Fg(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=Lg(i),{start:f,end:c,loop:d,style:p}=ay(n,e,t),g=[];let v=!1,b=null,y,C,$;const S=()=>a(s,$,y)&&r(s,$)!==0,M=()=>r(l,y)===0||a(l,$,y),D=()=>v||S(),E=()=>!v||M();for(let O=f,F=f;O<=c;++O)C=e[O%o],!C.skip&&(y=u(C[i]),y!==$&&(v=a(y,s,l),b===null&&D()&&(b=r(y,s)===0?O:F),b!==null&&E()&&(g.push(rf({start:b,end:O,loop:d,count:o,style:p})),b=null),F=O,$=y));return b!==null&&g.push(rf({start:b,end:c,loop:d,count:o,style:p})),g}function Ig(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=Fg(i[s],n.points,e);l.length&&t.push(...l)}return t}function uy(n,e,t,i){let s=0,l=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(l+=s);l>s&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function fy(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 cy(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=uy(t,s,l,i);if(i===!0)return af(n,[{start:o,end:r,loop:l}],t,e);const a=r<o?r+s:r,u=!!n._fullLoop&&o===0&&r===s-1;return af(n,fy(t,o,a,u),t,e)}function af(n,e,t,i){return!i||!i.setContext||!t?e:dy(n,e,t,i)}function dy(n,e,t,i){const s=n._chart.getContext(),l=uf(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function p(g,v,b,y){const C=r?-1:1;if(g!==v){for(g+=a;t[g%a].skip;)g-=C;for(;t[v%a].skip;)v+=C;g%a!==v%a&&(u.push({start:g%a,end:v%a,loop:b,style:y}),f=y,c=v%a)}}for(const g of e){c=r?c:g.start;let v=t[c%a],b;for(d=c+1;d<=g.end;d++){const y=t[d%a];b=uf(i.setContext(Ni(s,{type:"segment",p0:v,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),hy(b,f)&&p(c,d-1,g.loop,f),v=y,f=b}c<d-1&&p(c,d-1,g.loop,f)}return u}function uf(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function hy(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}/*!
|
||
* Chart.js v3.8.0
|
||
* https://www.chartjs.org
|
||
* (c) 2022 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/class py{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=dg.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 hi=new py;const ff="transparent",my={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Qu(n||ff),s=i.valid&&Qu(e||ff);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class gy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||my[e.type||typeof o],this._easing=nl[e.easing]||nl.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=Ul([e.to,t,s,e.from]),this._from=Ul([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const _y=["x","y","borderWidth","radius","tension"],by=["color","borderColor","backgroundColor"];vt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const vy=Object.keys(vt.animation);vt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});vt.set("animations",{colors:{type:"color",properties:by},numbers:{type:"number",properties:_y}});vt.describe("animations",{_fallback:"animation"});vt.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 Ng{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!gt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!gt(s))return;const l={};for(const o of vy)l[o]=s[o];(It(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=ky(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&yy(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 gy(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 hi.add(this._chart,i),!0}}function yy(n,e){const t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const l=n[i[s]];l&&l.active()&&t.push(l.wait())}return Promise.all(t)}function ky(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function cf(n,e){const t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,l=t.max===void 0?e:0;return{start:i?l:s,end:i?s:l}}function wy(n,e,t){if(t===!1)return!1;const i=cf(n,t),s=cf(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Sy(n){let e,t,i,s;return gt(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function Rg(n,e){const t=[],i=n._getSortedDatasetMetas(e);let s,l;for(s=0,l=i.length;s<l;++s)t.push(i[s].index);return t}function df(n,e,t,i={}){const s=n.keys,l=i.mode==="single";let o,r,a,u;if(e!==null){for(o=0,r=s.length;o<r;++o){if(a=+s[o],a===t){if(i.all)continue;break}u=n.values[a],zt(u)&&(l||e===0||si(e)===si(u))&&(e+=u)}return e}}function $y(n){const e=Object.keys(n),t=new Array(e.length);let i,s,l;for(i=0,s=e.length;i<s;++i)l=e[i],t[i]={x:l,y:n[l]};return t}function hf(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function Cy(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function My(n){const{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function Ty(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function pf(n,e,t,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const l=n[s.index];if(t&&l>0||!t&&l<0)return s.index}return null}function mf(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=Cy(l,o,i),c=e.length;let d;for(let p=0;p<c;++p){const g=e[p],{[a]:v,[u]:b}=g,y=g._stacks||(g._stacks={});d=y[u]=Ty(s,f,v),d[r]=b,d._top=pf(d,o,!0,i.type),d._bottom=pf(d,o,!1,i.type)}}function fr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function Dy(n,e){return Ni(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Oy(n,e,t){return Ni(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Hs(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 cr=n=>n==="reset"||n==="none",gf=(n,e)=>e?n:Object.assign({},n),Ey=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Rg(t,!0),values:null};class fi{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=hf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Hs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,p,g)=>c==="x"?d:c==="r"?g:p,l=t.xAxisID=bt(i.xAxisID,fr(e,"x")),o=t.yAxisID=bt(i.yAxisID,fr(e,"y")),r=t.rAxisID=bt(i.rAxisID,fr(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&&ef(this._data,this),e._stacked&&Hs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(gt(t))this._data=$y(t);else if(i!==t){if(i){ef(i,this);const s=this._cachedMeta;Hs(s),s._parsed=[]}t&&Object.isExtensible(t)&&Av(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=hf(t.vScale,t),t.stack!==i.stack&&(s=!0,Hs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&mf(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{It(s[e])?d=this.parseArrayData(i,s,e,t):gt(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const p=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(p()&&(a=!1),u=c);i._sorted=a}o&&mf(this,d)}parsePrimitiveData(e,t,i,s){const{iScale:l,vScale:o}=e,r=l.axis,a=o.axis,u=l.getLabels(),f=l===o,c=new Array(s);let d,p,g;for(d=0,p=s;d<p;++d)g=d+i,c[d]={[r]:f||l.parse(u[g],g),[a]:o.parse(t[g],g)};return c}parseArrayData(e,t,i,s){const{xScale:l,yScale:o}=e,r=new Array(s);let a,u,f,c;for(a=0,u=s;a<u;++a)f=a+i,c=t[f],r[a]={x:l.parse(c[0],f),y:o.parse(c[1],f)};return r}parseObjectData(e,t,i,s){const{xScale:l,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(s);let f,c,d,p;for(f=0,c=s;f<c;++f)d=f+i,p=t[d],u[f]={x:l.parse(Li(p,r),d),y:o.parse(Li(p,a),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,l=this._cachedMeta,o=t[e.axis],r={keys:Rg(s,!0),values:t._stacks[e.axis]};return df(r,o,l.index,{mode:i})}updateRangeFromParsed(e,t,i,s){const l=i[t.axis];let o=l===null?NaN:l;const r=s&&i._stacks[t.axis];s&&r&&(s.values=r,o=df(s,l,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,s=i._parsed,l=i._sorted&&e===i.iScale,o=s.length,r=this._getOtherScale(e),a=Ey(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=My(r);let d,p;function g(){p=s[d];const v=p[r.axis];return!zt(p[e.axis])||f>v||c<v}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(u,e,p,a),l));++d);if(l){for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(u,e,p,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s<l;++s)o=t[s][e.axis],zt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,s=t.vScale,l=this.getParsed(e);return{label:i?""+i.getLabelForValue(l[i.axis]):"",value:s?""+s.getLabelForValue(l[s.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=Sy(bt(this.options.clip,wy(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],l=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,l,r,a),f=r;f<r+a;++f){const c=s[f];c.hidden||(c.active&&u?o.push(c):c.draw(e,l))}for(f=0;f<o.length;++f)o[f].draw(e,l)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let l;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];l=o.$context||(o.$context=Oy(this.getContext(),e,o)),l.parsed=this.getParsed(e),l.raw=s.data[e],l.index=l.dataIndex=e}else l=this.$context||(this.$context=Dy(this.chart.getContext(),this.index)),l.dataset=s,l.index=l.datasetIndex=this.index;return l.active=!!t,l.mode=i,l}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const s=t==="active",l=this._cachedDataOpts,o=e+"-"+t,r=l[o],a=this.enableOptionSharing&&Bn(i);if(r)return gf(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=s?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),p=Object.keys(vt.elements[e]),g=()=>this.getContext(i,s),v=u.resolveNamedOptions(d,p,g,c);return v.$shared&&(v.$shared=a,l[o]=Object.freeze(gf(v,a))),v}_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 Ng(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||cr(e)||this.chart._animationsDisabled}updateElement(e,t,i,s){cr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!cr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l<s&&this._removeElements(l,s-l)}_insertElements(e,t,i=!0){const s=this._cachedMeta,l=s.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r<o;++r)l[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(e,t),i&&this.updateElements(l,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&Hs(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}fi.defaults={};fi.prototype.datasetElementType=null;fi.prototype.dataElementType=null;function Ay(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let s=0,l=t.length;s<l;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=Cg(i.sort((s,l)=>s-l))}return n._cache.$bar}function Py(n){const e=n.iScale,t=Ay(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Bn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s<l;++s)o=e.getPixelForValue(t[s]),a();for(r=void 0,s=0,l=e.ticks.length;s<l;++s)o=e.getPixelForTick(s),a();return i}function Ly(n,e,t,i){const s=t.barThickness;let l,o;return Tt(s)?(l=e.min*t.categoryPercentage,o=t.barPercentage):(l=s*i,o=1),{chunk:l/i,ratio:o,start:e.pixels[n]-l/2}}function Fy(n,e,t,i){const s=e.pixels,l=s[n];let o=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const a=t.categoryPercentage;o===null&&(o=l-(r===null?e.end-e.start:r-l)),r===null&&(r=l+l-o);const u=l-(l-Math.min(o,r))/2*a;return{chunk:Math.abs(r-o)/2*a/i,ratio:t.barPercentage,start:u}}function Iy(n,e,t,i){const s=t.parse(n[0],i),l=t.parse(n[1],i),o=Math.min(s,l),r=Math.max(s,l);let a=o,u=r;Math.abs(o)>Math.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function Hg(n,e,t,i){return It(n)?Iy(n,e,t,i):e[t.axis]=t.parse(n,i),e}function _f(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u<f;++u)d=e[u],c={},c[s.axis]=r||s.parse(o[u],u),a.push(Hg(d,c,l,u));return a}function dr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Ny(n,e,t){return n!==0?si(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Ry(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",l="start"):(s="start",l="end"),{start:t,end:i,reverse:e,top:s,bottom:l}}function Hy(n,e,t,i){let s=e.borderSkipped;const l={};if(!s){n.borderSkipped=l;return}const{start:o,end:r,reverse:a,top:u,bottom:f}=Ry(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[bf(f,o,r,a)]=!0,s=u)),l[bf(s,o,r,a)]=!0,n.borderSkipped=l}function bf(n,e,t,i){return i?(n=jy(n,e,t),n=vf(n,t,e)):n=vf(n,e,t),n}function jy(n,e,t){return n===e?t:n===t?e:n}function vf(n,e,t){return n==="start"?e:n==="end"?t:n}function qy(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Pa extends fi{parsePrimitiveData(e,t,i,s){return _f(e,t,i,s)}parseArrayData(e,t,i,s){return _f(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:l,vScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=l.axis==="x"?r:a,f=o.axis==="x"?r:a,c=[];let d,p,g,v;for(d=i,p=i+s;d<p;++d)v=t[d],g={},g[l.axis]=l.parse(Li(v,u),d),c.push(Hg(Li(v,f),g,o,d));return c}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const l=i._custom;l&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,l.min),e.max=Math.max(e.max,l.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,l=this.getParsed(e),o=l._custom,r=dr(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(l[s.axis]);return{label:""+i.getLabelForValue(l[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const l=s==="reset",{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),u=r.isHorizontal(),f=this._getRuler(),c=this.resolveDataElementOptions(t,s),d=this.getSharedOptions(c),p=this.includeOptions(s,d);this.updateSharedOptions(d,s,c);for(let g=t;g<t+i;g++){const v=this.getParsed(g),b=l||Tt(v[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,f),C=(v._stacks||{})[r.axis],$={horizontal:u,base:b.base,enableBorderRadius:!C||dr(v._custom)||o===C._top||o===C._bottom,x:u?b.head:y.center,y:u?y.center:b.head,height:u?y.size:Math.abs(b.size),width:u?Math.abs(b.size):y.size};p&&($.options=d||this.resolveDataElementOptions(g,e[g].active?"active":s));const S=$.options||e[g].options;Hy($,S,C,o),qy($,S,f.ratio),this.updateElement(e[g],g,$,s)}}_getStacks(e,t){const s=this._cachedMeta.iScale,l=s.getMatchingVisibleMetas(this._type),o=s.options.stacked,r=l.length,a=[];let u,f;for(u=0;u<r;++u)if(f=l[u],!!f.controller.options.grouped){if(typeof t<"u"){const c=f.controller.getParsed(t)[f.controller._cachedMeta.vScale.axis];if(Tt(c)||isNaN(c))continue}if((o===!1||a.indexOf(f.stack)===-1||o===void 0&&f.stack===void 0)&&a.push(f.stack),f.index===e)break}return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l<o;++l)s.push(i.getPixelForValue(this.getParsed(l)[i.axis],l));const r=e.barThickness;return{min:r||Py(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i},options:{base:s,minBarLength:l}}=this,o=s||0,r=this.getParsed(e),a=r._custom,u=dr(a);let f=r[t.axis],c=0,d=i?this.applyStack(t,r,i):f,p,g;d!==f&&(c=d-f,d=f),u&&(f=a.barStart,d=a.barEnd-a.barStart,f!==0&&si(f)!==si(a.barEnd)&&(c=0),c+=f);const v=!Tt(s)&&!u?s:c;let b=t.getPixelForValue(v);if(this.chart.getDataVisibility(e)?p=t.getPixelForValue(c+d):p=b,g=p-b,Math.abs(g)<l){g=Ny(g,t,o)*l,f===o&&(b-=g/2);const y=t.getPixelForDecimal(0),C=t.getPixelForDecimal(1),$=Math.min(y,C),S=Math.max(y,C);b=Math.max(Math.min(b,S),$),p=b+g}if(b===t.getPixelForValue(o)){const y=si(g)*t.getLineWidthForValue(o)/2;b+=y,g-=y}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=bt(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?Fy(e,t,s,u):Ly(e,t,s,u),c=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*c+f.chunk/2,a=Math.min(o,f.chunk*f.ratio)}else r=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(o,t.min*t.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let l=0;for(;l<s;++l)this.getParsed(l)[t.axis]!==null&&i[l].draw(this._ctx)}}Pa.id="bar";Pa.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Pa.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class La extends fi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){const l=super.parsePrimitiveData(e,t,i,s);for(let o=0;o<l.length;o++)l[o]._custom=this.resolveDataElementOptions(o+i).radius;return l}parseArrayData(e,t,i,s){const l=super.parseArrayData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=bt(r[2],this.resolveDataElementOptions(o+i).radius)}return l}parseObjectData(e,t,i,s){const l=super.parseObjectData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=bt(r&&r.r&&+r.r,this.resolveDataElementOptions(o+i).radius)}return l}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,a=this.resolveDataElementOptions(t,s),u=this.getSharedOptions(a),f=this.includeOptions(s,u),c=o.axis,d=r.axis;for(let p=t;p<t+i;p++){const g=e[p],v=!l&&this.getParsed(p),b={},y=b[c]=l?o.getPixelForDecimal(.5):o.getPixelForValue(v[c]),C=b[d]=l?r.getBasePixel():r.getPixelForValue(v[d]);b.skip=isNaN(y)||isNaN(C),f&&(b.options=this.resolveDataElementOptions(p,g.active?"active":s),l&&(b.options.radius=0)),this.updateElement(g,p,b,s)}this.updateSharedOptions(u,s,a)}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const l=s.radius;return t!=="active"&&(s.radius=0),s.radius+=bt(i&&i._custom,l),s}}La.id="bubble";La.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};La.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function Vy(n,e,t){let i=1,s=1,l=0,o=0;if(e<Pt){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),c=Math.cos(a),d=Math.sin(a),p=($,S,M)=>cl($,r,a,!0)?1:Math.max(S,S*t,M,M*t),g=($,S,M)=>cl($,r,a,!0)?-1:Math.min(S,S*t,M,M*t),v=p(0,u,c),b=p(qt,f,d),y=g(Vt,u,c),C=g(Vt+qt,f,d);i=(v-y)/2,s=(b-C)/2,l=-(v+y)/2,o=-(b+C)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Cl extends fi{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(gt(i[e])){const{key:a="value"}=this._parsing;l=u=>+Li(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Gn(this.options.rotation-90)}_getCircumference(){return Gn(this.options.circumference)}_getRotationExtents(){let e=Pt,t=-Pt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,l=s._getRotation(),o=s._getCircumference();e=Math.min(e,l),t=Math.max(t,l+o)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,s=this._cachedMeta,l=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(l)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min(R1(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:p,offsetX:g,offsetY:v}=Vy(c,f,a),b=(i.width-o)/d,y=(i.height-o)/p,C=Math.max(Math.min(b,y)/2,0),$=pg(this.options.radius,C),S=Math.max($*a,0),M=($-S)/this._getVisibleDatasetWeightTotal();this.offsetX=g*$,this.offsetY=v*$,s.total=this.calculateTotal(),this.outerRadius=$-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*u,0),this.updateElements(l,0,l.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,l=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*l/Pt)}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,r=o.chartArea,u=o.options.animation,f=(r.left+r.right)/2,c=(r.top+r.bottom)/2,d=l&&u.animateScale,p=d?0:this.innerRadius,g=d?0:this.outerRadius,v=this.resolveDataElementOptions(t,s),b=this.getSharedOptions(v),y=this.includeOptions(s,b);let C=this._getRotation(),$;for($=0;$<t;++$)C+=this._circumference($,l);for($=t;$<t+i;++$){const S=this._circumference($,l),M=e[$],D={x:f+this.offsetX,y:c+this.offsetY,startAngle:C,endAngle:C+S,circumference:S,outerRadius:g,innerRadius:p};y&&(D.options=b||this.resolveDataElementOptions($,M.active?"active":s)),C+=S,this.updateElement(M,$,D,s)}this.updateSharedOptions(b,s,v)}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const l=e._parsed[s];l!==null&&!isNaN(l)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(l))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?Pt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;s<l;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),e=o.data,r=o.controller;break}}if(!e)return 0;for(s=0,l=e.length;s<l;++s)a=r.resolveDataElementOptions(s),a.borderAlign!=="inner"&&(t=Math.max(t,a.borderWidth||0,a.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){const l=this.resolveDataElementOptions(i);t=Math.max(t,l.offset||0,l.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(bt(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Cl.id="doughnut";Cl.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};Cl.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Cl.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 It(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Ml extends fi{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}=zy(t,s,o);this._drawStart=r,this._drawCount=a,By(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,f=this.resolveDataElementOptions(t,s),c=this.getSharedOptions(f),d=this.includeOptions(s,c),p=o.axis,g=r.axis,{spanGaps:v,segment:b}=this.options,y=fl(v)?v:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let S=t;S<t+i;++S){const M=e[S],D=this.getParsed(S),E=C?M:{},O=Tt(D[g]),F=E[p]=o.getPixelForValue(D[p],S),L=E[g]=l||O?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,D,a):D[g],S);E.skip=isNaN(F)||isNaN(L)||O,E.stop=S>0&&Math.abs(D[p]-$[p])>y,b&&(E.parsed=D,E.raw=u.data[S]),d&&(E.options=c||this.resolveDataElementOptions(S,M.active?"active":s)),C||this.updateElement(M,S,E,s),$=D}this.updateSharedOptions(c,s,f)}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()}}Ml.id="line";Ml.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Ml.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};function zy(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=on(Math.min(Xi(r,o.axis,u).lo,t?i:Xi(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=on(Math.max(Xi(r,o.axis,f).hi+1,t?0:Xi(e,a,o.getPixelForValue(f)).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function By(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}class Fa extends fi{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=$l(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return Eg.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(l<t.min&&(t.min=l),l>t.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Vt;let p=d,g;const v=360/this.countVisibleElements();for(g=0;g<t;++g)p+=this._computeAngle(g,s,v);for(g=t;g<t+i;g++){const b=e[g];let y=p,C=p+this._computeAngle(g,s,v),$=o.getDataVisibility(g)?u.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=C,l&&(a.animateScale&&($=0),a.animateRotate&&(y=C=d));const S={x:f,y:c,innerRadius:0,outerRadius:$,startAngle:y,endAngle:C,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,S,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Gn(this.resolveDataElementOptions(e,t).angle||i):0}}Fa.id="polarArea";Fa.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Fa.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 jg extends Cl{}jg.id="pie";jg.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ia extends fi{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 Eg.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r<t+i;r++){const a=e[r],u=this.resolveDataElementOptions(r,a.active?"active":s),f=l.getPointPositionForValue(r,this.getParsed(r).r),c=o?l.xCenter:f.x,d=o?l.yCenter:f.y,p={x:c,y:d,angle:f.angle,skip:isNaN(c)||isNaN(d),options:u};this.updateElement(a,r,p,s)}}}Ia.id="radar";Ia.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Ia.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Na extends Ml{}Na.id="scatter";Na.defaults={showLine:!1,fill:!1};Na.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Ui(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Wr{constructor(e){this.options=e||{}}formats(){return Ui()}parse(e,t){return Ui()}format(e,t){return Ui()}add(e,t,i){return Ui()}diff(e,t,i){return Ui()}startOf(e,t,i){return Ui()}endOf(e,t){return Ui()}}Wr.override=function(n){Object.assign(Wr.prototype,n)};var qg={_date:Wr};function Uy(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?Ov:Xi;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 Tl(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r<a;++r){const{index:u,data:f}=l[r],{lo:c,hi:d}=Uy(l[r],e,o,s);for(let p=c;p<=d;++p){const g=f[p];g.skip||i(g,u,p)}}}function Wy(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){const l=e?Math.abs(i.x-s.x):0,o=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(l,2)+Math.pow(o,2))}}function hr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Tl(n,t,e,function(r,a,u){!s&&!hl(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function Yy(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=_g(o,{x:e.x,y:e.y});cl(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Tl(n,t,e,l),s}function Ky(n,e,t,i,s,l){let o=[];const r=Wy(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const p=f.inRange(e.x,e.y,s);if(i&&!p)return;const g=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(g))&&!p)return;const b=r(e,g);b<a?(o=[{element:f,datasetIndex:c,index:d}],a=b):b===a&&o.push({element:f,datasetIndex:c,index:d})}return Tl(n,t,e,u),o}function pr(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?Yy(n,e,t,s):Ky(n,e,t,i,s,l)}function yf(n,e,t,i,s){const l=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Tl(n,t,e,(a,u,f)=>{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var Zy={evaluateInteractionItems:Tl,modes:{index(n,e,t,i){const s=Ki(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?hr(n,s,l,i,o):pr(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=Ki(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?hr(n,s,l,i,o):pr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;f<u.length;++f)r.push({element:u[f],datasetIndex:a,index:f})}return r},point(n,e,t,i){const s=Ki(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return hr(n,s,l,i,o)},nearest(n,e,t,i){const s=Ki(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return pr(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Ki(e,n);return yf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Ki(e,n);return yf(n,s,"y",t.intersect,i)}}};const Vg=["left","top","right","bottom"];function js(n,e){return n.filter(t=>t.pos===e)}function kf(n,e){return n.filter(t=>Vg.indexOf(t.pos)===-1&&t.box.axis===e)}function qs(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 Jy(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:l,options:{stack:o,stackWeight:r=1}}=s,e.push({index:t,box:s,pos:l,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&l+o,stackWeight:r});return e}function Gy(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!Vg.includes(s))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=l}return e}function Xy(n,e){const t=Gy(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let l,o,r;for(l=0,o=n.length;l<o;++l){r=n[l];const{fullSize:a}=r.box,u=t[r.stack],f=u&&r.stackWeight/u.weight;r.horizontal?(r.width=f?f*i:a&&e.availableWidth,r.height=s):(r.width=i,r.height=f?f*s:a&&e.availableHeight)}return t}function Qy(n){const e=Jy(n),t=qs(e.filter(u=>u.box.fullSize),!0),i=qs(js(e,"left"),!0),s=qs(js(e,"right")),l=qs(js(e,"top"),!0),o=qs(js(e,"bottom")),r=kf(e,"x"),a=kf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:js(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function wf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function zg(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 xy(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!gt(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&&zg(o,l.getPadding());const r=Math.max(0,e.outerWidth-wf(o,n,"left","right")),a=Math.max(0,e.outerHeight-wf(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 ek(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 tk(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 Zs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l<o;++l){r=n[l],a=r.box,a.update(r.width||e.w,r.height||e.h,tk(r.horizontal,e));const{same:c,other:d}=xy(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&Zs(s,e,t,i)||f}function Yl(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function Sf(n,e,t,i){const s=t.padding;let{x:l,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{count:1,placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const c=e.w*f,d=u.size||a.height;Bn(u.start)&&(o=u.start),a.fullSize?Yl(a,s.left,o,t.outerWidth-s.right-s.left,d):Yl(a,e.left+u.placed,o,c,d),u.start=o,u.placed+=c,o=a.bottom}else{const c=e.h*f,d=u.size||a.width;Bn(u.start)&&(l=u.start),a.fullSize?Yl(a,l,s.top,d,t.outerHeight-s.bottom-s.top):Yl(a,l,e.top+u.placed,d,c),u.start=l,u.placed+=c,l=a.right}}e.x=l,e.y=o}vt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Kl={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const s=Un(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=Qy(n.boxes),a=r.vertical,u=r.horizontal;Mt(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const f=a.reduce((v,b)=>b.box.options&&b.box.options.display===!1?v:v+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);zg(d,Un(i));const p=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=Xy(a.concat(u),c);Zs(r.fullSize,p,c,g),Zs(a,p,c,g),Zs(u,p,c,g)&&Zs(a,p,c,g),ek(p),Sf(r.leftAndTop,p,c,g),p.x+=p.w,p.y+=p.h,Sf(r.rightAndBottom,p,c,g),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Mt(r.chartArea,v=>{const b=v.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Bg{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 nk extends Bg{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ro="$chartjs",ik={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$f=n=>n===null||n==="";function sk(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ro]={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",$f(s)){const l=lf(n,"width");l!==void 0&&(n.width=l)}if($f(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=lf(n,"height");l!==void 0&&(n.height=l)}return n}const Ug=ey?{passive:!0}:!1;function lk(n,e,t){n.addEventListener(e,t,Ug)}function ok(n,e,t){n.canvas.removeEventListener(e,t,Ug)}function rk(n,e){const t=ik[n.type]||n.type,{x:i,y:s}=Ki(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function To(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function ak(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||To(r.addedNodes,i),o=o&&!To(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function uk(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||To(r.removedNodes,i),o=o&&!To(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const pl=new Map;let Cf=0;function Wg(){const n=window.devicePixelRatio;n!==Cf&&(Cf=n,pl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function fk(n,e){pl.size||window.addEventListener("resize",Wg),pl.set(n,e)}function ck(n){pl.delete(n),pl.size||window.removeEventListener("resize",Wg)}function dk(n,e,t){const i=n.canvas,s=i&&Aa(i);if(!s)return;const l=hg((r,a)=>{const u=s.clientWidth;t(r,a),u<s.clientWidth&&t()},window),o=new ResizeObserver(r=>{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),fk(n,l),o}function mr(n,e,t){t&&t.disconnect(),e==="resize"&&ck(n)}function hk(n,e,t){const i=n.canvas,s=hg(l=>{n.ctx!==null&&t(rk(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return lk(i,e,s),s}class pk extends Bg{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(sk(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ro])return!1;const i=t[ro].initial;["height","width"].forEach(l=>{const o=i[l];Tt(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[ro],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:ak,detach:uk,resize:dk}[t]||hk;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:mr,detach:mr,resize:mr}[t]||ok)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return xv(e,t,i,s)}isAttached(e){const t=Aa(e);return!!(t&&t.isConnected)}}function mk(n){return!Pg()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?nk:pk}class ki{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return fl(this.x)&&fl(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(l=>{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}ki.defaults={};ki.defaultRoutes=void 0;const Yg={values(n){return It(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=gk(n,t)}const o=Rn(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),$l(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Rn(n)));return i===1||i===2||i===5?Yg.numeric.call(this,n,e,t):""}};function gk(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 Uo={formatters:Yg};vt.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:Uo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});vt.route("scale.ticks","color","","color");vt.route("scale.grid","color","","borderColor");vt.route("scale.grid","borderColor","","borderColor");vt.route("scale.title","color","","color");vt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});vt.describe("scales",{_fallback:"scale"});vt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function _k(n,e){const t=n.options.ticks,i=t.maxTicksLimit||bk(n),s=t.major.enabled?yk(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return kk(e,a,s,l/i),a;const u=vk(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Zl(e,a,u,Tt(d)?0:o-d,o),f=0,c=l-1;f<c;f++)Zl(e,a,u,s[f],s[f+1]);return Zl(e,a,u,r,Tt(d)?e.length:r+d),a}return Zl(e,a,u),a}function bk(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function vk(n,e,t){const i=wk(n),s=e.length/t;if(!i)return Math.max(s,1);const l=W1(i);for(let o=0,r=l.length-1;o<r;o++){const a=l[o];if(a>s)return a}return Math.max(s,1)}function yk(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function kk(n,e,t,i){let s=0,l=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===l&&(e.push(n[o]),s++,l=t[s*i])}function Zl(n,e,t,i,s){const l=bt(i,0),o=Math.min(bt(s,n.length),n.length);let r=0,a,u,f;for(t=Math.ceil(t),s&&(a=s-i,t=a/Math.floor(a/t)),f=l;f<0;)r++,f=Math.round(l+r*t);for(u=Math.max(l,0);u<o;u++)u===f&&(e.push(n[u]),r++,f=Math.round(l+r*t))}function wk(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const Sk=n=>n==="left"?"right":n==="right"?"left":n,Mf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Tf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;l<s;l+=i)t.push(n[Math.floor(l)]);return t}function $k(n,e,t){const i=n.ticks.length,s=Math.min(e,i-1),l=n._startPixel,o=n._endPixel,r=1e-6;let a=n.getPixelForTick(s),u;if(!(t&&(i===1?u=Math.max(a-l,o-a):e===0?u=(n.getPixelForTick(1)-a)/2:u=(a-n.getPixelForTick(s-1))/2,a+=s<e?u:-u,a<l-r||a>o+r)))return a}function Ck(n,e){Mt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;l<s;++l)delete t.data[i[l]];i.splice(0,s)}})}function Vs(n){return n.drawTicks?n.tickLength:0}function Df(n,e){if(!n.display)return 0;const t=Cn(n.font,e),i=Un(n.padding);return(It(n.text)?n.text.length:1)*t.lineHeight+i.height}function Mk(n,e){return Ni(n,{scale:e,type:"scale"})}function Tk(n,e,t){return Ni(n,{tick:t,index:e,type:"tick"})}function Dk(n,e,t){let i=I1(n);return(t&&e!=="right"||!t&&e==="right")&&(i=Sk(i)),i}function Ok(n,e,t,i){const{top:s,left:l,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,p,g;const v=o-s,b=r-l;if(n.isHorizontal()){if(p=qu(i,l,r),gt(t)){const y=Object.keys(t)[0],C=t[y];g=f[y].getPixelForValue(C)+v-e}else t==="center"?g=(u.bottom+u.top)/2+v-e:g=Mf(n,t,e);d=r-l}else{if(gt(t)){const y=Object.keys(t)[0],C=t[y];p=f[y].getPixelForValue(C)-b+e}else t==="center"?p=(u.left+u.right)/2-b+e:p=Mf(n,t,e);g=qu(i,o,s),c=t==="left"?-qt:qt}return{titleX:p,titleY:g,maxWidth:d,rotation:c}}class ls extends ki{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=Fn(e,Number.POSITIVE_INFINITY),t=Fn(t,Number.NEGATIVE_INFINITY),i=Fn(i,Number.POSITIVE_INFINITY),s=Fn(s,Number.NEGATIVE_INFINITY),{min:Fn(e,i),max:Fn(t,s),minDefined:zt(e),maxDefined:zt(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:l}=this.getUserBounds(),o;if(s&&l)return{min:t,max:i};const r=this.getMatchingVisibleMetas();for(let a=0,u=r.length;a<u;++a)o=r[a].controller.getMinMax(this,e),s||(t=Math.min(t,o.min)),l||(i=Math.max(i,o.max));return t=l&&t>i?i:t,i=s&&t>i?t:i,{min:Fn(t,Fn(i,t)),max:Fn(i,Fn(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(){jt(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=Dv(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Tf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=_k(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){jt(this.options.afterUpdate,[this])}beforeSetDimensions(){jt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){jt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),jt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){jt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,s,l;for(i=0,s=e.length;i<s;i++)l=e[i],l.label=jt(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=this.ticks.length,s=t.minRotation||0,l=t.maxRotation;let o=s,r,a,u;if(!this._isVisible()||!t.display||s>=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,p=on(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:p/(i-1),c+6>r&&(r=p/(i-(e.offset?.5:1)),a=this.maxHeight-Vs(e.grid)-t.padding-Df(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=ya(Math.min(Math.asin(on((f.highest.height+6)/r,-1,1)),Math.asin(on(a/u,-1,1))-Math.asin(on(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){jt(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=Df(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Vs(l)+a):(e.height=this.maxHeight,e.width=Vs(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),p=i.padding*2,g=Gn(this.labelRotation),v=Math.cos(g),b=Math.sin(g);if(r){const y=i.mirror?0:b*c.width+v*d.height;e.height=Math.min(this.maxHeight,e.height+y+p)}else{const y=i.mirror?0:v*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+p)}this._calculatePadding(u,f,b,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,p=0;a?u?(d=s*e.width,p=i*t.height):(d=i*e.height,p=s*t.width):l==="start"?p=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,p=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((p-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(){jt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)Tt(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=Tf(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){const{ctx:i,_longestTextCache:s}=this,l=[],o=[];let r=0,a=0,u,f,c,d,p,g,v,b,y,C,$;for(u=0;u<t;++u){if(d=e[u].label,p=this._resolveTickFontOptions(u),i.font=g=p.string,v=s[g]=s[g]||{data:{},gc:[]},b=p.lineHeight,y=C=0,!Tt(d)&&!It(d))y=So(i,v.data,v.gc,y,d),C=b;else if(It(d))for(f=0,c=d.length;f<c;++f)$=d[f],!Tt($)&&!It($)&&(y=So(i,v.data,v.gc,y,$),C+=b);l.push(y),o.push(C),r=Math.max(y,r),a=Math.max(C,a)}Ck(s,t);const S=l.indexOf(r),M=o.indexOf(a),D=E=>({width:l[E]||0,height:o[E]||0});return{first:D(0),last:D(t-1),widest:D(S),highest:D(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 Z1(this._alignToPixels?Bi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=Tk(this.getContext(),e,i))}return this.$context||(this.$context=Mk(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Gn(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),l=this._getLabelSizes(),o=e.autoSkipPadding||0,r=l?l.widest.width+o:0,a=l?l.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Vs(l),d=[],p=l.setContext(this.getContext()),g=p.drawBorder?p.borderWidth:0,v=g/2,b=function(B){return Bi(i,B,g)};let y,C,$,S,M,D,E,O,F,L,H,j;if(o==="top")y=b(this.bottom),D=this.bottom-c,O=y-v,L=b(e.top)+v,j=e.bottom;else if(o==="bottom")y=b(this.top),L=e.top,j=b(e.bottom)-v,D=y+v,O=this.top+c;else if(o==="left")y=b(this.right),M=this.right-c,E=y-v,F=b(e.left)+v,H=e.right;else if(o==="right")y=b(this.left),F=e.left,H=b(e.right)-v,M=y+v,E=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(gt(o)){const B=Object.keys(o)[0],K=o[B];y=b(this.chart.scales[B].getPixelForValue(K))}L=e.top,j=e.bottom,D=y+v,O=D+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(gt(o)){const B=Object.keys(o)[0],K=o[B];y=b(this.chart.scales[B].getPixelForValue(K))}M=y-v,E=M-c,F=e.left,H=e.right}const Q=bt(s.ticks.maxTicksLimit,f),ne=Math.max(1,Math.ceil(f/Q));for(C=0;C<f;C+=ne){const B=l.setContext(this.getContext(C)),K=B.lineWidth,W=B.color,J=l.borderDash||[],ie=B.borderDashOffset,fe=B.tickWidth,ye=B.tickColor,le=B.tickBorderDash||[],ue=B.tickBorderDashOffset;$=$k(this,C,r),$!==void 0&&(S=Bi(i,$,K),a?M=E=F=H=S:D=O=L=j=S,d.push({tx1:M,ty1:D,tx2:E,ty2:O,x1:F,y1:L,x2:H,y2:j,width:K,color:W,borderDash:J,borderDashOffset:ie,tickWidth:fe,tickColor:ye,tickBorderDash:le,tickBorderDashOffset:ue}))}return this._ticksLength=f,this._borderValue=y,d}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:l}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:c}=l,d=Vs(i.grid),p=d+f,g=c?-f:p,v=-Gn(this.labelRotation),b=[];let y,C,$,S,M,D,E,O,F,L,H,j,Q="middle";if(s==="top")D=this.bottom-g,E=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+g,E=this._getXAxisLabelAlignment();else if(s==="left"){const B=this._getYAxisLabelAlignment(d);E=B.textAlign,M=B.x}else if(s==="right"){const B=this._getYAxisLabelAlignment(d);E=B.textAlign,M=B.x}else if(t==="x"){if(s==="center")D=(e.top+e.bottom)/2+p;else if(gt(s)){const B=Object.keys(s)[0],K=s[B];D=this.chart.scales[B].getPixelForValue(K)+p}E=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")M=(e.left+e.right)/2-p;else if(gt(s)){const B=Object.keys(s)[0],K=s[B];M=this.chart.scales[B].getPixelForValue(K)}E=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?Q="top":a==="end"&&(Q="bottom"));const ne=this._getLabelSizes();for(y=0,C=r.length;y<C;++y){$=r[y],S=$.label;const B=l.setContext(this.getContext(y));O=this.getPixelForTick(y)+l.labelOffset,F=this._resolveTickFontOptions(y),L=F.lineHeight,H=It(S)?S.length:1;const K=H/2,W=B.color,J=B.textStrokeColor,ie=B.textStrokeWidth;let fe=E;o?(M=O,E==="inner"&&(y===C-1?fe=this.options.reverse?"left":"right":y===0?fe=this.options.reverse?"right":"left":fe="center"),s==="top"?u==="near"||v!==0?j=-H*L+L/2:u==="center"?j=-ne.highest.height/2-K*L+L:j=-ne.highest.height+L/2:u==="near"||v!==0?j=L/2:u==="center"?j=ne.highest.height/2-K*L:j=ne.highest.height-H*L,c&&(j*=-1)):(D=O,j=(1-H)*L/2);let ye;if(B.showLabelBackdrop){const le=Un(B.backdropPadding),ue=ne.heights[y],Te=ne.widths[y];let Z=D+j-le.top,be=M-le.left;switch(Q){case"middle":Z-=ue/2;break;case"bottom":Z-=ue;break}switch(E){case"center":be-=Te/2;break;case"right":be-=Te;break}ye={left:be,top:Z,width:Te+le.width,height:ue+le.height,color:B.backdropColor}}b.push({rotation:v,label:S,font:F,color:W,strokeColor:J,strokeWidth:ie,textOffset:j,textAlign:fe,textBaseline:Q,translation:[M,D],backdrop:ye})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Gn(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:l}}=this.options,o=this._getLabelSizes(),r=e+l,a=o.widest.width;let u,f;return t==="left"?s?(f=this.right+l,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?s?(f=this.left+l,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:l,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,l,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(l=>l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l<o;++l){const a=s[l];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),l=i.drawBorder?s.borderWidth:0;if(!l)return;const o=i.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let a,u,f,c;this.isHorizontal()?(a=Bi(e,this.left,l)-l/2,u=Bi(e,this.right,o)+o/2,f=c=r):(f=Bi(e,this.top,l)-l/2,c=Bi(e,this.bottom,o)+o/2,a=u=r),t.save(),t.lineWidth=s.borderWidth,t.strokeStyle=s.borderColor,t.beginPath(),t.moveTo(a,f),t.lineTo(u,c),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&$a(i,s);const l=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=l.length;o<r;++o){const a=l[o],u=a.font,f=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let c=a.textOffset;$o(i,f,0,c,u,a)}s&&Ca(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=Cn(i.font),o=Un(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||gt(t)?(a+=o.bottom,It(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=Ok(this,a,t,r);$o(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:Dk(r,t,s),textBaseline:"middle",translation:[u,f]})}draw(e){!this._isVisible()||(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=bt(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==ls.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l<o;++l){const r=t[l];r[i]===this.id&&(!e||r.type===e)&&s.push(r)}return s}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return Cn(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Jl{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;Pk(t)&&(i=this.register(t));const s=this.items,l=e.id,o=this.scope+"."+l;if(!l)throw new Error("class does not have id: "+e);return l in s||(s[l]=e,Ek(e,o,i),this.override&&vt.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in vt[s]&&(delete vt[s][i],this.override&&delete ns[i])}}function Ek(n,e,t){const i=ul(Object.create(null),[t?vt.get(t):{},vt.get(e),n.defaults]);vt.set(e,i),n.defaultRoutes&&Ak(e,n.defaultRoutes),n.descriptors&&vt.describe(e,n.descriptors)}function Ak(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");vt.route(l,s,a,r)})}function Pk(n){return"id"in n&&"defaults"in n}class Lk{constructor(){this.controllers=new Jl(fi,"datasets",!0),this.elements=new Jl(ki,"elements"),this.plugins=new Jl(Object,"plugins"),this.scales=new Jl(ls,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):Mt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=va(e);jt(i["before"+s],[],i),t[e](i),jt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var _i=new Lk;class Fk{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(jt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Tt(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=bt(i.options&&i.options.plugins,{}),l=Ik(i);return s===!1&&!t?[]:Rk(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 Ik(n){const e=[],t=Object.keys(_i.plugins.items);for(let s=0;s<t.length;s++)e.push(_i.getPlugin(t[s]));const i=n.plugins||[];for(let s=0;s<i.length;s++){const l=i[s];e.indexOf(l)===-1&&e.push(l)}return e}function Nk(n,e){return!e&&n===!1?null:n===!0?{}:n}function Rk(n,e,t,i){const s=[],l=n.getContext();for(let o=0;o<e.length;o++){const r=e[o],a=r.id,u=Nk(t[a],i);u!==null&&s.push({plugin:r,options:Hk(n.config,r,u,l)})}return s}function Hk(n,e,t,i){const s=n.pluginScopeKeys(e),l=n.getOptionScopes(t,s);return n.createResolver(l,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Yr(n,e){const t=vt.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function jk(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function qk(n,e){return n===e?"_index_":"_value_"}function Vk(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Kr(n,e){return n==="x"||n==="y"?n:e.axis||Vk(e.position)||n.charAt(0).toLowerCase()}function zk(n,e){const t=ns[n.type]||{scales:{}},i=e.scales||{},s=Yr(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!gt(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=Kr(r,a),f=qk(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=el(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||Yr(a,e),c=(ns[a]||{}).scales||{};Object.keys(c).forEach(d=>{const p=jk(d,u),g=r[p+"AxisID"]||l[p]||p;o[g]=o[g]||Object.create(null),el(o[g],[{axis:p},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];el(a,[vt.scales[a.type],vt.scale])}),o}function Kg(n){const e=n.options||(n.options={});e.plugins=bt(e.plugins,{}),e.scales=zk(n,e)}function Zg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Bk(n){return n=n||{},n.data=Zg(n.data),Kg(n),n}const Of=new Map,Jg=new Set;function Gl(n,e){let t=Of.get(n);return t||(t=e(),Of.set(n,t),Jg.add(t)),t}const zs=(n,e,t)=>{const i=Li(e,t);i!==void 0&&n.add(i)};class Uk{constructor(e){this._config=Bk(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=Zg(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(),Kg(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gl(`${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=>zs(a,e,c))),f.forEach(c=>zs(a,s,c)),f.forEach(c=>zs(a,ns[l]||{},c)),f.forEach(c=>zs(a,vt,c)),f.forEach(c=>zs(a,Br,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Jg.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,ns[t]||{},vt.datasets[t]||{},{type:t},vt,Br]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Ef(this._resolverCache,e,s);let a=o;if(Yk(o,t)){l.$shared=!1,i=Fi(i)?i():i;const u=this.createResolver(e,i,r);a=Ss(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Ef(this._resolverCache,e,i);return gt(t)?Ss(l,t,void 0,s):l}}function Ef(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:Da(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const Wk=n=>gt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Fi(n[t]),!1);function Yk(n,e){const{isScriptable:t,isIndexable:i}=Mg(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Fi(r)||Wk(r))||o&&It(r))return!0}return!1}var Kk="3.8.0";const Zk=["top","bottom","left","right","chartArea"];function Af(n,e){return n==="top"||n==="bottom"||Zk.indexOf(n)===-1&&e==="x"}function Pf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Lf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),jt(t&&t.onComplete,[n],e)}function Jk(n){const e=n.chart,t=e.options.animation;jt(t&&t.onProgress,[n],e)}function Gg(n){return Pg()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Do={},Xg=n=>{const e=Gg(n);return Object.values(Do).filter(t=>t.canvas===e).pop()};function Gk(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 Xk(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Oo{constructor(e,t){const i=this.config=new Uk(t),s=Gg(e),l=Xg(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||mk(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=N1(),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 Fk,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=F1(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Do[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}hi.listen(this,"complete",Lf),hi.listen(this,"progress",Jk),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Tt(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():sf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return xu(this.canvas,this.ctx),this}stop(){return hi.stop(this),this}resize(e,t){hi.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,sf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),jt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Mt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=Kr(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Mt(l,o=>{const r=o.options,a=r.id,u=Kr(a,r),f=bt(r.type,o.dtype);(r.position===void 0||Af(r.position,u)!==Af(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=_i.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),Mt(s,(o,r)=>{o||delete i[r]}),Mt(i,o=>{Kl.configure(this,o,o.options),Kl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Pf("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i<s;i++){const l=t[i];let o=this.getDatasetMeta(i);const r=l.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=l.indexAxis||Yr(r,this.options),o.order=l.order||0,o.index=i,o.label=""+l.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const a=_i.getController(r),{datasetElementType:u,dataElementType:f}=vt.datasets[r];Object.assign(a.prototype,{dataElementType:_i.getElement(f),datasetElementType:u&&_i.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){Mt(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u<f;u++){const{controller:c}=this.getDatasetMeta(u),d=!s&&l.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||Mt(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Pf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Mt(this.scales,e=>{Kl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!zu(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;Gk(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;l<t;l++)if(!zu(s,i(l)))return;return Array.from(s).map(l=>l.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Kl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Mt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,Fi(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(hi.has(this)?this.attached&&!hi.running(this)&&hi.start(this):(this.draw(),Lf({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,l;for(s=0,l=t.length;s<l;++s){const o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&$a(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&&Ca(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return hl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Zy.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=Ni(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);Bn(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(),hi.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),xu(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Do[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(l,o)=>{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};Mt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){Mt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Mt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:l,index:o})=>{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!vo(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=z1(e),u=Xk(e,this._lastEvent,i,a);i&&(this._lastEvent=null,jt(l.onHover,[e,r,this],this),a&&jt(l.onClick,[e,r,this],this));const f=!vo(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 Ff=()=>Mt(Oo.instances,n=>n._plugins.invalidate()),Ci=!0;Object.defineProperties(Oo,{defaults:{enumerable:Ci,value:vt},instances:{enumerable:Ci,value:Do},overrides:{enumerable:Ci,value:ns},registry:{enumerable:Ci,value:_i},version:{enumerable:Ci,value:Kk},getChart:{enumerable:Ci,value:Xg},register:{enumerable:Ci,value:(...n)=>{_i.add(...n),Ff()}},unregister:{enumerable:Ci,value:(...n)=>{_i.remove(...n),Ff()}}});function Qg(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+qt,i-qt),n.closePath(),n.clip()}function Qk(n){return Ma(n,["outerStart","outerEnd","innerStart","innerEnd"])}function xk(n,e,t,i){const s=Qk(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 on(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:on(s.innerStart,0,o),innerEnd:on(s.innerEnd,0,o)}}function ps(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Zr(n,e,t,i,s){const{x:l,y:o,startAngle:r,pixelMargin:a,innerRadius:u}=e,f=Math.max(e.outerRadius+i+t-a,0),c=u>0?u+i+t+a:0;let d=0;const p=s-r;if(i){const K=u>0?u-i:0,W=f>0?f-i:0,J=(K+W)/2,ie=J!==0?p*J/(J+i):p;d=(p-ie)/2}const g=Math.max(.001,p*f-t/Vt)/f,v=(p-g)/2,b=r+v+d,y=s-v-d,{outerStart:C,outerEnd:$,innerStart:S,innerEnd:M}=xk(e,c,f,y-b),D=f-C,E=f-$,O=b+C/D,F=y-$/E,L=c+S,H=c+M,j=b+S/L,Q=y-M/H;if(n.beginPath(),n.arc(l,o,f,O,F),$>0){const K=ps(E,F,l,o);n.arc(K.x,K.y,$,F,y+qt)}const ne=ps(H,y,l,o);if(n.lineTo(ne.x,ne.y),M>0){const K=ps(H,Q,l,o);n.arc(K.x,K.y,M,y+qt,Q+Math.PI)}if(n.arc(l,o,c,y-M/c,b+S/c,!0),S>0){const K=ps(L,j,l,o);n.arc(K.x,K.y,S,j+Math.PI,b-qt)}const B=ps(D,b,l,o);if(n.lineTo(B.x,B.y),C>0){const K=ps(D,O,l,o);n.arc(K.x,K.y,C,b-qt,O)}n.closePath()}function e2(n,e,t,i){const{fullCircles:s,startAngle:l,circumference:o}=e;let r=e.endAngle;if(s){Zr(n,e,t,i,l+Pt);for(let a=0;a<s;++a)n.fill();isNaN(o)||(r=l+o%Pt,o%Pt===0&&(r+=Pt))}return Zr(n,e,t,i,r),n.fill(),r}function t2(n,e,t){const{x:i,y:s,startAngle:l,pixelMargin:o,fullCircles:r}=e,a=Math.max(e.outerRadius-o,0),u=e.innerRadius+o;let f;for(t&&Qg(n,e,l+Pt),n.beginPath(),n.arc(i,s,u,l+Pt,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+Pt),f=0;f<r;++f)n.stroke()}function n2(n,e,t,i,s){const{options:l}=e,{borderWidth:o,borderJoinStyle:r}=l,a=l.borderAlign==="inner";!o||(a?(n.lineWidth=o*2,n.lineJoin=r||"round"):(n.lineWidth=o,n.lineJoin=r||"bevel"),e.fullCircles&&t2(n,e,a),a&&Qg(n,e,s),Zr(n,e,t,i,s),n.stroke())}class Ra extends ki{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.getProps(["x","y"],i),{angle:l,distance:o}=_g(s,{x:e,y:t}),{startAngle:r,endAngle:a,innerRadius:u,outerRadius:f,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,g=bt(c,a-r)>=Pt||cl(l,r,a),v=dl(o,u+d,f+d);return g&&v}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;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>Pt?Math.floor(i/Pt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=0;if(s){o=s/2;const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*o,Math.sin(a)*o),this.circumference>=Vt&&(o=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const r=e2(e,this,o,l);n2(e,this,o,l,r),e.restore()}}Ra.id="arc";Ra.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0};Ra.defaultRoutes={backgroundColor:"backgroundColor"};function xg(n,e,t=e){n.lineCap=bt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(bt(t.borderDash,e.borderDash)),n.lineDashOffset=bt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=bt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=bt(t.borderWidth,e.borderWidth),n.strokeStyle=bt(t.borderColor,e.borderColor)}function i2(n,e,t){n.lineTo(t.x,t.y)}function s2(n){return n.stepped?yv:n.tension||n.cubicInterpolationMode==="monotone"?kv:i2}function e_(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=s<o&&l<o||s>r&&l>r;return{count:i,start:a,loop:e.loop,ilen:u<a&&!f?i+u-a:u-a}}function l2(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=e_(s,t,i),f=s2(l);let{move:c=!0,reverse:d}=i||{},p,g,v;for(p=0;p<=u;++p)g=s[(r+(d?u-p:p))%o],!g.skip&&(c?(n.moveTo(g.x,g.y),c=!1):f(n,v,g,d,l.stepped),v=g);return a&&(g=s[(r+(d?u:0))%o],f(n,v,g,d,l.stepped)),!!a}function o2(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=e_(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,p,g,v,b,y;const C=S=>(o+(u?r-S:S))%l,$=()=>{v!==b&&(n.lineTo(f,b),n.lineTo(f,v),n.lineTo(f,y))};for(a&&(p=s[C(0)],n.moveTo(p.x,p.y)),d=0;d<=r;++d){if(p=s[C(d)],p.skip)continue;const S=p.x,M=p.y,D=S|0;D===g?(M<v?v=M:M>b&&(b=M),f=(c*f+S)/++c):($(),n.lineTo(S,M),g=D,c=0,v=b=M),y=M}$()}function Jr(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?o2:l2}function r2(n){return n.stepped?ty:n.tension||n.cubicInterpolationMode==="monotone"?ny:Zi}function a2(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),xg(n,e.options),n.stroke(s)}function u2(n,e,t,i){const{segments:s,options:l}=e,o=Jr(e);for(const r of s)xg(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const f2=typeof Path2D=="function";function c2(n,e,t,i){f2&&!e.options.segment?a2(n,e,t,i):u2(n,e,t,i)}class Ri extends ki{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;Kv(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=cy(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=Ig(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=r2(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],p=l[c],g=l[d];if(p===g){r.push(p);continue}const v=Math.abs((s-p[t])/(g[t]-p[t])),b=a(p,g,v,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return Jr(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=Jr(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const r of s)o&=l(e,this,r,{start:t,end:t+i-1});return!!o}draw(e,t,i,s){const l=this.options||{};(this.points||[]).length&&l.borderWidth&&(e.save(),c2(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ri.id="line";Ri.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Ri.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Ri.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function If(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class Wo extends ki{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.options,{x:l,y:o}=this.getProps(["x","y"],i);return Math.pow(e-l,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return If(this,e,"x",t)}inYRange(e,t){return If(this,e,"y",t)}getCenterPoint(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);const i=t&&e.borderWidth||0;return(t+i)*2}draw(e,t){const i=this.options;this.skip||i.radius<.1||!hl(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Ur(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Wo.id="point";Wo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Wo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function t_(n,e){const{x:t,y:i,base:s,width:l,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,c;return n.horizontal?(c=o/2,r=Math.min(t,s),a=Math.max(t,s),u=i-c,f=i+c):(c=l/2,r=t-c,a=t+c,u=Math.min(i,s),f=Math.max(i,s)),{left:r,top:u,right:a,bottom:f}}function Ei(n,e,t,i){return n?0:on(e,t,i)}function d2(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=Sg(i);return{t:Ei(s.top,l.top,0,t),r:Ei(s.right,l.right,0,e),b:Ei(s.bottom,l.bottom,0,t),l:Ei(s.left,l.left,0,e)}}function h2(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=bs(s),o=Math.min(e,t),r=n.borderSkipped,a=i||gt(s);return{topLeft:Ei(!a||r.top||r.left,l.topLeft,0,o),topRight:Ei(!a||r.top||r.right,l.topRight,0,o),bottomLeft:Ei(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:Ei(!a||r.bottom||r.right,l.bottomRight,0,o)}}function p2(n){const e=t_(n),t=e.right-e.left,i=e.bottom-e.top,s=d2(n,t/2,i/2),l=h2(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:l},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,l.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,l.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,l.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,l.bottomRight-Math.max(s.b,s.r))}}}}function gr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&t_(n,i);return r&&(s||dl(e,r.left,r.right))&&(l||dl(t,r.top,r.bottom))}function m2(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function g2(n,e){n.rect(e.x,e.y,e.w,e.h)}function _r(n,e,t={}){const i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,l=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+l,h:n.h+o,radius:n.radius}}class Ha extends ki{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:l,outer:o}=p2(this),r=m2(o.radius)?Co:g2;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,_r(o,t,l)),e.clip(),r(e,_r(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,_r(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return gr(this,e,t,i)}inXRange(e,t){return gr(this,e,null,t)}inYRange(e,t){return gr(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:l}=this.getProps(["x","y","base","horizontal"],e);return{x:l?(t+s)/2:t,y:l?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Ha.id="bar";Ha.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Ha.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function _2(n,e,t){const i=n.segments,s=n.points,l=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=ja(a,u,s);const f=Gr(t,s[a],s[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:s[a],end:s[u]});continue}const c=Ig(e,f);for(const d of c){const p=Gr(t,l[d.start],l[d.end],d.loop),g=Fg(r,s,p);for(const v of g)o.push({source:v,target:d,start:{[t]:Nf(f,p,"start",Math.max)},end:{[t]:Nf(f,p,"end",Math.min)}})}}return o}function Gr(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=Sn(s),l=Sn(l)),{property:n,start:s,end:l}}function b2(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=ja(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 ja(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Nf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function n_(n,e){let t=[],i=!1;return It(n)?(i=!0,t=n):t=b2(n,e),t.length?new Ri({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function v2(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(!zt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function y2(n,e,t){const i=$2(n);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return zt(s)&&Math.floor(s)===s?k2(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function k2(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function w2(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:gt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function S2(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:gt(n)?i=n.value:i=e.getBaseValue(),i}function $2(n){const e=n.options,t=e.fill;let i=bt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function C2(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=M2(e,t);r.push(n_({x:null,y:e.bottom},i));for(let a=0;a<l.length;a++){const u=l[a];for(let f=u.start;f<=u.end;f++)T2(s,o[f],r)}return new Ri({points:s,options:{}})}function M2(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const l=i[s];if(l.index===e)break;l.hidden||t.unshift(l.dataset)}return t}function T2(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=D2(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function D2(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const s=i[t],l=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<l.length;u++){const f=l[u],c=o[f.start][t],d=o[f.end][t];if(dl(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class i_{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:s,y:l,radius:o}=this;return t=t||{start:0,end:Pt},e.arc(s,l,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:s}=this,l=e.angle;return{x:t+Math.cos(l)*s,y:i+Math.sin(l)*s,angle:l}}}function O2(n){const{chart:e,fill:t,line:i}=n;if(zt(t))return E2(e,t);if(t==="stack")return C2(n);if(t==="shape")return!0;const s=A2(n);return s instanceof i_?s:n_(s,i)}function E2(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function A2(n){return(n.scale||{}).getPointPositionForValue?L2(n):P2(n)}function P2(n){const{scale:e={},fill:t}=n,i=w2(t,e);if(zt(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function L2(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=S2(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new i_({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<s;++a)r.push(e.getPointPositionForValue(a,o));return r}function br(n,e,t){const i=O2(e),{line:s,scale:l,axis:o}=e,r=s.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:c=u}=a||{};i&&s.points.length&&($a(n,t),F2(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),Ca(n))}function F2(n,e){const{line:t,target:i,above:s,below:l,area:o,scale:r}=e,a=t._loop?"angle":e.axis;n.save(),a==="x"&&l!==s&&(Rf(n,i,o.top),Hf(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),Rf(n,i,o.bottom)),Hf(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function Rf(n,e,t){const{segments:i,points:s}=e;let l=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=s[a],c=s[ja(a,u,s)];l?(n.moveTo(f.x,f.y),l=!1):(n.lineTo(f.x,t),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(c.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function Hf(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=_2(t,i,s);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=l}={}}=a,p=i!==!0;n.save(),n.fillStyle=d,I2(n,o,p&&Gr(s,f,c)),n.beginPath();const g=!!t.pathSegment(n,a);let v;if(p){g?n.closePath():jf(n,i,c,s);const b=!!i.pathSegment(n,u,{move:g,reverse:!0});v=g&&b,v||jf(n,i,f,s)}n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function I2(n,e,t){const{top:i,bottom:s}=e.chart.chartArea,{property:l,start:o,end:r}=t||{};l==="x"&&(n.beginPath(),n.rect(o,i,r-o,s-i),n.clip())}function jf(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var N2={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,s=[];let l,o,r,a;for(o=0;o<i;++o)l=n.getDatasetMeta(o),r=l.dataset,a=null,r&&r.options&&r instanceof Ri&&(a={visible:n.isDatasetVisible(o),index:o,fill:y2(r,o,i),chart:n,axis:l.controller.options.indexAxis,scale:l.vScale,line:r}),l.$filler=a,s.push(a);for(o=0;o<i;++o)a=s[o],!(!a||a.fill===!1)&&(a.fill=v2(s,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),l=n.chartArea;for(let o=s.length-1;o>=0;--o){const r=s[o].$filler;!r||(r.line.updateControlPoints(l,r.axis),i&&br(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;l&&br(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!i||i.fill===!1||t.drawTime!=="beforeDatasetDraw"||br(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const sl={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e<t;++e){const o=n[e].element;if(o&&o.hasValue()){const r=o.tooltipPosition();i+=r.x,s+=r.y,++l}}return{x:i/l,y:s/l}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,l,o,r;for(l=0,o=n.length;l<o;++l){const a=n[l].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=Vr(e,u);f<s&&(s=f,r=a)}}if(r){const a=r.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function ti(n,e){return e&&(It(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function pi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
||
`)>-1?n.split(`
|
||
`):n}function R2(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 qf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Cn(e.bodyFont),u=Cn(e.titleFont),f=Cn(e.footerFont),c=l.length,d=s.length,p=i.length,g=Un(e.padding);let v=g.height,b=0,y=i.reduce((S,M)=>S+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=p*S+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const $=function(S){b=Math.max(b,t.measureText(S).width+C)};return t.save(),t.font=u.string,Mt(n.title,$),t.font=a.string,Mt(n.beforeBody.concat(n.afterBody),$),C=e.displayColors?o+2+e.boxPadding:0,Mt(i,S=>{Mt(S.before,$),Mt(S.lines,$),Mt(S.after,$)}),C=0,t.font=f.string,Mt(n.footer,$),t.restore(),b+=g.width,{width:b,height:v}}function H2(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function j2(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 q2(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"),j2(u,n,e,t)&&(u="center"),u}function Vf(n,e,t){const i=t.yAlign||e.yAlign||H2(n,t);return{xAlign:t.xAlign||e.xAlign||q2(n,e,t,i),yAlign:i}}function V2(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function z2(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function zf(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:p}=bs(o);let g=V2(e,r);const v=z2(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,p)+s),{x:on(g,0,i.width-e.width),y:on(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Un(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Bf(n){return ti([],pi(n))}function B2(n,e,t){return Ni(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Uf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class Xr extends ki{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 Ng(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=B2(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=ti(r,pi(s)),r=ti(r,pi(l)),r=ti(r,pi(o)),r}getBeforeBody(e,t){return Bf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Mt(e,l=>{const o={before:[],lines:[],after:[]},r=Uf(i,l);ti(o.before,pi(r.beforeLabel.call(this,l))),ti(o.lines,r.label.call(this,l)),ti(o.after,pi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return Bf(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=ti(r,pi(s)),r=ti(r,pi(l)),r=ti(r,pi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(R2(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),Mt(r,f=>{const c=Uf(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=sl[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=qf(this,i),u=Object.assign({},r,a),f=Vf(this.chart,i,u),c=zf(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}=bs(r),{x:d,y:p}=e,{width:g,height:v}=t;let b,y,C,$,S,M;return l==="center"?(S=p+v/2,s==="left"?(b=d,y=b-o,$=S+o,M=S-o):(b=d+g,y=b+o,$=S-o,M=S+o),C=b):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+g-Math.max(u,c)-o:y=this.caretX,l==="top"?($=p,S=$-o,b=y-o,C=y+o):($=p+v,S=$+o,b=y+o,C=y-o),M=$),{x1:b,x2:y,x3:C,y1:$,y2:S,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=ur(i.rtl,this.x,this.width);for(e.x=Xl(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Cn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<l;++a)t.fillText(s[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===l&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,s,l){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u,boxPadding:f}=l,c=Cn(l.bodyFont),d=Xl(this,"left",l),p=s.x(d),g=a<c.lineHeight?(c.lineHeight-a)/2:0,v=t.y+g;if(l.usePointStyle){const b={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(p,u)+u/2,C=v+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,Ur(e,b,y,C),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Ur(e,b,y,C)}else{e.lineWidth=o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(p,u-f),y=s.leftForLtr(s.xPlus(p,1),u-f-2),C=bs(o.borderRadius);Object.values(C).some($=>$!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Co(e,{x:b,y:v,w:u,h:a,radius:C}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Co(e,{x:y,y:v+1,w:u-2,h:a-2,radius:C}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,v,u,a),e.strokeRect(b,v,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,v+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=Cn(i.bodyFont);let d=c.lineHeight,p=0;const g=ur(i.rtl,this.x,this.width),v=function(O){t.fillText(O,g.x(e.x+p),e.y+d/2),e.y+=d+l},b=g.textAlign(o);let y,C,$,S,M,D,E;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xl(this,b,i),t.fillStyle=i.bodyColor,Mt(this.beforeBody,v),p=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,S=0,D=s.length;S<D;++S){for(y=s[S],C=this.labelTextColors[S],t.fillStyle=C,Mt(y.before,v),$=y.lines,r&&$.length&&(this._drawColorBox(t,e,S,g,i),d=Math.max(c.lineHeight,a)),M=0,E=$.length;M<E;++M)v($[M]),d=c.lineHeight;Mt(y.after,v)}p=0,d=c.lineHeight,Mt(this.afterBody,v),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=ur(i.rtl,this.x,this.width);for(e.x=Xl(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=Cn(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<l;++r)t.fillText(s[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:l,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:c,topRight:d,bottomLeft:p,bottomRight:g}=bs(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-g),t.quadraticCurveTo(r+u,a+f,r+u-g,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+p,a+f),t.quadraticCurveTo(r,a+f,r,a+f-p),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,a),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=sl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=qf(this,e),a=Object.assign({},o,this._size),u=Vf(t,e,a),f=zf(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=Un(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),oy(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),ry(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=!vo(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||!vo(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=sl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}Xr.positioners=sl;var U2={id:"tooltip",_element:Xr,positioners:sl,afterInit(n,e,t){t&&(n.tooltip=new Xr({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:di,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:di,beforeBody:di,beforeLabel:di,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return Tt(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:di,afterBody:di,beforeFooter:di,footer:di,afterFooter:di}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const W2=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function Y2(n,e,t,i){const s=n.indexOf(e);if(s===-1)return W2(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const K2=(n,e)=>n===null?null:on(Math.round(n),0,e);class Qr extends ls{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(Tt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:Y2(i,e,bt(t,e),this._addedLabels),K2(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Qr.id="category";Qr.defaults={ticks:{callback:Qr.prototype.getLabelForValue}};function Z2(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,p=l||1,g=f-1,{min:v,max:b}=e,y=!Tt(o),C=!Tt(r),$=!Tt(u),S=(b-v)/(c+1);let M=Uu((b-v)/g/p)*p,D,E,O,F;if(M<1e-14&&!y&&!C)return[{value:v},{value:b}];F=Math.ceil(b/M)-Math.floor(v/M),F>g&&(M=Uu(F*M/g/p)*p),Tt(a)||(D=Math.pow(10,a),M=Math.ceil(M*D)/D),s==="ticks"?(E=Math.floor(v/M)*M,O=Math.ceil(b/M)*M):(E=v,O=b),y&&C&&l&&Y1((r-o)/l,M/1e3)?(F=Math.round(Math.min((r-o)/M,f)),M=(r-o)/F,E=o,O=r):$?(E=y?o:E,O=C?r:O,F=u-1,M=(O-E)/F):(F=(O-E)/M,tl(F,Math.round(F),M/1e3)?F=Math.round(F):F=Math.ceil(F));const L=Math.max(Wu(M),Wu(E));D=Math.pow(10,Tt(a)?L:a),E=Math.round(E*D)/D,O=Math.round(O*D)/D;let H=0;for(y&&(d&&E!==o?(t.push({value:o}),E<o&&H++,tl(Math.round((E+H*M)*D)/D,o,Wf(o,S,n))&&H++):E<o&&H++);H<F;++H)t.push({value:Math.round((E+H*M)*D)/D});return C&&d&&O!==r?t.length&&tl(t[t.length-1].value,r,Wf(r,S,n))?t[t.length-1].value=r:t.push({value:r}):(!C||O===r)&&t.push({value:O}),t}function Wf(n,e,{horizontal:t,minRotation:i}){const s=Gn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class Eo extends ls{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return Tt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:s,max:l}=this;const o=a=>s=t?s:a,r=a=>l=i?l:a;if(e){const a=si(s),u=si(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=Z2(s,l);return e.bounds==="ticks"&&gg(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 $l(e,this.chart.options.locale,this.options.ticks.format)}}class qa extends Eo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=zt(e)?e:0,this.max=zt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Gn(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:Uo.formatters.numeric}};function Yf(n){return n/Math.pow(10,Math.floor(Rn(n)))===1}function J2(n,e){const t=Math.floor(Rn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Fn(n.min,Math.pow(10,Math.floor(Rn(e.min)))),o=Math.floor(Rn(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:Yf(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o<t||o===t&&r<i);const u=Fn(n.max,l);return s.push({value:u,major:Yf(l)}),s}class s_ extends ls{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Eo.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return zt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=zt(e)?Math.max(0,e):null,this.max=zt(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(Rn(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=J2(t,this);return e.bounds==="ticks"&&gg(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":$l(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Rn(e),this._valueRange=Rn(this.max)-Rn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Rn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}s_.id="logarithmic";s_.defaults={ticks:{callback:Uo.formatters.logarithmic,major:{enabled:!0}}};function xr(n){const e=n.ticks;if(e.display&&n.display){const t=Un(e.backdropPadding);return bt(e.font&&e.font.size,vt.font.size)+t.height}return 0}function G2(n,e,t){return t=It(t)?t:[t],{w:vv(n,e.string,t),h:t.length*e.lineHeight}}function Kf(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:n<i||n>s?{start:e-t,end:e}:{start:e,end:e+t}}function X2(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?Vt/l:0;for(let a=0;a<l;a++){const u=o.setContext(n.getPointLabelContext(a));s[a]=u.padding;const f=n.getPointPosition(a,n.drawingArea+s[a],r),c=Cn(u.font),d=G2(n.ctx,c,n._pointLabels[a]);i[a]=d;const p=Sn(n.getIndexAngle(a)+r),g=Math.round(ya(p)),v=Kf(g,f.x,d.w,0,180),b=Kf(g,f.y,d.h,90,270);Q2(t,e,p,v,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=x2(n,i,s)}function Q2(n,e,t,i,s){const l=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));let r=0,a=0;i.start<e.l?(r=(e.l-i.start)/l,n.l=Math.min(n.l,e.l-r)):i.end>e.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.start<e.t?(a=(e.t-s.start)/o,n.t=Math.min(n.t,e.t-a)):s.end>e.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function x2(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=xr(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Vt/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(ya(Sn(f.angle+qt))),d=e[u],p=nw(f.y,d.h,c),g=ew(c),v=tw(f.x,d.w,g);i.push({x:f.x,y:p,textAlign:g,left:v,top:p,right:v+d.w,bottom:p+d.h})}return i}function ew(n){return n===0||n===180?"center":n<180?"left":"right"}function tw(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function nw(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function iw(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=Cn(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:p}=n._pointLabelItems[s],{backdropColor:g}=l;if(!Tt(g)){const v=bs(l.borderRadius),b=Un(l.backdropPadding);t.fillStyle=g;const y=f-b.left,C=c-b.top,$=d-f+b.width,S=p-c+b.height;Object.values(v).some(M=>M!==0)?(t.beginPath(),Co(t,{x:y,y:C,w:$,h:S,radius:v}),t.fill()):t.fillRect(y,C,$,S)}$o(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function l_(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,Pt);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o<i;o++)l=n.getPointPosition(o,e),s.lineTo(l.x,l.y)}}function sw(n,e,t,i){const s=n.ctx,l=e.circular,{color:o,lineWidth:r}=e;!l&&!i||!o||!r||t<0||(s.save(),s.strokeStyle=o,s.lineWidth=r,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),l_(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function lw(n,e,t){return Ni(n,{label:t,index:e,type:"pointLabel"})}class Yo extends Eo{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Un(xr(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=zt(e)&&!isNaN(e)?e:0,this.max=zt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/xr(this.options))}generateTickLabels(e){Eo.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=jt(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?X2(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=Pt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Sn(e*t+Gn(i))}getDistanceFromCenterForValue(e){if(Tt(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(Tt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return lw(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-qt+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:s,bottom:l}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:l}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),l_(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:s}=t,l=this._pointLabels.length;let o,r,a;if(t.pointLabels.display&&iw(this,l),s.display&&this.ticks.forEach((u,f)=>{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));sw(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=Cn(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=Un(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(){}}Yo.id="radialLinear";Yo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Uo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Yo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Yo.descriptors={angleLines:{_fallback:"grid"}};const Ko={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}},gn=Object.keys(Ko);function ow(n,e){return n-e}function Zf(n,e){if(Tt(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)),zt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(fl(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function Jf(n,e,t,i){const s=gn.length;for(let l=gn.indexOf(n);l<s-1;++l){const o=Ko[gn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return gn[l]}return gn[s-1]}function rw(n,e,t,i,s){for(let l=gn.length-1;l>=gn.indexOf(t);l--){const o=gn[l];if(Ko[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return gn[t?gn.indexOf(t):0]}function aw(n){for(let e=gn.indexOf(n)+1,t=gn.length;e<t;++e)if(Ko[gn[e]].common)return gn[e]}function Gf(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Ta(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function uw(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 Xf(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o<l;++o)r=e[o],s[r]=o,i.push({value:r,major:!1});return l===0||!t?i:uw(n,i,s,t)}class Dl extends ls{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){const i=e.time||(e.time={}),s=this._adapter=new qg._date(e.adapters.date);el(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Zf(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:s,max:l,minDefined:o,maxDefined:r}=this.getUserBounds();function a(u){!o&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!r&&!isNaN(u.max)&&(l=Math.max(l,u.max))}(!o||!r)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),s=zt(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=zt(l)&&!isNaN(l)?l:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,l-1),this.max=Math.max(s+1,l)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const l=this.min,o=this.max,r=Ev(s,l,o);return this._unit=t.unit||(i.autoSkip?Jf(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):rw(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:aw(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),Xf(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=on(t,0,o),i=on(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||Jf(l.minUnit,t,i,this._getLabelCapacity(t)),r=bt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=fl(a)||a===!0,f={};let c=t,d,p;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 g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,p=0;d<i;d=+e.add(d,r,o),p++)Gf(f,d,g);return(d===i||s.bounds==="ticks"||p===1)&&Gf(f,d,g),Object.keys(f).sort((v,b)=>v-b).map(v=>+v)}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,p=this._adapter.format(e,s||(d?f:u)),g=l.ticks.callback;return g?jt(g,[p,t,i],this):p}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,s=Gn(this.isHorizontal()?t.maxRotation:t.minRotation),l=Math.cos(s),o=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*l+r*o,h:i*o+r*l}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,l=this._tickFormatFunction(e,0,Xf(this,[e],this._majorUnit),s),o=this._getLabelSize(l),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(Zf(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Cg(e.sort(ow))}}Dl.id="time";Dl.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Ql(n,e,t){let i=0,s=n.length-1,l,o,r,a;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Xi(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}=Xi(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 o_ extends Dl{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=Ql(t,this.min),this._tableRange=Ql(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o<r;++o)u=e[o],u>=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o<r;++o)f=s[o+1],a=s[o-1],u=s[o],Math.round((f+a)/2)!==u&&l.push({time:u,pos:o/(r-1)});return l}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(Ql(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Ql(this._table,i*this._tableRange+this._minPos,!0)}}o_.id="timeseries";o_.defaults=Dl.defaults;/*!
|
||
* chartjs-adapter-luxon v1.1.0
|
||
* https://www.chartjs.org
|
||
* (c) 2021 chartjs-adapter-luxon Contributors
|
||
* Released under the MIT license
|
||
*/const fw={datetime:et.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:et.TIME_WITH_SECONDS,minute:et.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};qg._date.override({_id:"luxon",_create:function(n){return et.fromMillis(n,this.options)},formats:function(){return fw},parse:function(n,e){const t=this.options;if(n===null||typeof n>"u")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=et.fromFormat(n,e,t):n=et.fromISO(n,t):n instanceof Date?n=et.fromJSDate(n,t):i==="object"&&!(n instanceof et)&&(n=et.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Qf(n){let e,t,i;return{c(){e=_("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ut(e,zn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=ut(e,zn,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function cw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=R(n[1]),t=T(),s=R(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&me(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&me(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function dw(n){let e;return{c(){e=R("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function hw(n){let e,t,i,s,l,o,r=n[2]&&Qf();function a(c,d){return c[2]?dw:cw}let u=a(n),f=u(n);return{c(){e=_("div"),r&&r.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),f.c(),h(i,"class","chart-canvas svelte-vh4sl8"),Za(i,"height","250px"),Za(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),ee(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),r&&r.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),o=!0},p(c,[d]){c[2]?r?d&4&&A(r,1):(r=Qf(),r.c(),A(r,1),r.m(e,t)):r&&(De(),P(r,1,1,()=>{r=null}),Oe()),d&4&&ee(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){o||(A(r),o=!0)},o(c){P(r),o=!1},d(c){c&&k(e),r&&r.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function pw(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),we.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let g of p)r.push({x:Y.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),we.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Yn(()=>(Oo.register(Ri,Wo,Ml,qa,Dl,N2,U2),t(6,o=new Oo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,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:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){he[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.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 mw extends Pe{constructor(e){super(),Ae(this,e,pw,hw,Ee,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var xf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r_={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||
*
|
||
* @license MIT <https://opensource.org/licenses/MIT>
|
||
* @author Lea Verou <https://lea.verou.me>
|
||
* @namespace
|
||
* @public
|
||
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C($){return $ instanceof a?new a($.type,C($.content),$.alias):Array.isArray($)?$.map(C):$.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++l}),C.__id},clone:function C($,S){S=S||{};var M,D;switch(r.util.type($)){case"Object":if(D=r.util.objId($),S[D])return S[D];M={},S[D]=M;for(var E in $)$.hasOwnProperty(E)&&(M[E]=C($[E],S));return M;case"Array":return D=r.util.objId($),S[D]?S[D]:(M=[],S[D]=M,$.forEach(function(O,F){M[F]=C(O,S)}),M);default:return $}},getLanguage:function(C){for(;C;){var $=s.exec(C.className);if($)return $[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,$){C.className=C.className.replace(RegExp(s,"gi"),""),C.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(C){var $=document.getElementsByTagName("script");for(var S in $)if($[S].src==C)return $[S]}return null}},isActive:function(C,$,S){for(var M="no-"+$;C;){var D=C.classList;if(D.contains($))return!0;if(D.contains(M))return!1;C=C.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(C,$){var S=r.util.clone(r.languages[C]);for(var M in $)S[M]=$[M];return S},insertBefore:function(C,$,S,M){M=M||r.languages;var D=M[C],E={};for(var O in D)if(D.hasOwnProperty(O)){if(O==$)for(var F in S)S.hasOwnProperty(F)&&(E[F]=S[F]);S.hasOwnProperty(O)||(E[O]=D[O])}var L=M[C];return M[C]=E,r.languages.DFS(r.languages,function(H,j){j===L&&H!=C&&(this[H]=E)}),E},DFS:function C($,S,M,D){D=D||{};var E=r.util.objId;for(var O in $)if($.hasOwnProperty(O)){S.call($,O,$[O],M||O);var F=$[O],L=r.util.type(F);L==="Object"&&!D[E(F)]?(D[E(F)]=!0,C(F,S,null,D)):L==="Array"&&!D[E(F)]&&(D[E(F)]=!0,C(F,S,O,D))}}},plugins:{},highlightAll:function(C,$){r.highlightAllUnder(document,C,$)},highlightAllUnder:function(C,$,S){var M={callback:S,container:C,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 D=0,E;E=M.elements[D++];)r.highlightElement(E,$===!0,M.callback)},highlightElement:function(C,$,S){var M=r.util.getLanguage(C),D=r.languages[M];r.util.setLanguage(C,M);var E=C.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=C.textContent,F={element:C,language:M,grammar:D,code:O};function L(j){F.highlightedCode=j,r.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,r.hooks.run("after-highlight",F),r.hooks.run("complete",F),S&&S.call(F.element)}if(r.hooks.run("before-sanity-check",F),E=F.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!F.code){r.hooks.run("complete",F),S&&S.call(F.element);return}if(r.hooks.run("before-highlight",F),!F.grammar){L(r.util.encode(F.code));return}if($&&i.Worker){var H=new Worker(r.filename);H.onmessage=function(j){L(j.data)},H.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else L(r.highlight(F.code,F.grammar,F.language))},highlight:function(C,$,S){var M={code:C,grammar:$,language:S};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(C,$){var S=$.rest;if(S){for(var M in S)$[M]=S[M];delete $.rest}var D=new c;return d(D,D.head,C),f(C,D,$,D.head,0),g(D)},hooks:{all:{},add:function(C,$){var S=r.hooks.all;S[C]=S[C]||[],S[C].push($)},run:function(C,$){var S=r.hooks.all[C];if(!(!S||!S.length))for(var M=0,D;D=S[M++];)D($)}},Token:a};i.Prism=r;function a(C,$,S,M){this.type=C,this.content=$,this.alias=S,this.length=(M||"").length|0}a.stringify=function C($,S){if(typeof $=="string")return $;if(Array.isArray($)){var M="";return $.forEach(function(L){M+=C(L,S)}),M}var D={type:$.type,content:C($.content,S),tag:"span",classes:["token",$.type],attributes:{},language:S},E=$.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(D.classes,E):D.classes.push(E)),r.hooks.run("wrap",D);var O="";for(var F in D.attributes)O+=" "+F+'="'+(D.attributes[F]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+O+">"+D.content+"</"+D.tag+">"};function u(C,$,S,M){C.lastIndex=$;var D=C.exec(S);if(D&&M&&D[1]){var E=D[1].length;D.index+=E,D[0]=D[0].slice(E)}return D}function f(C,$,S,M,D,E){for(var O in S)if(!(!S.hasOwnProperty(O)||!S[O])){var F=S[O];F=Array.isArray(F)?F:[F];for(var L=0;L<F.length;++L){if(E&&E.cause==O+","+L)return;var H=F[L],j=H.inside,Q=!!H.lookbehind,ne=!!H.greedy,B=H.alias;if(ne&&!H.pattern.global){var K=H.pattern.toString().match(/[imsuy]*$/)[0];H.pattern=RegExp(H.pattern.source,K+"g")}for(var W=H.pattern||H,J=M.next,ie=D;J!==$.tail&&!(E&&ie>=E.reach);ie+=J.value.length,J=J.next){var fe=J.value;if($.length>C.length)return;if(!(fe instanceof a)){var ye=1,le;if(ne){if(le=u(W,ie,C,Q),!le||le.index>=C.length)break;var be=le.index,ue=le.index+le[0].length,Te=ie;for(Te+=J.value.length;be>=Te;)J=J.next,Te+=J.value.length;if(Te-=J.value.length,ie=Te,J.value instanceof a)continue;for(var Z=J;Z!==$.tail&&(Te<ue||typeof Z.value=="string");Z=Z.next)ye++,Te+=Z.value.length;ye--,fe=C.slice(ie,Te),le.index-=ie}else if(le=u(W,0,fe,Q),!le)continue;var be=le.index,x=le[0],G=fe.slice(0,be),_e=fe.slice(be+x.length),je=ie+fe.length;E&&je>E.reach&&(E.reach=je);var Fe=J.prev;G&&(Fe=d($,Fe,G),ie+=G.length),p($,Fe,ye);var Re=new a(O,j?r.tokenize(x,j):x,B,x);if(J=d($,Fe,Re),_e&&d($,J,_e),ye>1){var re={cause:O+","+L,reach:je};f(C,$,S,J.prev,ie,re),E&&re.reach>E.reach&&(E.reach=re.reach)}}}}}}function c(){var C={value:null,prev:null,next:null},$={value:null,prev:C,next:null};C.next=$,this.head=C,this.tail=$,this.length=0}function d(C,$,S){var M=$.next,D={value:S,prev:$,next:M};return $.next=D,M.prev=D,C.length++,D}function p(C,$,S){for(var M=$.next,D=0;D<S&&M!==C.tail;D++)M=M.next;$.next=M,M.prev=$,C.length-=D}function g(C){for(var $=[],S=C.head.next;S!==C.tail;)$.push(S.value),S=S.next;return $}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(C){var $=JSON.parse(C.data),S=$.language,M=$.code,D=$.immediateClose;i.postMessage(r.highlight(M,r.languages[S],S)),D&&i.close()},!1)),r;var v=r.util.currentScript();v&&(r.filename=v.src,v.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof xf<"u"&&(xf.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},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:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,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\u2026",s=function(v,b){return"\u2716 Error "+v+" while fetching file: "+b},l="\u2716 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,b,y){var C=new XMLHttpRequest;C.open("GET",v,!0),C.onreadystatechange=function(){C.readyState==4&&(C.status<400&&C.responseText?b(C.responseText):C.status>=400?y(s(C.status,C.statusText)):y(l))},C.send(null)}function p(v){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(b){var y=Number(b[1]),C=b[2],$=b[3];return C?$?[y,Number($)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(v){v.selector+=", "+c}),t.hooks.add("before-sanity-check",function(v){var b=v.element;if(b.matches(c)){v.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var C=b.getAttribute("data-src"),$=v.language;if($==="none"){var S=(/\.(\w+)$/.exec(C)||[,"none"])[1];$=o[S]||S}t.util.setLanguage(y,$),t.util.setLanguage(b,$);var M=t.plugins.autoloader;M&&M.loadLanguages($),d(C,function(D){b.setAttribute(r,u);var E=p(b.getAttribute("data-range"));if(E){var O=D.split(/\r\n?|\n/g),F=E[0],L=E[1]==null?O.length:E[1];F<0&&(F+=O.length),F=Math.max(0,Math.min(F-1,O.length)),L<0&&(L+=O.length),L=Math.max(0,Math.min(L,O.length)),D=O.slice(F,L).join(`
|
||
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(F+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),C=0,$;$=y[C++];)t.highlightElement($)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(r_);const Bs=r_.exports;var gw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;r<l.length;++r)l.charCodeAt(r)==" ".charCodeAt(0)&&(o+=3);return l.length+o}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,o){o=e(this.defaults,o);for(var r in o){var a=i(r);r!=="normalize"&&a!=="setDefaults"&&o[r]&&this[a]&&(l=this[a].call(this,l,o[r]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,o){return o=o|0||4,l.replace(/\t/g,new Array(++o).join(" "))},spacesToTabs:function(l,o){return o=o|0||4,l.replace(RegExp(" {"+o+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var o=l.match(/^[^\S\n\r]*(?=\S)/gm);return!o||!o[0].length||(o.sort(function(r,a){return r.length-a.length}),!o[0].length)?l:l.replace(RegExp("^"+o[0],"gm"),"")},indent:function(l,o){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++o).join(" ")+"$&")},breakLines:function(l,o){o=o===!0?80:o|0||80;for(var r=l.split(`
|
||
`),a=0;a<r.length;++a)if(!(s(r[a])<=o)){for(var u=r[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>o&&(u[c]=`
|
||
`+u[c],f=d)}r[a]=u.join("")}return r.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(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var p=a[d];p==l.element?c=!0:p.nodeName==="#text"&&(c?f+=p.nodeValue:u+=p.nodeValue,r.removeChild(p),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=o.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(gw);function _w(n){let e,t;return{c(){e=_("div"),t=_("code"),h(t,"class","svelte-tv7jme"),h(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:oe,o:oe,d(i){i&&k(e)}}}function bw(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function o(r){return r=typeof r=="string"?r:"",r=Bs.plugins.NormalizeWhitespace.normalize(r,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Bs.highlight(r,Bs.languages[s]||Bs.languages.javascript,s)}return n.$$set=r=>{"content"in r&&t(1,i=r.content),"language"in r&&t(2,s=r.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof Bs<"u"&&i&&t(0,l=o(i))},[l,i,s]}class nn extends Pe{constructor(e){super(),Ae(this,e,bw,_w,Ee,{content:1,language:2})}}const vw=n=>({}),ec=n=>({}),yw=n=>({}),tc=n=>({});function nc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$=n[4]&&!n[2]&&ic(n);const S=n[18].header,M=Mn(S,n,n[17],tc);let D=n[4]&&n[2]&&sc(n);const E=n[18].default,O=Mn(E,n,n[17],null),F=n[18].footer,L=Mn(F,n,n[17],ec);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),$&&$.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),L&&L.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(d,"class","overlay-panel-section panel-footer"),h(l,"class",p="overlay-panel "+n[1]+" "+n[8]),ee(l,"popup",n[2]),h(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(H,j){w(H,e,j),m(e,t),m(e,s),m(e,l),m(l,o),$&&$.m(o,null),m(o,r),M&&M.m(o,null),m(o,a),D&&D.m(o,null),m(l,u),m(l,f),O&&O.m(f,null),n[20](f),m(l,c),m(l,d),L&&L.m(d,null),b=!0,y||(C=[X(t,"click",Bt(n[19])),X(f,"scroll",n[21])],y=!0)},p(H,j){n=H,n[4]&&!n[2]?$?$.p(n,j):($=ic(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!b||j&131072)&&Dn(M,S,n,n[17],b?Tn(S,n[17],j,yw):On(n[17]),tc),n[4]&&n[2]?D?D.p(n,j):(D=sc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||j&131072)&&Dn(O,E,n,n[17],b?Tn(E,n[17],j,null):On(n[17]),null),L&&L.p&&(!b||j&131072)&&Dn(L,F,n,n[17],b?Tn(F,n[17],j,vw):On(n[17]),ec),(!b||j&258&&p!==(p="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",p),j&262&&ee(l,"popup",n[2]),j&4&&ee(e,"padded",n[2]),j&1&&ee(e,"active",n[0])},i(H){b||(Dt(()=>{i||(i=ut(t,bo,{duration:ms,opacity:0},!0)),i.run(1)}),A(M,H),A(O,H),A(L,H),Dt(()=>{v&&v.end(1),g=Xp(l,Vn,n[2]?{duration:ms,y:-10}:{duration:ms,x:50}),g.start()}),b=!0)},o(H){i||(i=ut(t,bo,{duration:ms,opacity:0},!1)),i.run(0),P(M,H),P(O,H),P(L,H),g&&g.invalidate(),v=Qp(l,Vn,n[2]?{duration:ms,y:10}:{duration:ms,x:50}),b=!1},d(H){H&&k(e),H&&i&&i.end(),$&&$.d(),M&&M.d(H),D&&D.d(),O&&O.d(H),n[20](null),L&&L.d(H),H&&v&&v.end(),y=!1,st(C)}}}function ic(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=X(e,"click",Bt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function sc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=X(e,"click",Bt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function kw(n){let e,t,i,s,l=n[0]&&nc(n);return{c(){e=_("div"),l&&l.c(),h(e,"class","overlay-panel-wrapper")},m(o,r){w(o,e,r),l&&l.m(e,null),n[22](e),t=!0,i||(s=[X(window,"resize",n[10]),X(window,"keydown",n[9])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=nc(o),l.c(),A(l,1),l.m(e,null)):l&&(De(),P(l,1,1,()=>{l=null}),Oe())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[22](null),i=!1,st(s)}}}let Wi;function a_(){return Wi=Wi||document.querySelector(".overlays"),Wi||(Wi=document.createElement("div"),Wi.classList.add("overlays"),document.body.appendChild(Wi)),Wi}let ms=150;function lc(){return 1e3+a_().querySelectorAll(".overlay-panel-container.active").length}function ww(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const p=un();let g,v,b,y,C="";function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function S(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(B){B?(b=document.activeElement,g==null||g.focus(),p("show")):(clearTimeout(y),b==null||b.focus(),p("hide")),await ai(),E()}function E(){!g||(o?t(6,g.style.zIndex=lc(),g):t(6,g.style="",g))}function O(B){o&&f&&B.code=="Escape"&&!Y.isInput(B.target)&&g&&g.style.zIndex==lc()&&(B.preventDefault(),S())}function F(B){o&&L(v)}function L(B,K){K&&t(8,C=""),B&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!B)return;if(B.scrollHeight-B.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}B.scrollTop==0?t(8,C+=" scroll-top-reached"):B.scrollTop+B.offsetHeight==B.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Yn(()=>(a_().appendChild(g),()=>{var B;clearTimeout(y),(B=g==null?void 0:g.classList)==null||B.add("hidden")}));const H=()=>a?S():!0;function j(B){he[B?"unshift":"push"](()=>{v=B,t(7,v)})}const Q=B=>L(B.target);function ne(B){he[B?"unshift":"push"](()=>{g=B,t(6,g)})}return n.$$set=B=>{"class"in B&&t(1,l=B.class),"active"in B&&t(0,o=B.active),"popup"in B&&t(2,r=B.popup),"overlayClose"in B&&t(3,a=B.overlayClose),"btnClose"in B&&t(4,u=B.btnClose),"escClose"in B&&t(12,f=B.escClose),"beforeOpen"in B&&t(13,c=B.beforeOpen),"beforeHide"in B&&t(14,d=B.beforeHide),"$$scope"in B&&t(17,s=B.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&D(o),n.$$.dirty&128&&L(v,!0),n.$$.dirty&64&&g&&E()},[o,l,r,a,u,S,g,v,C,O,F,L,f,c,d,$,M,s,i,H,j,Q,ne]}class wi extends Pe{constructor(e){super(),Ae(this,e,ww,kw,Ee,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16})}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function Sw(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function $w(n){let e,t=n[2].referer+"",i,s;return{c(){e=_("a"),i=R(t),h(e,"href",s=n[2].referer),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&me(i,t),o&4&&s!==(s=l[2].referer)&&h(e,"href",s)},d(l){l&&k(e)}}}function Cw(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function Mw(n){let e,t;return e=new nn({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Tw(n){var ei;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,p,g,v=n[2].status+"",b,y,C,$,S,M,D=((ei=n[2].method)==null?void 0:ei.toUpperCase())+"",E,O,F,L,H,j,Q=n[2].auth+"",ne,B,K,W,J,ie,fe=n[2].url+"",ye,le,ue,Te,Z,be,x,G,_e,je,Fe,Re=n[2].ip+"",re,ae,ke,Ke,Ye,nt,lt=n[2].userAgent+"",xe,ge,de,qe,ct,te,ve,Ze,at,mt,yt,Lt,pe,Se,Je,tt;function Ft(dt,N){return dt[2].referer?$w:Sw}let ce=Ft(n),$e=ce(n);const Ge=[Mw,Cw],Xt=[];function Ut(dt,N){return N&4&&(ve=null),ve==null&&(ve=!Y.isEmpty(dt[2].meta)),ve?0:1}return Ze=Ut(n,-1),at=Xt[Ze]=Ge[Ze](n),Je=new vi({props:{date:n[2].created}}),{c(){e=_("table"),t=_("tbody"),i=_("tr"),s=_("td"),s.textContent="ID",l=T(),o=_("td"),a=R(r),u=T(),f=_("tr"),c=_("td"),c.textContent="Status",d=T(),p=_("td"),g=_("span"),b=R(v),y=T(),C=_("tr"),$=_("td"),$.textContent="Method",S=T(),M=_("td"),E=R(D),O=T(),F=_("tr"),L=_("td"),L.textContent="Auth",H=T(),j=_("td"),ne=R(Q),B=T(),K=_("tr"),W=_("td"),W.textContent="URL",J=T(),ie=_("td"),ye=R(fe),le=T(),ue=_("tr"),Te=_("td"),Te.textContent="Referer",Z=T(),be=_("td"),$e.c(),x=T(),G=_("tr"),_e=_("td"),_e.textContent="IP",je=T(),Fe=_("td"),re=R(Re),ae=T(),ke=_("tr"),Ke=_("td"),Ke.textContent="UserAgent",Ye=T(),nt=_("td"),xe=R(lt),ge=T(),de=_("tr"),qe=_("td"),qe.textContent="Meta",ct=T(),te=_("td"),at.c(),mt=T(),yt=_("tr"),Lt=_("td"),Lt.textContent="Created",pe=T(),Se=_("td"),z(Je.$$.fragment),h(s,"class","min-width txt-hint txt-bold"),h(c,"class","min-width txt-hint txt-bold"),h(g,"class","label"),ee(g,"label-danger",n[2].status>=400),h($,"class","min-width txt-hint txt-bold"),h(L,"class","min-width txt-hint txt-bold"),h(W,"class","min-width txt-hint txt-bold"),h(Te,"class","min-width txt-hint txt-bold"),h(_e,"class","min-width txt-hint txt-bold"),h(Ke,"class","min-width txt-hint txt-bold"),h(qe,"class","min-width txt-hint txt-bold"),h(Lt,"class","min-width txt-hint txt-bold"),h(e,"class","table-compact table-border")},m(dt,N){w(dt,e,N),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,a),m(t,u),m(t,f),m(f,c),m(f,d),m(f,p),m(p,g),m(g,b),m(t,y),m(t,C),m(C,$),m(C,S),m(C,M),m(M,E),m(t,O),m(t,F),m(F,L),m(F,H),m(F,j),m(j,ne),m(t,B),m(t,K),m(K,W),m(K,J),m(K,ie),m(ie,ye),m(t,le),m(t,ue),m(ue,Te),m(ue,Z),m(ue,be),$e.m(be,null),m(t,x),m(t,G),m(G,_e),m(G,je),m(G,Fe),m(Fe,re),m(t,ae),m(t,ke),m(ke,Ke),m(ke,Ye),m(ke,nt),m(nt,xe),m(t,ge),m(t,de),m(de,qe),m(de,ct),m(de,te),Xt[Ze].m(te,null),m(t,mt),m(t,yt),m(yt,Lt),m(yt,pe),m(yt,Se),q(Je,Se,null),tt=!0},p(dt,N){var se;(!tt||N&4)&&r!==(r=dt[2].id+"")&&me(a,r),(!tt||N&4)&&v!==(v=dt[2].status+"")&&me(b,v),N&4&&ee(g,"label-danger",dt[2].status>=400),(!tt||N&4)&&D!==(D=((se=dt[2].method)==null?void 0:se.toUpperCase())+"")&&me(E,D),(!tt||N&4)&&Q!==(Q=dt[2].auth+"")&&me(ne,Q),(!tt||N&4)&&fe!==(fe=dt[2].url+"")&&me(ye,fe),ce===(ce=Ft(dt))&&$e?$e.p(dt,N):($e.d(1),$e=ce(dt),$e&&($e.c(),$e.m(be,null))),(!tt||N&4)&&Re!==(Re=dt[2].ip+"")&&me(re,Re),(!tt||N&4)&<!==(lt=dt[2].userAgent+"")&&me(xe,lt);let I=Ze;Ze=Ut(dt,N),Ze===I?Xt[Ze].p(dt,N):(De(),P(Xt[I],1,1,()=>{Xt[I]=null}),Oe(),at=Xt[Ze],at?at.p(dt,N):(at=Xt[Ze]=Ge[Ze](dt),at.c()),A(at,1),at.m(te,null));const U={};N&4&&(U.date=dt[2].created),Je.$set(U)},i(dt){tt||(A(at),A(Je.$$.fragment,dt),tt=!0)},o(dt){P(at),P(Je.$$.fragment,dt),tt=!1},d(dt){dt&&k(e),$e.d(),Xt[Ze].d(),V(Je)}}}function Dw(n){let e;return{c(){e=_("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Ow(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',h(e,"type","button"),h(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[4]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Ew(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[Ow],header:[Dw],default:[Tw]},$$scope:{ctx:n}};return e=new wi({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(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||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function Aw(n,e,t){let i,s=new Or;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){he[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){ht.call(this,n,c)}function f(c){ht.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class Pw extends Pe{constructor(e){super(),Ae(this,e,Aw,Ew,Ee,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function Lw(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Include requests by admins"),h(e,"type","checkbox"),h(e,"id",t=n[14]),h(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[0],w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&h(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function oc(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 mw({props:l}),he.push(()=>Ie(e,"filter",s)),{c(){z(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function rc(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 L1({props:l}),he.push(()=>Ie(e,"filter",s)),e.$on("select",n[12]),{c(){z(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Fw(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$=n[3],S,M=n[3],D,E,O;a=new zo({}),a.$on("refresh",n[7]),p=new Le({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[Lw,({uniqueId:j})=>({14:j}),({uniqueId:j})=>j?16384:0]},$$scope:{ctx:n}}}),v=new Vo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","ip","referer","status","auth","userAgent"]}}),v.$on("submit",n[9]);let F=oc(n),L=rc(n),H={};return E=new Pw({props:H}),n[13](E),{c(){e=_("main"),t=_("div"),i=_("header"),s=_("nav"),l=_("div"),o=R(n[5]),r=T(),z(a.$$.fragment),u=T(),f=_("div"),c=T(),d=_("div"),z(p.$$.fragment),g=T(),z(v.$$.fragment),b=T(),y=_("div"),C=T(),F.c(),S=T(),L.c(),D=T(),z(E.$$.fragment),h(l,"class","breadcrumb-item"),h(s,"class","breadcrumbs"),h(f,"class","flex-fill"),h(d,"class","inline-flex"),h(i,"class","page-header"),h(y,"class","clearfix m-b-xs"),h(t,"class","page-header-wrapper m-b-0"),h(e,"class","page-wrapper")},m(j,Q){w(j,e,Q),m(e,t),m(t,i),m(i,s),m(s,l),m(l,o),m(i,r),q(a,i,null),m(i,u),m(i,f),m(i,c),m(i,d),q(p,d,null),m(t,g),q(v,t,null),m(t,b),m(t,y),m(t,C),F.m(t,null),m(e,S),L.m(e,null),w(j,D,Q),q(E,j,Q),O=!0},p(j,[Q]){(!O||Q&32)&&me(o,j[5]);const ne={};Q&49153&&(ne.$$scope={dirty:Q,ctx:j}),p.$set(ne);const B={};Q&4&&(B.value=j[2]),v.$set(B),Q&8&&Ee($,$=j[3])?(De(),P(F,1,1,oe),Oe(),F=oc(j),F.c(),A(F,1),F.m(t,null)):F.p(j,Q),Q&8&&Ee(M,M=j[3])?(De(),P(L,1,1,oe),Oe(),L=rc(j),L.c(),A(L,1),L.m(e,null)):L.p(j,Q);const K={};E.$set(K)},i(j){O||(A(a.$$.fragment,j),A(p.$$.fragment,j),A(v.$$.fragment,j),A(F),A(L),A(E.$$.fragment,j),O=!0)},o(j){P(a.$$.fragment,j),P(p.$$.fragment,j),P(v.$$.fragment,j),P(F),P(L),P(E.$$.fragment,j),O=!1},d(j){j&&k(e),V(a),V(p),V(v),F.d(j),L.d(j),j&&k(D),n[13](null),V(E,j)}}}const ac="includeAdminLogs";function Iw(n,e,t){var y;let i,s;At(n,Zt,C=>t(5,s=C)),bn(Zt,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem(ac))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=C=>t(2,o=C.detail);function p(C){o=C,t(2,o)}function g(C){o=C,t(2,o)}const v=C=>l==null?void 0:l.show(C==null?void 0:C.detail);function b(C){he[C?"unshift":"push"](()=>{l=C,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(ac,r<<0)},[r,l,o,a,i,s,u,f,c,d,p,g,v,b]}class Nw extends Pe{constructor(e){super(),Ae(this,e,Iw,Fw,Ee,{})}}const Cs=xn([]),li=xn({}),ea=xn(!1);function Rw(n){li.update(e=>Y.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Cs.update(e=>(Y.pushOrReplaceByKey(e,n,"id"),e))}function Hw(n){Cs.update(e=>(Y.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function jw(n=null){return ea.set(!0),li.set({}),Cs.set([]),we.Collections.getFullList(200,{sort:"+created"}).then(e=>{Cs.set(e);const t=n&&Y.findByKey(e,"id",n);if(t)li.set(t);else if(e.length){const i=e.find(s=>s.name!="profiles");i&&li.set(i)}}).catch(e=>{we.errorResponseHandler(e)}).finally(()=>{ea.set(!1)})}const Va=xn({});function yi(n,e,t){Va.set({text:n,yesCallback:e,noCallback:t})}function u_(){Va.set({})}function uc(n){let e,t,i,s;const l=n[13].default,o=Mn(l,n,n[12],null);return{c(){e=_("div"),o&&o.c(),h(e,"class",n[1]),ee(e,"active",n[0])},m(r,a){w(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&4096)&&Dn(o,l,r,r[12],s?Tn(l,r[12],a,null):On(r[12]),null),(!s||a&2)&&h(e,"class",r[1]),a&3&&ee(e,"active",r[0])},i(r){s||(A(o,r),r&&Dt(()=>{i&&i.end(1),t=Xp(e,Vn,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=Qp(e,Vn,{duration:150,y:2})),s=!1},d(r){r&&k(e),o&&o.d(r),r&&i&&i.end()}}}function qw(n){let e,t,i,s,l=n[0]&&uc(n);return{c(){e=_("div"),l&&l.c(),h(e,"class","toggler-container")},m(o,r){w(o,e,r),l&&l.m(e,null),n[14](e),t=!0,i||(s=[X(window,"click",n[3]),X(window,"keydown",n[4]),X(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=uc(o),l.c(),A(l,1),l.m(e,null)):l&&(De(),P(l,1,1,()=>{l=null}),Oe())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[14](null),i=!1,st(s)}}}function Vw(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f;const c=un();function d(){t(0,o=!1)}function p(){t(0,o=!0)}function g(){o?d():p()}function v(D){return!f||D.classList.contains(a)||(l==null?void 0:l.contains(D))&&!f.contains(D)||f.contains(D)&&D.closest&&D.closest("."+a)}function b(D){(!o||v(D.target))&&(D.preventDefault(),g())}function y(D){(D.code==="Enter"||D.code==="Space")&&(!o||v(D.target))&&(D.preventDefault(),D.stopPropagation(),g())}function C(D){o&&!(f!=null&&f.contains(D.target))&&!(l!=null&&l.contains(D.target))&&d()}function $(D){o&&r&&D.code=="Escape"&&(D.preventDefault(),d())}function S(D){return C(D)}Yn(()=>(t(6,l=l||f.parentNode),l.addEventListener("click",b),l.addEventListener("keydown",y),()=>{l.removeEventListener("click",b),l.removeEventListener("keydown",y)}));function M(D){he[D?"unshift":"push"](()=>{f=D,t(2,f)})}return n.$$set=D=>{"trigger"in D&&t(6,l=D.trigger),"active"in D&&t(0,o=D.active),"escClose"in D&&t(7,r=D.escClose),"closableClass"in D&&t(8,a=D.closableClass),"class"in D&&t(1,u=D.class),"$$scope"in D&&t(12,s=D.$$scope)},n.$$.update=()=>{var D,E;n.$$.dirty&65&&(o?((D=l==null?void 0:l.classList)==null||D.add("active"),c("show")):((E=l==null?void 0:l.classList)==null||E.remove("active"),c("hide")))},[o,u,f,C,$,S,l,r,a,d,p,g,s,i,M]}class os extends Pe{constructor(e){super(),Ae(this,e,Vw,qw,Ee,{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 zw=n=>({active:n&1}),fc=n=>({active:n[0]});function cc(n){let e,t,i;const s=n[12].default,l=Mn(s,n,n[11],null);return{c(){e=_("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&2048)&&Dn(l,s,o,o[11],i?Tn(s,o[11],r,null):On(o[11]),null)},i(o){i||(A(l,o),o&&Dt(()=>{t||(t=ut(e,xt,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=ut(e,xt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function Bw(n){let e,t,i,s,l,o,r,a;const u=n[12].header,f=Mn(u,n,n[11],fc);let c=n[0]&&cc(n);return{c(){e=_("div"),t=_("header"),f&&f.c(),i=T(),c&&c.c(),h(t,"class","accordion-header"),ee(t,"interactive",n[2]),h(e,"tabindex",s=n[2]?0:-1),h(e,"class",l="accordion "+n[1]),ee(e,"active",n[0])},m(d,p){w(d,e,p),m(e,t),f&&f.m(t,null),m(e,i),c&&c.m(e,null),n[14](e),o=!0,r||(a=[X(t,"click",Bt(n[13])),X(e,"keydown",Wp(n[5]))],r=!0)},p(d,[p]){f&&f.p&&(!o||p&2049)&&Dn(f,u,d,d[11],o?Tn(u,d[11],p,zw):On(d[11]),fc),p&4&&ee(t,"interactive",d[2]),d[0]?c?(c.p(d,p),p&1&&A(c,1)):(c=cc(d),c.c(),A(c,1),c.m(e,null)):c&&(De(),P(c,1,1,()=>{c=null}),Oe()),(!o||p&4&&s!==(s=d[2]?0:-1))&&h(e,"tabindex",s),(!o||p&2&&l!==(l="accordion "+d[1]))&&h(e,"class",l),p&3&&ee(e,"active",d[0])},i(d){o||(A(f,d),A(c),o=!0)},o(d){P(f,d),P(c),o=!1},d(d){d&&k(e),f&&f.d(d),c&&c.d(),n[14](null),r=!1,st(a)}}}function Uw(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=un();let o,r,{class:a=""}=e,{active:u=!1}=e,{interactive:f=!0}=e,{single:c=!1}=e;function d(){v(),t(0,u=!0),l("expand")}function p(){t(0,u=!1),clearTimeout(r),l("collapse")}function g(){l("toggle"),u?p():d()}function v(){if(c&&o.parentElement){const $=o.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const S of $)S.click()}}function b($){!f||($.code==="Enter"||$.code==="Space")&&($.preventDefault(),g())}Yn(()=>()=>clearTimeout(r));const y=()=>f&&g();function C($){he[$?"unshift":"push"](()=>{o=$,t(4,o)})}return n.$$set=$=>{"class"in $&&t(1,a=$.class),"active"in $&&t(0,u=$.active),"interactive"in $&&t(2,f=$.interactive),"single"in $&&t(6,c=$.single),"$$scope"in $&&t(11,s=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1041&&u&&(clearTimeout(r),t(10,r=setTimeout(()=>{o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},250)))},[u,a,f,g,o,b,c,d,p,v,r,s,i,y,C]}class za extends Pe{constructor(e){super(),Ae(this,e,Uw,Bw,Ee,{class:1,active:0,interactive:2,single:6,expand:7,collapse:8,toggle:3,collapseSiblings:9})}get expand(){return this.$$.ctx[7]}get collapse(){return this.$$.ctx[8]}get toggle(){return this.$$.ctx[3]}get collapseSiblings(){return this.$$.ctx[9]}}const Ww=n=>({}),dc=n=>({});function hc(n,e,t){const i=n.slice();return i[46]=e[t],i}function pc(n,e,t){const i=n.slice();return i[49]=e[t],i}const Yw=n=>({}),mc=n=>({});function gc(n,e,t){const i=n.slice();return i[49]=e[t],i}function _c(n){let e,t;return{c(){e=_("div"),t=R(n[2]),h(e,"class","txt-placeholder")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&4&&me(t,i[2])},d(i){i&&k(e)}}}function Kw(n){let e,t=n[49]+"",i;return{c(){e=_("span"),i=R(t),h(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&1&&t!==(t=s[49]+"")&&me(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function Zw(n){let e,t,i;const s=[{item:n[49]},n[8]];var l=n[7];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=pt(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&z(e.$$.fragment),t=rt()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&257?pn(s,[a[0]&1&&{item:r[49]},a[0]&256&&ui(r[8])]):{};if(l!==(l=r[7])){if(e){De();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),Oe()}l?(e=new l(o()),z(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function bc(n){let e,t,i;function s(){return n[34](n[49])}return{c(){e=_("span"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Qe(Ct.call(null,e,"Clear")),X(e,"click",qn(Bt(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,st(i)}}}function vc(n){let e,t,i,s,l,o;const r=[Zw,Kw],a=[];function u(c,d){return c[7]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&bc(n);return{c(){e=_("div"),i.c(),s=T(),f&&f.c(),l=T(),h(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),m(e,s),f&&f.m(e,null),m(e,l),o=!0},p(c,d){let p=t;t=u(c),t===p?a[t].p(c,d):(De(),P(a[p],1,1,()=>{a[p]=null}),Oe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=bc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){P(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function yc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[Xw]},$$scope:{ctx:n}};return e=new os({props:i}),n[39](e),e.$on("show",n[23]),e.$on("hide",n[40]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&131072&&(o.trigger=s[17]),l[0]&806410|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[39](null),V(e,s)}}}function kc(n){let e,t,i,s,l,o,r,a,u=n[14].length&&wc(n);return{c(){e=_("div"),t=_("label"),i=_("div"),i.innerHTML='<i class="ri-search-line"></i>',s=T(),l=_("input"),o=T(),u&&u.c(),h(i,"class","addon p-r-0"),l.autofocus=!0,h(l,"type","text"),h(l,"placeholder",n[3]),h(t,"class","input-group"),h(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(t,s),m(t,l),Ce(l,n[14]),m(t,o),u&&u.m(t,null),l.focus(),r||(a=X(l,"input",n[36]),r=!0)},p(f,c){c[0]&8&&h(l,"placeholder",f[3]),c[0]&16384&&l.value!==f[14]&&Ce(l,f[14]),f[14].length?u?u.p(f,c):(u=wc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function wc(n){let e,t,i,s;return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-close-line"></i>',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-secondary clear"),h(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),m(e,t),i||(s=X(t,"click",qn(Bt(n[20]))),i=!0)},p:oe,d(l){l&&k(e),i=!1,s()}}}function Sc(n){let e,t=n[1]&&$c(n);return{c(){t&&t.c(),e=rt()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=$c(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function $c(n){let e,t;return{c(){e=_("div"),t=R(n[1]),h(e,"class","txt-missing")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&2&&me(t,i[1])},d(i){i&&k(e)}}}function Cc(n){let e,t=n[46].group+"",i;return{c(){e=_("div"),i=R(t),h(e,"class","dropdown-item separator")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&524288&&t!==(t=s[46].group+"")&&me(i,t)},d(s){s&&k(e)}}}function Jw(n){let e=n[49]+"",t;return{c(){t=R(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&524288&&e!==(e=i[49]+"")&&me(t,e)},i:oe,o:oe,d(i){i&&k(t)}}}function Gw(n){let e,t,i;const s=[{item:n[49]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=pt(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&z(e.$$.fragment),t=rt()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&525312?pn(s,[a[0]&524288&&{item:r[49]},a[0]&1024&&ui(r[10])]):{};if(l!==(l=r[9])){if(e){De();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),Oe()}l?(e=new l(o()),z(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function Mc(n){let e,t,i,s,l,o,r;const a=[Gw,Jw],u=[];function f(p,g){return p[9]?0:1}t=f(n),i=u[t]=a[t](n);function c(...p){return n[37](n[49],...p)}function d(...p){return n[38](n[49],...p)}return{c(){e=_("div"),i.c(),s=T(),h(e,"tabindex","0"),h(e,"class","dropdown-item option closable"),ee(e,"selected",n[18](n[49]))},m(p,g){w(p,e,g),u[t].m(e,null),m(e,s),l=!0,o||(r=[X(e,"click",c),X(e,"keydown",d)],o=!0)},p(p,g){n=p;let v=t;t=f(n),t===v?u[t].p(n,g):(De(),P(u[v],1,1,()=>{u[v]=null}),Oe(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),g[0]&786432&&ee(e,"selected",n[18](n[49]))},i(p){l||(A(i),l=!0)},o(p){P(i),l=!1},d(p){p&&k(e),u[t].d(),o=!1,st(r)}}}function Tc(n){let e,t,i,s=n[46].group!=ta&&Cc(n),l=n[46].items,o=[];for(let a=0;a<l.length;a+=1)o[a]=Mc(pc(n,l,a));const r=a=>P(o[a],1,1,()=>{o[a]=null});return{c(){s&&s.c(),e=T();for(let a=0;a<o.length;a+=1)o[a].c();t=rt()},m(a,u){s&&s.m(a,u),w(a,e,u);for(let f=0;f<o.length;f+=1)o[f].m(a,u);w(a,t,u),i=!0},p(a,u){if(a[46].group!=ta?s?s.p(a,u):(s=Cc(a),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),u[0]&7079424){l=a[46].items;let f;for(f=0;f<l.length;f+=1){const c=pc(a,l,f);o[f]?(o[f].p(c,u),A(o[f],1)):(o[f]=Mc(c),o[f].c(),A(o[f],1),o[f].m(t.parentNode,t))}for(De(),f=l.length;f<o.length;f+=1)r(f);Oe()}},i(a){if(!i){for(let u=0;u<l.length;u+=1)A(o[u]);i=!0}},o(a){o=o.filter(Boolean);for(let u=0;u<o.length;u+=1)P(o[u]);i=!1},d(a){s&&s.d(a),a&&k(e),jn(o,a),a&&k(t)}}}function Xw(n){let e,t,i,s,l,o=n[11]&&kc(n);const r=n[33].beforeOptions,a=Mn(r,n,n[42],mc);let u=n[19],f=[];for(let v=0;v<u.length;v+=1)f[v]=Tc(hc(n,u,v));const c=v=>P(f[v],1,1,()=>{f[v]=null});let d=null;u.length||(d=Sc(n));const p=n[33].afterOptions,g=Mn(p,n,n[42],dc);return{c(){o&&o.c(),e=T(),a&&a.c(),t=T(),i=_("div");for(let v=0;v<f.length;v+=1)f[v].c();d&&d.c(),s=T(),g&&g.c(),h(i,"class","options-list")},m(v,b){o&&o.m(v,b),w(v,e,b),a&&a.m(v,b),w(v,t,b),w(v,i,b);for(let y=0;y<f.length;y+=1)f[y].m(i,null);d&&d.m(i,null),w(v,s,b),g&&g.m(v,b),l=!0},p(v,b){if(v[11]?o?o.p(v,b):(o=kc(v),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&2048)&&Dn(a,r,v,v[42],l?Tn(r,v[42],b,Yw):On(v[42]),mc),b[0]&7079426){u=v[19];let y;for(y=0;y<u.length;y+=1){const C=hc(v,u,y);f[y]?(f[y].p(C,b),A(f[y],1)):(f[y]=Tc(C),f[y].c(),A(f[y],1),f[y].m(i,null))}for(De(),y=u.length;y<f.length;y+=1)c(y);Oe(),!u.length&&d?d.p(v,b):u.length?d&&(d.d(1),d=null):(d=Sc(v),d.c(),d.m(i,null))}g&&g.p&&(!l||b[1]&2048)&&Dn(g,p,v,v[42],l?Tn(p,v[42],b,Ww):On(v[42]),dc)},i(v){if(!l){A(a,v);for(let b=0;b<u.length;b+=1)A(f[b]);A(g,v),l=!0}},o(v){P(a,v),f=f.filter(Boolean);for(let b=0;b<f.length;b+=1)P(f[b]);P(g,v),l=!1},d(v){o&&o.d(v),v&&k(e),a&&a.d(v),v&&k(t),v&&k(i),jn(f,v),d&&d.d(),v&&k(s),g&&g.d(v)}}}function Qw(n){let e,t,i,s,l,o,r=Y.toArray(n[0]),a=[];for(let d=0;d<r.length;d+=1)a[d]=vc(gc(n,r,d));const u=d=>P(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=_c(n));let c=!n[5]&&yc(n);return{c(){e=_("div"),t=_("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),s=T(),c&&c.c(),h(t,"tabindex",i=n[5]?"-1":"0"),h(t,"class","selected-container"),ee(t,"disabled",n[5]),h(e,"class",l="select "+n[12]),ee(e,"multiple",n[4]),ee(e,"disabled",n[5])},m(d,p){w(d,e,p),m(e,t);for(let g=0;g<a.length;g+=1)a[g].m(t,null);f&&f.m(t,null),n[35](t),m(e,s),c&&c.m(e,null),n[41](e),o=!0},p(d,p){if(p[0]&8661){r=Y.toArray(d[0]);let g;for(g=0;g<r.length;g+=1){const v=gc(d,r,g);a[g]?(a[g].p(v,p),A(a[g],1)):(a[g]=vc(v),a[g].c(),A(a[g],1),a[g].m(t,null))}for(De(),g=r.length;g<a.length;g+=1)u(g);Oe(),!r.length&&f?f.p(d,p):r.length?f&&(f.d(1),f=null):(f=_c(d),f.c(),f.m(t,null))}(!o||p[0]&32&&i!==(i=d[5]?"-1":"0"))&&h(t,"tabindex",i),p[0]&32&&ee(t,"disabled",d[5]),d[5]?c&&(De(),P(c,1,1,()=>{c=null}),Oe()):c?(c.p(d,p),p[0]&32&&A(c,1)):(c=yc(d),c.c(),A(c,1),c.m(e,null)),(!o||p[0]&4096&&l!==(l="select "+d[12]))&&h(e,"class",l),p[0]&4112&&ee(e,"multiple",d[4]),p[0]&4128&&ee(e,"disabled",d[5])},i(d){if(!o){for(let p=0;p<r.length;p+=1)A(a[p]);A(c),o=!0}},o(d){a=a.filter(Boolean);for(let p=0;p<a.length;p+=1)P(a[p]);P(c),o=!1},d(d){d&&k(e),jn(a,d),f&&f.d(),n[35](null),c&&c.d(),n[41](null)}}}const ta="_base_";function xw(n,e){let t=(""+e).replace(/\s+/g,"").toLowerCase(),i=n;try{typeof n=="object"&&n!==null&&(i=JSON.stringify(n))}catch{}return(""+i).replace(/\s+/g,"").toLowerCase().includes(t)}function eS(n,e,t){let i,s,l,{$$slots:o={},$$scope:r}=e,{id:a=""}=e,{noOptionsText:u="No options found"}=e,{selectPlaceholder:f="- Select -"}=e,{searchPlaceholder:c="Search..."}=e,{items:d=[]}=e,{multiple:p=!1}=e,{disabled:g=!1}=e,{selected:v=p?[]:void 0}=e,{toggle:b=!1}=e,{labelComponent:y=void 0}=e,{labelComponentProps:C={}}=e,{optionComponent:$=void 0}=e,{optionComponentProps:S={}}=e,{searchable:M=!1}=e,{searchFunc:D=void 0}=e,{class:E=""}=e,O,F="",L,H;function j(re){if(Y.isEmpty(v))return;let ae=Y.toArray(v);Y.inArray(ae,re)&&(Y.removeByValue(ae,re),t(0,v=ae)),L==null||L.dispatchEvent(new CustomEvent("change",{detail:v,bubbles:!0}))}function Q(re){if(p){let ae=Y.toArray(v);Y.inArray(ae,re)||t(0,v=[...ae,re])}else t(0,v=re);L==null||L.dispatchEvent(new CustomEvent("change",{detail:v,bubbles:!0}))}function ne(re){return l(re)?j(re):Q(re)}function B(){t(0,v=p?[]:void 0)}function K(){O!=null&&O.show&&(O==null||O.show())}function W(){O!=null&&O.hide&&(O==null||O.hide())}function J(){if(Y.isEmpty(v)||Y.isEmpty(i))return;let re=Y.toArray(v),ae=[];for(const ke of re){let Ke=!1;for(const Ye of i)if(Y.inArray(Ye.items,ke)){Ke=!0;break}Ke||ae.push(ke)}if(ae.length){for(const ke of ae)Y.removeByValue(re,ke);t(0,v=p?re:re[0])}}function ie(){t(14,F="")}function fe(re,ae){var Ye;const ke=[],Ke=D||xw;for(const nt of re){let lt;typeof ae=="string"&&ae.length?lt=((Ye=nt.items)==null?void 0:Ye.filter(xe=>Ke(xe,ae)))||[]:lt=nt.items||[],lt.length&&ke.push({group:nt.group,items:lt})}return ke}function ye(re,ae){re.preventDefault(),b&&p?ne(ae):Q(ae)}function le(re,ae){(re.code==="Enter"||re.code==="Space")&&ye(re,ae)}function ue(){ie(),setTimeout(()=>{const re=L==null?void 0:L.querySelector(".dropdown-item.option.selected");re&&(re.focus(),re.scrollIntoView({block:"nearest"}))},0)}function Te(re){re.stopPropagation(),!g&&(O==null||O.toggle())}Yn(()=>{const re=document.querySelectorAll(`label[for="${a}"]`);for(const ae of re)ae.addEventListener("click",Te);return()=>{for(const ae of re)ae.removeEventListener("click",Te)}});const Z=re=>j(re);function be(re){he[re?"unshift":"push"](()=>{H=re,t(17,H)})}function x(){F=this.value,t(14,F)}const G=(re,ae)=>ye(ae,re),_e=(re,ae)=>le(ae,re);function je(re){he[re?"unshift":"push"](()=>{O=re,t(15,O)})}function Fe(re){ht.call(this,n,re)}function Re(re){he[re?"unshift":"push"](()=>{L=re,t(16,L)})}return n.$$set=re=>{"id"in re&&t(24,a=re.id),"noOptionsText"in re&&t(1,u=re.noOptionsText),"selectPlaceholder"in re&&t(2,f=re.selectPlaceholder),"searchPlaceholder"in re&&t(3,c=re.searchPlaceholder),"items"in re&&t(25,d=re.items),"multiple"in re&&t(4,p=re.multiple),"disabled"in re&&t(5,g=re.disabled),"selected"in re&&t(0,v=re.selected),"toggle"in re&&t(6,b=re.toggle),"labelComponent"in re&&t(7,y=re.labelComponent),"labelComponentProps"in re&&t(8,C=re.labelComponentProps),"optionComponent"in re&&t(9,$=re.optionComponent),"optionComponentProps"in re&&t(10,S=re.optionComponentProps),"searchable"in re&&t(11,M=re.searchable),"searchFunc"in re&&t(26,D=re.searchFunc),"class"in re&&t(12,E=re.class),"$$scope"in re&&t(42,r=re.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&t(32,i=Y.isObjectArrayWithKeys(d,["group"])?d:[{group:ta,items:d}]),n.$$.dirty[0]&33554432&&d&&(J(),ie()),n.$$.dirty[0]&16384|n.$$.dirty[1]&2&&t(19,s=fe(i,F)),n.$$.dirty[0]&1&&t(18,l=function(re){let ae=Y.toArray(v);return Y.inArray(ae,re)})},[v,u,f,c,p,g,b,y,C,$,S,M,E,j,F,O,L,H,l,s,ie,ye,le,ue,a,d,D,Q,ne,B,K,W,i,o,Z,be,x,G,_e,je,Fe,Re,r]}class f_ extends Pe{constructor(e){super(),Ae(this,e,eS,Qw,Ee,{id:24,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:25,multiple:4,disabled:5,selected:0,toggle:6,labelComponent:7,labelComponentProps:8,optionComponent:9,optionComponentProps:10,searchable:11,searchFunc:26,class:12,deselectItem:13,selectItem:27,toggleItem:28,reset:29,showDropdown:30,hideDropdown:31},null,[-1,-1])}get deselectItem(){return this.$$.ctx[13]}get selectItem(){return this.$$.ctx[27]}get toggleItem(){return this.$$.ctx[28]}get reset(){return this.$$.ctx[29]}get showDropdown(){return this.$$.ctx[30]}get hideDropdown(){return this.$$.ctx[31]}}function Dc(n){let e,t;return{c(){e=_("i"),h(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&h(e,"class",t)},d(i){i&&k(e)}}}function tS(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&&Dc(n);return{c(){l&&l.c(),e=T(),t=_("span"),s=R(i),h(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),m(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Dc(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)+"")&&me(s,i)},i:oe,o:oe,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function nS(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Oc extends Pe{constructor(e){super(),Ae(this,e,nS,tS,Ee,{item:0})}}const iS=n=>({}),Ec=n=>({});function sS(n){let e;const t=n[8].afterOptions,i=Mn(t,n,n[12],Ec);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Dn(i,t,s,s[12],e?Tn(t,s[12],l,iS):On(s[12]),Ec)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function lS(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:[sS]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=pt(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new f_({props:o}),he.push(()=>Ie(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?pn(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&ui(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function oS(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Kt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Oc}=e,{optionComponent:c=Oc}=e,{selectionKey:d="value"}=e,{keyOfSelected:p=a?[]:void 0}=e;function g(S){S=Y.toArray(S,!0);let M=[],D=b();for(let E of D)Y.inArray(S,E[d])&&M.push(E);S.length&&!M.length||t(0,u=a?M:M[0])}async function v(S){let M=Y.toArray(S,!0).map(D=>D[d]);!r.length||t(6,p=a?M:M[0])}function b(){if(!Y.isObjectArrayWithKeys(r,["group","items"]))return r;let S=[];for(const M of r)S=S.concat(M.items);return S}function y(S){u=S,t(0,u)}function C(S){ht.call(this,n,S)}function $(S){ht.call(this,n,S)}return n.$$set=S=>{e=pt(pt({},e),ri(S)),t(5,s=Kt(e,i)),"items"in S&&t(1,r=S.items),"multiple"in S&&t(2,a=S.multiple),"selected"in S&&t(0,u=S.selected),"labelComponent"in S&&t(3,f=S.labelComponent),"optionComponent"in S&&t(4,c=S.optionComponent),"selectionKey"in S&&t(7,d=S.selectionKey),"keyOfSelected"in S&&t(6,p=S.keyOfSelected),"$$scope"in S&&t(12,o=S.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(p),n.$$.dirty&1&&v(u)},[u,r,a,f,c,s,p,d,l,y,C,$,o]}class rs extends Pe{constructor(e){super(),Ae(this,e,oS,lS,Ee,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function rS(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{searchable:!0},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;r<s.length;r+=1)o=pt(o,s[r]);return n[0]!==void 0&&(o.keyOfSelected=n[0]),e=new rs({props:o}),he.push(()=>Ie(e,"keyOfSelected",l)),{c(){z(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&14?pn(s,[a&2&&{class:"field-type-select "+r[1]},s[1],a&4&&{items:r[2]},a&8&&ui(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function aS(n,e,t){const i=["value","class"];let s=Kt(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Text",value:"text",icon:Y.getFieldTypeIcon("text")},{label:"Number",value:"number",icon:Y.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:Y.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:Y.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:Y.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:Y.getFieldTypeIcon("date")},{label:"Multiple choices",value:"select",icon:Y.getFieldTypeIcon("select")},{label:"JSON",value:"json",icon:Y.getFieldTypeIcon("json")},{label:"File",value:"file",icon:Y.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:Y.getFieldTypeIcon("relation")},{label:"User",value:"user",icon:Y.getFieldTypeIcon("user")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=pt(pt({},e),ri(u)),t(3,s=Kt(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class uS extends Pe{constructor(e){super(),Ae(this,e,aS,rS,Ee,{value:0,class:1})}}function fS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Min length"),s=T(),l=_("input"),h(e,"for",i=n[5]),h(l,"type","number"),h(l,"id",o=n[5]),h(l,"step","1"),h(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].min),r||(a=X(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].min&&Ce(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function cS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=R("Max length"),s=T(),l=_("input"),h(e,"for",i=n[5]),h(l,"type","number"),h(l,"id",o=n[5]),h(l,"step","1"),h(l,"min",r=n[0].min||0)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Ce(l,n[0].max),a||(u=X(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&h(e,"for",i),c&32&&o!==(o=f[5])&&h(l,"id",o),c&1&&r!==(r=f[0].min||0)&&h(l,"min",r),c&1&&Ot(l.value)!==f[0].max&&Ce(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function dS(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("Regex pattern"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML="Valid Go regular expression, eg. <code>^\\w+$</code>.",h(e,"for",i=n[5]),h(l,"type","text"),h(l,"id",o=n[5]),h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].pattern),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&h(e,"for",i),d&32&&o!==(o=c[5])&&h(l,"id",o),d&1&&l.value!==c[0].pattern&&Ce(l,c[0].pattern)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function hS(n){let e,t,i,s,l,o,r,a,u,f;return i=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[fS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[cS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[dS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(a,"class","col-sm-12"),h(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),f=!0},p(c,[d]){const p={};d&2&&(p.name="schema."+c[1]+".options.min"),d&97&&(p.$$scope={dirty:d,ctx:c}),i.$set(p);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&97&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.pattern"),d&97&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function pS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Ot(this.value),t(0,s)}function o(){s.max=Ot(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 mS extends Pe{constructor(e){super(),Ae(this,e,pS,hS,Ee,{key:1,options:0})}}function gS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Min"),s=T(),l=_("input"),h(e,"for",i=n[4]),h(l,"type","number"),h(l,"id",o=n[4])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].min),r||(a=X(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&h(e,"for",i),f&16&&o!==(o=u[4])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].min&&Ce(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function _S(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=R("Max"),s=T(),l=_("input"),h(e,"for",i=n[4]),h(l,"type","number"),h(l,"id",o=n[4]),h(l,"min",r=n[0].min)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Ce(l,n[0].max),a||(u=X(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&h(e,"for",i),c&16&&o!==(o=f[4])&&h(l,"id",o),c&1&&r!==(r=f[0].min)&&h(l,"min",r),c&1&&Ot(l.value)!==f[0].max&&Ce(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function bS(n){let e,t,i,s,l,o,r;return i=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[gS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[_S,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function vS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Ot(this.value),t(0,s)}function o(){s.max=Ot(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 yS extends Pe{constructor(e){super(),Ae(this,e,vS,bS,Ee,{key:1,options:0})}}function kS(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 wS extends Pe{constructor(e){super(),Ae(this,e,kS,null,Ee,{key:0,options:1})}}function SS(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r<l.length;r+=1)o=pt(o,l[r]);return{c(){e=_("input"),oi(e,o)},m(r,a){w(r,e,a),e.value=o.value,e.autofocus&&e.focus(),i||(s=X(e,"input",n[4]),i=!0)},p(r,[a]){oi(e,o=pn(l,[a&8&&t!==(t=r[3].type||"text")&&{type:t},a&4&&e.value!==r[2]&&{value:r[2]},a&8&&r[3]])),"value"in o&&(e.value=o.value)},i:oe,o:oe,d(r){r&&k(e),i=!1,s()}}}function $S(n,e,t){let i;const s=["value","separator"];let l=Kt(e,s),{value:o=[]}=e,{separator:r=","}=e;const a=u=>{t(0,o=Y.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=pt(pt({},e),ri(u)),t(3,l=Kt(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 as extends Pe{constructor(e){super(),Ae(this,e,$S,SS,Ee,{value:0,separator:1})}}function CS(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[2](b)}let v={id:n[4],disabled:!Y.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[4]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.call(null,s,{text:`List of domains that are NOT allowed.
|
||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&h(e,"for",l);const C={};y&16&&(C.id=b[4]),y&1&&(C.disabled=!Y.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function MS(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!Y.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[4]+".options.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.call(null,s,{text:`List of domains that are ONLY allowed.
|
||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&h(e,"for",l);const C={};y&16&&(C.id=b[4]+".options.onlyDomains"),y&1&&(C.disabled=!Y.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function TS(n){let e,t,i,s,l,o,r;return i=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[CS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[MS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function DS(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 c_ extends Pe{constructor(e){super(),Ae(this,e,DS,TS,Ee,{key:1,options:0})}}function OS(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 c_({props:r}),he.push(()=>Ie(e,"key",l)),he.push(()=>Ie(e,"options",o)),{c(){z(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],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){V(e,a)}}}function ES(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 AS extends Pe{constructor(e){super(),Ae(this,e,ES,OS,Ee,{key:0,options:1})}}var vr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],vs={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ml={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},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function Ac(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var yr=function(n){return n instanceof Array?n:[n]};function fn(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 xl(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function d_(n,e){if(e(n))return n;if(n.parentNode)return d_(n.parentNode,e)}function eo(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 kn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var kr=function(){},Ao=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},PS={D:kr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*In(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:kr,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:kr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Gi={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})"},ll={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ll.w(n,e,t)]},F:function(n,e,t){return Ao(ll.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(ll.h(n,e,t))},H:function(n){return mn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[In(n.getHours()>11)]},M:function(n,e){return Ao(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(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)}},h_=function(n){var e=n.config,t=e===void 0?vs:e,i=n.l10n,s=i===void 0?ml: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,p){return ll[c]&&p[d-1]!=="\\"?ll[c](r,f,t):c!=="\\"?c:""}).join("")}},na=function(n){var e=n.config,t=e===void 0?vs:e,i=n.l10n,s=i===void 0?ml: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||vs).dateFormat,p=String(l).trim();if(p==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(p)||/GMT$/.test(p))f=new Date(l);else{for(var g=void 0,v=[],b=0,y=0,C="";b<d.length;b++){var $=d[b],S=$==="\\",M=d[b-1]==="\\"||S;if(Gi[$]&&!M){C+=Gi[$];var D=new RegExp(C).exec(l);D&&(g=!0)&&v[$!=="Y"?"push":"unshift"]({fn:PS[$],val:D[++y]})}else S||(C+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),v.forEach(function(E){var O=E.fn,F=E.val;return f=O(f,F,u)||f}),f=g?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function wn(n,e,t){return t===void 0&&(t=!0),t!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var LS=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},wr=function(n,e,t){return n*3600+e*60+t},FS=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},IS={DAY:864e5};function Sr(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var s=n.minDate.getHours(),l=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<s&&(e=s),e===s&&t<l&&(t=l),e===s&&t===l&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},s=0,l=e;s<l.length;s++){var o=l[s];i(o)}return n});var ln=globalThis&&globalThis.__assign||function(){return ln=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},ln.apply(this,arguments)},Pc=globalThis&&globalThis.__spreadArrays||function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),s=0,e=0;e<t;e++)for(var l=arguments[e],o=0,r=l.length;o<r;o++,s++)i[s]=l[o];return i},NS=300;function RS(n,e){var t={config:ln(ln({},vs),Yt.defaultConfig),l10n:ml};t.parseDate=na({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=v,t._setHoursFromDate=d,t._positionCalendar=lt,t.changeMonth=ye,t.changeYear=x,t.clear=le,t.close=ue,t.onMouseOver=Re,t._createElement=St,t.createDay=D,t.destroy=Te,t.isEnabled=G,t.jumpToDate=C,t.updateValue=Ut,t.open=ae,t.redraw=de,t.set=ve,t.setDate=at,t.toggle=Je;function i(){t.utils={getDaysInMonth:function(N,I){return N===void 0&&(N=t.currentMonth),I===void 0&&(I=t.currentYear),N===1&&(I%4===0&&I%100!==0||I%400===0)?29:t.l10n.daysInMonth[N]}}}function s(){t.element=t.input=n,t.isOpen=!1,Ke(),nt(),Lt(),yt(),i(),t.isMobile||M(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Ut(!1)),r();var N=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&N&<(),tt("onReady")}function l(){var N;return((N=t.calendarContainer)===null||N===void 0?void 0:N.getRootNode()).activeElement||document.activeElement}function o(N){return N.bind(t)}function r(){var N=t.config;N.weekNumbers===!1&&N.showMonths===1||N.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var I=(t.days.offsetWidth+1)*N.showMonths;t.daysContainer.style.width=I+"px",t.calendarContainer.style.width=I+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(N){if(t.selectedDates.length===0){var I=t.config.minDate===void 0||wn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),U=Sr(t.config);I.setHours(U.hours,U.minutes,U.seconds,I.getMilliseconds()),t.selectedDates=[I],t.latestSelectedDateObj=I}N!==void 0&&N.type!=="blur"&&dt(N);var se=t._input.value;c(),Ut(),t._input.value!==se&&t._debouncedChange()}function u(N,I){return N%12+12*In(I===t.l10n.amPM[1])}function f(N){switch(N%24){case 0:case 12:return 12;default:return N%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var N=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,I=(parseInt(t.minuteElement.value,10)||0)%60,U=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(N=u(N,t.amPM.textContent));var se=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&wn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Ne=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&wn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var ze=wr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),it=wr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),We=wr(N,I,U);if(We>it&&We<ze){var ot=FS(ze);N=ot[0],I=ot[1],U=ot[2]}}else{if(Ne){var Ue=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;N=Math.min(N,Ue.getHours()),N===Ue.getHours()&&(I=Math.min(I,Ue.getMinutes())),I===Ue.getMinutes()&&(U=Math.min(U,Ue.getSeconds()))}if(se){var Xe=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;N=Math.max(N,Xe.getHours()),N===Xe.getHours()&&I<Xe.getMinutes()&&(I=Xe.getMinutes()),I===Xe.getMinutes()&&(U=Math.max(U,Xe.getSeconds()))}}p(N,I,U)}}function d(N){var I=N||t.latestSelectedDateObj;I&&I instanceof Date&&p(I.getHours(),I.getMinutes(),I.getSeconds())}function p(N,I,U){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(N%24,I,U||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=mn(t.config.time_24hr?N:(12+N)%12+12*In(N%12===0)),t.minuteElement.value=mn(I),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[In(N>=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(U)))}function g(N){var I=kn(N),U=parseInt(I.value)+(N.delta||0);(U/1e3>1||N.key==="Enter"&&!/[^\d]/.test(U.toString()))&&x(U)}function v(N,I,U,se){if(I instanceof Array)return I.forEach(function(Ne){return v(N,Ne,U,se)});if(N instanceof Array)return N.forEach(function(Ne){return v(Ne,I,U,se)});N.addEventListener(I,U,se),t._handlers.push({remove:function(){return N.removeEventListener(I,U,se)}})}function b(){tt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(U){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+U+"]"),function(se){return v(se,"click",t[U])})}),t.isMobile){Se();return}var N=Ac(re,50);if(t._debouncedChange=Ac(b,NS),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(U){t.config.mode==="range"&&Re(kn(U))}),v(t._input,"keydown",Fe),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Fe),!t.config.inline&&!t.config.static&&v(window,"resize",N),window.ontouchstart!==void 0?v(window.document,"touchstart",be):v(window.document,"mousedown",be),v(window.document,"focus",be,{capture:!0}),t.config.clickOpens===!0&&(v(t._input,"focus",t.open),v(t._input,"click",t.open)),t.daysContainer!==void 0&&(v(t.monthNav,"click",ei),v(t.monthNav,["keyup","increment"],g),v(t.daysContainer,"click",ct)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var I=function(U){return kn(U).select()};v(t.timeContainer,["increment"],a),v(t.timeContainer,"blur",a,{capture:!0}),v(t.timeContainer,"click",$),v([t.hourElement,t.minuteElement],["focus","click"],I),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(U){a(U)})}t.config.allowInput&&v(t._input,"blur",je)}function C(N,I){var U=N!==void 0?t.parseDate(N):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),se=t.currentYear,Ne=t.currentMonth;try{U!==void 0&&(t.currentYear=U.getFullYear(),t.currentMonth=U.getMonth())}catch(ze){ze.message="Invalid date supplied: "+U,t.config.errorHandler(ze)}I&&t.currentYear!==se&&(tt("onYearChange"),Q()),I&&(t.currentYear!==se||t.currentMonth!==Ne)&&tt("onMonthChange"),t.redraw()}function $(N){var I=kn(N);~I.className.indexOf("arrow")&&S(N,I.classList.contains("arrowUp")?1:-1)}function S(N,I,U){var se=N&&kn(N),Ne=U||se&&se.parentNode&&se.parentNode.firstChild,ze=Ft("increment");ze.delta=I,Ne&&Ne.dispatchEvent(ze)}function M(){var N=window.document.createDocumentFragment();if(t.calendarContainer=St("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(N.appendChild(K()),t.innerContainer=St("div","flatpickr-innerContainer"),t.config.weekNumbers){var I=fe(),U=I.weekWrapper,se=I.weekNumbers;t.innerContainer.appendChild(U),t.weekNumbers=se,t.weekWrapper=U}t.rContainer=St("div","flatpickr-rContainer"),t.rContainer.appendChild(J()),t.daysContainer||(t.daysContainer=St("div","flatpickr-days"),t.daysContainer.tabIndex=-1),j(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),N.appendChild(t.innerContainer)}t.config.enableTime&&N.appendChild(W()),fn(t.calendarContainer,"rangeMode",t.config.mode==="range"),fn(t.calendarContainer,"animate",t.config.animate===!0),fn(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(N);var Ne=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&&(!Ne&&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 ze=St("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(ze,t.element),ze.appendChild(t.element),t.altInput&&ze.appendChild(t.altInput),ze.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(N,I,U,se){var Ne=G(I,!0),ze=St("span",N,I.getDate().toString());return ze.dateObj=I,ze.$i=se,ze.setAttribute("aria-label",t.formatDate(I,t.config.ariaDateFormat)),N.indexOf("hidden")===-1&&wn(I,t.now)===0&&(t.todayDateElem=ze,ze.classList.add("today"),ze.setAttribute("aria-current","date")),Ne?(ze.tabIndex=-1,ce(I)&&(ze.classList.add("selected"),t.selectedDateElem=ze,t.config.mode==="range"&&(fn(ze,"startRange",t.selectedDates[0]&&wn(I,t.selectedDates[0],!0)===0),fn(ze,"endRange",t.selectedDates[1]&&wn(I,t.selectedDates[1],!0)===0),N==="nextMonthDay"&&ze.classList.add("inRange")))):ze.classList.add("flatpickr-disabled"),t.config.mode==="range"&&$e(I)&&!ce(I)&&ze.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&N!=="prevMonthDay"&&se%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(I)+"</span>"),tt("onDayCreate",ze),ze}function E(N){N.focus(),t.config.mode==="range"&&Re(N)}function O(N){for(var I=N>0?0:t.config.showMonths-1,U=N>0?t.config.showMonths:-1,se=I;se!=U;se+=N)for(var Ne=t.daysContainer.children[se],ze=N>0?0:Ne.children.length-1,it=N>0?Ne.children.length:-1,We=ze;We!=it;We+=N){var ot=Ne.children[We];if(ot.className.indexOf("hidden")===-1&&G(ot.dateObj))return ot}}function F(N,I){for(var U=N.className.indexOf("Month")===-1?N.dateObj.getMonth():t.currentMonth,se=I>0?t.config.showMonths:-1,Ne=I>0?1:-1,ze=U-t.currentMonth;ze!=se;ze+=Ne)for(var it=t.daysContainer.children[ze],We=U-t.currentMonth===ze?N.$i+I:I<0?it.children.length-1:0,ot=it.children.length,Ue=We;Ue>=0&&Ue<ot&&Ue!=(I>0?ot:-1);Ue+=Ne){var Xe=it.children[Ue];if(Xe.className.indexOf("hidden")===-1&&G(Xe.dateObj)&&Math.abs(N.$i-Ue)>=Math.abs(I))return E(Xe)}t.changeMonth(Ne),L(O(Ne),0)}function L(N,I){var U=l(),se=_e(U||document.body),Ne=N!==void 0?N:se?U:t.selectedDateElem!==void 0&&_e(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&_e(t.todayDateElem)?t.todayDateElem:O(I>0?1:-1);Ne===void 0?t._input.focus():se?F(Ne,I):E(Ne)}function H(N,I){for(var U=(new Date(N,I,1).getDay()-t.l10n.firstDayOfWeek+7)%7,se=t.utils.getDaysInMonth((I-1+12)%12,N),Ne=t.utils.getDaysInMonth(I,N),ze=window.document.createDocumentFragment(),it=t.config.showMonths>1,We=it?"prevMonthDay hidden":"prevMonthDay",ot=it?"nextMonthDay hidden":"nextMonthDay",Ue=se+1-U,Xe=0;Ue<=se;Ue++,Xe++)ze.appendChild(D("flatpickr-day "+We,new Date(N,I-1,Ue),Ue,Xe));for(Ue=1;Ue<=Ne;Ue++,Xe++)ze.appendChild(D("flatpickr-day",new Date(N,I,Ue),Ue,Xe));for(var $t=Ne+1;$t<=42-U&&(t.config.showMonths===1||Xe%7!==0);$t++,Xe++)ze.appendChild(D("flatpickr-day "+ot,new Date(N,I+1,$t%Ne),$t,Xe));var yn=St("div","dayContainer");return yn.appendChild(ze),yn}function j(){if(t.daysContainer!==void 0){xl(t.daysContainer),t.weekNumbers&&xl(t.weekNumbers);for(var N=document.createDocumentFragment(),I=0;I<t.config.showMonths;I++){var U=new Date(t.currentYear,t.currentMonth,1);U.setMonth(t.currentMonth+I),N.appendChild(H(U.getFullYear(),U.getMonth()))}t.daysContainer.appendChild(N),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Re()}}function Q(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var N=function(se){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&se<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&se>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var I=0;I<12;I++)if(!!N(I)){var U=St("option","flatpickr-monthDropdown-month");U.value=new Date(t.currentYear,I).getMonth().toString(),U.textContent=Ao(I,t.config.shorthandCurrentMonth,t.l10n),U.tabIndex=-1,t.currentMonth===I&&(U.selected=!0),t.monthsDropdownContainer.appendChild(U)}}}function ne(){var N=St("div","flatpickr-month"),I=window.document.createDocumentFragment(),U;t.config.showMonths>1||t.config.monthSelectorType==="static"?U=St("span","cur-month"):(t.monthsDropdownContainer=St("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(it){var We=kn(it),ot=parseInt(We.value,10);t.changeMonth(ot-t.currentMonth),tt("onMonthChange")}),Q(),U=t.monthsDropdownContainer);var se=eo("cur-year",{tabindex:"-1"}),Ne=se.getElementsByTagName("input")[0];Ne.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Ne.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Ne.setAttribute("max",t.config.maxDate.getFullYear().toString()),Ne.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var ze=St("div","flatpickr-current-month");return ze.appendChild(U),ze.appendChild(se),I.appendChild(ze),N.appendChild(I),{container:N,yearElement:Ne,monthElement:U}}function B(){xl(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var N=t.config.showMonths;N--;){var I=ne();t.yearElements.push(I.yearElement),t.monthElements.push(I.monthElement),t.monthNav.appendChild(I.container)}t.monthNav.appendChild(t.nextMonthNav)}function K(){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,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(N){t.__hidePrevMonthArrow!==N&&(fn(t.prevMonthNav,"flatpickr-disabled",N),t.__hidePrevMonthArrow=N)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(N){t.__hideNextMonthArrow!==N&&(fn(t.nextMonthNav,"flatpickr-disabled",N),t.__hideNextMonthArrow=N)}}),t.currentYearElement=t.yearElements[0],Ge(),t.monthNav}function W(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var N=Sr(t.config);t.timeContainer=St("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var I=St("span","flatpickr-time-separator",":"),U=eo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=U.getElementsByTagName("input")[0];var se=eo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=se.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?N.hours:f(N.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():N.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(U),t.timeContainer.appendChild(I),t.timeContainer.appendChild(se),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Ne=eo("flatpickr-second");t.secondElement=Ne.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():N.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(Ne)}return t.config.time_24hr||(t.amPM=St("span","flatpickr-am-pm",t.l10n.amPM[In((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function J(){t.weekdayContainer?xl(t.weekdayContainer):t.weekdayContainer=St("div","flatpickr-weekdays");for(var N=t.config.showMonths;N--;){var I=St("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(I)}return ie(),t.weekdayContainer}function ie(){if(!!t.weekdayContainer){var N=t.l10n.firstDayOfWeek,I=Pc(t.l10n.weekdays.shorthand);N>0&&N<I.length&&(I=Pc(I.splice(N,I.length),I.splice(0,N)));for(var U=t.config.showMonths;U--;)t.weekdayContainer.children[U].innerHTML=`
|
||
<span class='flatpickr-weekday'>
|
||
`+I.join("</span><span class='flatpickr-weekday'>")+`
|
||
</span>
|
||
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var N=St("div","flatpickr-weekwrapper");N.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var I=St("div","flatpickr-weeks");return N.appendChild(I),{weekWrapper:N,weekNumbers:I}}function ye(N,I){I===void 0&&(I=!0);var U=I?N:N-t.currentMonth;U<0&&t._hidePrevMonthArrow===!0||U>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=U,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,tt("onYearChange"),Q()),j(),tt("onMonthChange"),Ge())}function le(N,I){if(N===void 0&&(N=!0),I===void 0&&(I=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,I===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var U=Sr(t.config),se=U.hours,Ne=U.minutes,ze=U.seconds;p(se,Ne,ze)}t.redraw(),N&&tt("onChange")}function ue(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),tt("onClose")}function Te(){t.config!==void 0&&tt("onDestroy");for(var N=t._handlers.length;N--;)t._handlers[N].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 I=t.calendarContainer.parentNode;if(I.lastChild&&I.removeChild(I.lastChild),I.parentNode){for(;I.firstChild;)I.parentNode.insertBefore(I.firstChild,I);I.parentNode.removeChild(I)}}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(U){try{delete t[U]}catch{}})}function Z(N){return t.calendarContainer.contains(N)}function be(N){if(t.isOpen&&!t.config.inline){var I=kn(N),U=Z(I),se=I===t.input||I===t.altInput||t.element.contains(I)||N.path&&N.path.indexOf&&(~N.path.indexOf(t.input)||~N.path.indexOf(t.altInput)),Ne=!se&&!U&&!Z(N.relatedTarget),ze=!t.config.ignoredFocusElements.some(function(it){return it.contains(I)});Ne&&ze&&(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 x(N){if(!(!N||t.config.minDate&&N<t.config.minDate.getFullYear()||t.config.maxDate&&N>t.config.maxDate.getFullYear())){var I=N,U=t.currentYear!==I;t.currentYear=I||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)),U&&(t.redraw(),tt("onYearChange"),Q())}}function G(N,I){var U;I===void 0&&(I=!0);var se=t.parseDate(N,void 0,I);if(t.config.minDate&&se&&wn(se,t.config.minDate,I!==void 0?I:!t.minDateHasTime)<0||t.config.maxDate&&se&&wn(se,t.config.maxDate,I!==void 0?I:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(se===void 0)return!1;for(var Ne=!!t.config.enable,ze=(U=t.config.enable)!==null&&U!==void 0?U:t.config.disable,it=0,We=void 0;it<ze.length;it++){if(We=ze[it],typeof We=="function"&&We(se))return Ne;if(We instanceof Date&&se!==void 0&&We.getTime()===se.getTime())return Ne;if(typeof We=="string"){var ot=t.parseDate(We,void 0,!0);return ot&&ot.getTime()===se.getTime()?Ne:!Ne}else if(typeof We=="object"&&se!==void 0&&We.from&&We.to&&se.getTime()>=We.from.getTime()&&se.getTime()<=We.to.getTime())return Ne}return!Ne}function _e(N){return t.daysContainer!==void 0?N.className.indexOf("hidden")===-1&&N.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(N):!1}function je(N){var I=N.target===t._input,U=t._input.value.trimEnd()!==Xt();I&&U&&!(N.relatedTarget&&Z(N.relatedTarget))&&t.setDate(t._input.value,!0,N.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Fe(N){var I=kn(N),U=t.config.wrap?n.contains(I):I===t._input,se=t.config.allowInput,Ne=t.isOpen&&(!se||!U),ze=t.config.inline&&U&&!se;if(N.keyCode===13&&U){if(se)return t.setDate(t._input.value,!0,I===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),I.blur();t.open()}else if(Z(I)||Ne||ze){var it=!!t.timeContainer&&t.timeContainer.contains(I);switch(N.keyCode){case 13:it?(N.preventDefault(),a(),qe()):ct(N);break;case 27:N.preventDefault(),qe();break;case 8:case 46:U&&!t.config.allowInput&&(N.preventDefault(),t.clear());break;case 37:case 39:if(!it&&!U){N.preventDefault();var We=l();if(t.daysContainer!==void 0&&(se===!1||We&&_e(We))){var ot=N.keyCode===39?1:-1;N.ctrlKey?(N.stopPropagation(),ye(ot),L(O(1),0)):L(void 0,ot)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:N.preventDefault();var Ue=N.keyCode===40?1:-1;t.daysContainer&&I.$i!==void 0||I===t.input||I===t.altInput?N.ctrlKey?(N.stopPropagation(),x(t.currentYear-Ue),L(O(1),0)):it||L(void 0,Ue*7):I===t.currentYearElement?x(t.currentYear-Ue):t.config.enableTime&&(!it&&t.hourElement&&t.hourElement.focus(),a(N),t._debouncedChange());break;case 9:if(it){var Xe=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Jt){return Jt}),$t=Xe.indexOf(I);if($t!==-1){var yn=Xe[$t+(N.shiftKey?-1:1)];N.preventDefault(),(yn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(I)&&N.shiftKey&&(N.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&I===t.amPM)switch(N.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Ut();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ut();break}(U||Z(I))&&tt("onKeyDown",N)}function Re(N,I){if(I===void 0&&(I="flatpickr-day"),!(t.selectedDates.length!==1||N&&(!N.classList.contains(I)||N.classList.contains("flatpickr-disabled")))){for(var U=N?N.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),se=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Ne=Math.min(U,t.selectedDates[0].getTime()),ze=Math.max(U,t.selectedDates[0].getTime()),it=!1,We=0,ot=0,Ue=Ne;Ue<ze;Ue+=IS.DAY)G(new Date(Ue),!0)||(it=it||Ue>Ne&&Ue<ze,Ue<se&&(!We||Ue>We)?We=Ue:Ue>se&&(!ot||Ue<ot)&&(ot=Ue));var Xe=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+I));Xe.forEach(function($t){var yn=$t.dateObj,Jt=yn.getTime(),Qt=We>0&&Jt<We||ot>0&&Jt>ot;if(Qt){$t.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ci){$t.classList.remove(ci)});return}else if(it&&!Qt)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ci){$t.classList.remove(ci)}),N!==void 0&&(N.classList.add(U<=t.selectedDates[0].getTime()?"startRange":"endRange"),se<U&&Jt===se?$t.classList.add("startRange"):se>U&&Jt===se&&$t.classList.add("endRange"),Jt>=We&&(ot===0||Jt<=ot)&&LS(Jt,se,U)&&$t.classList.add("inRange"))})}}function re(){t.isOpen&&!t.config.static&&!t.config.inline&<()}function ae(N,I){if(I===void 0&&(I=t._positionElement),t.isMobile===!0){if(N){N.preventDefault();var U=kn(N);U&&U.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),tt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var se=t.isOpen;t.isOpen=!0,se||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),tt("onOpen"),lt(I)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(N===void 0||!t.timeContainer.contains(N.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ke(N){return function(I){var U=t.config["_"+N+"Date"]=t.parseDate(I,t.config.dateFormat),se=t.config["_"+(N==="min"?"max":"min")+"Date"];U!==void 0&&(t[N==="min"?"minDateHasTime":"maxDateHasTime"]=U.getHours()>0||U.getMinutes()>0||U.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Ne){return G(Ne)}),!t.selectedDates.length&&N==="min"&&d(U),Ut()),t.daysContainer&&(de(),U!==void 0?t.currentYearElement[N]=U.getFullYear().toString():t.currentYearElement.removeAttribute(N),t.currentYearElement.disabled=!!se&&U!==void 0&&se.getFullYear()===U.getFullYear())}}function Ke(){var N=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],I=ln(ln({},JSON.parse(JSON.stringify(n.dataset||{}))),e),U={};t.config.parseDate=I.parseDate,t.config.formatDate=I.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Xe){t.config._enable=mt(Xe)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Xe){t.config._disable=mt(Xe)}});var se=I.mode==="time";if(!I.dateFormat&&(I.enableTime||se)){var Ne=Yt.defaultConfig.dateFormat||vs.dateFormat;U.dateFormat=I.noCalendar||se?"H:i"+(I.enableSeconds?":S":""):Ne+" H:i"+(I.enableSeconds?":S":"")}if(I.altInput&&(I.enableTime||se)&&!I.altFormat){var ze=Yt.defaultConfig.altFormat||vs.altFormat;U.altFormat=I.noCalendar||se?"h:i"+(I.enableSeconds?":S K":" K"):ze+(" h:i"+(I.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ke("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ke("max")});var it=function(Xe){return function($t){t.config[Xe==="min"?"_minTime":"_maxTime"]=t.parseDate($t,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:it("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:it("max")}),I.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,U,I);for(var We=0;We<N.length;We++)t.config[N[We]]=t.config[N[We]]===!0||t.config[N[We]]==="true";vr.filter(function(Xe){return t.config[Xe]!==void 0}).forEach(function(Xe){t.config[Xe]=yr(t.config[Xe]||[]).map(o)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var We=0;We<t.config.plugins.length;We++){var ot=t.config.plugins[We](t)||{};for(var Ue in ot)vr.indexOf(Ue)>-1?t.config[Ue]=yr(ot[Ue]).map(o).concat(t.config[Ue]):typeof I[Ue]>"u"&&(t.config[Ue]=ot[Ue])}I.altInputClass||(t.config.altInputClass=Ye().className+" "+t.config.altInputClass),tt("onParseConfig")}function Ye(){return t.config.wrap?n.querySelector("[data-input]"):n}function nt(){typeof t.config.locale!="object"&&typeof Yt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=ln(ln({},Yt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Yt.l10ns[t.config.locale]:void 0),Gi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Gi.l="("+t.l10n.weekdays.longhand.join("|")+")",Gi.M="("+t.l10n.months.shorthand.join("|")+")",Gi.F="("+t.l10n.months.longhand.join("|")+")",Gi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var N=ln(ln({},e),JSON.parse(JSON.stringify(n.dataset||{})));N.time_24hr===void 0&&Yt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=h_(t),t.parseDate=na({config:t.config,l10n:t.l10n})}function lt(N){if(typeof t.config.position=="function")return void t.config.position(t,N);if(t.calendarContainer!==void 0){tt("onPreCalendarPosition");var I=N||t._positionElement,U=Array.prototype.reduce.call(t.calendarContainer.children,function(ji,Pl){return ji+Pl.offsetHeight},0),se=t.calendarContainer.offsetWidth,Ne=t.config.position.split(" "),ze=Ne[0],it=Ne.length>1?Ne[1]:null,We=I.getBoundingClientRect(),ot=window.innerHeight-We.bottom,Ue=ze==="above"||ze!=="below"&&ot<U&&We.top>U,Xe=window.pageYOffset+We.top+(Ue?-U-2:I.offsetHeight+2);if(fn(t.calendarContainer,"arrowTop",!Ue),fn(t.calendarContainer,"arrowBottom",Ue),!t.config.inline){var $t=window.pageXOffset+We.left,yn=!1,Jt=!1;it==="center"?($t-=(se-We.width)/2,yn=!0):it==="right"&&($t-=se-We.width,Jt=!0),fn(t.calendarContainer,"arrowLeft",!yn&&!Jt),fn(t.calendarContainer,"arrowCenter",yn),fn(t.calendarContainer,"arrowRight",Jt);var Qt=window.document.body.offsetWidth-(window.pageXOffset+We.right),ci=$t+se>window.document.body.offsetWidth,Si=Qt+se>window.document.body.offsetWidth;if(fn(t.calendarContainer,"rightMost",ci),!t.config.static)if(t.calendarContainer.style.top=Xe+"px",!ci)t.calendarContainer.style.left=$t+"px",t.calendarContainer.style.right="auto";else if(!Si)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Qt+"px";else{var en=xe();if(en===void 0)return;var us=window.document.body.offsetWidth,Ol=Math.max(0,us/2-se/2),Hi=".flatpickr-calendar.centerMost:before",El=".flatpickr-calendar.centerMost:after",fs=en.cssRules.length,Al="{left:"+We.left+"px;right:auto;}";fn(t.calendarContainer,"rightMost",!1),fn(t.calendarContainer,"centerMost",!0),en.insertRule(Hi+","+El+Al,fs),t.calendarContainer.style.left=Ol+"px",t.calendarContainer.style.right="auto"}}}}function xe(){for(var N=null,I=0;I<document.styleSheets.length;I++){var U=document.styleSheets[I];if(!!U.cssRules){try{U.cssRules}catch{continue}N=U;break}}return N!=null?N:ge()}function ge(){var N=document.createElement("style");return document.head.appendChild(N),N.sheet}function de(){t.config.noCalendar||t.isMobile||(Q(),Ge(),j())}function qe(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function ct(N){N.preventDefault(),N.stopPropagation();var I=function(Xe){return Xe.classList&&Xe.classList.contains("flatpickr-day")&&!Xe.classList.contains("flatpickr-disabled")&&!Xe.classList.contains("notAllowed")},U=d_(kn(N),I);if(U!==void 0){var se=U,Ne=t.latestSelectedDateObj=new Date(se.dateObj.getTime()),ze=(Ne.getMonth()<t.currentMonth||Ne.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=se,t.config.mode==="single")t.selectedDates=[Ne];else if(t.config.mode==="multiple"){var it=ce(Ne);it?t.selectedDates.splice(parseInt(it),1):t.selectedDates.push(Ne)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Ne,t.selectedDates.push(Ne),wn(Ne,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Xe,$t){return Xe.getTime()-$t.getTime()}));if(c(),ze){var We=t.currentYear!==Ne.getFullYear();t.currentYear=Ne.getFullYear(),t.currentMonth=Ne.getMonth(),We&&(tt("onYearChange"),Q()),tt("onMonthChange")}if(Ge(),j(),Ut(),!ze&&t.config.mode!=="range"&&t.config.showMonths===1?E(se):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var ot=t.config.mode==="single"&&!t.config.enableTime,Ue=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(ot||Ue)&&qe()}b()}}var te={locale:[nt,ie],showMonths:[B,r,J],minDate:[C],maxDate:[C],positionElement:[pe],clickOpens:[function(){t.config.clickOpens===!0?(v(t._input,"focus",t.open),v(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function ve(N,I){if(N!==null&&typeof N=="object"){Object.assign(t.config,N);for(var U in N)te[U]!==void 0&&te[U].forEach(function(se){return se()})}else t.config[N]=I,te[N]!==void 0?te[N].forEach(function(se){return se()}):vr.indexOf(N)>-1&&(t.config[N]=yr(I));t.redraw(),Ut(!0)}function Ze(N,I){var U=[];if(N instanceof Array)U=N.map(function(se){return t.parseDate(se,I)});else if(N instanceof Date||typeof N=="number")U=[t.parseDate(N,I)];else if(typeof N=="string")switch(t.config.mode){case"single":case"time":U=[t.parseDate(N,I)];break;case"multiple":U=N.split(t.config.conjunction).map(function(se){return t.parseDate(se,I)});break;case"range":U=N.split(t.l10n.rangeSeparator).map(function(se){return t.parseDate(se,I)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(N)));t.selectedDates=t.config.allowInvalidPreload?U:U.filter(function(se){return se instanceof Date&&G(se,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(se,Ne){return se.getTime()-Ne.getTime()})}function at(N,I,U){if(I===void 0&&(I=!1),U===void 0&&(U=t.config.dateFormat),N!==0&&!N||N instanceof Array&&N.length===0)return t.clear(I);Ze(N,U),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),C(void 0,I),d(),t.selectedDates.length===0&&t.clear(!1),Ut(I),I&&tt("onChange")}function mt(N){return N.slice().map(function(I){return typeof I=="string"||typeof I=="number"||I instanceof Date?t.parseDate(I,void 0,!0):I&&typeof I=="object"&&I.from&&I.to?{from:t.parseDate(I.from,void 0),to:t.parseDate(I.to,void 0)}:I}).filter(function(I){return I})}function yt(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var N=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);N&&Ze(N,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Lt(){if(t.input=Ye(),!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"),pe()}function pe(){t._positionElement=t.config.positionElement||t._input}function Se(){var N=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=N,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="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{}v(t.mobileInput,"change",function(I){t.setDate(kn(I).value,!1,t.mobileFormatStr),tt("onChange"),tt("onClose")})}function Je(N){if(t.isOpen===!0)return t.close();t.open(N)}function tt(N,I){if(t.config!==void 0){var U=t.config[N];if(U!==void 0&&U.length>0)for(var se=0;U[se]&&se<U.length;se++)U[se](t.selectedDates,t.input.value,t,I);N==="onChange"&&(t.input.dispatchEvent(Ft("change")),t.input.dispatchEvent(Ft("input")))}}function Ft(N){var I=document.createEvent("Event");return I.initEvent(N,!0,!0),I}function ce(N){for(var I=0;I<t.selectedDates.length;I++){var U=t.selectedDates[I];if(U instanceof Date&&wn(U,N)===0)return""+I}return!1}function $e(N){return t.config.mode!=="range"||t.selectedDates.length<2?!1:wn(N,t.selectedDates[0])>=0&&wn(N,t.selectedDates[1])<=0}function Ge(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(N,I){var U=new Date(t.currentYear,t.currentMonth,1);U.setMonth(t.currentMonth+I),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[I].textContent=Ao(U.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=U.getMonth().toString(),N.value=U.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Xt(N){var I=N||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(U){return t.formatDate(U,I)}).filter(function(U,se,Ne){return t.config.mode!=="range"||t.config.enableTime||Ne.indexOf(U)===se}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ut(N){N===void 0&&(N=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Xt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Xt(t.config.altFormat)),N!==!1&&tt("onValueUpdate")}function ei(N){var I=kn(N),U=t.prevMonthNav.contains(I),se=t.nextMonthNav.contains(I);U||se?ye(U?-1:1):t.yearElements.indexOf(I)>=0?I.select():I.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):I.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function dt(N){N.preventDefault();var I=N.type==="keydown",U=kn(N),se=U;t.amPM!==void 0&&U===t.amPM&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]);var Ne=parseFloat(se.getAttribute("min")),ze=parseFloat(se.getAttribute("max")),it=parseFloat(se.getAttribute("step")),We=parseInt(se.value,10),ot=N.delta||(I?N.which===38?1:-1:0),Ue=We+it*ot;if(typeof se.value<"u"&&se.value.length===2){var Xe=se===t.hourElement,$t=se===t.minuteElement;Ue<Ne?(Ue=ze+Ue+In(!Xe)+(In(Xe)&&In(!t.amPM)),$t&&S(void 0,-1,t.hourElement)):Ue>ze&&(Ue=se===t.hourElement?Ue-ze-In(!t.amPM):Ne,$t&&S(void 0,1,t.hourElement)),t.amPM&&Xe&&(it===1?Ue+We===23:Math.abs(Ue-We)>it)&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]),se.value=mn(Ue)}}return s(),t}function ys(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s<t.length;s++){var l=t[s];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=RS(l,e||{}),i.push(l._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return ys(this,n)},HTMLElement.prototype.flatpickr=function(n){return ys([this],n)});var Yt=function(n,e){return typeof n=="string"?ys(window.document.querySelectorAll(n),e):n instanceof Node?ys([n],e):ys(n,e)};Yt.defaultConfig={};Yt.l10ns={en:ln({},ml),default:ln({},ml)};Yt.localize=function(n){Yt.l10ns.default=ln(ln({},Yt.l10ns.default),n)};Yt.setDefaults=function(n){Yt.defaultConfig=ln(ln({},Yt.defaultConfig),n)};Yt.parseDate=na({});Yt.formatDate=h_({});Yt.compareDates=wn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ys(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Yt);function HS(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=pt(i,t[s]);return{c(){e=_("input"),oi(e,i)},m(s,l){w(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){oi(e,i=pn(t,[l&2&&s[1]]))},d(s){s&&k(e),n[11](null)}}}function jS(n){let e;const t=n[10].default,i=Mn(t,n,n[9],null),s=i||HS(n);return{c(){s&&s.c()},m(l,o){s&&s.m(l,o),e=!0},p(l,[o]){i?i.p&&(!e||o&512)&&Dn(i,t,l,l[9],e?Tn(t,l[9],o,null):On(l[9]),null):s&&s.p&&(!e||o&3)&&s.p(l,e?o:-1)},i(l){e||(A(s,l),e=!0)},o(l){P(s,l),e=!1},d(l){s&&s.d(l)}}}function qS(n){return n.charAt(2).toLowerCase()+n.substring(3)}function VS(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Kt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a="",formattedValue:u="",element:f=null,dateFormat:c=null}=e,{options:d={}}=e,p=!1,{input:g=void 0,flatpickr:v=void 0}=e;Yn(()=>{const S=f||g,M=y(d);return M.onReady.push(()=>{t(8,p=!0)}),t(3,v=Yt(S,Object.assign(M,f?{wrap:!0}:{}))),()=>{v.destroy()}});const b=un();function y(S={}){S=Object.assign({},S);for(const M of r){const D=(E,O,F)=>{b(qS(M),[E,O,F])};M in S?(Array.isArray(S[M])||(S[M]=[S[M]]),S[M].push(D)):S[M]=[D]}return S.onChange&&!S.onChange.includes(C)&&S.onChange.push(C),S}function C(S,M,D){var O,F;const E=(F=(O=D==null?void 0:D.config)==null?void 0:O.mode)!=null?F:"single";t(2,a=E==="single"?S[0]:S),t(4,u=M)}function $(S){he[S?"unshift":"push"](()=>{g=S,t(0,g)})}return n.$$set=S=>{e=pt(pt({},e),ri(S)),t(1,s=Kt(e,i)),"value"in S&&t(2,a=S.value),"formattedValue"in S&&t(4,u=S.formattedValue),"element"in S&&t(5,f=S.element),"dateFormat"in S&&t(6,c=S.dateFormat),"options"in S&&t(7,d=S.options),"input"in S&&t(0,g=S.input),"flatpickr"in S&&t(3,v=S.flatpickr),"$$scope"in S&&t(9,o=S.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&p&&v.setDate(a,!1,c),n.$$.dirty&392&&v&&p)for(const[S,M]of Object.entries(y(d)))v.set(S,M)},[g,s,a,v,u,f,c,d,p,o,l,$]}class Ba extends Pe{constructor(e){super(),Ae(this,e,VS,jS,Ee,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function zS(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:Y.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new Ba({props:u}),he.push(()=>Ie(l,"formattedValue",a)),{c(){e=_("label"),t=R("Min date (UTC)"),s=T(),z(l.$$.fragment),h(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&h(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,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function BS(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:Y.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new Ba({props:u}),he.push(()=>Ie(l,"formattedValue",a)),{c(){e=_("label"),t=R("Max date (UTC)"),s=T(),z(l.$$.fragment),h(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&h(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,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function US(n){let e,t,i,s,l,o,r;return i=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[zS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[BS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function WS(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 YS extends Pe{constructor(e){super(),Ae(this,e,WS,US,Ee,{key:1,options:0})}}function KS(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 as({props:c}),he.push(()=>Ie(l,"value",f)),{c(){e=_("label"),t=R("Choices"),s=T(),z(l.$$.fragment),r=T(),a=_("div"),a.textContent="Use comma as separator.",h(e,"for",i=n[4]),h(a,"class","help-block")},m(d,p){w(d,e,p),m(e,t),w(d,s,p),q(l,d,p),w(d,r,p),w(d,a,p),u=!0},p(d,p){(!u||p&16&&i!==(i=d[4]))&&h(e,"for",i);const g={};p&16&&(g.id=d[4]),!o&&p&1&&(o=!0,g.value=d[0].values,He(()=>o=!1)),l.$set(g)},i(d){u||(A(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&k(e),d&&k(s),V(l,d),d&&k(r),d&&k(a)}}}function ZS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max select"),s=T(),l=_("input"),h(e,"for",i=n[4]),h(l,"type","number"),h(l,"id",o=n[4]),h(l,"step","1"),h(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=X(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&h(e,"for",i),f&16&&o!==(o=u[4])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function JS(n){let e,t,i,s,l,o,r;return i=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[KS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[ZS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-9"),h(l,"class","col-sm-3"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function GS(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=Ot(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&&Y.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class XS extends Pe{constructor(e){super(),Ae(this,e,GS,JS,Ee,{key:1,options:0})}}function QS(n,e,t){return["",{}]}class xS extends Pe{constructor(e){super(),Ae(this,e,QS,null,Ee,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function e3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max file size (bytes)"),s=T(),l=_("input"),h(e,"for",i=n[10]),h(l,"type","number"),h(l,"id",o=n[10]),h(l,"step","1"),h(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSize),r||(a=X(l,"input",n[2]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&h(e,"for",i),f&1024&&o!==(o=u[10])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].maxSize&&Ce(l,u[0].maxSize)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function t3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max files"),s=T(),l=_("input"),h(e,"for",i=n[10]),h(l,"type","number"),h(l,"id",o=n[10]),h(l,"step","1"),h(l,"min",""),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=X(l,"input",n[3]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&h(e,"for",i),f&1024&&o!==(o=u[10])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function n3(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("div"),e.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',t=T(),i=_("div"),i.innerHTML='<span class="txt">Images (jpg, png, svg, gif)</span>',s=T(),l=_("div"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=T(),r=_("div"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',h(e,"tabindex","0"),h(e,"class","dropdown-item closable"),h(i,"tabindex","0"),h(i,"class","dropdown-item closable"),h(l,"tabindex","0"),h(l,"class","dropdown-item closable"),h(r,"tabindex","0"),h(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[X(e,"click",n[5]),X(i,"click",n[6]),X(l,"click",n[7]),X(r,"click",n[8])],a=!0)},p:oe,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,st(u)}}}function i3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C;function $(M){n[4](M)}let S={id:n[10],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(S.value=n[0].mimeTypes),r=new as({props:S}),he.push(()=>Ie(r,"value",$)),v=new os({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[n3]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Mime types",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),c=R(`Use comma as separator.
|
||
`),d=_("span"),p=_("span"),p.textContent="Choose presets",g=T(),z(v.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(p,"class","txt link-primary"),h(d,"class","inline-flex"),h(f,"class","help-block")},m(M,D){w(M,e,D),m(e,t),m(e,i),m(e,s),w(M,o,D),q(r,M,D),w(M,u,D),w(M,f,D),m(f,c),m(f,d),m(d,p),m(d,g),q(v,d,null),b=!0,y||(C=Qe(Ct.call(null,s,{text:`Allow files ONLY with the listed mime types.
|
||
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&h(e,"for",l);const E={};D&1024&&(E.id=M[10]),!a&&D&1&&(a=!0,E.value=M[0].mimeTypes,He(()=>a=!1)),r.$set(E);const O={};D&2049&&(O.$$scope={dirty:D,ctx:M}),v.$set(O)},i(M){b||(A(r.$$.fragment,M),A(v.$$.fragment,M),b=!0)},o(M){P(r.$$.fragment,M),P(v.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(o),V(r,M),M&&k(u),M&&k(f),V(v),y=!1,C()}}}function s3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[9](b)}let v={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&1024&&l!==(l=b[10]))&&h(e,"for",l);const C={};y&1024&&(C.id=b[10]),!a&&y&1&&(a=!0,C.value=b[0].thumbs,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function l3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return i=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[e3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[t3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[i3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[s3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(a,"class","col-sm-12"),h(c,"class","col-sm-12"),h(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),p=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const $={};v&2&&($.name="schema."+g[1]+".options.thumbs"),v&3073&&($.$$scope={dirty:v,ctx:g}),d.$set($)},i(g){p||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),p=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),p=!1},d(g){g&&k(e),V(i),V(o),V(u),V(d)}}}function o3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Ot(this.value),t(0,s)}function o(){s.maxSelect=Ot(this.value),t(0,s)}function r(p){n.$$.not_equal(s.mimeTypes,p)&&(s.mimeTypes=p,t(0,s))}const a=()=>{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)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(p){n.$$.not_equal(s.thumbs,p)&&(s.thumbs=p,t(0,s))}return n.$$set=p=>{"key"in p&&t(1,i=p.key),"options"in p&&t(0,s=p.options)},n.$$.update=()=>{n.$$.dirty&1&&Y.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class r3 extends Pe{constructor(e){super(),Ae(this,e,o3,l3,Ee,{key:1,options:0})}}function a3(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new rs({props:u}),he.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("Collection"),s=T(),z(l.$$.fragment),h(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&h(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function u3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max select"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","number"),h(l,"id",o=n[9]),h(l,"step","1"),h(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=X(l,"input",n[6]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function f3(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={id:n[9],items:n[4]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new rs({props:u}),he.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("Delete record on relation delete"),s=T(),z(l.$$.fragment),h(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&h(e,"for",i);const d={};c&512&&(d.id=f[9]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function c3(n){let e,t,i,s,l,o,r,a,u,f;return i=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[a3,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[u3,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[f3,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-9"),h(l,"class","col-sm-3"),h(a,"class","col-sm-12"),h(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),f=!0},p(c,[d]){const p={};d&2&&(p.name="schema."+c[1]+".options.collectionId"),d&1549&&(p.$$scope={dirty:d,ctx:c}),i.$set(p);const g={};d&2&&(g.name="schema."+c[1]+".options.maxSelect"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.cascadeDelete"),d&1537&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function d3(n,e,t){let{key:i=""}=e,{options:s={}}=e;const l=[{label:"False",value:!1},{label:"True",value:!0}];let o=!1,r=[];a();function a(){t(2,o=!0),we.Collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,r=d)}).catch(d=>{we.errorResponseHandler(d)}).finally(()=>{t(2,o=!1)})}function u(d){n.$$.not_equal(s.collectionId,d)&&(s.collectionId=d,t(0,s))}function f(){s.maxSelect=Ot(this.value),t(0,s)}function c(d){n.$$.not_equal(s.cascadeDelete,d)&&(s.cascadeDelete=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&Y.isEmpty(s)&&t(0,s={maxSelect:1,collectionId:null,cascadeDelete:!1})},[s,i,o,r,l,u,f,c]}class h3 extends Pe{constructor(e){super(),Ae(this,e,d3,c3,Ee,{key:1,options:0})}}function p3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max select"),s=T(),l=_("input"),h(e,"for",i=n[5]),h(l,"type","number"),h(l,"id",o=n[5]),h(l,"step","1"),h(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=X(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function m3(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new rs({props:u}),he.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("Delete record on user delete"),s=T(),z(l.$$.fragment),h(e,"for",i=n[5])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&h(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function g3(n){let e,t,i,s,l,o,r;return i=new Le({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[p3,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[m3,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.maxSelect"),u&97&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.cascadeDelete"),u&97&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function _3(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=Ot(this.value),t(0,l)}function r(a){n.$$.not_equal(l.cascadeDelete,a)&&(l.cascadeDelete=a,t(0,l))}return n.$$set=a=>{"key"in a&&t(1,s=a.key),"options"in a&&t(0,l=a.options)},n.$$.update=()=>{n.$$.dirty&1&&Y.isEmpty(l)&&t(0,l={maxSelect:1,cascadeDelete:!1})},[l,s,i,o,r]}class b3 extends Pe{constructor(e){super(),Ae(this,e,_3,g3,Ee,{key:1,options:0})}}function v3(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[38],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new uS({props:u}),he.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Type"),s=T(),z(l.$$.fragment),h(e,"for",i=n[38])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&128&&i!==(i=f[38]))&&h(e,"for",i);const d={};c[1]&128&&(d.id=f[38]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function Lc(n){let e,t,i;return{c(){e=_("span"),e.textContent="Duplicated or invalid name",h(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){w(s,e,l),i=!0},i(s){i||(Dt(()=>{t||(t=ut(e,Vn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=ut(e,Vn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function y3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g=!n[5]&&Lc();return{c(){e=_("label"),t=_("span"),t.textContent="Name",i=T(),g&&g.c(),l=T(),o=_("input"),h(t,"class","txt"),h(e,"for",s=n[38]),h(o,"type","text"),h(o,"id",r=n[38]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,h(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(v,b){w(v,e,b),m(e,t),m(e,i),g&&g.m(e,null),w(v,l,b),w(v,o,b),c=!0,n[0].id||o.focus(),d||(p=X(o,"input",n[17]),d=!0)},p(v,b){v[5]?g&&(De(),P(g,1,1,()=>{g=null}),Oe()):g?b[0]&32&&A(g,1):(g=Lc(),g.c(),A(g,1),g.m(e,null)),(!c||b[1]&128&&s!==(s=v[38]))&&h(e,"for",s),(!c||b[1]&128&&r!==(r=v[38]))&&h(o,"id",r),(!c||b[0]&1&&a!==(a=v[0].id&&v[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!v[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=v[0].name)&&o.value!==f)&&(o.value=f)},i(v){c||(A(g),c=!0)},o(v){P(g),c=!1},d(v){v&&k(e),g&&g.d(),v&&k(l),v&&k(o),d=!1,p()}}}function k3(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 b3({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function w3(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 h3({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function S3(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 r3({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $3(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 xS({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function C3(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 XS({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M3(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 YS({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function T3(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 AS({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function D3(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 c_({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O3(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 wS({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function E3(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 yS({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function A3(n){let e,t,i;function s(o){n[18](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new mS({props:l}),he.push(()=>Ie(e,"options",s)),{c(){z(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function P3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Required"),h(e,"type","checkbox"),h(e,"id",t=n[38]),h(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].required,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[29]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&h(e,"id",t),f[0]&1&&(e.checked=u[0].required),f[1]&128&&o!==(o=u[38])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Fc(n){let e,t;return e=new Le({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[L3,({uniqueId:i})=>({38:i}),({uniqueId:i})=>[0,i?128:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&384&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function L3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Unique"),h(e,"type","checkbox"),h(e,"id",t=n[38]),h(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].unique,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[30]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&h(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&128&&o!==(o=u[38])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Ic(n){let e,t,i,s,l,o,r,a,u=n[8]&&Nc(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),l=_("button"),l.innerHTML='<span class="txt">Remove</span>',o=T(),u&&u.c(),h(t,"class","flex-fill"),h(l,"type","button"),h(l,"class","btn btn-sm btn-secondary fade"),h(s,"class","inline-flex flex-gap-base flex-nowrap"),h(e,"class","col-sm-4 txt-right")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),u&&u.m(s,null),r||(a=X(l,"click",qn(n[9])),r=!0)},p(f,c){f[8]?u?u.p(f,c):(u=Nc(f),u.c(),u.m(s,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function Nc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Done</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",qn(n[3])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function F3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D;s=new Le({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[v3,({uniqueId:j})=>({38:j}),({uniqueId:j})=>[0,j?128:0]]},$$scope:{ctx:n}}}),r=new Le({props:{class:`
|
||
form-field
|
||
required
|
||
`+(n[5]?"":"invalid")+`
|
||
`+(n[0].id&&n[0].system?"disabled":"")+`
|
||
`,name:"schema."+n[1]+".name",$$slots:{default:[y3,({uniqueId:j})=>({38:j}),({uniqueId:j})=>[0,j?128:0]]},$$scope:{ctx:n}}});const E=[A3,E3,O3,D3,T3,M3,C3,$3,S3,w3,k3],O=[];function F(j,Q){return j[0].type==="text"?0:j[0].type==="number"?1:j[0].type==="bool"?2:j[0].type==="email"?3:j[0].type==="url"?4:j[0].type==="date"?5:j[0].type==="select"?6:j[0].type==="json"?7:j[0].type==="file"?8:j[0].type==="relation"?9:j[0].type==="user"?10:-1}~(f=F(n))&&(c=O[f]=E[f](n)),g=new Le({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[P3,({uniqueId:j})=>({38:j}),({uniqueId:j})=>[0,j?128:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&Fc(n),H=!n[0].toDelete&&Ic(n);return{c(){e=_("form"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),p=_("div"),z(g.$$.fragment),v=T(),b=_("div"),L&&L.c(),y=T(),H&&H.c(),C=T(),$=_("input"),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(u,"class","col-sm-12 hidden-empty"),h(p,"class","col-sm-4 flex"),h(b,"class","col-sm-4 flex"),h(t,"class","grid"),h($,"type","submit"),h($,"class","hidden"),h($,"tabindex","-1"),h(e,"class","field-form")},m(j,Q){w(j,e,Q),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,p),q(g,p,null),m(t,v),m(t,b),L&&L.m(b,null),m(t,y),H&&H.m(t,null),m(e,C),m(e,$),S=!0,M||(D=X(e,"submit",Bt(n[31])),M=!0)},p(j,Q){const ne={};Q[0]&1&&(ne.class="form-field required "+(j[0].id?"disabled":"")),Q[0]&2&&(ne.name="schema."+j[1]+".type"),Q[0]&1|Q[1]&384&&(ne.$$scope={dirty:Q,ctx:j}),s.$set(ne);const B={};Q[0]&33&&(B.class=`
|
||
form-field
|
||
required
|
||
`+(j[5]?"":"invalid")+`
|
||
`+(j[0].id&&j[0].system?"disabled":"")+`
|
||
`),Q[0]&2&&(B.name="schema."+j[1]+".name"),Q[0]&33|Q[1]&384&&(B.$$scope={dirty:Q,ctx:j}),r.$set(B);let K=f;f=F(j),f===K?~f&&O[f].p(j,Q):(c&&(De(),P(O[K],1,1,()=>{O[K]=null}),Oe()),~f?(c=O[f],c?c.p(j,Q):(c=O[f]=E[f](j),c.c()),A(c,1),c.m(u,null)):c=null);const W={};Q[0]&1|Q[1]&384&&(W.$$scope={dirty:Q,ctx:j}),g.$set(W),j[0].type!=="file"?L?(L.p(j,Q),Q[0]&1&&A(L,1)):(L=Fc(j),L.c(),A(L,1),L.m(b,null)):L&&(De(),P(L,1,1,()=>{L=null}),Oe()),j[0].toDelete?H&&(H.d(1),H=null):H?H.p(j,Q):(H=Ic(j),H.c(),H.m(t,null))},i(j){S||(A(s.$$.fragment,j),A(r.$$.fragment,j),A(c),A(g.$$.fragment,j),A(L),S=!0)},o(j){P(s.$$.fragment,j),P(r.$$.fragment,j),P(c),P(g.$$.fragment,j),P(L),S=!1},d(j){j&&k(e),V(s),V(r),~f&&O[f].d(),V(g),L&&L.d(),H&&H.d(),M=!1,D()}}}function Rc(n){let e,t,i,s,l=n[0].system&&Hc(),o=!n[0].id&&jc(n),r=n[0].required&&qc(),a=n[0].unique&&Vc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),h(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Hc(),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=jc(u),o.c(),o.m(e,i)),u[0].required?r||(r=qc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Vc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Hc(n){let e;return{c(){e=_("span"),e.textContent="System",h(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jc(n){let e;return{c(){e=_("span"),e.textContent="New",h(e,"class","label"),ee(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ee(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function qc(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="Unique",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Qe(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=ut(e,zn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ut(e,zn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Bc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",qn(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function I3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,p,g,v,b,y=!n[0].toDelete&&Rc(n),C=n[7]&&!n[0].system&&zc(),$=n[0].toDelete&&Bc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=R(r),f=T(),y&&y.c(),c=T(),d=_("div"),p=T(),C&&C.c(),g=T(),$&&$.c(),v=rt(),h(i,"class",s=Ka(Y.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),h(t,"class","icon field-type"),h(o,"class","title field-name svelte-1tpxlm5"),h(o,"title",u=n[0].name),ee(o,"txt-strikethrough",n[0].toDelete),h(e,"class","inline-flex"),h(d,"class","flex-fill")},m(S,M){w(S,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(S,f,M),y&&y.m(S,M),w(S,c,M),w(S,d,M),w(S,p,M),C&&C.m(S,M),w(S,g,M),$&&$.m(S,M),w(S,v,M),b=!0},p(S,M){(!b||M[0]&1&&s!==(s=Ka(Y.getFieldTypeIcon(S[0].type))+" svelte-1tpxlm5"))&&h(i,"class",s),(!b||M[0]&1)&&r!==(r=(S[0].name||"-")+"")&&me(a,r),(!b||M[0]&1&&u!==(u=S[0].name))&&h(o,"title",u),M[0]&1&&ee(o,"txt-strikethrough",S[0].toDelete),S[0].toDelete?y&&(y.d(1),y=null):y?y.p(S,M):(y=Rc(S),y.c(),y.m(c.parentNode,c)),S[7]&&!S[0].system?C?M[0]&129&&A(C,1):(C=zc(),C.c(),A(C,1),C.m(g.parentNode,g)):C&&(De(),P(C,1,1,()=>{C=null}),Oe()),S[0].toDelete?$?$.p(S,M):($=Bc(S),$.c(),$.m(v.parentNode,v)):$&&($.d(1),$=null)},i(S){b||(A(C),b=!0)},o(S){P(C),b=!1},d(S){S&&k(e),S&&k(f),y&&y.d(S),S&&k(c),S&&k(d),S&&k(p),C&&C.d(S),S&&k(g),$&&$.d(S),S&&k(v)}}}function N3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[I3],default:[F3]},$$scope:{ctx:n}};return e=new za({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&256&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[32](null),V(e,s)}}}function R3(n,e,t){let i,s,l,o,r;At(n,ss,Z=>t(14,r=Z));const a=un();let{key:u="0"}=e,{field:f=new vn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,p,g=f.type;function v(){p==null||p.expand()}function b(){p==null||p.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function C(Z){if(Z=(""+Z).toLowerCase(),!Z)return!1;for(const be of d)if(be.toLowerCase()===Z)return!1;return!0}function $(Z){return Y.slugify(Z)}Yn(()=>{f.id||v()});const S=()=>{t(0,f.toDelete=!1,f)};function M(Z){n.$$.not_equal(f.type,Z)&&(f.type=Z,t(0,f),t(13,g),t(4,p))}const D=Z=>{t(0,f.name=$(Z.target.value),f),Z.target.value=f.name};function E(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function O(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function F(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function L(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function H(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function j(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function Q(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function ne(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function B(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function K(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function W(Z){n.$$.not_equal(f.options,Z)&&(f.options=Z,t(0,f),t(13,g),t(4,p))}function J(){f.required=this.checked,t(0,f),t(13,g),t(4,p)}function ie(){f.unique=this.checked,t(0,f),t(13,g),t(4,p)}const fe=()=>{i&&b()};function ye(Z){he[Z?"unshift":"push"](()=>{p=Z,t(4,p)})}function le(Z){ht.call(this,n,Z)}function ue(Z){ht.call(this,n,Z)}function Te(Z){ht.call(this,n,Z)}return n.$$set=Z=>{"key"in Z&&t(1,u=Z.key),"field"in Z&&t(0,f=Z.field),"disabled"in Z&&t(2,c=Z.disabled),"excludeNames"in Z&&t(11,d=Z.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&8193&&g!=f.type&&(t(13,g=f.type),t(0,f.options={},f),t(0,f.unique=!1,f)),n.$$.dirty[0]&17&&f.toDelete&&(p&&b(),f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f)),n.$$.dirty[0]&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty[0]&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty[0]&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty[0]&1&&t(6,i=!Y.isEmpty(f.name)&&f.type),n.$$.dirty[0]&80&&(i||p&&v()),n.$$.dirty[0]&69&&t(8,s=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=C(f.name)),n.$$.dirty[0]&16418&&t(7,o=!l||!Y.isEmpty(Y.getNestedVal(r,`schema.${u}`)))},[f,u,c,b,p,l,i,o,s,y,$,d,v,g,r,S,M,D,E,O,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te]}class H3 extends Pe{constructor(e){super(),Ae(this,e,R3,N3,Ee,{key:1,field:0,disabled:2,excludeNames:11,expand:12,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[12]}get collapse(){return this.$$.ctx[3]}}function Uc(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Wc(n,e){let t,i,s,l;function o(u){e[5](u,e[9],e[10],e[11])}function r(){return e[6](e[11])}let a={key:e[11],excludeNames:e[1].concat(e[4](e[9]))};return e[9]!==void 0&&(a.field=e[9]),i=new H3({props:a}),he.push(()=>Ie(i,"field",o)),i.$on("remove",r),{key:n,first:null,c(){t=rt(),z(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),q(i,u,f),l=!0},p(u,f){e=u;const c={};f&1&&(c.key=e[11]),f&1&&(c.excludeNames=e[1].concat(e[4](e[9]))),!s&&f&1&&(s=!0,c.field=e[9],He(()=>s=!1)),i.$set(c)},i(u){l||(A(i.$$.fragment,u),l=!0)},o(u){P(i.$$.fragment,u),l=!1},d(u){u&&k(t),V(i,u)}}}function j3(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,p,g,v=n[0].schema;const b=y=>y[11];for(let y=0;y<v.length;y+=1){let C=Uc(n,v,y),$=b(C);i.set($,t[y]=Wc($,C))}return{c(){var y;e=_("div");for(let C=0;C<t.length;C+=1)t[C].c();s=T(),l=_("div"),o=T(),r=_("button"),a=_("i"),u=T(),f=_("span"),f.textContent="New field",h(e,"class","accordions"),h(l,"class","clearfix m-t-xs"),h(a,"class","ri-add-line"),h(f,"class","txt"),h(r,"type","button"),h(r,"class",c="btn btn-block "+((y=n[0].schema)!=null&&y.length?"btn-secondary":"btn-success"))},m(y,C){w(y,e,C);for(let $=0;$<t.length;$+=1)t[$].m(e,null);w(y,s,C),w(y,l,C),w(y,o,C),w(y,r,C),m(r,a),m(r,u),m(r,f),d=!0,p||(g=X(r,"click",n[3]),p=!0)},p(y,[C]){var $;C&23&&(v=y[0].schema,De(),t=ft(t,C,b,1,y,v,i,e,Nt,Wc,null,Uc),Oe()),(!d||C&1&&c!==(c="btn btn-block "+(($=y[0].schema)!=null&&$.length?"btn-secondary":"btn-success")))&&h(r,"class",c)},i(y){if(!d){for(let C=0;C<v.length;C+=1)A(t[C]);d=!0}},o(y){for(let C=0;C<t.length;C+=1)P(t[C]);d=!1},d(y){y&&k(e);for(let C=0;C<t.length;C+=1)t[C].d();y&&k(s),y&&k(l),y&&k(o),y&&k(r),p=!1,g()}}}function q3(n,e,t){const i=["id","created","updated"];let{collection:s={}}=e;function l(d){s.schema[d]&&(s.schema.splice(d,1),t(0,s))}function o(){const d=new vn({name:r()});s.schema.push(d),t(0,s)}function r(d="field"){let p="";for(;a(d+p);)++p;return d+p}function a(d){return!!s.schema.find(p=>p.name===d)}function u(d){let p=[];if(d.toDelete)return p;for(let g of s.schema)g===d||g.toDelete||p.push(g.name);return p}function f(d,p,g,v){g[v]=d,t(0,s)}const c=d=>l(d);return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof(s==null?void 0:s.schema)>"u"&&(t(0,s=s||{}),t(0,s.schema=[],s))},[s,i,l,o,u,f,c]}class V3 extends Pe{constructor(e){super(),Ae(this,e,q3,j3,Ee,{collection:0})}}function Yc(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[16]=e,i[17]=t,i}function Kc(n,e,t){const i=n.slice();return i[19]=e[t],i}function Zc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j,Q,ne,B=n[0].schema,K=[];for(let W=0;W<B.length;W+=1)K[W]=Jc(Kc(n,B,W));return{c(){e=_("div"),t=_("div"),i=_("div"),s=_("p"),s.textContent="The following record fields are available:",l=T(),o=_("div"),r=_("code"),r.textContent="id",a=T(),u=_("code"),u.textContent="created",f=T(),c=_("code"),c.textContent="updated",d=T();for(let W=0;W<K.length;W+=1)K[W].c();p=T(),g=_("hr"),v=T(),b=_("p"),b.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=T(),C=_("div"),C.innerHTML=`<code>@request.method</code>
|
||
<code>@request.query.*</code>
|
||
<code>@request.data.*</code>
|
||
<code>@request.user.*</code>`,$=T(),S=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",E=T(),O=_("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",F=T(),L=_("hr"),H=T(),j=_("p"),j.innerHTML=`Example rule:
|
||
<br/>
|
||
<code>@request.user.id!="" && created>"2022-01-01 00:00:00"</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(g,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h(C,"class","inline-flex flex-gap-5"),h(S,"class","m-t-10 m-b-5"),h(D,"class","m-b-0"),h(O,"class","inline-flex flex-gap-5"),h(L,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(W,J){w(W,e,J),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let ie=0;ie<K.length;ie+=1)K[ie].m(o,null);m(i,p),m(i,g),m(i,v),m(i,b),m(i,y),m(i,C),m(i,$),m(i,S),m(i,M),m(i,D),m(i,E),m(i,O),m(i,F),m(i,L),m(i,H),m(i,j),ne=!0},p(W,J){if(J&1){B=W[0].schema;let ie;for(ie=0;ie<B.length;ie+=1){const fe=Kc(W,B,ie);K[ie]?K[ie].p(fe,J):(K[ie]=Jc(fe),K[ie].c(),K[ie].m(o,null))}for(;ie<K.length;ie+=1)K[ie].d(1);K.length=B.length}},i(W){ne||(W&&Dt(()=>{Q||(Q=ut(e,xt,{duration:150},!0)),Q.run(1)}),ne=!0)},o(W){W&&(Q||(Q=ut(e,xt,{duration:150},!1)),Q.run(0)),ne=!1},d(W){W&&k(e),jn(K,W),W&&Q&&Q.end()}}}function z3(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&me(i,t)},d(s){s&&k(e)}}}function B3(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=R(t),s=R(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&me(i,t)},d(l){l&&k(e)}}}function Jc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?B3:z3}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function U3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[14];for(let r=0;r<l.length;r+=1){let a=Yc(n,l,r),u=o(a);t.set(u,e[r]=Gc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=rt()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&262235&&(l=Object.entries(r[6]),De(),e=ft(e,a,o,1,r,l,t,i.parentNode,Nt,Gc,i,Yc),Oe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function W3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function Y3(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Qe(Ct.call(null,e,"Lock and set to Admins only")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,st(i)}}}function K3(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Qe(Ct.call(null,e,"Unlock and set custom rule")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,st(i)}}}function Z3(n){let e;return{c(){e=R("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function J3(n){let e;return{c(){e=R("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function G3(n){let e,t=n[15]+"",i,s,l=Di(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,p,g,v,b,y;function C(){return n[10](n[14])}const $=()=>n[11](u,f),S=()=>n[11](null,f);function M(H){n[12](H,n[14])}var D=n[4];function E(H){let j={baseCollection:H[0],disabled:Di(H[0][H[14]])};return H[0][H[14]]!==void 0&&(j.value=H[0][H[14]]),{props:j}}D&&(u=new D(E(n)),$(),he.push(()=>Ie(u,"value",M)));function O(H,j){return j&1&&(g=null),g==null&&(g=!!Di(H[0][H[14]])),g?J3:Z3}let F=O(n,-1),L=F(n);return{c(){e=_("label"),i=R(t),s=R(" - "),o=R(l),a=T(),u&&z(u.$$.fragment),d=T(),p=_("div"),L.c(),h(e,"for",r=n[18]),h(p,"class","help-block")},m(H,j){w(H,e,j),m(e,i),m(e,s),m(e,o),w(H,a,j),u&&q(u,H,j),w(H,d,j),w(H,p,j),L.m(p,null),v=!0,b||(y=X(e,"click",C),b=!0)},p(H,j){n=H,(!v||j&1)&&l!==(l=Di(n[0][n[14]])?"Admins only":"Custom rule")&&me(o,l),(!v||j&262144&&r!==(r=n[18]))&&h(e,"for",r),f!==n[14]&&(S(),f=n[14],$());const Q={};if(j&1&&(Q.baseCollection=n[0]),j&1&&(Q.disabled=Di(n[0][n[14]])),!c&&j&65&&(c=!0,Q.value=n[0][n[14]],He(()=>c=!1)),D!==(D=n[4])){if(u){De();const ne=u;P(ne.$$.fragment,1,0,()=>{V(ne,1)}),Oe()}D?(u=new D(E(n)),$(),he.push(()=>Ie(u,"value",M)),z(u.$$.fragment),A(u.$$.fragment,1),q(u,d.parentNode,d)):u=null}else D&&u.$set(Q);F!==(F=O(n,j))&&(L.d(1),L=F(n),L&&(L.c(),L.m(p,null)))},i(H){v||(u&&A(u.$$.fragment,H),v=!0)},o(H){u&&P(u.$$.fragment,H),v=!1},d(H){H&&k(e),H&&k(a),S(),u&&V(u,H),H&&k(d),H&&k(p),L.d(),b=!1,y()}}}function Gc(n,e){let t,i,s,l,o,r,a,u;function f(p,g){return g&1&&(l=null),l==null&&(l=!!Di(p[0][p[14]])),l?K3:Y3}let c=f(e,-1),d=c(e);return r=new Le({props:{class:"form-field rule-field m-0 "+(Di(e[0][e[14]])?"disabled":""),name:e[14],$$slots:{default:[G3,({uniqueId:p})=>({18:p}),({uniqueId:p})=>p?262144:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=_("hr"),i=T(),s=_("div"),d.c(),o=T(),z(r.$$.fragment),a=T(),h(t,"class","m-t-sm m-b-sm"),h(s,"class","rule-block svelte-fjxz7k"),this.first=t},m(p,g){w(p,t,g),w(p,i,g),w(p,s,g),d.m(s,null),m(s,o),q(r,s,null),m(s,a),u=!0},p(p,g){e=p,c===(c=f(e,g))&&d?d.p(e,g):(d.d(1),d=c(e),d&&(d.c(),d.m(s,o)));const v={};g&1&&(v.class="form-field rule-field m-0 "+(Di(e[0][e[14]])?"disabled":"")),g&4456473&&(v.$$scope={dirty:g,ctx:e}),r.$set(v)},i(p){u||(A(r.$$.fragment,p),u=!0)},o(p){P(r.$$.fragment,p),u=!1},d(p){p&&k(t),p&&k(i),p&&k(s),d.d(),V(r)}}}function X3(n){let e,t,i,s,l,o=n[2]?"Hide available fields":"Show available fields",r,a,u,f,c,d,p,g,v,b=n[2]&&Zc(n);const y=[W3,U3],C=[];function $(S,M){return S[5]?0:1}return f=$(n),c=C[f]=y[f](n),{c(){e=_("div"),t=_("div"),i=_("p"),i.innerHTML=`All rules follow the
|
||
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||
</a>.`,s=T(),l=_("span"),r=R(o),a=T(),b&&b.c(),u=T(),c.c(),d=rt(),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex"),h(e,"class","block m-b-base")},m(S,M){w(S,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(S,u,M),C[f].m(S,M),w(S,d,M),p=!0,g||(v=X(l,"click",n[7]),g=!0)},p(S,[M]){(!p||M&4)&&o!==(o=S[2]?"Hide available fields":"Show available fields")&&me(r,o),S[2]?b?(b.p(S,M),M&4&&A(b,1)):(b=Zc(S),b.c(),A(b,1),b.m(e,null)):b&&(De(),P(b,1,1,()=>{b=null}),Oe());let D=f;f=$(S),f===D?C[f].p(S,M):(De(),P(C[D],1,1,()=>{C[D]=null}),Oe(),c=C[f],c?c.p(S,M):(c=C[f]=y[f](S),c.c()),A(c,1),c.m(d.parentNode,d))},i(S){p||(A(b),A(c),p=!0)},o(S){P(b),P(c),p=!1},d(S){S&&k(e),b&&b.d(),S&&k(u),C[f].d(S),S&&k(d),g=!1,v()}}}function Di(n){return n===null}function Q3(n,e,t){let{collection:i=new An}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Ji(()=>import("./FilterAutocompleteInput.ec82b78a.js"),[])).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Yn(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var C;t(0,i[y]=s[y]||"",i),await ai(),(C=o[y])==null||C.focus()},p=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},g=y=>{var C;return(C=o[y])==null?void 0:C.focus()};function v(y,C){he[y?"unshift":"push"](()=>{o[C]=y,t(3,o)})}function b(y,C){n.$$.not_equal(i[C],y)&&(i[C]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,p,g,v,b]}class x3 extends Pe{constructor(e){super(),Ae(this,e,Q3,X3,Ee,{collection:0})}}function Xc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qc(n,e,t){const i=n.slice();return i[14]=e[t],i}function xc(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ed(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=R(`Renamed collection
|
||
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&2&&l!==(l=p[1].originalName+"")&&me(o,l),g&2&&c!==(c=p[1].name+"")&&me(d,c)},d(p){p&&k(e)}}}function td(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=R(`Renamed field
|
||
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&16&&l!==(l=p[14].originalName+"")&&me(o,l),g&16&&c!==(c=p[14].name+"")&&me(d,c)},d(p){p&&k(e)}}}function nd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=R("Removed field "),i=_("span"),l=R(s),o=T(),h(i,"class","txt-bold"),h(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&me(l,s)},d(r){r&&k(e)}}}function e$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[3].length&&xc(),g=n[5]&&ed(n),v=n[4],b=[];for(let $=0;$<v.length;$+=1)b[$]=td(Qc(n,v,$));let y=n[3],C=[];for(let $=0;$<y.length;$+=1)C[$]=nd(Xc(n,y,$));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=T(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
|
||
update it manually!`,o=T(),p&&p.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let $=0;$<b.length;$+=1)b[$].c();d=T();for(let $=0;$<C.length;$+=1)C[$].c();h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning"),h(f,"class","changes-list svelte-1ghly2p")},m($,S){w($,e,S),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),p&&p.m(s,null),w($,r,S),w($,a,S),w($,u,S),w($,f,S),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<C.length;M+=1)C[M].m(f,null)},p($,S){if($[3].length?p||(p=xc(),p.c(),p.m(s,null)):p&&(p.d(1),p=null),$[5]?g?g.p($,S):(g=ed($),g.c(),g.m(f,c)):g&&(g.d(1),g=null),S&16){v=$[4];let M;for(M=0;M<v.length;M+=1){const D=Qc($,v,M);b[M]?b[M].p(D,S):(b[M]=td(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if(S&8){y=$[3];let M;for(M=0;M<y.length;M+=1){const D=Xc($,y,M);C[M]?C[M].p(D,S):(C[M]=nd(D),C[M].c(),C[M].m(f,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=y.length}},d($){$&&k(e),p&&p.d(),$&&k(r),$&&k(a),$&&k(u),$&&k(f),g&&g.d(),jn(b,$),jn(C,$)}}}function t$(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function n$(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=T(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-secondary"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[X(e,"click",n[8]),X(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,st(l)}}}function i$(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[n$],header:[t$],default:[e$]},$$scope:{ctx:n}};return e=new wi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function s$(n,e,t){let i,s,l;const o=un();let r,a;async function u(y){t(1,a=y),await ai(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),p=()=>c();function g(y){he[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){ht.call(this,n,y)}function b(y){ht.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,p,g,v,b]}class l$ extends Pe{constructor(e){super(),Ae(this,e,s$,i$,Ee,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function id(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new x3({props:o}),he.push(()=>Ie(t,"collection",l)),{c(){e=_("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function o$(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new V3({props:a}),he.push(()=>Ie(i,"collection",r));let u=n[9]===gl&&id(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),l=T(),u&&u.c(),h(t,"class","tab-item"),ee(t,"active",n[9]===ts),h(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),q(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),c[0]&512&&ee(t,"active",f[9]===ts),f[9]===gl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=id(f),u.c(),A(u,1),u.m(e,null)):u&&(De(),P(u,1,1,()=>{u=null}),Oe())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),V(i),u&&u.d()}}}function sd(n){let e,t,i,s,l,o,r;return o=new os({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[r$]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("i"),l=T(),z(o.$$.fragment),h(e,"class","flex-fill"),h(s,"class","ri-more-line"),h(i,"type","button"),h(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),V(o)}}}function r$(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function ld(n){let e;return{c(){e=_("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function a$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[2].system&&ld();return{c(){e=_("label"),t=R("Name"),s=T(),l=_("input"),u=T(),p&&p.c(),f=rt(),h(e,"for",i=n[38]),h(l,"type","text"),h(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],h(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,h(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),p&&p.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=X(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&h(e,"for",i),v[1]&128&&o!==(o=g[38])&&h(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?p||(p=ld(),p.c(),p.m(f.parentNode,f)):p&&(p.d(1),p=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),p&&p.d(g),g&&k(f),c=!1,d()}}}function od(n){let e,t,i,s,l,o;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Qe(t=Ct.call(null,e,n[12])),l=!0)},p(r,a){t&&Wn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Dt(()=>{i||(i=ut(e,zn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=ut(e,zn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function rd(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Qe(Ct.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Dt(()=>{t||(t=ut(e,zn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=ut(e,zn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function u$(n){var H,j,Q,ne,B,K;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,p,g,v=!Y.isEmpty((H=n[4])==null?void 0:H.schema),b,y,C,$,S=!Y.isEmpty((j=n[4])==null?void 0:j.listRule)||!Y.isEmpty((Q=n[4])==null?void 0:Q.viewRule)||!Y.isEmpty((ne=n[4])==null?void 0:ne.createRule)||!Y.isEmpty((B=n[4])==null?void 0:B.updateRule)||!Y.isEmpty((K=n[4])==null?void 0:K.deleteRule),M,D,E,O=!n[2].isNew&&!n[2].system&&sd(n);r=new Le({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[a$,({uniqueId:W})=>({38:W}),({uniqueId:W})=>[0,W?128:0]]},$$scope:{ctx:n}}});let F=v&&od(n),L=S&&rd();return{c(){e=_("h4"),i=R(t),s=T(),O&&O.c(),l=T(),o=_("form"),z(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),p=_("span"),p.textContent="Fields",g=T(),F&&F.c(),b=T(),y=_("button"),C=_("span"),C.textContent="API Rules",$=T(),L&&L.c(),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(p,"class","txt"),h(d,"type","button"),h(d,"class","tab-item"),ee(d,"active",n[9]===ts),h(C,"class","txt"),h(y,"type","button"),h(y,"class","tab-item"),ee(y,"active",n[9]===gl),h(c,"class","tabs-header stretched")},m(W,J){w(W,e,J),m(e,i),w(W,s,J),O&&O.m(W,J),w(W,l,J),w(W,o,J),q(r,o,null),m(o,a),m(o,u),w(W,f,J),w(W,c,J),m(c,d),m(d,p),m(d,g),F&&F.m(d,null),m(c,b),m(c,y),m(y,C),m(y,$),L&&L.m(y,null),M=!0,D||(E=[X(o,"submit",Bt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],D=!0)},p(W,J){var fe,ye,le,ue,Te,Z;(!M||J[0]&4)&&t!==(t=W[2].isNew?"New collection":"Edit collection")&&me(i,t),!W[2].isNew&&!W[2].system?O?(O.p(W,J),J[0]&4&&A(O,1)):(O=sd(W),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(De(),P(O,1,1,()=>{O=null}),Oe());const ie={};J[0]&2048&&(ie.class="form-field required m-b-0 "+(W[11]?"disabled":"")),J[0]&2052|J[1]&384&&(ie.$$scope={dirty:J,ctx:W}),r.$set(ie),J[0]&16&&(v=!Y.isEmpty((fe=W[4])==null?void 0:fe.schema)),v?F?(F.p(W,J),J[0]&16&&A(F,1)):(F=od(W),F.c(),A(F,1),F.m(d,null)):F&&(De(),P(F,1,1,()=>{F=null}),Oe()),J[0]&512&&ee(d,"active",W[9]===ts),J[0]&16&&(S=!Y.isEmpty((ye=W[4])==null?void 0:ye.listRule)||!Y.isEmpty((le=W[4])==null?void 0:le.viewRule)||!Y.isEmpty((ue=W[4])==null?void 0:ue.createRule)||!Y.isEmpty((Te=W[4])==null?void 0:Te.updateRule)||!Y.isEmpty((Z=W[4])==null?void 0:Z.deleteRule)),S?L?J[0]&16&&A(L,1):(L=rd(),L.c(),A(L,1),L.m(y,null)):L&&(De(),P(L,1,1,()=>{L=null}),Oe()),J[0]&512&&ee(y,"active",W[9]===gl)},i(W){M||(A(O),A(r.$$.fragment,W),A(F),A(L),M=!0)},o(W){P(O),P(r.$$.fragment,W),P(F),P(L),M=!1},d(W){W&&k(e),W&&k(s),O&&O.d(W),W&&k(l),W&&k(o),V(r),W&&k(f),W&&k(c),F&&F.d(),L&&L.d(),D=!1,st(E)}}}function f$(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=R(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ee(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[X(e,"click",n[18]),X(s,"click",n[19])],u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&me(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&ee(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,st(f)}}}function c$(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header compact-header collection-panel",beforeHide:n[27],$$slots:{footer:[f$],header:[u$],default:[o$]},$$scope:{ctx:n}};e=new wi({props:l}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let o={};return i=new l$({props:o}),n[31](i),i.$on("confirm",n[32]),{c(){z(e.$$.fragment),t=T(),z(i.$$.fragment)},m(r,a){q(e,r,a),w(r,t,a),q(i,r,a),s=!0},p(r,a){const u={};a[0]&264&&(u.beforeHide=r[27]),a[0]&7828|a[1]&256&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[28](null),V(e,r),r&&k(t),n[31](null),V(i,r)}}}const ts="fields",gl="api_rules";function $r(n){return JSON.stringify(n)}function d$(n,e,t){let i,s,l,o,r,a;At(n,li,Z=>t(34,r=Z)),At(n,ss,Z=>t(4,a=Z));const u=un();let f,c,d=null,p=new An,g=!1,v=!1,b=ts,y=$r(p);function C(Z){t(9,b=Z)}function $(Z){return M(Z),t(8,v=!0),C(ts),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function M(Z){Ii({}),typeof Z<"u"?(d=Z,t(2,p=Z==null?void 0:Z.clone())):(d=null,t(2,p=new An)),t(2,p.schema=p.schema||[],p),t(2,p.originalName=p.name||"",p),await ai(),t(17,y=$r(p))}function D(){if(p.isNew)return E();c==null||c.show(p)}function E(){if(g)return;t(7,g=!0);const Z=O();let be;p.isNew?be=we.Collections.create(Z):be=we.Collections.update(p.id,Z),be.then(x=>{t(8,v=!1),S(),hn(p.isNew?"Successfully created collection.":"Successfully updated collection."),Rw(x),p.isNew&&bn(li,r=x,r),u("save",x)}).catch(x=>{we.errorResponseHandler(x)}).finally(()=>{t(7,g=!1)})}function O(){const Z=p.export();Z.schema=Z.schema.slice(0);for(let be=Z.schema.length-1;be>=0;be--)Z.schema[be].toDelete&&Z.schema.splice(be,1);return Z}function F(){!(d!=null&&d.id)||yi(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>we.Collections.delete(d==null?void 0:d.id).then(()=>{S(),hn(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),Hw(d)}).catch(Z=>{we.errorResponseHandler(Z)}))}const L=()=>S(),H=()=>D(),j=()=>F(),Q=Z=>{t(2,p.name=Y.slugify(Z.target.value),p),Z.target.value=p.name},ne=()=>{o&&D()},B=()=>C(ts),K=()=>C(gl);function W(Z){p=Z,t(2,p)}function J(Z){p=Z,t(2,p)}const ie=()=>l&&v?(yi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),S()}),!1):!0;function fe(Z){he[Z?"unshift":"push"](()=>{f=Z,t(5,f)})}function ye(Z){ht.call(this,n,Z)}function le(Z){ht.call(this,n,Z)}function ue(Z){he[Z?"unshift":"push"](()=>{c=Z,t(6,c)})}const Te=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&16&&t(12,i=typeof Y.getNestedVal(a,"schema.message",null)=="string"?Y.getNestedVal(a,"schema.message"):"Has errors"),n.$$.dirty[0]&4&&t(11,s=!p.isNew&&p.system),n.$$.dirty[0]&131076&&t(3,l=y!=$r(p)),n.$$.dirty[0]&12&&t(10,o=p.isNew||l)},[C,S,p,l,a,f,c,g,v,b,o,s,i,D,E,F,$,y,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te]}class Ua extends Pe{constructor(e){super(),Ae(this,e,d$,c$,Ee,{changeTab:0,show:16,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[1]}}function ad(n,e,t){const i=n.slice();return i[13]=e[t],i}function ud(n){let e,t=n[1].length&&fd();return{c(){t&&t.c(),e=rt()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=fd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function fd(n){let e;return{c(){e=_("p"),e.textContent="No collections found.",h(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function h$(n){let e;return{c(){e=_("i"),h(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function p$(n){let e;return{c(){e=_("i"),h(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function cd(n,e){let t,i,s,l=e[13].name+"",o,r,a,u;function f(g,v){var b;return((b=g[5])==null?void 0:b.id)===g[13].id?p$:h$}let c=f(e),d=c(e);function p(){return e[10](e[13])}return{key:n,first:null,c(){var g;t=_("div"),d.c(),i=T(),s=_("span"),o=R(l),r=T(),h(s,"class","txt"),h(t,"tabindex","0"),h(t,"class","sidebar-list-item"),ee(t,"active",((g=e[5])==null?void 0:g.id)===e[13].id),this.first=t},m(g,v){w(g,t,v),d.m(t,null),m(t,i),m(t,s),m(s,o),m(t,r),a||(u=X(t,"click",p),a=!0)},p(g,v){var b;e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i))),v&8&&l!==(l=e[13].name+"")&&me(o,l),v&40&&ee(t,"active",((b=e[5])==null?void 0:b.id)===e[13].id)},d(g){g&&k(t),d.d(),a=!1,u()}}}function m$(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],p=new Map,g,v,b,y,C,$,S,M,D=n[3];const E=L=>L[13].id;for(let L=0;L<D.length;L+=1){let H=ad(n,D,L),j=E(H);p.set(j,d[L]=cd(j,H))}let O=null;D.length||(O=ud(n));let F={};return C=new Ua({props:F}),n[12](C),{c(){e=_("aside"),t=_("header"),i=_("div"),s=_("div"),l=_("button"),l.innerHTML='<i class="ri-close-line"></i>',o=T(),r=_("input"),a=T(),u=_("hr"),f=T(),c=_("div");for(let L=0;L<d.length;L+=1)d[L].c();O&&O.c(),g=T(),v=_("footer"),b=_("button"),b.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">New collection</span>`,y=T(),z(C.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ee(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),ee(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(c,"class","sidebar-content"),h(b,"type","button"),h(b,"class","btn btn-block btn-outline"),h(v,"class","sidebar-footer"),h(e,"class","page-sidebar collection-sidebar")},m(L,H){w(L,e,H),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Ce(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let j=0;j<d.length;j+=1)d[j].m(c,null);O&&O.m(c,null),m(e,g),m(e,v),m(v,b),w(L,y,H),q(C,L,H),$=!0,S||(M=[X(l,"click",n[8]),X(r,"input",n[9]),X(b,"click",n[11])],S=!0)},p(L,[H]){H&16&&ee(l,"hidden",!L[4]),H&1&&r.value!==L[0]&&Ce(r,L[0]),H&16&&ee(i,"active",L[4]),H&106&&(D=L[3],d=ft(d,H,E,1,L,D,p,c,rn,cd,null,ad),!D.length&&O?O.p(L,H):D.length?O&&(O.d(1),O=null):(O=ud(L),O.c(),O.m(c,null)));const j={};C.$set(j)},i(L){$||(A(C.$$.fragment,L),$=!0)},o(L){P(C.$$.fragment,L),$=!1},d(L){L&&k(e);for(let H=0;H<d.length;H+=1)d[H].d();O&&O.d(),L&&k(y),n[12](null),V(C,L),S=!1,st(M)}}}function g$(n,e,t){let i,s,l,o,r;At(n,li,b=>t(5,o=b)),At(n,Cs,b=>t(7,r=b));let a,u="";function f(b){bn(li,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const p=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){he[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,p,g,v]}class _$ extends Pe{constructor(e){super(),Ae(this,e,g$,m$,Ee,{})}}function b$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe,Re,re,ae,ke,Ke;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
|
||
<code><span class="txt-success">OPERAND</span>
|
||
<span class="txt-danger">OPERATOR</span>
|
||
<span class="txt-success">OPERAND</span></code>, where:`,t=T(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||
quoted), number, null, true, false`,l=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=R(` - is one of:
|
||
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),p=_("code"),p.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),C=_("code"),C.textContent="!=",$=T(),S=_("span"),S.textContent="NOT equal",M=T(),D=_("li"),E=_("code"),E.textContent=">",O=T(),F=_("span"),F.textContent="Greater than",L=T(),H=_("li"),j=_("code"),j.textContent=">=",Q=T(),ne=_("span"),ne.textContent="Greater than or equal",B=T(),K=_("li"),W=_("code"),W.textContent="<",J=T(),ie=_("span"),ie.textContent="Less than or equal",fe=T(),ye=_("li"),le=_("code"),le.textContent="<=",ue=T(),Te=_("span"),Te.textContent="Less than or equal",Z=T(),be=_("li"),x=_("code"),x.textContent="~",G=T(),_e=_("span"),_e.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||
match)`,je=T(),Fe=_("li"),Re=_("code"),Re.textContent="!~",re=T(),ae=_("span"),ae.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||
wildcard match)`,ke=T(),Ke=_("p"),Ke.innerHTML=`To group and combine several expressions you could use brackets
|
||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,h(r,"class","txt-danger"),h(p,"class","filter-op svelte-1w7s5nw"),h(v,"class","txt-hint"),h(C,"class","filter-op svelte-1w7s5nw"),h(S,"class","txt-hint"),h(E,"class","filter-op svelte-1w7s5nw"),h(F,"class","txt-hint"),h(j,"class","filter-op svelte-1w7s5nw"),h(ne,"class","txt-hint"),h(W,"class","filter-op svelte-1w7s5nw"),h(ie,"class","txt-hint"),h(le,"class","filter-op svelte-1w7s5nw"),h(Te,"class","txt-hint"),h(x,"class","filter-op svelte-1w7s5nw"),h(_e,"class","txt-hint"),h(Re,"class","filter-op svelte-1w7s5nw"),h(ae,"class","txt-hint")},m(Ye,nt){w(Ye,e,nt),w(Ye,t,nt),w(Ye,i,nt),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,p),m(d,g),m(d,v),m(c,b),m(c,y),m(y,C),m(y,$),m(y,S),m(c,M),m(c,D),m(D,E),m(D,O),m(D,F),m(c,L),m(c,H),m(H,j),m(H,Q),m(H,ne),m(c,B),m(c,K),m(K,W),m(K,J),m(K,ie),m(c,fe),m(c,ye),m(ye,le),m(ye,ue),m(ye,Te),m(c,Z),m(c,be),m(be,x),m(be,G),m(be,_e),m(c,je),m(c,Fe),m(Fe,Re),m(Fe,re),m(Fe,ae),w(Ye,ke,nt),w(Ye,Ke,nt)},p:oe,i:oe,o:oe,d(Ye){Ye&&k(e),Ye&&k(t),Ye&&k(i),Ye&&k(ke),Ye&&k(Ke)}}}class v$ extends Pe{constructor(e){super(),Ae(this,e,null,b$,Ee,{})}}function dd(n,e,t){const i=n.slice();return i[8]=e[t],i}function hd(n,e,t){const i=n.slice();return i[8]=e[t],i}function pd(n,e,t){const i=n.slice();return i[13]=e[t],i}function md(n,e,t){const i=n.slice();return i[13]=e[t],i}function gd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _d(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function bd(n,e){let t,i,s,l;return i=new nn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&ee(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function vd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function yd(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&ee(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function y$(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",C,$,S,M,D,E,O,F=[],L=new Map,H,j,Q=[],ne=new Map,B,K,W,J,ie,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe,Re,re,ae,ke,Ke,Ye,nt,lt,xe,ge,de,qe,ct,te,ve,Ze,at,mt,yt,Lt,pe,Se,Je,tt,Ft,ce,$e,Ge,Xt,Ut,ei,dt,N,I,U,se,Ne,ze,it,We,ot,Ue,Xe=[],$t=new Map,yn,Jt,Qt=[],ci=new Map,Si,en=n[1]&&gd(),us=n[4];const Ol=Me=>Me[13].lang;for(let Me=0;Me<us.length;Me+=1){let Be=md(n,us,Me),Et=Ol(Be);L.set(Et,F[Me]=_d(Et,Be))}let Hi=n[4];const El=Me=>Me[13].lang;for(let Me=0;Me<Hi.length;Me+=1){let Be=pd(n,Hi,Me),Et=El(Be);ne.set(Et,Q[Me]=bd(Et,Be))}lt=new nn({props:{content:`
|
||
// DESC by created and ASC by id
|
||
?sort=-created,id
|
||
`}}),at=new nn({props:{content:`
|
||
?filter=(id='abc' && created>'2022-01-01')
|
||
`}}),yt=new v$({}),Ge=new nn({props:{content:`
|
||
?expand=rel1,rel2.subrel21.subrel22
|
||
`}});let fs=n[5];const Al=Me=>Me[8].code;for(let Me=0;Me<fs.length;Me+=1){let Be=hd(n,fs,Me),Et=Al(Be);$t.set(Et,Xe[Me]=vd(Et,Be))}let ji=n[5];const Pl=Me=>Me[8].code;for(let Me=0;Me<ji.length;Me+=1){let Be=dd(n,ji,Me),Et=Pl(Be);ci.set(Et,Qt[Me]=yd(Et,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),en&&en.c(),d=T(),p=_("div"),g=_("p"),v=R("Fetch a paginated "),b=_("strong"),C=R(y),$=R(" records list."),S=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),E=_("div"),O=_("div");for(let Me=0;Me<F.length;Me+=1)F[Me].c();H=T(),j=_("div");for(let Me=0;Me<Q.length;Me+=1)Q[Me].c();B=T(),K=_("div"),K.textContent="Query parameters",W=T(),J=_("table"),ie=_("thead"),ie.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr>`,fe=T(),ye=_("tbody"),le=_("tr"),le.innerHTML=`<td>page</td>
|
||
<td><span class="label">Number</span></td>
|
||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,ue=T(),Te=_("tr"),Te.innerHTML=`<td>perPage</td>
|
||
<td><span class="label">Number</span></td>
|
||
<td>Specify the max returned records per page (default to 30).</td>`,Z=T(),be=_("tr"),x=_("td"),x.textContent="sort",G=T(),_e=_("td"),_e.innerHTML='<span class="label">String</span>',je=T(),Fe=_("td"),Re=R("Specify the records order attribute(s). "),re=_("br"),ae=R(`
|
||
Add `),ke=_("code"),ke.textContent="-",Ke=R(" / "),Ye=_("code"),Ye.textContent="+",nt=R(` (default) in front of the attribute for DESC / ASC order.
|
||
Ex.:
|
||
`),z(lt.$$.fragment),xe=T(),ge=_("tr"),de=_("td"),de.textContent="filter",qe=T(),ct=_("td"),ct.innerHTML='<span class="label">String</span>',te=T(),ve=_("td"),Ze=R(`Filter the returned records. Ex.:
|
||
`),z(at.$$.fragment),mt=T(),z(yt.$$.fragment),Lt=T(),pe=_("tr"),Se=_("td"),Se.textContent="expand",Je=T(),tt=_("td"),tt.innerHTML='<span class="label">String</span>',Ft=T(),ce=_("td"),$e=R(`Auto expand nested record relations. Ex.:
|
||
`),z(Ge.$$.fragment),Xt=R(`
|
||
Supports up to 6-levels depth nested relations expansion. `),Ut=_("br"),ei=R(`
|
||
The expanded relations will be appended to each individual record under the
|
||
`),dt=_("code"),dt.textContent="@expand",N=R(" property (eg. "),I=_("code"),I.textContent='"@expand": {"rel1": {...}, ...}',U=R(`). Only the
|
||
relations that the user has permissions to `),se=_("strong"),se.textContent="view",Ne=R(" will be expanded."),ze=T(),it=_("div"),it.textContent="Responses",We=T(),ot=_("div"),Ue=_("div");for(let Me=0;Me<Xe.length;Me+=1)Xe[Me].c();yn=T(),Jt=_("div");for(let Me=0;Me<Qt.length;Me+=1)Qt[Me].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(p,"class","content m-b-base"),h(M,"class","section-title"),h(O,"class","tabs-header compact left"),h(j,"class","tabs-content"),h(E,"class","tabs m-b-lg"),h(K,"class","section-title"),h(J,"class","table-compact table-border m-b-lg"),h(it,"class","section-title"),h(Ue,"class","tabs-header compact left"),h(Jt,"class","tabs-content"),h(ot,"class","tabs")},m(Me,Be){w(Me,e,Be),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),en&&en.m(e,null),w(Me,d,Be),w(Me,p,Be),m(p,g),m(g,v),m(g,b),m(b,C),m(g,$),w(Me,S,Be),w(Me,M,Be),w(Me,D,Be),w(Me,E,Be),m(E,O);for(let Et=0;Et<F.length;Et+=1)F[Et].m(O,null);m(E,H),m(E,j);for(let Et=0;Et<Q.length;Et+=1)Q[Et].m(j,null);w(Me,B,Be),w(Me,K,Be),w(Me,W,Be),w(Me,J,Be),m(J,ie),m(J,fe),m(J,ye),m(ye,le),m(ye,ue),m(ye,Te),m(ye,Z),m(ye,be),m(be,x),m(be,G),m(be,_e),m(be,je),m(be,Fe),m(Fe,Re),m(Fe,re),m(Fe,ae),m(Fe,ke),m(Fe,Ke),m(Fe,Ye),m(Fe,nt),q(lt,Fe,null),m(ye,xe),m(ye,ge),m(ge,de),m(ge,qe),m(ge,ct),m(ge,te),m(ge,ve),m(ve,Ze),q(at,ve,null),m(ve,mt),q(yt,ve,null),m(ye,Lt),m(ye,pe),m(pe,Se),m(pe,Je),m(pe,tt),m(pe,Ft),m(pe,ce),m(ce,$e),q(Ge,ce,null),m(ce,Xt),m(ce,Ut),m(ce,ei),m(ce,dt),m(ce,N),m(ce,I),m(ce,U),m(ce,se),m(ce,Ne),w(Me,ze,Be),w(Me,it,Be),w(Me,We,Be),w(Me,ot,Be),m(ot,Ue);for(let Et=0;Et<Xe.length;Et+=1)Xe[Et].m(Ue,null);m(ot,yn),m(ot,Jt);for(let Et=0;Et<Qt.length;Et+=1)Qt[Et].m(Jt,null);Si=!0},p(Me,[Be]){(!Si||Be&1)&&a!==(a=Me[0].name+"")&&me(u,a),Me[1]?en||(en=gd(),en.c(),en.m(e,null)):en&&(en.d(1),en=null),(!Si||Be&1)&&y!==(y=Me[0].name+"")&&me(C,y),Be&24&&(us=Me[4],F=ft(F,Be,Ol,1,Me,us,L,O,rn,_d,null,md)),Be&24&&(Hi=Me[4],De(),Q=ft(Q,Be,El,1,Me,Hi,ne,j,Nt,bd,null,pd),Oe()),Be&36&&(fs=Me[5],Xe=ft(Xe,Be,Al,1,Me,fs,$t,Ue,rn,vd,null,hd)),Be&36&&(ji=Me[5],De(),Qt=ft(Qt,Be,Pl,1,Me,ji,ci,Jt,Nt,yd,null,dd),Oe())},i(Me){if(!Si){for(let Be=0;Be<Hi.length;Be+=1)A(Q[Be]);A(lt.$$.fragment,Me),A(at.$$.fragment,Me),A(yt.$$.fragment,Me),A(Ge.$$.fragment,Me);for(let Be=0;Be<ji.length;Be+=1)A(Qt[Be]);Si=!0}},o(Me){for(let Be=0;Be<Q.length;Be+=1)P(Q[Be]);P(lt.$$.fragment,Me),P(at.$$.fragment,Me),P(yt.$$.fragment,Me),P(Ge.$$.fragment,Me);for(let Be=0;Be<Qt.length;Be+=1)P(Qt[Be]);Si=!1},d(Me){Me&&k(e),en&&en.d(),Me&&k(d),Me&&k(p),Me&&k(S),Me&&k(M),Me&&k(D),Me&&k(E);for(let Be=0;Be<F.length;Be+=1)F[Be].d();for(let Be=0;Be<Q.length;Be+=1)Q[Be].d();Me&&k(B),Me&&k(K),Me&&k(W),Me&&k(J),V(lt),V(at),V(yt),V(Ge),Me&&k(ze),Me&&k(it),Me&&k(We),Me&&k(ot);for(let Be=0;Be<Xe.length;Be+=1)Xe[Be].d();for(let Be=0;Be<Qt.length;Be+=1)Qt[Be].d()}}}function k$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[Y.dummyCollectionRecord(s),Y.dummyCollectionRecord(s)]},null,2)}),r.push({code:400,body:`
|
||
{
|
||
"code": 400,
|
||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||
"data": {}
|
||
}
|
||
`}),i&&r.push({code:403,body:`
|
||
{
|
||
"code": 403,
|
||
"message": "Only admins can access this action.",
|
||
"data": {}
|
||
}
|
||
`}),r.push({code:404,body:`
|
||
{
|
||
"code": 404,
|
||
"message": "The requested resource wasn't found.",
|
||
"data": {}
|
||
}
|
||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase("${we.baseUrl}");
|
||
|
||
client.Records.getList("${s==null?void 0:s.name}", { page: 2 })
|
||
.then(function (list) {
|
||
// success...
|
||
}).catch(function (error) {
|
||
// error...
|
||
});
|
||
|
||
// alternatively you can also fetch all records at once via getFullList:
|
||
client.Records.getFullList("${s==null?void 0:s.name}", 200 /* batch size */)
|
||
.then(function (records) {
|
||
// success...
|
||
}).catch(function (error) {
|
||
// error...
|
||
});
|
||
`}])},[s,i,l,o,a,r,u,f]}class w$ extends Pe{constructor(e){super(),Ae(this,e,k$,y$,Ee,{collection:0})}}function kd(n,e,t){const i=n.slice();return i[8]=e[t],i}function wd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Sd(n,e,t){const i=n.slice();return i[13]=e[t],i}function $d(n,e,t){const i=n.slice();return i[13]=e[t],i}function Cd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Md(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function Td(n,e){let t,i,s,l;return i=new nn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&ee(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Dd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Od(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&ee(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function S$(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,C=n[0].name+"",$,S,M,D,E,O,F,L=[],H=new Map,j,Q,ne=[],B=new Map,K,W,J,ie,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe,Re,re,ae,ke,Ke,Ye,nt,lt,xe,ge,de,qe,ct,te,ve,Ze,at,mt=[],yt=new Map,Lt,pe,Se=[],Je=new Map,tt,Ft=n[1]&&Cd(),ce=n[4];const $e=I=>I[13].lang;for(let I=0;I<ce.length;I+=1){let U=$d(n,ce,I),se=$e(U);H.set(se,L[I]=Md(se,U))}let Ge=n[4];const Xt=I=>I[13].lang;for(let I=0;I<Ge.length;I+=1){let U=Sd(n,Ge,I),se=Xt(U);B.set(se,ne[I]=Td(se,U))}ae=new nn({props:{content:`
|
||
?expand=rel1,rel2.subrel21.subrel22
|
||
`}});let Ut=n[5];const ei=I=>I[8].code;for(let I=0;I<Ut.length;I+=1){let U=wd(n,Ut,I),se=ei(U);yt.set(se,mt[I]=Dd(se,U))}let dt=n[5];const N=I=>I[8].code;for(let I=0;I<dt.length;I+=1){let U=kd(n,dt,I),se=N(U);Je.set(se,Se[I]=Od(se,U))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Ft&&Ft.c(),p=T(),g=_("div"),v=_("p"),b=R("Fetch a single "),y=_("strong"),$=R(C),S=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),O=_("div"),F=_("div");for(let I=0;I<L.length;I+=1)L[I].c();j=T(),Q=_("div");for(let I=0;I<ne.length;I+=1)ne[I].c();K=T(),W=_("div"),W.textContent="Path Parameters",J=T(),ie=_("table"),ie.innerHTML=`<thead><tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr></thead>
|
||
<tbody><tr><td>id</td>
|
||
<td><span class="label">String</span></td>
|
||
<td>ID of the record to view.</td></tr></tbody>`,fe=T(),ye=_("div"),ye.textContent="Query parameters",le=T(),ue=_("table"),Te=_("thead"),Te.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr>`,Z=T(),be=_("tbody"),x=_("tr"),G=_("td"),G.textContent="expand",_e=T(),je=_("td"),je.innerHTML='<span class="label">String</span>',Fe=T(),Re=_("td"),re=R(`Auto expand nested record relations. Ex.:
|
||
`),z(ae.$$.fragment),ke=R(`
|
||
Supports up to 6-levels depth nested relations expansion. `),Ke=_("br"),Ye=R(`
|
||
The expanded relations will be appended to the record under the
|
||
`),nt=_("code"),nt.textContent="@expand",lt=R(" property (eg. "),xe=_("code"),xe.textContent='"@expand": {"rel1": {...}, ...}',ge=R(`). Only the
|
||
relations that the user has permissions to `),de=_("strong"),de.textContent="view",qe=R(" will be expanded."),ct=T(),te=_("div"),te.textContent="Responses",ve=T(),Ze=_("div"),at=_("div");for(let I=0;I<mt.length;I+=1)mt[I].c();Lt=T(),pe=_("div");for(let I=0;I<Se.length;I+=1)Se[I].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(W,"class","section-title"),h(ie,"class","table-compact table-border m-b-lg"),h(ye,"class","section-title"),h(ue,"class","table-compact table-border m-b-lg"),h(te,"class","section-title"),h(at,"class","tabs-header compact left"),h(pe,"class","tabs-content"),h(Ze,"class","tabs")},m(I,U){w(I,e,U),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Ft&&Ft.m(e,null),w(I,p,U),w(I,g,U),m(g,v),m(v,b),m(v,y),m(y,$),m(v,S),w(I,M,U),w(I,D,U),w(I,E,U),w(I,O,U),m(O,F);for(let se=0;se<L.length;se+=1)L[se].m(F,null);m(O,j),m(O,Q);for(let se=0;se<ne.length;se+=1)ne[se].m(Q,null);w(I,K,U),w(I,W,U),w(I,J,U),w(I,ie,U),w(I,fe,U),w(I,ye,U),w(I,le,U),w(I,ue,U),m(ue,Te),m(ue,Z),m(ue,be),m(be,x),m(x,G),m(x,_e),m(x,je),m(x,Fe),m(x,Re),m(Re,re),q(ae,Re,null),m(Re,ke),m(Re,Ke),m(Re,Ye),m(Re,nt),m(Re,lt),m(Re,xe),m(Re,ge),m(Re,de),m(Re,qe),w(I,ct,U),w(I,te,U),w(I,ve,U),w(I,Ze,U),m(Ze,at);for(let se=0;se<mt.length;se+=1)mt[se].m(at,null);m(Ze,Lt),m(Ze,pe);for(let se=0;se<Se.length;se+=1)Se[se].m(pe,null);tt=!0},p(I,[U]){(!tt||U&1)&&a!==(a=I[0].name+"")&&me(u,a),I[1]?Ft||(Ft=Cd(),Ft.c(),Ft.m(e,null)):Ft&&(Ft.d(1),Ft=null),(!tt||U&1)&&C!==(C=I[0].name+"")&&me($,C),U&24&&(ce=I[4],L=ft(L,U,$e,1,I,ce,H,F,rn,Md,null,$d)),U&24&&(Ge=I[4],De(),ne=ft(ne,U,Xt,1,I,Ge,B,Q,Nt,Td,null,Sd),Oe()),U&36&&(Ut=I[5],mt=ft(mt,U,ei,1,I,Ut,yt,at,rn,Dd,null,wd)),U&36&&(dt=I[5],De(),Se=ft(Se,U,N,1,I,dt,Je,pe,Nt,Od,null,kd),Oe())},i(I){if(!tt){for(let U=0;U<Ge.length;U+=1)A(ne[U]);A(ae.$$.fragment,I);for(let U=0;U<dt.length;U+=1)A(Se[U]);tt=!0}},o(I){for(let U=0;U<ne.length;U+=1)P(ne[U]);P(ae.$$.fragment,I);for(let U=0;U<Se.length;U+=1)P(Se[U]);tt=!1},d(I){I&&k(e),Ft&&Ft.d(),I&&k(p),I&&k(g),I&&k(M),I&&k(D),I&&k(E),I&&k(O);for(let U=0;U<L.length;U+=1)L[U].d();for(let U=0;U<ne.length;U+=1)ne[U].d();I&&k(K),I&&k(W),I&&k(J),I&&k(ie),I&&k(fe),I&&k(ye),I&&k(le),I&&k(ue),V(ae),I&&k(ct),I&&k(te),I&&k(ve),I&&k(Ze);for(let U=0;U<mt.length;U+=1)mt[U].d();for(let U=0;U<Se.length;U+=1)Se[U].d()}}}function $$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify(Y.dummyCollectionRecord(s),null,2)}),i&&r.push({code:403,body:`
|
||
{
|
||
"code": 403,
|
||
"message": "Only admins can access this action.",
|
||
"data": {}
|
||
}
|
||
`}),r.push({code:404,body:`
|
||
{
|
||
"code": 404,
|
||
"message": "The requested resource wasn't found.",
|
||
"data": {}
|
||
}
|
||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase("${we.baseUrl}");
|
||
|
||
client.Records.getOne("${s==null?void 0:s.name}", "RECORD_ID")
|
||
.then(function (record) {
|
||
// success...
|
||
}).catch(function (error) {
|
||
// error...
|
||
});
|
||
`}])},[s,i,l,o,a,r,u,f]}class C$ extends Pe{constructor(e){super(),Ae(this,e,$$,S$,Ee,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[8]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ld(n,e,t){const i=n.slice();return i[16]=e[t],i}function Fd(n,e,t){const i=n.slice();return i[16]=e[t],i}function Id(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Nd(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&me(s,i),f&20&&ee(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Rd(n,e){let t,i,s,l;return i=new nn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&ee(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function M$(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function T$(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function D$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function O$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function E$(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
|
||
Set to `),s=_("code"),s.textContent="null",l=R(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function A$(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function P$(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function L$(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function F$(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function I$(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Hd(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=Y.getFieldValueType(e[13])+"",p,g,v,b;function y(E,O){return E[13].required?T$:M$}let C=y(e),$=C(e);function S(E,O){if(E[13].type==="text")return I$;if(E[13].type==="number")return F$;if(E[13].type==="json")return L$;if(E[13].type==="email")return P$;if(E[13].type==="url")return A$;if(E[13].type==="file")return E$;if(E[13].type==="relation")return O$;if(E[13].type==="user")return D$}let M=S(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&($.d(1),$=C(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&me(a,r),O&1&&d!==(d=Y.getFieldValueType(e[13])+"")&&me(p,d),M===(M=S(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),$.d(),D&&D.d()}}}function jd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&me(s,i),f&10&&ee(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function qd(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&ee(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function N$(n){var Lt;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",C,$,S,M,D,E,O,F,L,H,j,Q=[],ne=new Map,B,K,W=[],J=new Map,ie,fe,ye,le,ue,Te,Z,be=[],x=new Map,G,_e,je,Fe,Re,re=[],ae=new Map,ke,Ke,Ye=[],nt=new Map,lt,xe=n[5]&&Id(),ge=n[4];const de=pe=>pe[16].lang;for(let pe=0;pe<ge.length;pe+=1){let Se=Fd(n,ge,pe),Je=de(Se);ne.set(Je,Q[pe]=Nd(Je,Se))}let qe=n[4];const ct=pe=>pe[16].lang;for(let pe=0;pe<qe.length;pe+=1){let Se=Ld(n,qe,pe),Je=ct(Se);J.set(Je,W[pe]=Rd(Je,Se))}let te=(Lt=n[0])==null?void 0:Lt.schema;const ve=pe=>pe[13].name;for(let pe=0;pe<te.length;pe+=1){let Se=Pd(n,te,pe),Je=ve(Se);x.set(Je,be[pe]=Hd(Je,Se))}let Ze=n[3];const at=pe=>pe[8].code;for(let pe=0;pe<Ze.length;pe+=1){let Se=Ad(n,Ze,pe),Je=at(Se);ae.set(Je,re[pe]=jd(Je,Se))}let mt=n[3];const yt=pe=>pe[8].code;for(let pe=0;pe<mt.length;pe+=1){let Se=Ed(n,mt,pe),Je=yt(Se);nt.set(Je,Ye[pe]=qd(Je,Se))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),xe&&xe.c(),d=T(),p=_("div"),g=_("p"),v=R("Create a new "),b=_("strong"),C=R(y),$=R(" record."),S=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||
<code>multipart/form-data</code>.`,D=T(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",O=T(),F=_("div"),F.textContent="Client SDKs example",L=T(),H=_("div"),j=_("div");for(let pe=0;pe<Q.length;pe+=1)Q[pe].c();B=T(),K=_("div");for(let pe=0;pe<W.length;pe+=1)W[pe].c();ie=T(),fe=_("div"),fe.textContent="Body Parameters",ye=T(),le=_("table"),ue=_("thead"),ue.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="50%">Description</th></tr>`,Te=T(),Z=_("tbody");for(let pe=0;pe<be.length;pe+=1)be[pe].c();G=T(),_e=_("div"),_e.textContent="Responses",je=T(),Fe=_("div"),Re=_("div");for(let pe=0;pe<re.length;pe+=1)re[pe].c();ke=T(),Ke=_("div");for(let pe=0;pe<Ye.length;pe+=1)Ye[pe].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-success"),h(p,"class","content m-b-base"),h(F,"class","section-title"),h(j,"class","tabs-header compact left"),h(K,"class","tabs-content"),h(H,"class","tabs m-b-lg"),h(fe,"class","section-title"),h(le,"class","table-compact table-border m-b-lg"),h(_e,"class","section-title"),h(Re,"class","tabs-header compact left"),h(Ke,"class","tabs-content"),h(Fe,"class","tabs")},m(pe,Se){w(pe,e,Se),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),xe&&xe.m(e,null),w(pe,d,Se),w(pe,p,Se),m(p,g),m(g,v),m(g,b),m(b,C),m(g,$),m(p,S),m(p,M),m(p,D),m(p,E),w(pe,O,Se),w(pe,F,Se),w(pe,L,Se),w(pe,H,Se),m(H,j);for(let Je=0;Je<Q.length;Je+=1)Q[Je].m(j,null);m(H,B),m(H,K);for(let Je=0;Je<W.length;Je+=1)W[Je].m(K,null);w(pe,ie,Se),w(pe,fe,Se),w(pe,ye,Se),w(pe,le,Se),m(le,ue),m(le,Te),m(le,Z);for(let Je=0;Je<be.length;Je+=1)be[Je].m(Z,null);w(pe,G,Se),w(pe,_e,Se),w(pe,je,Se),w(pe,Fe,Se),m(Fe,Re);for(let Je=0;Je<re.length;Je+=1)re[Je].m(Re,null);m(Fe,ke),m(Fe,Ke);for(let Je=0;Je<Ye.length;Je+=1)Ye[Je].m(Ke,null);lt=!0},p(pe,[Se]){var Je;(!lt||Se&1)&&a!==(a=pe[0].name+"")&&me(u,a),pe[5]?xe||(xe=Id(),xe.c(),xe.m(e,null)):xe&&(xe.d(1),xe=null),(!lt||Se&1)&&y!==(y=pe[0].name+"")&&me(C,y),Se&20&&(ge=pe[4],Q=ft(Q,Se,de,1,pe,ge,ne,j,rn,Nd,null,Fd)),Se&20&&(qe=pe[4],De(),W=ft(W,Se,ct,1,pe,qe,J,K,Nt,Rd,null,Ld),Oe()),Se&1&&(te=(Je=pe[0])==null?void 0:Je.schema,be=ft(be,Se,ve,1,pe,te,x,Z,rn,Hd,null,Pd)),Se&10&&(Ze=pe[3],re=ft(re,Se,at,1,pe,Ze,ae,Re,rn,jd,null,Ad)),Se&10&&(mt=pe[3],De(),Ye=ft(Ye,Se,yt,1,pe,mt,nt,Ke,Nt,qd,null,Ed),Oe())},i(pe){if(!lt){for(let Se=0;Se<qe.length;Se+=1)A(W[Se]);for(let Se=0;Se<mt.length;Se+=1)A(Ye[Se]);lt=!0}},o(pe){for(let Se=0;Se<W.length;Se+=1)P(W[Se]);for(let Se=0;Se<Ye.length;Se+=1)P(Ye[Se]);lt=!1},d(pe){pe&&k(e),xe&&xe.d(),pe&&k(d),pe&&k(p),pe&&k(O),pe&&k(F),pe&&k(L),pe&&k(H);for(let Se=0;Se<Q.length;Se+=1)Q[Se].d();for(let Se=0;Se<W.length;Se+=1)W[Se].d();pe&&k(ie),pe&&k(fe),pe&&k(ye),pe&&k(le);for(let Se=0;Se<be.length;Se+=1)be[Se].d();pe&&k(G),pe&&k(_e),pe&&k(je),pe&&k(Fe);for(let Se=0;Se<re.length;Se+=1)re[Se].d();for(let Se=0;Se<Ye.length;Se+=1)Ye[Se].d()}}}function R$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(Y.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||
{
|
||
"code": 400,
|
||
"message": "Failed to create record.",
|
||
"data": {
|
||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
|
||
"code": "validation_required",
|
||
"message": "Missing required value."
|
||
}
|
||
}
|
||
}
|
||
`},{code:403,body:`
|
||
{
|
||
"code": 403,
|
||
"message": "You are not allowed to perform this request.",
|
||
"data": {}
|
||
}
|
||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase("${we.baseUrl}");
|
||
|
||
const data = { ... };
|
||
|
||
client.Records.create("${s==null?void 0:s.name}", data)
|
||
.then(function (record) {
|
||
// success...
|
||
}).catch(function (error) {
|
||
// error...
|
||
});
|
||
`}])},[s,l,o,r,a,i,u,f]}class H$ extends Pe{constructor(e){super(),Ae(this,e,R$,N$,Ee,{collection:0})}}function Vd(n,e,t){const i=n.slice();return i[8]=e[t],i}function zd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Bd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ud(n,e,t){const i=n.slice();return i[16]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[16]=e[t],i}function Yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&me(s,i),f&20&&ee(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Zd(n,e){let t,i,s,l;return i=new nn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&ee(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function j$(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function q$(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function V$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function z$(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function B$(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
|
||
Set to `),s=_("code"),s.textContent="null",l=R(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function U$(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function W$(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Y$(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function K$(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Z$(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Jd(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=Y.getFieldValueType(e[13])+"",p,g,v,b;function y(E,O){return E[13].required?q$:j$}let C=y(e),$=C(e);function S(E,O){if(E[13].type==="text")return Z$;if(E[13].type==="number")return K$;if(E[13].type==="json")return Y$;if(E[13].type==="email")return W$;if(E[13].type==="url")return U$;if(E[13].type==="file")return B$;if(E[13].type==="relation")return z$;if(E[13].type==="user")return V$}let M=S(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&($.d(1),$=C(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&me(a,r),O&1&&d!==(d=Y.getFieldValueType(e[13])+"")&&me(p,d),M===(M=S(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),$.d(),D&&D.d()}}}function Gd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&me(s,i),f&10&&ee(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Xd(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&ee(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function J$(n){var Ft;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,C=n[0].name+"",$,S,M,D,E,O,F,L,H,j,Q,ne=[],B=new Map,K,W,J=[],ie=new Map,fe,ye,le,ue,Te,Z,be,x,G,_e,je,Fe=[],Re=new Map,re,ae,ke,Ke,Ye,nt=[],lt=new Map,xe,ge,de=[],qe=new Map,ct,te=n[5]&&Yd(),ve=n[4];const Ze=ce=>ce[16].lang;for(let ce=0;ce<ve.length;ce+=1){let $e=Wd(n,ve,ce),Ge=Ze($e);B.set(Ge,ne[ce]=Kd(Ge,$e))}let at=n[4];const mt=ce=>ce[16].lang;for(let ce=0;ce<at.length;ce+=1){let $e=Ud(n,at,ce),Ge=mt($e);ie.set(Ge,J[ce]=Zd(Ge,$e))}let yt=(Ft=n[0])==null?void 0:Ft.schema;const Lt=ce=>ce[13].name;for(let ce=0;ce<yt.length;ce+=1){let $e=Bd(n,yt,ce),Ge=Lt($e);Re.set(Ge,Fe[ce]=Jd(Ge,$e))}let pe=n[3];const Se=ce=>ce[8].code;for(let ce=0;ce<pe.length;ce+=1){let $e=zd(n,pe,ce),Ge=Se($e);lt.set(Ge,nt[ce]=Gd(Ge,$e))}let Je=n[3];const tt=ce=>ce[8].code;for(let ce=0;ce<Je.length;ce+=1){let $e=Vd(n,Je,ce),Ge=tt($e);qe.set(Ge,de[ce]=Xd(Ge,$e))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),te&&te.c(),p=T(),g=_("div"),v=_("p"),b=R("Update a single "),y=_("strong"),$=R(C),S=R(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||
<code>multipart/form-data</code>.`,E=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",F=T(),L=_("div"),L.textContent="Client SDKs example",H=T(),j=_("div"),Q=_("div");for(let ce=0;ce<ne.length;ce+=1)ne[ce].c();K=T(),W=_("div");for(let ce=0;ce<J.length;ce+=1)J[ce].c();fe=T(),ye=_("div"),ye.textContent="Path parameters",le=T(),ue=_("table"),ue.innerHTML=`<thead><tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr></thead>
|
||
<tbody><tr><td>id</td>
|
||
<td><span class="label">String</span></td>
|
||
<td>ID of the record to update.</td></tr></tbody>`,Te=T(),Z=_("div"),Z.textContent="Body Parameters",be=T(),x=_("table"),G=_("thead"),G.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="50%">Description</th></tr>`,_e=T(),je=_("tbody");for(let ce=0;ce<Fe.length;ce+=1)Fe[ce].c();re=T(),ae=_("div"),ae.textContent="Responses",ke=T(),Ke=_("div"),Ye=_("div");for(let ce=0;ce<nt.length;ce+=1)nt[ce].c();xe=T(),ge=_("div");for(let ce=0;ce<de.length;ce+=1)de[ce].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-warning"),h(g,"class","content m-b-base"),h(L,"class","section-title"),h(Q,"class","tabs-header compact left"),h(W,"class","tabs-content"),h(j,"class","tabs m-b-lg"),h(ye,"class","section-title"),h(ue,"class","table-compact table-border m-b-lg"),h(Z,"class","section-title"),h(x,"class","table-compact table-border m-b-lg"),h(ae,"class","section-title"),h(Ye,"class","tabs-header compact left"),h(ge,"class","tabs-content"),h(Ke,"class","tabs")},m(ce,$e){w(ce,e,$e),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),te&&te.m(e,null),w(ce,p,$e),w(ce,g,$e),m(g,v),m(v,b),m(v,y),m(y,$),m(v,S),m(g,M),m(g,D),m(g,E),m(g,O),w(ce,F,$e),w(ce,L,$e),w(ce,H,$e),w(ce,j,$e),m(j,Q);for(let Ge=0;Ge<ne.length;Ge+=1)ne[Ge].m(Q,null);m(j,K),m(j,W);for(let Ge=0;Ge<J.length;Ge+=1)J[Ge].m(W,null);w(ce,fe,$e),w(ce,ye,$e),w(ce,le,$e),w(ce,ue,$e),w(ce,Te,$e),w(ce,Z,$e),w(ce,be,$e),w(ce,x,$e),m(x,G),m(x,_e),m(x,je);for(let Ge=0;Ge<Fe.length;Ge+=1)Fe[Ge].m(je,null);w(ce,re,$e),w(ce,ae,$e),w(ce,ke,$e),w(ce,Ke,$e),m(Ke,Ye);for(let Ge=0;Ge<nt.length;Ge+=1)nt[Ge].m(Ye,null);m(Ke,xe),m(Ke,ge);for(let Ge=0;Ge<de.length;Ge+=1)de[Ge].m(ge,null);ct=!0},p(ce,[$e]){var Ge;(!ct||$e&1)&&a!==(a=ce[0].name+"")&&me(u,a),ce[5]?te||(te=Yd(),te.c(),te.m(e,null)):te&&(te.d(1),te=null),(!ct||$e&1)&&C!==(C=ce[0].name+"")&&me($,C),$e&20&&(ve=ce[4],ne=ft(ne,$e,Ze,1,ce,ve,B,Q,rn,Kd,null,Wd)),$e&20&&(at=ce[4],De(),J=ft(J,$e,mt,1,ce,at,ie,W,Nt,Zd,null,Ud),Oe()),$e&1&&(yt=(Ge=ce[0])==null?void 0:Ge.schema,Fe=ft(Fe,$e,Lt,1,ce,yt,Re,je,rn,Jd,null,Bd)),$e&10&&(pe=ce[3],nt=ft(nt,$e,Se,1,ce,pe,lt,Ye,rn,Gd,null,zd)),$e&10&&(Je=ce[3],De(),de=ft(de,$e,tt,1,ce,Je,qe,ge,Nt,Xd,null,Vd),Oe())},i(ce){if(!ct){for(let $e=0;$e<at.length;$e+=1)A(J[$e]);for(let $e=0;$e<Je.length;$e+=1)A(de[$e]);ct=!0}},o(ce){for(let $e=0;$e<J.length;$e+=1)P(J[$e]);for(let $e=0;$e<de.length;$e+=1)P(de[$e]);ct=!1},d(ce){ce&&k(e),te&&te.d(),ce&&k(p),ce&&k(g),ce&&k(F),ce&&k(L),ce&&k(H),ce&&k(j);for(let $e=0;$e<ne.length;$e+=1)ne[$e].d();for(let $e=0;$e<J.length;$e+=1)J[$e].d();ce&&k(fe),ce&&k(ye),ce&&k(le),ce&&k(ue),ce&&k(Te),ce&&k(Z),ce&&k(be),ce&&k(x);for(let $e=0;$e<Fe.length;$e+=1)Fe[$e].d();ce&&k(re),ce&&k(ae),ce&&k(ke),ce&&k(Ke);for(let $e=0;$e<nt.length;$e+=1)nt[$e].d();for(let $e=0;$e<de.length;$e+=1)de[$e].d()}}}function G$(n,e,t){let i,{collection:s=new An}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(Y.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||
{
|
||
"code": 400,
|
||
"message": "Failed to update record.",
|
||
"data": {
|
||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
|
||
"code": "validation_required",
|
||
"message": "Missing required value."
|
||
}
|
||
}
|
||
}
|
||
`},{code:403,body:`
|
||
{
|
||
"code": 403,
|
||
"message": "You are not allowed to perform this request.",
|
||
"data": {}
|
||
}
|
||
`},{code:404,body:`
|
||
{
|
||
"code": 404,
|
||
"message": "The requested resource wasn't found.",
|
||
"data": {}
|
||
}
|
||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase("${we.baseUrl}");
|
||
|
||
const data = { ... };
|
||
|
||
client.Records.update("${s==null?void 0:s.name}", "RECORD_ID", data)
|
||
.then(function (record) {
|
||
// success...
|
||
}).catch(function (error) {
|
||
// error...
|
||
});
|
||
`}])},[s,l,o,r,a,i,u,f]}class X$ extends Pe{constructor(e){super(),Ae(this,e,G$,J$,Ee,{collection:0})}}function Qd(n,e,t){const i=n.slice();return i[8]=e[t],i}function xd(n,e,t){const i=n.slice();return i[8]=e[t],i}function eh(n,e,t){const i=n.slice();return i[13]=e[t],i}function th(n,e,t){const i=n.slice();return i[13]=e[t],i}function nh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ih(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function sh(n,e){let t,i,s,l;return i=new nn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&ee(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function lh(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function oh(n,e){let t,i,s,l;return i=new nn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&ee(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Q$(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,C=n[0].name+"",$,S,M,D,E,O,F,L=[],H=new Map,j,Q,ne=[],B=new Map,K,W,J,ie,fe,ye,le,ue,Te,Z=[],be=new Map,x,G,_e=[],je=new Map,Fe,Re=n[1]&&nh(),re=n[4];const ae=ge=>ge[13].lang;for(let ge=0;ge<re.length;ge+=1){let de=th(n,re,ge),qe=ae(de);H.set(qe,L[ge]=ih(qe,de))}let ke=n[4];const Ke=ge=>ge[13].lang;for(let ge=0;ge<ke.length;ge+=1){let de=eh(n,ke,ge),qe=Ke(de);B.set(qe,ne[ge]=sh(qe,de))}let Ye=n[5];const nt=ge=>ge[8].code;for(let ge=0;ge<Ye.length;ge+=1){let de=xd(n,Ye,ge),qe=nt(de);be.set(qe,Z[ge]=lh(qe,de))}let lt=n[5];const xe=ge=>ge[8].code;for(let ge=0;ge<lt.length;ge+=1){let de=Qd(n,lt,ge),qe=xe(de);je.set(qe,_e[ge]=oh(qe,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Re&&Re.c(),p=T(),g=_("div"),v=_("p"),b=R("Delete a single "),y=_("strong"),$=R(C),S=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),O=_("div"),F=_("div");for(let ge=0;ge<L.length;ge+=1)L[ge].c();j=T(),Q=_("div");for(let ge=0;ge<ne.length;ge+=1)ne[ge].c();K=T(),W=_("div"),W.textContent="Path parameters",J=T(),ie=_("table"),ie.innerHTML=`<thead><tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr></thead>
|
||
<tbody><tr><td>id</td>
|
||
<td><span class="label">String</span></td>
|
||
<td>ID of the record to delete.</td></tr></tbody>`,fe=T(),ye=_("div"),ye.textContent="Responses",le=T(),ue=_("div"),Te=_("div");for(let ge=0;ge<Z.length;ge+=1)Z[ge].c();x=T(),G=_("div");for(let ge=0;ge<_e.length;ge+=1)_e[ge].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-danger"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(W,"class","section-title"),h(ie,"class","table-compact table-border m-b-lg"),h(ye,"class","section-title"),h(Te,"class","tabs-header compact left"),h(G,"class","tabs-content"),h(ue,"class","tabs")},m(ge,de){w(ge,e,de),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Re&&Re.m(e,null),w(ge,p,de),w(ge,g,de),m(g,v),m(v,b),m(v,y),m(y,$),m(v,S),w(ge,M,de),w(ge,D,de),w(ge,E,de),w(ge,O,de),m(O,F);for(let qe=0;qe<L.length;qe+=1)L[qe].m(F,null);m(O,j),m(O,Q);for(let qe=0;qe<ne.length;qe+=1)ne[qe].m(Q,null);w(ge,K,de),w(ge,W,de),w(ge,J,de),w(ge,ie,de),w(ge,fe,de),w(ge,ye,de),w(ge,le,de),w(ge,ue,de),m(ue,Te);for(let qe=0;qe<Z.length;qe+=1)Z[qe].m(Te,null);m(ue,x),m(ue,G);for(let qe=0;qe<_e.length;qe+=1)_e[qe].m(G,null);Fe=!0},p(ge,[de]){(!Fe||de&1)&&a!==(a=ge[0].name+"")&&me(u,a),ge[1]?Re||(Re=nh(),Re.c(),Re.m(e,null)):Re&&(Re.d(1),Re=null),(!Fe||de&1)&&C!==(C=ge[0].name+"")&&me($,C),de&24&&(re=ge[4],L=ft(L,de,ae,1,ge,re,H,F,rn,ih,null,th)),de&24&&(ke=ge[4],De(),ne=ft(ne,de,Ke,1,ge,ke,B,Q,Nt,sh,null,eh),Oe()),de&36&&(Ye=ge[5],Z=ft(Z,de,nt,1,ge,Ye,be,Te,rn,lh,null,xd)),de&36&&(lt=ge[5],De(),_e=ft(_e,de,xe,1,ge,lt,je,G,Nt,oh,null,Qd),Oe())},i(ge){if(!Fe){for(let de=0;de<ke.length;de+=1)A(ne[de]);for(let de=0;de<lt.length;de+=1)A(_e[de]);Fe=!0}},o(ge){for(let de=0;de<ne.length;de+=1)P(ne[de]);for(let de=0;de<_e.length;de+=1)P(_e[de]);Fe=!1},d(ge){ge&&k(e),Re&&Re.d(),ge&&k(p),ge&&k(g),ge&&k(M),ge&&k(D),ge&&k(E),ge&&k(O);for(let de=0;de<L.length;de+=1)L[de].d();for(let de=0;de<ne.length;de+=1)ne[de].d();ge&&k(K),ge&&k(W),ge&&k(J),ge&&k(ie),ge&&k(fe),ge&&k(ye),ge&&k(le),ge&&k(ue);for(let de=0;de<Z.length;de+=1)Z[de].d();for(let de=0;de<_e.length;de+=1)_e[de].d()}}}function x$(n,e,t){let i,{collection:s=new An}=e,l=204,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:204,body:`
|
||
null
|
||
`}),r.push({code:400,body:`
|
||
{
|
||
"code": 400,
|
||
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
|
||
"data": {}
|
||
}
|
||
`}),i&&r.push({code:403,body:`
|
||
{
|
||
"code": 403,
|
||
"message": "Only admins can access this action.",
|
||
"data": {}
|
||
}
|
||
`}),r.push({code:404,body:`
|
||
{
|
||
"code": 404,
|
||
"message": "The requested resource wasn't found.",
|
||
"data": {}
|
||
}
|
||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase("${we.baseUrl}");
|
||
|
||
client.Records.delete("${s==null?void 0:s.name}", "RECORD_ID")
|
||
.then(function () {
|
||
// success...
|
||
}).catch(function (error) {
|
||
// error...
|
||
});
|
||
`}])},[s,i,l,o,a,r,u,f]}class eC extends Pe{constructor(e){super(),Ae(this,e,x$,Q$,Ee,{collection:0})}}function rh(n,e,t){const i=n.slice();return i[4]=e[t],i}function ah(n,e,t){const i=n.slice();return i[4]=e[t],i}function uh(n,e){let t,i=e[4].lang+"",s,l,o,r;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[4].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[4].lang+"")&&me(s,i),f&6&&ee(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),o=!1,r()}}}function fh(n,e){let t,i,s,l;return i=new nn({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),ee(t,"active",e[1]===e[4].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[4].code),i.$set(a),r&6&&ee(t,"active",e[1]===e[4].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function tC(n){let e,t,i,s,l,o,r,a,u=[],f=new Map,c,d,p=[],g=new Map,v,b,y,C,$,S=n[2];const M=O=>O[4].lang;for(let O=0;O<S.length;O+=1){let F=ah(n,S,O),L=M(F);f.set(L,u[O]=uh(L,F))}let D=n[2];const E=O=>O[4].lang;for(let O=0;O<D.length;O+=1){let F=rh(n,D,O),L=E(F);g.set(L,p[O]=fh(L,F))}return C=new nn({props:{content:JSON.stringify({action:"create",record:Y.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||
<div class="content"><p>/api/realtime</p></div>`,t=T(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||
<p>Events are send for <strong>create</strong>, <strong>update</strong>
|
||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||
the event message.</p>
|
||
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||
the event message.</p></div></div>`,s=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),r=_("div"),a=_("div");for(let O=0;O<u.length;O+=1)u[O].c();c=T(),d=_("div");for(let O=0;O<p.length;O+=1)p[O].c();v=T(),b=_("div"),b.textContent="Event data format",y=T(),z(C.$$.fragment),h(e,"class","alert"),h(i,"class","content m-b-base"),h(l,"class","section-title"),h(a,"class","tabs-header compact left"),h(d,"class","tabs-content"),h(r,"class","tabs m-b-base"),h(b,"class","section-title")},m(O,F){w(O,e,F),w(O,t,F),w(O,i,F),w(O,s,F),w(O,l,F),w(O,o,F),w(O,r,F),m(r,a);for(let L=0;L<u.length;L+=1)u[L].m(a,null);m(r,c),m(r,d);for(let L=0;L<p.length;L+=1)p[L].m(d,null);w(O,v,F),w(O,b,F),w(O,y,F),q(C,O,F),$=!0},p(O,[F]){F&6&&(S=O[2],u=ft(u,F,M,1,O,S,f,a,rn,uh,null,ah)),F&6&&(D=O[2],De(),p=ft(p,F,E,1,O,D,g,d,Nt,fh,null,rh),Oe());const L={};F&1&&(L.content=JSON.stringify({action:"create",record:Y.dummyCollectionRecord(O[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),C.$set(L)},i(O){if(!$){for(let F=0;F<D.length;F+=1)A(p[F]);A(C.$$.fragment,O),$=!0}},o(O){for(let F=0;F<p.length;F+=1)P(p[F]);P(C.$$.fragment,O),$=!1},d(O){O&&k(e),O&&k(t),O&&k(i),O&&k(s),O&&k(l),O&&k(o),O&&k(r);for(let F=0;F<u.length;F+=1)u[F].d();for(let F=0;F<p.length;F+=1)p[F].d();O&&k(v),O&&k(b),O&&k(y),V(C,O)}}}function nC(n,e,t){let{collection:i=new An}=e,s="JavaScript",l=[];const o=r=>t(1,s=r.lang);return n.$$set=r=>{"collection"in r&&t(0,i=r.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{lang:"JavaScript",code:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase("${we.baseUrl}");
|
||
|
||
// (Optionally) authenticate
|
||
client.Users.authViaEmail("test@example.com", "123456");
|
||
|
||
// Subscribe to changes in any record from the collection
|
||
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
|
||
console.log(e.record);
|
||
});
|
||
|
||
// Subscribe to changes in a single record
|
||
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
|
||
console.log(e.record);
|
||
});
|
||
|
||
// Unsubscribe
|
||
client.Realtime.unsubscribe() // remove all subscriptions
|
||
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
|
||
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
|
||
`}])},[i,s,l,o]}class iC extends Pe{constructor(e){super(),Ae(this,e,nC,tC,Ee,{collection:0})}}function ch(n,e,t){const i=n.slice();return i[14]=e[t],i}function dh(n,e,t){const i=n.slice();return i[14]=e[t],i}function hh(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&z(t.$$.fragment),i=T(),h(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&q(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){De();const f=t;P(f.$$.fragment,1,0,()=>{V(f,1)}),Oe()}l?(t=new l(o(r)),z(t.$$.fragment),A(t.$$.fragment,1),q(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&V(t)}}}function ph(n,e){let t,i,s,l=e[4]===e[14].id&&hh(e);return{key:n,first:null,c(){t=rt(),l&&l.c(),i=rt(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=hh(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(De(),P(l,1,1,()=>{l=null}),Oe())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function sC(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=ch(n,l,r),u=o(a);i.set(u,t[r]=ph(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],De(),t=ft(t,a,o,1,r,l,i,e,Nt,ph,null,ch),Oe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function mh(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=R(s),o=T(),h(i,"class","txt"),h(t,"tabindex","0"),h(t,"class","tab-item"),ee(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[X(t,"click",u),X(t,"keydown",Wp(f))],r=!0)},p(c,d){e=c,d&48&&ee(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,st(a)}}}function lC(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let p=dh(n,f,d),g=c(p);u.set(g,a[d]=mh(g,p))}return{c(){e=_("h4"),t=_("strong"),s=R(i),l=R(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();h(r,"class","tabs-header stretched")},m(d,p){w(d,e,p),m(e,t),m(t,s),m(e,l),w(d,o,p),w(d,r,p);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,p){p&8&&i!==(i=d[3].name+"")&&me(s,i),p&114&&(f=d[5],a=ft(a,p,c,1,d,f,u,r,rn,mh,null,dh))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let p=0;p<a.length;p+=1)a[p].d()}}}function oC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',h(e,"type","button"),h(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function rC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[oC],header:[lC],default:[sC]},$$scope:{ctx:n}};return e=new wi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function aC(n,e,t){const i=[{id:"list",label:"List",component:w$},{id:"view",label:"View",component:C$},{id:"create",label:"Create",component:H$},{id:"update",label:"Update",component:X$},{id:"delete",label:"Delete",component:eC},{id:"realtime",label:"Realtime",component:iC}];let s,l=new An,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,C){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(C))}const c=()=>a(),d=y=>u(y.id),p=(y,C)=>f(C,y.id);function g(y){he[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){ht.call(this,n,y)}function b(y){ht.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,p,g,v,b]}class uC extends Pe{constructor(e){super(),Ae(this,e,aC,rC,Ee,{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 fC(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=pt(l,s[o]);return{c(){e=_("textarea"),oi(e,l),ee(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),Ce(e,n[0]),t||(i=[X(e,"input",n[6]),X(e,"keydown",n[2])],t=!0)},p(o,[r]){oi(e,l=pn(s,[r&8&&o[3]])),r&1&&Ce(e,o[0]),ee(e,"svelte-1x1pbts",!0)},i:oe,o:oe,d(o){o&&k(e),n[5](null),t=!1,st(i)}}}function cC(n,e,t){const i=["value","maxHeight"];let s=Kt(e,i),{value:l=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(p){if((p==null?void 0:p.code)==="Enter"&&!(p!=null&&p.shiftKey)){p.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Yn(()=>(u(),()=>clearTimeout(a)));function c(p){he[p?"unshift":"push"](()=>{r=p,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=pt(pt({},e),ri(p)),t(3,s=Kt(e,i)),"value"in p&&t(0,l=p.value),"maxHeight"in p&&t(4,o=p.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class dC extends Pe{constructor(e){super(),Ae(this,e,cC,fC,Ee,{value:0,maxHeight:4})}}function hC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function p(v){n[2](v)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new dC({props:g}),he.push(()=>Ie(f,"value",p)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),q(f,v,b),d=!0},p(v,b){(!d||b&2&&i!==(i=Y.getFieldTypeIcon(v[1].type)))&&h(t,"class",i),(!d||b&2)&&o!==(o=v[1].name+"")&&me(r,o),(!d||b&8&&a!==(a=v[3]))&&h(e,"for",a);const y={};b&8&&(y.id=v[3]),b&2&&(y.required=v[1].required),!c&&b&1&&(c=!0,y.value=v[0],He(()=>c=!1)),f.$set(y)},i(v){d||(A(f.$$.fragment,v),d=!0)},o(v){P(f.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(u),V(f,v)}}}function pC(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[hC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mC(n,e,t){let{field:i=new vn}=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 gC extends Pe{constructor(e){super(),Ae(this,e,mC,pC,Ee,{field:1,value:0})}}function _C(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g,v,b;return{c(){var y,C;e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("input"),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","number"),h(f,"id",c=n[3]),f.required=d=n[1].required,h(f,"min",p=(y=n[1].options)==null?void 0:y.min),h(f,"max",g=(C=n[1].options)==null?void 0:C.max),h(f,"step","any")},m(y,C){w(y,e,C),m(e,t),m(e,s),m(e,l),m(l,r),w(y,u,C),w(y,f,C),Ce(f,n[0]),v||(b=X(f,"input",n[2]),v=!0)},p(y,C){var $,S;C&2&&i!==(i=Y.getFieldTypeIcon(y[1].type))&&h(t,"class",i),C&2&&o!==(o=y[1].name+"")&&me(r,o),C&8&&a!==(a=y[3])&&h(e,"for",a),C&8&&c!==(c=y[3])&&h(f,"id",c),C&2&&d!==(d=y[1].required)&&(f.required=d),C&2&&p!==(p=($=y[1].options)==null?void 0:$.min)&&h(f,"min",p),C&2&&g!==(g=(S=y[1].options)==null?void 0:S.max)&&h(f,"max",g),C&1&&Ot(f.value)!==y[0]&&Ce(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),v=!1,b()}}}function bC(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[_C,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function vC(n,e,t){let{field:i=new vn}=e,{value:s=void 0}=e;function l(){s=Ot(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 yC extends Pe{constructor(e){super(),Ae(this,e,vC,bC,Ee,{field:1,value:0})}}function kC(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=_("input"),i=T(),s=_("label"),o=R(l),h(e,"type","checkbox"),h(e,"id",t=n[3]),h(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),m(s,o),a||(u=X(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&h(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&me(o,l),c&8&&r!==(r=f[3])&&h(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function wC(n){let e,t;return e=new Le({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[kC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function SC(n,e,t){let{field:i=new vn}=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 $C extends Pe{constructor(e){super(),Ae(this,e,SC,wC,Ee,{field:1,value:0})}}function CC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("input"),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","email"),h(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Ce(f,n[0]),p||(g=X(f,"input",n[2]),p=!0)},p(v,b){b&2&&i!==(i=Y.getFieldTypeIcon(v[1].type))&&h(t,"class",i),b&2&&o!==(o=v[1].name+"")&&me(r,o),b&8&&a!==(a=v[3])&&h(e,"for",a),b&8&&c!==(c=v[3])&&h(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&f.value!==v[0]&&Ce(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),p=!1,g()}}}function MC(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[CC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function TC(n,e,t){let{field:i=new vn}=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 DC extends Pe{constructor(e){super(),Ae(this,e,TC,MC,Ee,{field:1,value:0})}}function OC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("input"),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","url"),h(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Ce(f,n[0]),p||(g=X(f,"input",n[2]),p=!0)},p(v,b){b&2&&i!==(i=Y.getFieldTypeIcon(v[1].type))&&h(t,"class",i),b&2&&o!==(o=v[1].name+"")&&me(r,o),b&8&&a!==(a=v[3])&&h(e,"for",a),b&8&&c!==(c=v[3])&&h(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Ce(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),p=!1,g()}}}function EC(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[OC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function AC(n,e,t){let{field:i=new vn}=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 PC extends Pe{constructor(e){super(),Ae(this,e,AC,EC,Ee,{field:1,value:0})}}function LC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p;function g(b){n[2](b)}let v={id:n[3],options:Y.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(v.formattedValue=n[0]),c=new Ba({props:v}),he.push(()=>Ie(c,"formattedValue",g)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),a=R(" (UTC)"),f=T(),z(c.$$.fragment),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",u=n[3])},m(b,y){w(b,e,y),m(e,t),m(e,s),m(e,l),m(l,r),m(l,a),w(b,f,y),q(c,b,y),p=!0},p(b,y){(!p||y&2&&i!==(i=Y.getFieldTypeIcon(b[1].type)))&&h(t,"class",i),(!p||y&2)&&o!==(o=b[1].name+"")&&me(r,o),(!p||y&8&&u!==(u=b[3]))&&h(e,"for",u);const C={};y&8&&(C.id=b[3]),y&1&&(C.value=b[0]),!d&&y&1&&(d=!0,C.formattedValue=b[0],He(()=>d=!1)),c.$set(C)},i(b){p||(A(c.$$.fragment,b),p=!0)},o(b){P(c.$$.fragment,b),p=!1},d(b){b&&k(e),b&&k(f),V(c,b)}}}function FC(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[LC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function IC(n,e,t){let{field:i=new vn}=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 NC extends Pe{constructor(e){super(),Ae(this,e,IC,FC,Ee,{field:1,value:0})}}function gh(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=R("Select up to "),s=R(i),l=R(" items."),h(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&me(s,i)},d(o){o&&k(e)}}}function RC(n){var C,$,S;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;function v(M){n[3](M)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(C=n[1].options)==null?void 0:C.values,searchable:(($=n[1].options)==null?void 0:$.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new f_({props:b}),he.push(()=>Ie(f,"selected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&gh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),d=T(),y&&y.c(),p=rt(),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(M,D){w(M,e,D),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,D),q(f,M,D),w(M,d,D),y&&y.m(M,D),w(M,p,D),g=!0},p(M,D){var O,F,L;(!g||D&2&&i!==(i=Y.getFieldTypeIcon(M[1].type)))&&h(t,"class",i),(!g||D&2)&&o!==(o=M[1].name+"")&&me(r,o),(!g||D&16&&a!==(a=M[4]))&&h(e,"for",a);const E={};D&16&&(E.id=M[4]),D&6&&(E.toggle=!M[1].required||M[2]),D&4&&(E.multiple=M[2]),D&2&&(E.items=(O=M[1].options)==null?void 0:O.values),D&2&&(E.searchable=((F=M[1].options)==null?void 0:F.values)>5),!c&&D&1&&(c=!0,E.selected=M[0],He(()=>c=!1)),f.$set(E),((L=M[1].options)==null?void 0:L.maxSelect)>1?y?y.p(M,D):(y=gh(M),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i(M){g||(A(f.$$.fragment,M),g=!0)},o(M){P(f.$$.fragment,M),g=!1},d(M){M&&k(e),M&&k(u),V(f,M),M&&k(d),y&&y.d(M),M&&k(p)}}}function HC(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RC,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function jC(n,e,t){let i,{field:s=new vn}=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 qC extends Pe{constructor(e){super(),Ae(this,e,jC,HC,Ee,{field:1,value:0})}}function VC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("textarea"),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"id",c=n[3]),f.required=d=n[1].required,h(f,"class","txt-mono")},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Ce(f,n[0]),p||(g=X(f,"input",n[2]),p=!0)},p(v,b){b&2&&i!==(i=Y.getFieldTypeIcon(v[1].type))&&h(t,"class",i),b&2&&o!==(o=v[1].name+"")&&me(r,o),b&8&&a!==(a=v[3])&&h(e,"for",a),b&8&&c!==(c=v[3])&&h(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Ce(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),p=!1,g()}}}function zC(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[VC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function BC(n,e,t){let{field:i=new vn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&typeof s!="string"&&s!==null&&t(0,s=JSON.stringify(s,null,2))},[s,i,l]}class UC extends Pe{constructor(e){super(),Ae(this,e,BC,zC,Ee,{field:1,value:0})}}function WC(n){let e,t;return{c(){e=_("i"),h(e,"class","ri-file-line"),h(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&h(e,"alt",t)},d(i){i&&k(e)}}}function YC(n){let e,t,i;return{c(){e=_("img"),Xn(e.src,t=n[2])||h(e,"src",t),h(e,"width",n[1]),h(e,"height",n[1]),h(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!Xn(e.src,t=s[2])&&h(e,"src",t),l&2&&h(e,"width",s[1]),l&2&&h(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&h(e,"alt",i)},d(s){s&&k(e)}}}function KC(n){let e;function t(l,o){return l[2]?YC:WC}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function ZC(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),Y.hasImageExtension(s==null?void 0:s.name)&&Y.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 JC extends Pe{constructor(e){super(),Ae(this,e,ZC,KC,Ee,{file:0,size:1})}}function GC(n){let e,t;return{c(){e=_("img"),Xn(e.src,t=n[2])||h(e,"src",t),h(e,"alt","Preview")},m(i,s){w(i,e,s)},p(i,s){s&4&&!Xn(e.src,t=i[2])&&h(e,"src",t)},d(i){i&&k(e)}}}function XC(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=X(e,"click",Bt(n[0])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function QC(n){let e,t,i=n[2].substring(n[2].lastIndexOf("/")+1)+"",s,l,o,r,a,u,f;return{c(){e=_("a"),t=R("/../"),s=R(i),l=T(),o=_("div"),r=T(),a=_("button"),a.textContent="Close",h(e,"href",n[2]),h(e,"title","Download"),h(e,"class","link-hint txt-ellipsis"),h(o,"class","flex-fill"),h(a,"type","button"),h(a,"class","btn btn-secondary")},m(c,d){w(c,e,d),m(e,t),m(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=X(a,"click",n[0]),u=!0)},p(c,d){d&4&&i!==(i=c[2].substring(c[2].lastIndexOf("/")+1)+"")&&me(s,i),d&4&&h(e,"href",c[2])},d(c){c&&k(e),c&&k(l),c&&k(o),c&&k(r),c&&k(a),u=!1,f()}}}function xC(n){let e,t,i={class:"image-preview",btnClose:!1,popup:!0,$$slots:{footer:[QC],header:[XC],default:[GC]},$$scope:{ctx:n}};return e=new wi({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&132&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[4](null),V(e,s)}}}function e4(n,e,t){let i,s="";function l(f){f!==""&&Y.checkImageUrl(f).then(()=>{t(2,s=f),i==null||i.show()}).catch(()=>{console.warn("Invalid image preview url: ",f),o()})}function o(){return i==null?void 0:i.hide()}function r(f){he[f?"unshift":"push"](()=>{i=f,t(1,i)})}function a(f){ht.call(this,n,f)}function u(f){ht.call(this,n,f)}return[o,i,s,l,r,a,u]}class t4 extends Pe{constructor(e){super(),Ae(this,e,e4,xC,Ee,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function n4(n){let e;return{c(){e=_("i"),h(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function i4(n){let e,t,i,s,l;return{c(){e=_("img"),Xn(e.src,t=n[4])||h(e,"src",t),h(e,"alt",n[0]),h(e,"title",i="Preview "+n[0]),ee(e,"link-fade",n[2])},m(o,r){w(o,e,r),s||(l=[X(e,"click",n[7]),X(e,"error",n[5])],s=!0)},p(o,r){r&16&&!Xn(e.src,t=o[4])&&h(e,"src",t),r&1&&h(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&h(e,"title",i),r&4&&ee(e,"link-fade",o[2])},d(o){o&&k(e),s=!1,st(l)}}}function s4(n){let e,t,i;function s(a,u){return a[2]?i4:n4}let l=s(n),o=l(n),r={};return t=new t4({props:r}),n[8](t),{c(){o.c(),e=T(),z(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),q(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[8](null),V(t,a)}}}function l4(n,e,t){let i,{record:s}=e,{filename:l}=e,o,r="",a="";function u(){t(4,r="")}const f=d=>{d.stopPropagation(),o==null||o.show(a)};function c(d){he[d?"unshift":"push"](()=>{o=d,t(3,o)})}return n.$$set=d=>{"record"in d&&t(6,s=d.record),"filename"in d&&t(0,l=d.filename)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=Y.hasImageExtension(l)),n.$$.dirty&69&&i&&t(1,a=we.Records.getFileUrl(s,`${l}`)),n.$$.dirty&2&&t(4,r=a?a+"?thumb=100x100":"")},[l,a,i,o,r,u,s,f,c]}class p_ extends Pe{constructor(e){super(),Ae(this,e,l4,s4,Ee,{record:6,filename:0})}}function _h(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function bh(n,e,t){const i=n.slice();return i[25]=e[t],i[24]=t,i}function o4(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"type","button"),h(e,"class","btn btn-secondary btn-sm btn-circle btn-remove txt-hint")},m(l,o){w(l,e,o),t||(i=[Qe(Ct.call(null,e,"Remove file")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,st(i)}}}function r4(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-secondary")},m(l,o){w(l,e,o),t||(i=X(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function vh(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,p,g;s=new p_({props:{record:e[2],filename:e[25]}});function v(C,$){return $&18&&(p=null),p==null&&(p=!!C[1].includes(C[24])),p?r4:o4}let b=v(e,-1),y=b(e);return{key:n,first:null,c(){t=_("div"),i=_("figure"),z(s.$$.fragment),l=T(),o=_("a"),r=R("/.../"),u=R(a),d=T(),y.c(),h(i,"class","thumb"),ee(i,"fade",e[1].includes(e[24])),h(o,"href",f=we.Records.getFileUrl(e[2],e[25])),h(o,"class","filename"),h(o,"title",c="Download "+e[25]),h(o,"target","_blank"),h(o,"rel","noopener"),h(o,"download",""),ee(o,"txt-strikethrough",e[1].includes(e[24])),h(t,"class","list-item"),this.first=t},m(C,$){w(C,t,$),m(t,i),q(s,i,null),m(t,l),m(t,o),m(o,r),m(o,u),m(t,d),y.m(t,null),g=!0},p(C,$){e=C;const S={};$&4&&(S.record=e[2]),$&16&&(S.filename=e[25]),s.$set(S),$&18&&ee(i,"fade",e[1].includes(e[24])),(!g||$&16)&&a!==(a=e[25]+"")&&me(u,a),(!g||$&20&&f!==(f=we.Records.getFileUrl(e[2],e[25])))&&h(o,"href",f),(!g||$&16&&c!==(c="Download "+e[25]))&&h(o,"title",c),$&18&&ee(o,"txt-strikethrough",e[1].includes(e[24])),b===(b=v(e,$))&&y?y.p(e,$):(y.d(1),y=b(e),y&&(y.c(),y.m(t,null)))},i(C){g||(A(s.$$.fragment,C),g=!0)},o(C){P(s.$$.fragment,C),g=!1},d(C){C&&k(t),V(s),y.d()}}}function yh(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,p,g,v,b;i=new JC({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=_("div"),t=_("figure"),z(i.$$.fragment),s=T(),l=_("div"),o=_("small"),o.textContent="New",r=T(),a=_("span"),f=R(u),d=T(),p=_("button"),p.innerHTML='<i class="ri-close-line"></i>',h(t,"class","thumb"),h(o,"class","label label-success m-r-5"),h(a,"class","txt"),h(l,"class","filename"),h(l,"title",c=n[22].name),h(p,"type","button"),h(p,"class","btn btn-secondary btn-sm btn-circle btn-remove"),h(e,"class","list-item")},m(C,$){w(C,e,$),m(e,t),q(i,t,null),m(e,s),m(e,l),m(l,o),m(l,r),m(l,a),m(a,f),m(e,d),m(e,p),g=!0,v||(b=[Qe(Ct.call(null,p,"Remove file")),X(p,"click",y)],v=!0)},p(C,$){n=C;const S={};$&1&&(S.file=n[22]),i.$set(S),(!g||$&1)&&u!==(u=n[22].name+"")&&me(f,u),(!g||$&1&&c!==(c=n[22].name))&&h(l,"title",c)},i(C){g||(A(i.$$.fragment,C),g=!0)},o(C){P(i.$$.fragment,C),g=!1},d(C){C&&k(e),V(i),v=!1,st(b)}}}function kh(n){let e,t,i,s,l,o;return{c(){e=_("div"),t=_("input"),i=T(),s=_("button"),s.innerHTML=`<i class="ri-upload-cloud-line"></i>
|
||
<span class="txt">Upload new file</span>`,h(t,"type","file"),h(t,"class","hidden"),t.multiple=n[5],h(s,"type","button"),h(s,"class","btn btn-secondary btn-sm btn-block"),h(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[X(t,"change",n[17]),X(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,st(o)}}}function a4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,p,g,v,b=n[4];const y=D=>D[25];for(let D=0;D<b.length;D+=1){let E=bh(n,b,D),O=y(E);d.set(O,c[D]=vh(O,E))}let C=n[0],$=[];for(let D=0;D<C.length;D+=1)$[D]=yh(_h(n,C,D));const S=D=>P($[D],1,1,()=>{$[D]=null});let M=!n[8]&&kh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();p=T();for(let D=0;D<$.length;D+=1)$[D].c();g=T(),M&&M.c(),h(t,"class",i=Y.getFieldTypeIcon(n[3].type)),h(l,"class","txt"),h(e,"for",a=n[21]),h(f,"class","files-list")},m(D,E){w(D,e,E),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,E),w(D,f,E);for(let O=0;O<c.length;O+=1)c[O].m(f,null);m(f,p);for(let O=0;O<$.length;O+=1)$[O].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,E){if((!v||E&8&&i!==(i=Y.getFieldTypeIcon(D[3].type)))&&h(t,"class",i),(!v||E&8)&&o!==(o=D[3].name+"")&&me(r,o),(!v||E&2097152&&a!==(a=D[21]))&&h(e,"for",a),E&1558&&(b=D[4],De(),c=ft(c,E,y,1,D,b,d,f,Nt,vh,p,bh),Oe()),E&2049){C=D[0];let O;for(O=0;O<C.length;O+=1){const F=_h(D,C,O);$[O]?($[O].p(F,E),A($[O],1)):($[O]=yh(F),$[O].c(),A($[O],1),$[O].m(f,g))}for(De(),O=C.length;O<$.length;O+=1)S(O);Oe()}D[8]?M&&(M.d(1),M=null):M?M.p(D,E):(M=kh(D),M.c(),M.m(f,null))},i(D){if(!v){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<C.length;E+=1)A($[E]);v=!0}},o(D){for(let E=0;E<c.length;E+=1)P(c[E]);$=$.filter(Boolean);for(let E=0;E<$.length;E+=1)P($[E]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let E=0;E<c.length;E+=1)c[E].d();jn($,D),M&&M.d(),n[19](null)}}}function u4(n){let e,t;return e=new Le({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[a4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function f4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new vn}=e,c,d;function p(O){Y.removeByValue(u,O),t(1,u)}function g(O){Y.pushUnique(u,O),t(1,u)}function v(O){Y.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>p(O),C=O=>g(O),$=O=>v(O);function S(O){he[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function E(O){he[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,F;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=Y.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=Y.toArray(u))),n.$$.dirty&8&&t(5,i=((O=f.options)==null?void 0:O.maxSelect)>1),n.$$.dirty&4128&&Y.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=Y.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((F=f.options)==null?void 0:F.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,p,g,v,r,y,C,$,S,M,D,E]}class c4 extends Pe{constructor(e){super(),Ae(this,e,f4,u4,Ee,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function wh(n){let e,t;return{c(){e=_("small"),t=R(n[1]),h(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&me(t,i[1])},d(i){i&&k(e)}}}function d4(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&wh(n);return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=R(o),a=T(),c&&c.c(),h(e,"class","ri-information-line link-hint"),h(l,"class","block txt-ellipsis"),h(s,"class","content svelte-1gjwqyd")},m(d,p){w(d,e,p),w(d,i,p),w(d,s,p),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=Qe(t=Ct.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[p]){t&&Wn(t.update)&&p&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),p&1&&o!==(o=d[0].id+"")&&me(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,p):(c=wh(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:oe,o:oe,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function h4(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...Object.keys(r)];for(const u of a)if(typeof r[u]=="string"&&!Y.isEmpty(r[u])&&!s.includes(u))return u+": "+r[u];return""}return n.$$set=r=>{"item"in r&&t(0,l=r.item)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=o(l))},[l,i]}class p4 extends Pe{constructor(e){super(),Ae(this,e,h4,d4,Ee,{item:0})}}function Sh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',h(e,"type","button"),h(e,"class","btn btn-block btn-sm"),ee(e,"btn-loading",n[6]),ee(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=X(e,"click",qn(n[14])),t=!0)},p(s,l){l&64&&ee(e,"btn-loading",s[6]),l&64&&ee(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function m4(n){let e,t=n[7]&&Sh(n);return{c(){t&&t.c(),e=rt()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=Sh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function g4(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:n[4]},{optionComponent:n[4]},{multiple:n[2]},{class:"records-select block-options"},n[10]];function o(u){n[15](u)}function r(u){n[16](u)}let a={$$slots:{afterOptions:[m4]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=pt(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new rs({props:a}),he.push(()=>Ie(e,"keyOfSelected",o)),he.push(()=>Ie(e,"selected",r)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&16&&{labelComponent:u[4]},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&ui(u[10])]):{};f&4194496&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function _4(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let o=Kt(e,l);const r="select_"+Y.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=p4}=e,{collectionId:p}=e,g=[],v=1,b=0,y=!1,C=!1;$();async function $(){const L=Y.toArray(f);if(!(!p||!L.length)){t(13,C=!0);try{const H=[];for(const j of L)H.push(`id="${j}"`);t(0,u=await we.Records.getFullList(p,200,{sort:"-created",filter:H.join("||"),$cancelKey:r+"loadSelected"})),t(5,g=Y.filterDuplicatesByKey(g.concat(u)))}catch(H){we.errorResponseHandler(H)}t(13,C=!1)}}async function S(L=!1){if(!!p){t(6,y=!0);try{const H=L?1:v+1,j=await we.Records.getList(p,H,200,{sort:"-created",$cancelKey:r+"loadList"});L&&t(5,g=[]),t(5,g=Y.filterDuplicatesByKey(g.concat(j.items))),v=j.page,t(12,b=j.totalItems)}catch(H){we.errorResponseHandler(H)}t(6,y=!1)}}const M=()=>S();function D(L){f=L,t(1,f)}function E(L){u=L,t(0,u)}function O(L){ht.call(this,n,L)}function F(L){ht.call(this,n,L)}return n.$$set=L=>{e=pt(pt({},e),ri(L)),t(10,o=Kt(e,l)),"multiple"in L&&t(2,a=L.multiple),"selected"in L&&t(0,u=L.selected),"keyOfSelected"in L&&t(1,f=L.keyOfSelected),"selectPlaceholder"in L&&t(3,c=L.selectPlaceholder),"optionComponent"in L&&t(4,d=L.optionComponent),"collectionId"in L&&t(11,p=L.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&p&&S(!0),n.$$.dirty&8256&&t(8,i=y||C),n.$$.dirty&4128&&t(7,s=b>g.length)},[u,f,a,c,d,g,y,s,i,S,o,p,b,C,M,D,E,O,F]}class b4 extends Pe{constructor(e){super(),Ae(this,e,_4,g4,Ee,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function $h(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=R("Select up to "),s=R(i),l=R(" items."),h(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&me(s,i)},d(o){o&&k(e)}}}function v4(n){var C,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;function v(S){n[3](S)}let b={toggle:!0,id:n[4],multiple:n[2],collectionId:(C=n[1].options)==null?void 0:C.collectionId};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new b4({props:b}),he.push(()=>Ie(f,"keyOfSelected",v));let y=(($=n[1].options)==null?void 0:$.maxSelect)>1&&$h(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),d=T(),y&&y.c(),p=rt(),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(S,M){w(S,e,M),m(e,t),m(e,s),m(e,l),m(l,r),w(S,u,M),q(f,S,M),w(S,d,M),y&&y.m(S,M),w(S,p,M),g=!0},p(S,M){var E,O;(!g||M&2&&i!==(i=Y.getFieldTypeIcon(S[1].type)))&&h(t,"class",i),(!g||M&2)&&o!==(o=S[1].name+"")&&me(r,o),(!g||M&16&&a!==(a=S[4]))&&h(e,"for",a);const D={};M&16&&(D.id=S[4]),M&4&&(D.multiple=S[2]),M&2&&(D.collectionId=(E=S[1].options)==null?void 0:E.collectionId),!c&&M&1&&(c=!0,D.keyOfSelected=S[0],He(()=>c=!1)),f.$set(D),((O=S[1].options)==null?void 0:O.maxSelect)>1?y?y.p(S,M):(y=$h(S),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i(S){g||(A(f.$$.fragment,S),g=!0)},o(S){P(f.$$.fragment,S),g=!1},d(S){S&&k(e),S&&k(u),V(f,S),S&&k(d),y&&y.d(S),S&&k(p)}}}function y4(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[v4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function k4(n,e,t){let i,{field:s=new vn}=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&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(s.options.maxSelect-1))},[l,s,i,o]}class w4 extends Pe{constructor(e){super(),Ae(this,e,k4,y4,Ee,{field:1,value:0})}}function S4(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f=n[0].email+"",c,d,p;return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=R(o),a=T(),u=_("small"),c=R(f),h(e,"class","ri-information-line link-hint"),h(l,"class","block txt-ellipsis"),h(u,"class","block txt-hint txt-ellipsis"),h(s,"class","content")},m(g,v){w(g,e,v),w(g,i,v),w(g,s,v),m(s,l),m(l,r),m(s,a),m(s,u),m(u,c),d||(p=Qe(t=Ct.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),d=!0)},p(g,[v]){t&&Wn(t.update)&&v&1&&t.update.call(null,{text:JSON.stringify(g[0],null,2),position:"left",class:"code"}),v&1&&o!==(o=g[0].id+"")&&me(r,o),v&1&&f!==(f=g[0].email+"")&&me(c,f)},i:oe,o:oe,d(g){g&&k(e),g&&k(i),g&&k(s),d=!1,p()}}}function $4(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class ia extends Pe{constructor(e){super(),Ae(this,e,$4,S4,Ee,{item:0})}}function Ch(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',h(e,"type","button"),h(e,"class","btn btn-block btn-sm"),ee(e,"btn-loading",n[6]),ee(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=X(e,"click",qn(n[13])),t=!0)},p(s,l){l&64&&ee(e,"btn-loading",s[6]),l&64&&ee(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function C4(n){let e,t=n[7]&&Ch(n);return{c(){t&&t.c(),e=rt()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=Ch(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function M4(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:ia},{optionComponent:n[4]},{multiple:n[2]},{class:"users-select block-options"},n[10]];function o(u){n[14](u)}function r(u){n[15](u)}let a={$$slots:{afterOptions:[C4]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=pt(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new rs({props:a}),he.push(()=>Ie(e,"keyOfSelected",o)),he.push(()=>Ie(e,"selected",r)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&0&&{labelComponent:ia},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&ui(u[10])]):{};f&2097344&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function T4(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let o=Kt(e,l);const r="select_"+Y.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=ia}=e,p=[],g=1,v=0,b=!1,y=!1;$(!0),C();async function C(){const F=Y.toArray(f);if(!!F.length){t(12,y=!0);try{const L=[];for(const H of F)L.push(`id="${H}"`);t(0,u=await we.Users.getFullList(100,{sort:"-created",filter:L.join("||"),$cancelKey:r+"loadSelected"})),t(5,p=Y.filterDuplicatesByKey(p.concat(u)))}catch(L){we.errorResponseHandler(L)}t(12,y=!1)}}async function $(F=!1){t(6,b=!0);try{const L=F?1:g+1,H=await we.Users.getList(L,200,{sort:"-created",$cancelKey:r+"loadList"});F&&t(5,p=[]),t(5,p=Y.filterDuplicatesByKey(p.concat(H.items))),g=H.page,t(11,v=H.totalItems)}catch(L){we.errorResponseHandler(L)}t(6,b=!1)}const S=()=>$();function M(F){f=F,t(1,f)}function D(F){u=F,t(0,u)}function E(F){ht.call(this,n,F)}function O(F){ht.call(this,n,F)}return n.$$set=F=>{e=pt(pt({},e),ri(F)),t(10,o=Kt(e,l)),"multiple"in F&&t(2,a=F.multiple),"selected"in F&&t(0,u=F.selected),"keyOfSelected"in F&&t(1,f=F.keyOfSelected),"selectPlaceholder"in F&&t(3,c=F.selectPlaceholder),"optionComponent"in F&&t(4,d=F.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=b||y),n.$$.dirty&2080&&t(7,s=v>p.length)},[u,f,a,c,d,p,b,s,i,$,o,v,y,S,M,D,E,O]}class D4 extends Pe{constructor(e){super(),Ae(this,e,T4,M4,Ee,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function Mh(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=R("Select up to "),s=R(i),l=R(" users."),h(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&me(s,i)},d(o){o&&k(e)}}}function O4(n){var C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;function v($){n[4]($)}let b={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new D4({props:b}),he.push(()=>Ie(f,"keyOfSelected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&Mh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),d=T(),y&&y.c(),p=rt(),h(t,"class",i=Y.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[5])},m($,S){w($,e,S),m(e,t),m(e,s),m(e,l),m(l,r),w($,u,S),q(f,$,S),w($,d,S),y&&y.m($,S),w($,p,S),g=!0},p($,S){var D;(!g||S&2&&i!==(i=Y.getFieldTypeIcon($[1].type)))&&h(t,"class",i),(!g||S&2)&&o!==(o=$[1].name+"")&&me(r,o),(!g||S&32&&a!==(a=$[5]))&&h(e,"for",a);const M={};S&32&&(M.id=$[5]),S&4&&(M.multiple=$[2]),S&8&&(M.disabled=$[3]),!c&&S&1&&(c=!0,M.keyOfSelected=$[0],He(()=>c=!1)),f.$set(M),((D=$[1].options)==null?void 0:D.maxSelect)>1?y?y.p($,S):(y=Mh($),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i($){g||(A(f.$$.fragment,$),g=!0)},o($){P(f.$$.fragment,$),g=!1},d($){$&&k(e),$&&k(u),V(f,$),$&&k(d),y&&y.d($),$&&k(p)}}}function E4(n){let e,t;return e=new Le({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[O4,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&10&&(l.class="form-field "+(i[1].required?"required":"")+" "+(i[3]?"disabled":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function A4(n,e,t){let i,s,{field:l=new vn}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(2,s),t(1,l)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{var a;n.$$.dirty&2&&t(2,s=((a=l.options)==null?void 0:a.maxSelect)>1),n.$$.dirty&7&&s&&Array.isArray(o)&&o.length>l.options.maxSelect&&t(0,o=o.slice(l.options.maxSelect-1)),n.$$.dirty&3&&t(3,i=!Y.isEmpty(o)&&l.system)},[o,l,s,i,r]}class P4 extends Pe{constructor(e){super(),Ae(this,e,A4,E4,Ee,{field:1,value:0})}}function Th(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function Dh(n){let e,t;return e=new Le({props:{class:"form-field disabled",name:"id",$$slots:{default:[L4,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function L4(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="id",l=T(),o=_("span"),a=T(),u=_("input"),h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[43]),h(u,"type","text"),h(u,"id",f=n[43]),u.value=c=n[2].id,u.disabled=!0},m(d,p){w(d,e,p),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),w(d,a,p),w(d,u,p)},p(d,p){p[1]&4096&&r!==(r=d[43])&&h(e,"for",r),p[1]&4096&&f!==(f=d[43])&&h(u,"id",f),p[0]&4&&c!==(c=d[2].id)&&u.value!==c&&(u.value=c)},d(d){d&&k(e),d&&k(a),d&&k(u)}}}function Oh(n){let e;return{c(){e=_("div"),e.innerHTML=`<h5>No custom fields to be set</h5>
|
||
`,h(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function F4(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new P4({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function I4(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new w4({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function N4(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new c4({props:u}),he.push(()=>Ie(e,"value",o)),he.push(()=>Ie(e,"uploadedFiles",r)),he.push(()=>Ie(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function R4(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new UC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function H4(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new qC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function j4(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new NC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function q4(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new PC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function V4(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new DC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function z4(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new $C({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function B4(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new yC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function U4(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new gC({props:l}),he.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Eh(n,e){let t,i,s,l,o;const r=[U4,B4,z4,V4,q4,j4,H4,R4,N4,I4,F4],a=[];function u(f,c){return f[40].type==="text"?0:f[40].type==="number"?1:f[40].type==="bool"?2:f[40].type==="email"?3:f[40].type==="url"?4:f[40].type==="date"?5:f[40].type==="select"?6:f[40].type==="json"?7:f[40].type==="file"?8:f[40].type==="relation"?9:f[40].type==="user"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=rt(),s&&s.c(),l=rt(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(De(),P(a[d],1,1,()=>{a[d]=null}),Oe()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(t),~i&&a[i].d(f),f&&k(l)}}}function W4(n){var d;let e,t,i=[],s=new Map,l,o,r,a=!n[2].isNew&&Dh(n),u=((d=n[0])==null?void 0:d.schema)||[];const f=p=>p[40].name;for(let p=0;p<u.length;p+=1){let g=Th(n,u,p),v=f(g);s.set(v,i[p]=Eh(v,g))}let c=null;return u.length||(c=Oh()),{c(){e=_("form"),a&&a.c(),t=T();for(let p=0;p<i.length;p+=1)i[p].c();c&&c.c(),h(e,"id",n[11]),h(e,"class","block")},m(p,g){w(p,e,g),a&&a.m(e,null),m(e,t);for(let v=0;v<i.length;v+=1)i[v].m(e,null);c&&c.m(e,null),l=!0,o||(r=X(e,"submit",Bt(n[12])),o=!0)},p(p,g){var v;p[2].isNew?a&&(De(),P(a,1,1,()=>{a=null}),Oe()):a?(a.p(p,g),g[0]&4&&A(a,1)):(a=Dh(p),a.c(),A(a,1),a.m(e,t)),g[0]&29&&(u=((v=p[0])==null?void 0:v.schema)||[],De(),i=ft(i,g,f,1,p,u,s,e,Nt,Eh,null,Th),Oe(),!u.length&&c?c.p(p,g):u.length?c&&(c.d(1),c=null):(c=Oh(),c.c(),c.m(e,null)))},i(p){if(!l){A(a);for(let g=0;g<u.length;g+=1)A(i[g]);l=!0}},o(p){P(a);for(let g=0;g<i.length;g+=1)P(i[g]);l=!1},d(p){p&&k(e),a&&a.d();for(let g=0;g<i.length;g+=1)i[g].d();c&&c.d(),o=!1,r()}}}function Ah(n){let e,t,i,s,l,o,r,a;return r=new os({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[Y4]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("div"),l=_("i"),o=T(),z(r.$$.fragment),h(e,"class","flex-fill"),h(l,"class","ri-more-line"),h(s,"class","content"),h(i,"type","button"),h(i,"class","btn btn-sm btn-circle btn-secondary")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),m(i,s),m(s,l),m(s,o),q(r,s,null),a=!0},p(u,f){const c={};f[1]&8192&&(c.$$scope={dirty:f,ctx:u}),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&k(e),u&&k(t),u&&k(i),V(r)}}}function Y4(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
<span class="txt">Delete</span>`,h(e,"tabindex","0"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function K4(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&Ah(n);return{c(){e=_("h4"),i=R(t),s=T(),o=R(l),r=R(" record"),a=T(),c&&c.c(),u=rt()},m(d,p){w(d,e,p),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,p),c&&c.m(d,p),w(d,u,p),f=!0},p(d,p){(!f||p[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&me(i,t),(!f||p[0]&1)&&l!==(l=d[0].name+"")&&me(o,l),!d[2].isNew&&d[10]?c?(c.p(d,p),p[0]&1028&&A(c,1)):(c=Ah(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(De(),P(c,1,1,()=>{c=null}),Oe())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function Z4(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=R(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[11]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ee(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=X(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&me(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ee(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function J4(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[Z4],header:[K4],default:[W4]},$$scope:{ctx:n}};return e=new wi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),V(e,s)}}}function Ph(n){return JSON.stringify(n)}function G4(n,e,t){let i,s,l,o;const r=un(),a="record_"+Y.randomString(5);let{collection:u}=e,f,c=null,d=new fo,p=!1,g=!1,v={},b={},y="";function C(x){return S(x),t(8,g=!0),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function S(x){Ii({}),c=x||{},t(2,d=x!=null&&x.clone?x.clone():new fo),t(3,v={}),t(4,b={}),await ai(),t(15,y=Ph(d))}function M(){if(p||!l)return;t(7,p=!0);const x=E();let G;d.isNew?G=we.Records.create(u==null?void 0:u.id,x):G=we.Records.update(u==null?void 0:u.id,d.id,x),G.then(async _e=>{hn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),$(),r("save",_e)}).catch(_e=>{we.errorResponseHandler(_e)}).finally(()=>{t(7,p=!1)})}function D(){!(c!=null&&c.id)||yi("Do you really want to delete the selected record?",()=>we.Records.delete(c["@collectionId"],c.id).then(()=>{$(),hn("Successfully deleted record."),r("delete",c)}).catch(x=>{we.errorResponseHandler(x)}))}function E(){const x=(d==null?void 0:d.export())||{},G=new FormData,_e={};for(const je of(u==null?void 0:u.schema)||[])_e[je.name]=je;for(const je in x)!_e[je]||(typeof x[je]>"u"&&(x[je]=null),Y.addValueToFormData(G,je,x[je]));for(const je in v){const Fe=Y.toArray(v[je]);for(const Re of Fe)G.append(je,Re)}for(const je in b){const Fe=Y.toArray(b[je]);for(const Re of Fe)G.append(je+"."+Re,"")}return G}const O=()=>$(),F=()=>D();function L(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function H(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function j(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function Q(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function ne(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function B(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function K(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function W(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function J(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function ie(x,G){n.$$.not_equal(v[G.name],x)&&(v[G.name]=x,t(3,v))}function fe(x,G){n.$$.not_equal(b[G.name],x)&&(b[G.name]=x,t(4,b))}function ye(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}function le(x,G){n.$$.not_equal(d[G.name],x)&&(d[G.name]=x,t(2,d))}const ue=()=>s&&g?(yi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),$()}),!1):!0;function Te(x){he[x?"unshift":"push"](()=>{f=x,t(6,f)})}function Z(x){ht.call(this,n,x)}function be(x){ht.call(this,n,x)}return n.$$set=x=>{"collection"in x&&t(0,u=x.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=Y.hasNonEmptyProps(v)||Y.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=Ph(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,$,d,v,b,s,f,p,g,l,o,a,M,D,C,y,i,O,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te,Z,be]}class m_ extends Pe{constructor(e){super(),Ae(this,e,G4,J4,Ee,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function X4(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Q4(n){let e,t;return{c(){e=_("span"),t=R(n[1]),h(e,"class","label txt-base txt-mono"),h(e,"title",n[0])},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&me(t,i[1]),s&1&&h(e,"title",i[0])},d(i){i&&k(e)}}}function x4(n){let e;function t(l,o){return l[0]?Q4:X4}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function eM(n,e,t){let{id:i=""}=e,s=i;return n.$$set=l=>{"id"in l&&t(0,i=l.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,s=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,s]}class Zo extends Pe{constructor(e){super(),Ae(this,e,eM,x4,Ee,{id:0})}}function Lh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Fh(n,e,t){const i=n.slice();return i[3]=e[t],i}function Ih(n,e,t){const i=n.slice();return i[3]=e[t],i}function tM(n){let e,t=n[0][n[1].name]+"",i,s;return{c(){e=_("span"),i=R(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[0][n[1].name])},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&3&&t!==(t=l[0][l[1].name]+"")&&me(i,t),o&3&&s!==(s=l[0][l[1].name])&&h(e,"title",s)},i:oe,o:oe,d(l){l&&k(e)}}}function nM(n){let e,t,i=Y.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Nh(Lh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o<s.length;o+=1)s[o].c();h(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r&3){i=Y.toArray(o[0][o[1].name]);let a;for(a=0;a<i.length;a+=1){const u=Lh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Nh(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(De(),a=i.length;a<s.length;a+=1)l(a);Oe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){o&&k(e),jn(s,o)}}}function iM(n){let e,t,i=Y.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Rh(Fh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o<s.length;o+=1)s[o].c();h(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r&3){i=Y.toArray(o[0][o[1].name]);let a;for(a=0;a<i.length;a+=1){const u=Fh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Rh(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(De(),a=i.length;a<s.length;a+=1)l(a);Oe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){o&&k(e),jn(s,o)}}}function sM(n){let e,t=Y.toArray(n[0][n[1].name]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Hh(Ih(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();h(e,"class","inline-flex")},m(s,l){w(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&3){t=Y.toArray(s[0][s[1].name]);let o;for(o=0;o<t.length;o+=1){const r=Ih(s,t,o);i[o]?i[o].p(r,l):(i[o]=Hh(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:oe,o:oe,d(s){s&&k(e),jn(i,s)}}}function lM(n){let e,t=JSON.stringify(n[0][n[1].name])+"",i;return{c(){e=_("span"),i=R(t),h(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=JSON.stringify(s[0][s[1].name])+"")&&me(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function oM(n){let e,t;return e=new vi({props:{date:n[0][n[1].name]}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&3&&(l.date=i[0][i[1].name]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function rM(n){let e,t=n[0][n[1].name]+"",i,s,l,o;return{c(){e=_("a"),i=R(t),h(e,"class","txt-ellipsis"),h(e,"href",s=n[0][n[1].name]),h(e,"target","_blank"),h(e,"rel","noopener")},m(r,a){w(r,e,a),m(e,i),l||(o=[Qe(Ct.call(null,e,"Open in new tab")),X(e,"click",qn(n[2]))],l=!0)},p(r,a){a&3&&t!==(t=r[0][r[1].name]+"")&&me(i,t),a&3&&s!==(s=r[0][r[1].name])&&h(e,"href",s)},i:oe,o:oe,d(r){r&&k(e),l=!1,st(o)}}}function aM(n){let e,t=n[0][n[1].name]?"True":"False",i;return{c(){e=_("span"),i=R(t),h(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=s[0][s[1].name]?"True":"False")&&me(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function uM(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function Nh(n){let e,t,i,s;return t=new p_({props:{record:n[0],filename:n[8]}}),{c(){e=_("figure"),z(t.$$.fragment),i=T(),h(e,"class","thumb thumb-sm")},m(l,o){w(l,e,o),q(t,e,null),m(e,i),s=!0},p(l,o){const r={};o&1&&(r.record=l[0]),o&3&&(r.filename=l[8]),t.$set(r)},i(l){s||(A(t.$$.fragment,l),s=!0)},o(l){P(t.$$.fragment,l),s=!1},d(l){l&&k(e),V(t)}}}function Rh(n){let e,t;return e=new Zo({props:{id:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&3&&(l.id=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Hh(n){let e,t=n[3]+"",i;return{c(){e=_("span"),i=R(t),h(e,"class","label")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=s[3]+"")&&me(i,t)},d(s){s&&k(e)}}}function fM(n){let e,t,i,s,l,o;const r=[uM,aM,rM,oM,lM,sM,iM,nM,tM],a=[];function u(f,c){return c&3&&(t=null),t==null&&(t=!!Y.isEmpty(f[0][f[1].name])),t?0:f[1].type==="bool"?1:f[1].type==="url"?2:f[1].type==="date"?3:f[1].type==="json"?4:f[1].type==="select"?5:f[1].type==="relation"||f[1].type==="user"?6:f[1].type==="file"?7:8}return i=u(n,-1),s=a[i]=r[i](n),{c(){e=_("td"),s.c(),h(e,"class",l="col-type-"+n[1].type+" col-field-"+n[1].name)},m(f,c){w(f,e,c),a[i].m(e,null),o=!0},p(f,[c]){let d=i;i=u(f,c),i===d?a[i].p(f,c):(De(),P(a[d],1,1,()=>{a[d]=null}),Oe(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),A(s,1),s.m(e,null)),(!o||c&2&&l!==(l="col-type-"+f[1].type+" col-field-"+f[1].name))&&h(e,"class",l)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(e),a[i].d()}}}function cM(n,e,t){let{record:i}=e,{field:s}=e;function l(o){ht.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record),"field"in o&&t(1,s=o.field)},[i,s,l]}class g_ extends Pe{constructor(e){super(),Ae(this,e,cM,fM,Ee,{record:0,field:1})}}function jh(n,e,t){const i=n.slice();return i[35]=e[t],i}function qh(n,e,t){const i=n.slice();return i[38]=e[t],i}function Vh(n,e,t){const i=n.slice();return i[38]=e[t],i}function dM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function hM(n){let e,t,i,s,l,o=n[38].name+"",r;return{c(){e=_("div"),t=_("i"),s=T(),l=_("span"),r=R(o),h(t,"class",i=Y.getFieldTypeIcon(n[38].type)),h(l,"class","txt"),h(e,"class","col-header-content")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(l,r)},p(a,u){u[0]&2048&&i!==(i=Y.getFieldTypeIcon(a[38].type))&&h(t,"class",i),u[0]&2048&&o!==(o=a[38].name+"")&&me(r,o)},d(a){a&&k(e)}}}function zh(n,e){let t,i,s,l;function o(a){e[22](a)}let r={class:"col-type-"+e[38].type+" col-field-"+e[38].name,name:e[38].name,$$slots:{default:[hM]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new tn({props:r}),he.push(()=>Ie(i,"sort",o)),{key:n,first:null,c(){t=rt(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&2048&&(f.class="col-type-"+e[38].type+" col-field-"+e[38].name),u[0]&2048&&(f.name=e[38].name),u[0]&2048|u[1]&4096&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],He(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function pM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function mM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Bh(n){let e;function t(l,o){return l[8]?_M:gM}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function gM(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Uh(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No records found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Uh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function _M(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Uh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Wh(n,e){let t,i,s;return i=new g_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=rt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Yh(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,C,$,S,M,D,E,O,F,L,H,j;function Q(){return e[25](e[35])}p=new Zo({props:{id:e[35].id}});let ne=e[11];const B=J=>J[38].name;for(let J=0;J<ne.length;J+=1){let ie=qh(e,ne,J),fe=B(ie);b.set(fe,v[J]=Wh(fe,ie))}$=new vi({props:{date:e[35].created}}),D=new vi({props:{date:e[35].updated}});function K(){return e[26](e[35])}function W(...J){return e[27](e[35],...J)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),z(p.$$.fragment),g=T();for(let J=0;J<v.length;J+=1)v[J].c();y=T(),C=_("td"),z($.$$.fragment),S=T(),M=_("td"),z(D.$$.fragment),E=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),h(l,"type","checkbox"),h(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],h(u,"for",f="checkbox_"+e[35].id),h(s,"class","form-field"),h(i,"class","bulk-select-col min-width"),h(d,"class","col-type-text col-field-id"),h(C,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(J,ie){w(J,t,ie),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),q(p,d,null),m(t,g);for(let fe=0;fe<v.length;fe+=1)v[fe].m(t,null);m(t,y),m(t,C),q($,C,null),m(t,S),m(t,M),q(D,M,null),m(t,E),m(t,O),m(t,F),L=!0,H||(j=[X(l,"change",Q),X(s,"click",qn(e[19])),X(t,"click",K),X(t,"keydown",W)],H=!0)},p(J,ie){e=J,(!L||ie[0]&8&&o!==(o="checkbox_"+e[35].id))&&h(l,"id",o),(!L||ie[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!L||ie[0]&8&&f!==(f="checkbox_"+e[35].id))&&h(u,"for",f);const fe={};ie[0]&8&&(fe.id=e[35].id),p.$set(fe),ie[0]&2056&&(ne=e[11],De(),v=ft(v,ie,B,1,e,ne,b,t,Nt,Wh,y,qh),Oe());const ye={};ie[0]&8&&(ye.date=e[35].created),$.$set(ye);const le={};ie[0]&8&&(le.date=e[35].updated),D.$set(le)},i(J){if(!L){A(p.$$.fragment,J);for(let ie=0;ie<ne.length;ie+=1)A(v[ie]);A($.$$.fragment,J),A(D.$$.fragment,J),L=!0}},o(J){P(p.$$.fragment,J);for(let ie=0;ie<v.length;ie+=1)P(v[ie]);P($.$$.fragment,J),P(D.$$.fragment,J),L=!1},d(J){J&&k(t),V(p);for(let ie=0;ie<v.length;ie+=1)v[ie].d();V($),V(D),H=!1,st(j)}}}function Kh(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&me(s,i),a[0]&16&&me(o,r[4])},d(r){r&&k(e)}}}function Zh(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[8]),ee(t,"btn-disabled",n[8]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&me(o,l),c[0]&256&&ee(t,"btn-loading",f[8]),c[0]&256&&ee(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Jh(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,p,g,v,b,y,C;return{c(){e=_("div"),t=_("div"),i=R("Selected "),s=_("strong"),l=R(n[6]),o=T(),a=R(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),p=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ee(f,"btn-disabled",n[9]),h(d,"class","flex-fill"),h(g,"type","button"),h(g,"class","btn btn-sm btn-secondary btn-danger"),ee(g,"btn-loading",n[9]),ee(g,"btn-disabled",n[9]),h(e,"class","bulkbar")},m($,S){w($,e,S),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,p),m(e,g),b=!0,y||(C=[X(f,"click",n[30]),X(g,"click",n[31])],y=!0)},p($,S){(!b||S[0]&64)&&me(l,$[6]),(!b||S[0]&64)&&r!==(r=$[6]===1?"record":"records")&&me(a,r),S[0]&512&&ee(f,"btn-disabled",$[9]),S[0]&512&&ee(g,"btn-loading",$[9]),S[0]&512&&ee(g,"btn-disabled",$[9])},i($){b||($&&Dt(()=>{v||(v=ut(e,Vn,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o($){$&&(v||(v=ut(e,Vn,{duration:150,y:5},!1)),v.run(0)),b=!1},d($){$&&k(e),$&&v&&v.end(),y=!1,st(C)}}}function bM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,C,$,S,M,D,E,O,F,L,H=[],j=new Map,Q,ne,B,K,W,J,ie;function fe(ae){n[21](ae)}let ye={class:"col-type-text col-field-id",name:"id",$$slots:{default:[dM]},$$scope:{ctx:n}};n[0]!==void 0&&(ye.sort=n[0]),d=new tn({props:ye}),he.push(()=>Ie(d,"sort",fe));let le=n[11];const ue=ae=>ae[38].name;for(let ae=0;ae<le.length;ae+=1){let ke=Vh(n,le,ae),Ke=ue(ke);b.set(Ke,v[ae]=zh(Ke,ke))}function Te(ae){n[23](ae)}let Z={class:"col-type-date col-field-created",name:"created",$$slots:{default:[pM]},$$scope:{ctx:n}};n[0]!==void 0&&(Z.sort=n[0]),C=new tn({props:Z}),he.push(()=>Ie(C,"sort",Te));function be(ae){n[24](ae)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[mM]},$$scope:{ctx:n}};n[0]!==void 0&&(x.sort=n[0]),M=new tn({props:x}),he.push(()=>Ie(M,"sort",be));let G=n[3];const _e=ae=>ae[35].id;for(let ae=0;ae<G.length;ae+=1){let ke=jh(n,G,ae),Ke=_e(ke);j.set(Ke,H[ae]=Yh(Ke,ke))}let je=null;G.length||(je=Bh(n));let Fe=n[3].length&&Kh(n),Re=n[3].length&&n[12]&&Zh(n),re=n[6]&&Jh(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),l=_("th"),o=_("div"),r=_("input"),u=T(),f=_("label"),c=T(),z(d.$$.fragment),g=T();for(let ae=0;ae<v.length;ae+=1)v[ae].c();y=T(),z(C.$$.fragment),S=T(),z(M.$$.fragment),E=T(),O=_("th"),F=T(),L=_("tbody");for(let ae=0;ae<H.length;ae+=1)H[ae].c();je&&je.c(),Q=T(),Fe&&Fe.c(),ne=T(),Re&&Re.c(),B=T(),re&&re.c(),K=rt(),h(r,"type","checkbox"),h(r,"id","checkbox_0"),r.disabled=a=!n[3].length,r.checked=n[10],h(f,"for","checkbox_0"),h(o,"class","form-field"),h(l,"class","bulk-select-col min-width"),h(O,"class","col-type-action min-width"),h(t,"class","table"),ee(t,"table-loading",n[8]),h(e,"class","table-wrapper")},m(ae,ke){w(ae,e,ke),m(e,t),m(t,i),m(i,s),m(s,l),m(l,o),m(o,r),m(o,u),m(o,f),m(s,c),q(d,s,null),m(s,g);for(let Ke=0;Ke<v.length;Ke+=1)v[Ke].m(s,null);m(s,y),q(C,s,null),m(s,S),q(M,s,null),m(s,E),m(s,O),m(t,F),m(t,L);for(let Ke=0;Ke<H.length;Ke+=1)H[Ke].m(L,null);je&&je.m(L,null),w(ae,Q,ke),Fe&&Fe.m(ae,ke),w(ae,ne,ke),Re&&Re.m(ae,ke),w(ae,B,ke),re&&re.m(ae,ke),w(ae,K,ke),W=!0,J||(ie=X(r,"change",n[20]),J=!0)},p(ae,ke){(!W||ke[0]&8&&a!==(a=!ae[3].length))&&(r.disabled=a),(!W||ke[0]&1024)&&(r.checked=ae[10]);const Ke={};ke[1]&4096&&(Ke.$$scope={dirty:ke,ctx:ae}),!p&&ke[0]&1&&(p=!0,Ke.sort=ae[0],He(()=>p=!1)),d.$set(Ke),ke[0]&2049&&(le=ae[11],De(),v=ft(v,ke,ue,1,ae,le,b,s,Nt,zh,y,Vh),Oe());const Ye={};ke[1]&4096&&(Ye.$$scope={dirty:ke,ctx:ae}),!$&&ke[0]&1&&($=!0,Ye.sort=ae[0],He(()=>$=!1)),C.$set(Ye);const nt={};ke[1]&4096&&(nt.$$scope={dirty:ke,ctx:ae}),!D&&ke[0]&1&&(D=!0,nt.sort=ae[0],He(()=>D=!1)),M.$set(nt),ke[0]&76074&&(G=ae[3],De(),H=ft(H,ke,_e,1,ae,G,j,L,Nt,Yh,null,jh),Oe(),!G.length&&je?je.p(ae,ke):G.length?je&&(je.d(1),je=null):(je=Bh(ae),je.c(),je.m(L,null))),ke[0]&256&&ee(t,"table-loading",ae[8]),ae[3].length?Fe?Fe.p(ae,ke):(Fe=Kh(ae),Fe.c(),Fe.m(ne.parentNode,ne)):Fe&&(Fe.d(1),Fe=null),ae[3].length&&ae[12]?Re?Re.p(ae,ke):(Re=Zh(ae),Re.c(),Re.m(B.parentNode,B)):Re&&(Re.d(1),Re=null),ae[6]?re?(re.p(ae,ke),ke[0]&64&&A(re,1)):(re=Jh(ae),re.c(),A(re,1),re.m(K.parentNode,K)):re&&(De(),P(re,1,1,()=>{re=null}),Oe())},i(ae){if(!W){A(d.$$.fragment,ae);for(let ke=0;ke<le.length;ke+=1)A(v[ke]);A(C.$$.fragment,ae),A(M.$$.fragment,ae);for(let ke=0;ke<G.length;ke+=1)A(H[ke]);A(re),W=!0}},o(ae){P(d.$$.fragment,ae);for(let ke=0;ke<v.length;ke+=1)P(v[ke]);P(C.$$.fragment,ae),P(M.$$.fragment,ae);for(let ke=0;ke<H.length;ke+=1)P(H[ke]);P(re),W=!1},d(ae){ae&&k(e),V(d);for(let ke=0;ke<v.length;ke+=1)v[ke].d();V(C),V(M);for(let ke=0;ke<H.length;ke+=1)H[ke].d();je&&je.d(),ae&&k(Q),Fe&&Fe.d(ae),ae&&k(ne),Re&&Re.d(ae),ae&&k(B),re&&re.d(ae),ae&&k(K),J=!1,ie()}}}function vM(n,e,t){let i,s,l,o;const r=un();let{collection:a}=e,{sort:u=""}=e,{filter:f=""}=e,c=[],d=1,p=0,g={},v=!0,b=!1;async function y(le=1){if(!!(a!=null&&a.id))return t(8,v=!0),le<=1&&C(),we.Records.getList(a.id,le,50,{sort:u,filter:f}).then(ue=>{t(8,v=!1),t(3,c=c.concat(ue.items)),t(7,d=ue.page),t(4,p=ue.totalItems),r("load",c)}).catch(ue=>{ue!=null&&ue.isAbort||(t(8,v=!1),console.warn(ue),C(),we.errorResponseHandler(ue,!1))})}function C(){t(3,c=[]),t(7,d=1),t(4,p=0),t(5,g={})}function $(){o?S():M()}function S(){t(5,g={})}function M(){for(const le of c)t(5,g[le.id]=le,g);t(5,g)}function D(le){g[le.id]?delete g[le.id]:t(5,g[le.id]=le,g),t(5,g)}function E(){yi(`Do you really want to delete the selected ${l===1?"record":"records"}?`,O)}async function O(){if(b||!l)return;let le=[];for(const ue of Object.keys(g))le.push(we.Records.delete(a==null?void 0:a.id,ue));return t(9,b=!0),Promise.all(le).then(()=>{hn(`Successfully deleted the selected ${l===1?"record":"records"}.`),S()}).catch(ue=>{we.errorResponseHandler(ue)}).finally(()=>(t(9,b=!1),y()))}function F(le){ht.call(this,n,le)}const L=()=>$();function H(le){u=le,t(0,u)}function j(le){u=le,t(0,u)}function Q(le){u=le,t(0,u)}function ne(le){u=le,t(0,u)}const B=le=>D(le),K=le=>r("select",le),W=(le,ue)=>{ue.code==="Enter"&&(ue.preventDefault(),r("select",le))},J=()=>t(1,f=""),ie=()=>y(d+1),fe=()=>S(),ye=()=>E();return n.$$set=le=>{"collection"in le&&t(18,a=le.collection),"sort"in le&&t(0,u=le.sort),"filter"in le&&t(1,f=le.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&u!==-1&&f!==-1&&(C(),y(1)),n.$$.dirty[0]&24&&t(12,i=p>c.length),n.$$.dirty[0]&262144&&t(11,s=(a==null?void 0:a.schema)||[]),n.$$.dirty[0]&32&&t(6,l=Object.keys(g).length),n.$$.dirty[0]&72&&t(10,o=c.length&&l===c.length)},[u,f,y,c,p,g,l,d,v,b,o,s,i,r,$,S,D,E,a,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye]}class yM extends Pe{constructor(e){super(),Ae(this,e,vM,bM,Ee,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function kM(n){let e,t,i,s,l,o,r,a,u=n[2].name+"",f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j;e=new _$({}),g=new zo({}),g.$on("refresh",n[13]),M=new Vo({props:{value:n[0],autocompleteCollection:n[2]}}),M.$on("submit",n[16]);function Q(K){n[18](K)}function ne(K){n[19](K)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),E=new yM({props:B}),n[17](E),he.push(()=>Ie(E,"filter",Q)),he.push(()=>Ie(E,"sort",ne)),E.$on("select",n[20]),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Collections",r=T(),a=_("div"),f=R(u),c=T(),d=_("button"),d.innerHTML='<i class="ri-settings-4-line"></i>',p=T(),z(g.$$.fragment),v=T(),b=_("div"),y=_("button"),y.innerHTML=`<i class="ri-code-s-slash-line"></i>
|
||
<span class="txt">API Preview</span>`,C=T(),$=_("button"),$.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">New record</span>`,S=T(),z(M.$$.fragment),D=T(),z(E.$$.fragment),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(d,"type","button"),h(d,"class","btn btn-secondary btn-circle"),h(y,"type","button"),h(y,"class","btn btn-outline"),h($,"type","button"),h($,"class","btn btn-expanded"),h(b,"class","btns-group"),h(s,"class","page-header"),h(i,"class","page-wrapper")},m(K,W){q(e,K,W),w(K,t,W),w(K,i,W),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,f),m(s,c),m(s,d),m(s,p),q(g,s,null),m(s,v),m(s,b),m(b,y),m(b,C),m(b,$),m(i,S),q(M,i,null),m(i,D),q(E,i,null),L=!0,H||(j=[Qe(Ct.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(y,"click",n[14]),X($,"click",n[15])],H=!0)},p(K,W){(!L||W&4)&&u!==(u=K[2].name+"")&&me(f,u);const J={};W&1&&(J.value=K[0]),W&4&&(J.autocompleteCollection=K[2]),M.$set(J);const ie={};W&4&&(ie.collection=K[2]),!O&&W&1&&(O=!0,ie.filter=K[0],He(()=>O=!1)),!F&&W&2&&(F=!0,ie.sort=K[1],He(()=>F=!1)),E.$set(ie)},i(K){L||(A(e.$$.fragment,K),A(g.$$.fragment,K),A(M.$$.fragment,K),A(E.$$.fragment,K),L=!0)},o(K){P(e.$$.fragment,K),P(g.$$.fragment,K),P(M.$$.fragment,K),P(E.$$.fragment,K),L=!1},d(K){V(e,K),K&&k(t),K&&k(i),V(g),V(M),n[17](null),V(E),H=!1,st(j)}}}function wM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">Create new collection</span>`,h(t,"class","icon"),h(s,"class","m-b-10"),h(o,"type","button"),h(o,"class","btn btn-expanded-lg btn-lg"),h(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=X(o,"click",n[11]),r=!0)},p:oe,i:oe,o:oe,d(u){u&&k(e),r=!1,a()}}}function SM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function $M(n){let e,t,i,s,l,o,r,a,u;const f=[SM,wM,kM],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let p={};s=new Ua({props:p}),n[21](s);let g={};o=new uC({props:g}),n[22](o);let v={collection:n[2]};return a=new m_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,[y]){let C=e;e=d(b),e===C?c[e].p(b,y):(De(),P(c[C],1,1,()=>{c[C]=null}),Oe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const S={};o.$set(S);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),V(s,b),b&&k(l),n[22](null),V(o,b),b&&k(r),n[23](null),V(a,b)}}}function CM(n,e,t){var K;let i,s,l,o,r;At(n,li,W=>t(2,s=W)),At(n,Cs,W=>t(10,l=W)),At(n,Zt,W=>t(26,o=W)),At(n,ea,W=>t(8,r=W));const a=Y.getQueryParams((K=window.location)==null?void 0:K.href);bn(Zt,o="Collections",o);let u,f,c,d,p=a.filter||"",g=a.sort||"-created",v=a.collectionId;function b(){t(9,v=s.id),t(1,g="-created"),t(0,p="")}jw(v);const y=()=>u==null?void 0:u.show(),C=()=>u==null?void 0:u.show(s),$=()=>d==null?void 0:d.load(),S=()=>f==null?void 0:f.show(s),M=()=>c==null?void 0:c.show(),D=W=>t(0,p=W.detail);function E(W){he[W?"unshift":"push"](()=>{d=W,t(6,d)})}function O(W){p=W,t(0,p)}function F(W){g=W,t(1,g)}const L=W=>c==null?void 0:c.show(W==null?void 0:W.detail);function H(W){he[W?"unshift":"push"](()=>{u=W,t(3,u)})}function j(W){he[W?"unshift":"push"](()=>{f=W,t(4,f)})}function Q(W){he[W?"unshift":"push"](()=>{c=W,t(5,c)})}const ne=()=>d==null?void 0:d.load(),B=()=>d==null?void 0:d.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(W=>W.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&v!=s.id&&b(),n.$$.dirty&7&&(g||p||(s==null?void 0:s.id))&&Y.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:p,sort:g})},[p,g,s,u,f,c,d,i,r,v,l,y,C,$,S,M,D,E,O,F,L,H,j,Q,ne,B]}class MM extends Pe{constructor(e){super(),Ae(this,e,CM,$M,Ee,{})}}function Gh(n){let e,t;return e=new Le({props:{class:"form-field disabled",name:"id",$$slots:{default:[TM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function TM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","text"),h(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&h(e,"for",l),c[1]&1&&a!==(a=f[31])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Xh(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',h(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Qe(Ct.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function DM(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Xh();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[31]),h(a,"type","email"),h(a,"autocomplete","off"),h(a,"id",u=n[31]),a.required=!0},m(p,g){w(p,e,g),m(e,t),m(e,i),m(e,s),w(p,o,g),d&&d.m(p,g),w(p,r,g),w(p,a,g),Ce(a,n[2]),f||(c=X(a,"input",n[19]),f=!0)},p(p,g){g[1]&1&&l!==(l=p[31])&&h(e,"for",l),p[1].verified?d||(d=Xh(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=p[31])&&h(a,"id",u),g[0]&4&&a.value!==p[2]&&Ce(a,p[2])},d(p){p&&k(e),p&&k(o),d&&d.d(p),p&&k(r),p&&k(a),f=!1,c()}}}function Qh(n){let e,t;return e=new Le({props:{class:"form-field form-field-toggle",$$slots:{default:[OM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function OM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[31]),h(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[20]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&h(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&o!==(o=u[31])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function xh(n){let e,t,i,s,l,o,r,a,u;return s=new Le({props:{class:"form-field required",name:"password",$$slots:{default:[EM,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new Le({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[AM,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&128|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&256|c[1]&3&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),Dt(()=>{a||(a=ut(t,xt,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),a||(a=ut(t,xt,{duration:150},!1)),a.run(0),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function EM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[7]),u||(f=X(r,"input",n[21]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&h(e,"for",l),d[1]&1&&a!==(a=c[31])&&h(r,"id",a),d[0]&128&&r.value!==c[7]&&Ce(r,c[7])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function AM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password confirm",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[8]),u||(f=X(r,"input",n[22]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&h(e,"for",l),d[1]&1&&a!==(a=c[31])&&h(r,"id",a),d[0]&256&&r.value!==c[8]&&Ce(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function ep(n){let e,t;return e=new Le({props:{class:"form-field form-field-toggle",$$slots:{default:[PM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&512|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function PM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Send verification email"),h(e,"type","checkbox"),h(e,"id",t=n[31]),h(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[9],w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[23]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&h(e,"id",t),f[0]&512&&(e.checked=u[9]),f[1]&1&&o!==(o=u[31])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function LM(n){let e,t,i,s,l,o,r,a,u,f=!n[1].isNew&&Gh(n);i=new Le({props:{class:"form-field required",name:"email",$$slots:{default:[DM,({uniqueId:g})=>({31:g}),({uniqueId:g})=>[0,g?1:0]]},$$scope:{ctx:n}}});let c=!n[1].isNew&&Qh(n),d=(n[1].isNew||n[3])&&xh(n),p=n[1].isNew&&ep(n);return{c(){e=_("form"),f&&f.c(),t=T(),z(i.$$.fragment),s=T(),c&&c.c(),l=T(),d&&d.c(),o=T(),p&&p.c(),h(e,"id",n[11]),h(e,"class","grid"),h(e,"autocomplete","off")},m(g,v){w(g,e,v),f&&f.m(e,null),m(e,t),q(i,e,null),m(e,s),c&&c.m(e,null),m(e,l),d&&d.m(e,null),m(e,o),p&&p.m(e,null),r=!0,a||(u=X(e,"submit",Bt(n[12])),a=!0)},p(g,v){g[1].isNew?f&&(De(),P(f,1,1,()=>{f=null}),Oe()):f?(f.p(g,v),v[0]&2&&A(f,1)):(f=Gh(g),f.c(),A(f,1),f.m(e,t));const b={};v[0]&6|v[1]&3&&(b.$$scope={dirty:v,ctx:g}),i.$set(b),g[1].isNew?c&&(De(),P(c,1,1,()=>{c=null}),Oe()):c?(c.p(g,v),v[0]&2&&A(c,1)):(c=Qh(g),c.c(),A(c,1),c.m(e,l)),g[1].isNew||g[3]?d?(d.p(g,v),v[0]&10&&A(d,1)):(d=xh(g),d.c(),A(d,1),d.m(e,o)):d&&(De(),P(d,1,1,()=>{d=null}),Oe()),g[1].isNew?p?(p.p(g,v),v[0]&2&&A(p,1)):(p=ep(g),p.c(),A(p,1),p.m(e,null)):p&&(De(),P(p,1,1,()=>{p=null}),Oe())},i(g){r||(A(f),A(i.$$.fragment,g),A(c),A(d),A(p),r=!0)},o(g){P(f),P(i.$$.fragment,g),P(c),P(d),P(p),r=!1},d(g){g&&k(e),f&&f.d(),V(i),c&&c.d(),d&&d.d(),p&&p.d(),a=!1,u()}}}function FM(n){let e,t=n[1].isNew?"New user":"Edit user",i;return{c(){e=_("h4"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New user":"Edit user")&&me(i,t)},d(s){s&&k(e)}}}function tp(n){let e,t,i,s,l,o,r,a,u;return o=new os({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[IM]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),z(o.$$.fragment),r=T(),a=_("div"),h(s,"class","ri-more-line"),h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary"),h(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),q(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[0]&2|c[1]&2&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&k(e),V(o),f&&k(r),f&&k(a)}}}function np(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
|
||
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function IM(n){let e,t,i,s,l=!n[1].verified&&np(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
<span class="txt">Delete</span>`,h(t,"type","button"),h(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=X(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=np(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function NM(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&tp(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[5],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ee(l,"btn-loading",n[5])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?p&&(De(),P(p,1,1,()=>{p=null}),Oe()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=tp(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&me(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ee(l,"btn-loading",g[5])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function RM(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[NM],header:[FM],default:[LM]},$$scope:{ctx:n}};return e=new wi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),V(e,s)}}}function HM(n,e,t){let i;const s=un(),l="user_"+Y.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",p=!1,g=!0;function v(J){return y(J),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(J){Ii({}),t(1,r=J!=null&&J.clone?J.clone():new co),C()}function C(){t(3,p=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function $(){if(a||!i)return;t(5,a=!0);const J={email:f};(r.isNew||p)&&(J.password=c,J.passwordConfirm=d);let ie;r.isNew?ie=we.Users.create(J):ie=we.Users.update(r.id,J),ie.then(async fe=>{g&&M(!1),t(6,u=!1),b(),hn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",fe)}).catch(fe=>{we.errorResponseHandler(fe)}).finally(()=>{t(5,a=!1)})}function S(){!(r!=null&&r.id)||yi("Do you really want to delete the selected user?",()=>we.Users.delete(r.id).then(()=>{t(6,u=!1),b(),hn("Successfully deleted user."),s("delete",r)}).catch(J=>{we.errorResponseHandler(J)}))}function M(J=!0){return we.Users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),J&&hn(`Successfully sent verification email to ${r.email}.`)}).catch(ie=>{we.errorResponseHandler(ie)})}const D=()=>M(),E=()=>S(),O=()=>b();function F(){f=this.value,t(2,f)}function L(){p=this.checked,t(3,p)}function H(){c=this.value,t(7,c)}function j(){d=this.value,t(8,d)}function Q(){g=this.checked,t(9,g)}const ne=()=>i&&u?(yi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function B(J){he[J?"unshift":"push"](()=>{o=J,t(4,o)})}function K(J){ht.call(this,n,J)}function W(J){ht.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||p||f!==r.email)},[b,r,f,p,o,a,u,c,d,g,i,l,$,S,M,v,D,E,O,F,L,H,j,Q,ne,B,K,W]}class jM extends Pe{constructor(e){super(),Ae(this,e,HM,RM,Ee,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function ip(n,e,t){const i=n.slice();return i[39]=e[t],i}function sp(n,e,t){const i=n.slice();return i[42]=e[t],i}function lp(n,e,t){const i=n.slice();return i[42]=e[t],i}function qM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H=[],j=new Map,Q,ne,B,K,W,J,ie,fe,ye,le,ue=[],Te=new Map,Z,be,x,G,_e;u=new zo({}),u.$on("refresh",n[17]),v=new Vo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),v.$on("submit",n[19]);function je(te){n[20](te)}let Fe={class:"col-type-text col-field-id",name:"id",$$slots:{default:[zM]},$$scope:{ctx:n}};n[4]!==void 0&&(Fe.sort=n[4]),M=new tn({props:Fe}),he.push(()=>Ie(M,"sort",je));function Re(te){n[21](te)}let re={class:"col-type-email col-field-email",name:"email",$$slots:{default:[BM]},$$scope:{ctx:n}};n[4]!==void 0&&(re.sort=n[4]),O=new tn({props:re}),he.push(()=>Ie(O,"sort",Re));let ae=n[12];const ke=te=>te[42].name;for(let te=0;te<ae.length;te+=1){let ve=lp(n,ae,te),Ze=ke(ve);j.set(Ze,H[te]=op(Ze,ve))}function Ke(te){n[22](te)}let Ye={class:"col-type-date col-field-created",name:"created",$$slots:{default:[UM]},$$scope:{ctx:n}};n[4]!==void 0&&(Ye.sort=n[4]),ne=new tn({props:Ye}),he.push(()=>Ie(ne,"sort",Ke));function nt(te){n[23](te)}let lt={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[WM]},$$scope:{ctx:n}};n[4]!==void 0&&(lt.sort=n[4]),W=new tn({props:lt}),he.push(()=>Ie(W,"sort",nt));let xe=n[1];const ge=te=>te[39].id;for(let te=0;te<xe.length;te+=1){let ve=ip(n,xe,te),Ze=ge(ve);Te.set(Ze,ue[te]=fp(Ze,ve))}let de=null;xe.length||(de=rp(n));let qe=n[1].length&&cp(n),ct=n[1].length&&n[13]&&dp(n);return{c(){e=_("main"),t=_("header"),i=_("nav"),s=_("div"),l=R(n[14]),o=T(),r=_("button"),r.innerHTML='<i class="ri-settings-4-line"></i>',a=T(),z(u.$$.fragment),f=T(),c=_("div"),d=T(),p=_("button"),p.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">New user</span>`,g=T(),z(v.$$.fragment),b=T(),y=_("div"),C=_("table"),$=_("thead"),S=_("tr"),z(M.$$.fragment),E=T(),z(O.$$.fragment),L=T();for(let te=0;te<H.length;te+=1)H[te].c();Q=T(),z(ne.$$.fragment),K=T(),z(W.$$.fragment),ie=T(),fe=_("th"),ye=T(),le=_("tbody");for(let te=0;te<ue.length;te+=1)ue[te].c();de&&de.c(),Z=T(),qe&&qe.c(),be=T(),ct&&ct.c(),h(s,"class","breadcrumb-item"),h(i,"class","breadcrumbs"),h(r,"type","button"),h(r,"class","btn btn-secondary btn-circle"),h(c,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(t,"class","page-header"),h(fe,"class","col-type-action min-width"),h(C,"class","table"),ee(C,"table-loading",n[10]),h(y,"class","table-wrapper"),h(e,"class","page-wrapper")},m(te,ve){w(te,e,ve),m(e,t),m(t,i),m(i,s),m(s,l),m(t,o),m(t,r),m(t,a),q(u,t,null),m(t,f),m(t,c),m(t,d),m(t,p),m(e,g),q(v,e,null),m(e,b),m(e,y),m(y,C),m(C,$),m($,S),q(M,S,null),m(S,E),q(O,S,null),m(S,L);for(let Ze=0;Ze<H.length;Ze+=1)H[Ze].m(S,null);m(S,Q),q(ne,S,null),m(S,K),q(W,S,null),m(S,ie),m(S,fe),m(C,ye),m(C,le);for(let Ze=0;Ze<ue.length;Ze+=1)ue[Ze].m(le,null);de&&de.m(le,null),m(e,Z),qe&&qe.m(e,null),m(e,be),ct&&ct.m(e,null),x=!0,G||(_e=[Qe(Ct.call(null,r,{text:"Edit profile collection",position:"right"})),X(r,"click",n[16]),X(p,"click",n[18])],G=!0)},p(te,ve){(!x||ve[0]&16384)&&me(l,te[14]);const Ze={};ve[0]&8&&(Ze.value=te[3]),v.$set(Ze);const at={};ve[1]&65536&&(at.$$scope={dirty:ve,ctx:te}),!D&&ve[0]&16&&(D=!0,at.sort=te[4],He(()=>D=!1)),M.$set(at);const mt={};ve[1]&65536&&(mt.$$scope={dirty:ve,ctx:te}),!F&&ve[0]&16&&(F=!0,mt.sort=te[4],He(()=>F=!1)),O.$set(mt),ve[0]&4096&&(ae=te[12],H=ft(H,ve,ke,1,te,ae,j,S,rn,op,Q,lp));const yt={};ve[1]&65536&&(yt.$$scope={dirty:ve,ctx:te}),!B&&ve[0]&16&&(B=!0,yt.sort=te[4],He(()=>B=!1)),ne.$set(yt);const Lt={};ve[1]&65536&&(Lt.$$scope={dirty:ve,ctx:te}),!J&&ve[0]&16&&(J=!0,Lt.sort=te[4],He(()=>J=!1)),W.$set(Lt),ve[0]&5450&&(xe=te[1],De(),ue=ft(ue,ve,ge,1,te,xe,Te,le,Nt,fp,null,ip),Oe(),!xe.length&&de?de.p(te,ve):xe.length?de&&(de.d(1),de=null):(de=rp(te),de.c(),de.m(le,null))),ve[0]&1024&&ee(C,"table-loading",te[10]),te[1].length?qe?qe.p(te,ve):(qe=cp(te),qe.c(),qe.m(e,be)):qe&&(qe.d(1),qe=null),te[1].length&&te[13]?ct?ct.p(te,ve):(ct=dp(te),ct.c(),ct.m(e,null)):ct&&(ct.d(1),ct=null)},i(te){if(!x){A(u.$$.fragment,te),A(v.$$.fragment,te),A(M.$$.fragment,te),A(O.$$.fragment,te),A(ne.$$.fragment,te),A(W.$$.fragment,te);for(let ve=0;ve<xe.length;ve+=1)A(ue[ve]);x=!0}},o(te){P(u.$$.fragment,te),P(v.$$.fragment,te),P(M.$$.fragment,te),P(O.$$.fragment,te),P(ne.$$.fragment,te),P(W.$$.fragment,te);for(let ve=0;ve<ue.length;ve+=1)P(ue[ve]);x=!1},d(te){te&&k(e),V(u),V(v),V(M),V(O);for(let ve=0;ve<H.length;ve+=1)H[ve].d();V(ne),V(W);for(let ve=0;ve<ue.length;ve+=1)ue[ve].d();de&&de.d(),qe&&qe.d(),ct&&ct.d(),G=!1,st(_e)}}}function VM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
<h1>Loading users...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function zM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function BM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function op(n,e){let t,i,s,l,o,r,a,u=e[42].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=R("profile."),f=R(u),h(s,"class",l=Y.getFieldTypeIcon(e[42].type)),h(r,"class","txt"),h(i,"class","col-header-content"),h(t,"class",c="col-type-"+e[42].type+" col-field-"+e[42].name),h(t,"name",d=e[42].name),this.first=t},m(p,g){w(p,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(p,g){e=p,g[0]&4096&&l!==(l=Y.getFieldTypeIcon(e[42].type))&&h(s,"class",l),g[0]&4096&&u!==(u=e[42].name+"")&&me(f,u),g[0]&4096&&c!==(c="col-type-"+e[42].type+" col-field-"+e[42].name)&&h(t,"class",c),g[0]&4096&&d!==(d=e[42].name)&&h(t,"name",d)},d(p){p&&k(t)}}}function UM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function WM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function rp(n){let e;function t(l,o){return l[10]?KM:YM}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function YM(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&ap(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=ap(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function KM(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function ap(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[26]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function up(n,e){let t,i,s;return i=new g_({props:{field:e[42],record:e[39].profile||{}}}),{key:n,first:null,c(){t=rt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[42]),o[0]&2&&(r.record=e[39].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function fp(n,e){let t,i,s,l,o,r,a,u=e[39].email+"",f,c,d,p,g=e[39].verified?"Verified":"Unverified",v,b,y=[],C=new Map,$,S,M,D,E,O,F,L,H,j,Q,ne,B,K,W;s=new Zo({props:{id:e[39].id}});let J=e[12];const ie=le=>le[42].name;for(let le=0;le<J.length;le+=1){let ue=sp(e,J,le),Te=ie(ue);C.set(Te,y[le]=up(Te,ue))}M=new vi({props:{date:e[39].created}}),O=new vi({props:{date:e[39].updated}});function fe(){return e[24](e[39])}function ye(){return e[25](e[39])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),z(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=R(u),d=T(),p=_("span"),v=R(g),b=T();for(let le=0;le<y.length;le+=1)y[le].c();$=T(),S=_("td"),z(M.$$.fragment),D=T(),E=_("td"),z(O.$$.fragment),F=T(),L=_("td"),H=_("button"),H.innerHTML=`<i class="ri-user-settings-line"></i>
|
||
<span class="txt">Edit user</span>`,j=T(),Q=_("button"),Q.innerHTML=`<i class="ri-profile-line"></i>
|
||
<span class="txt">Edit profile</span>`,ne=T(),h(i,"class","col-type-text col-field-id"),h(a,"class","txt"),h(a,"title",c=e[39].email),h(p,"class","label"),ee(p,"label-success",e[39].verified),ee(p,"label-warning",!e[39].verified),h(r,"class","inline-flex"),h(o,"class","col-type-email col-field-email"),h(S,"class","col-type-date col-field-created"),h(E,"class","col-type-date col-field-updated"),h(H,"type","button"),h(H,"class","btn btn-sm btn-outline"),h(Q,"type","button"),h(Q,"class","btn btn-sm m-l-10"),h(L,"class","col-type-action min-width"),this.first=t},m(le,ue){w(le,t,ue),m(t,i),q(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,p),m(p,v),m(t,b);for(let Te=0;Te<y.length;Te+=1)y[Te].m(t,null);m(t,$),m(t,S),q(M,S,null),m(t,D),m(t,E),q(O,E,null),m(t,F),m(t,L),m(L,H),m(L,j),m(L,Q),m(t,ne),B=!0,K||(W=[X(H,"click",qn(fe)),X(Q,"click",qn(ye))],K=!0)},p(le,ue){e=le;const Te={};ue[0]&2&&(Te.id=e[39].id),s.$set(Te),(!B||ue[0]&2)&&u!==(u=e[39].email+"")&&me(f,u),(!B||ue[0]&2&&c!==(c=e[39].email))&&h(a,"title",c),(!B||ue[0]&2)&&g!==(g=e[39].verified?"Verified":"Unverified")&&me(v,g),ue[0]&2&&ee(p,"label-success",e[39].verified),ue[0]&2&&ee(p,"label-warning",!e[39].verified),ue[0]&4098&&(J=e[12],De(),y=ft(y,ue,ie,1,e,J,C,t,Nt,up,$,sp),Oe());const Z={};ue[0]&2&&(Z.date=e[39].created),M.$set(Z);const be={};ue[0]&2&&(be.date=e[39].updated),O.$set(be)},i(le){if(!B){A(s.$$.fragment,le);for(let ue=0;ue<J.length;ue+=1)A(y[ue]);A(M.$$.fragment,le),A(O.$$.fragment,le),B=!0}},o(le){P(s.$$.fragment,le);for(let ue=0;ue<y.length;ue+=1)P(y[ue]);P(M.$$.fragment,le),P(O.$$.fragment,le),B=!1},d(le){le&&k(t),V(s);for(let ue=0;ue<y.length;ue+=1)y[ue].d();V(M),V(O),K=!1,st(W)}}}function cp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[2]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&me(s,i),a[0]&4&&me(o,r[2])},d(r){r&&k(e)}}}function dp(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[10]),ee(t,"btn-disabled",n[10]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&me(o,l),c[0]&1024&&ee(t,"btn-loading",f[10]),c[0]&1024&&ee(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function ZM(n){let e,t,i,s,l,o,r,a,u;const f=[VM,qM],c=[];function d(b,y){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let p={};s=new jM({props:p}),n[28](s),s.$on("save",n[29]),s.$on("delete",n[30]);let g={};o=new Ua({props:g}),n[31](o),o.$on("save",n[32]);let v={collection:n[5]};return a=new m_({props:v}),n[33](a),a.$on("save",n[34]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,y){let C=e;e=d(b),e===C?c[e].p(b,y):(De(),P(c[C],1,1,()=>{c[C]=null}),Oe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const S={};o.$set(S);const M={};y[0]&32&&(M.collection=b[5]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[28](null),V(s,b),b&&k(l),n[31](null),V(o,b),b&&k(r),n[33](null),V(a,b)}}}function JM(n,e,t){var be;let i,s,l;At(n,Zt,x=>t(14,l=x));const o=Y.getQueryParams((be=window.location)==null?void 0:be.href),r=["id","userId","created","updated"];bn(Zt,l="Users",l);let a,u,f,c=[],d=1,p=0,g=!1,v=o.filter||"",b=o.sort||"-created",y=new An,C=!1;D();async function $(x=1){return t(10,g=!0),x<=1&&S(),we.Users.getList(x,50,{sort:b||"-created",filter:v}).then(G=>{t(10,g=!1),t(1,c=c.concat(G.items)),t(9,d=G.page),t(2,p=G.totalItems)}).catch(G=>{G!=null&&G.isAbort||(t(10,g=!1),console.warn(G),S(),we.errorResponseHandler(G,!1))})}function S(){t(1,c=[]),t(9,d=1),t(2,p=0)}function M(x){const G=c.find(_e=>_e.id===(x==null?void 0:x.userId));G&&(G.profile=x),t(1,c)}async function D(){t(11,C=!0);try{t(5,y=await we.Collections.getOne("profiles"))}catch(x){we.errorResponseHandler(x)}t(11,C=!1)}const E=()=>u==null?void 0:u.show(y),O=()=>$(),F=()=>a==null?void 0:a.show(),L=x=>t(3,v=x.detail);function H(x){b=x,t(4,b)}function j(x){b=x,t(4,b)}function Q(x){b=x,t(4,b)}function ne(x){b=x,t(4,b)}const B=x=>a==null?void 0:a.show(x),K=x=>f==null?void 0:f.show(x.profile),W=()=>t(3,v=""),J=()=>$(d+1);function ie(x){he[x?"unshift":"push"](()=>{a=x,t(6,a)})}const fe=()=>$(),ye=()=>$();function le(x){he[x?"unshift":"push"](()=>{u=x,t(7,u)})}const ue=x=>t(5,y=x.detail);function Te(x){he[x?"unshift":"push"](()=>{f=x,t(8,f)})}const Z=x=>M(x.detail);return n.$$.update=()=>{var x;n.$$.dirty[0]&24&&b!==-1&&v!==-1&&(Y.replaceClientQueryParams({filter:v,sort:b}),$()),n.$$.dirty[0]&6&&t(13,i=p>c.length),n.$$.dirty[0]&32&&t(12,s=(x=y==null?void 0:y.schema)==null?void 0:x.filter(G=>!r.includes(G.name)))},[$,c,p,v,b,y,a,u,f,d,g,C,s,i,l,M,E,O,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te,Z]}class GM extends Pe{constructor(e){super(),Ae(this,e,JM,ZM,Ee,{loadUsers:0},null,[-1,-1])}get loadUsers(){return this.$$.ctx[0]}}function XM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$;return{c(){e=_("aside"),t=_("div"),i=_("div"),i.textContent="System",s=T(),l=_("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
|
||
<span class="txt">Application</span>`,o=T(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||
<span class="txt">Mail settings</span>`,a=T(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||
<span class="txt">Files storage</span>`,f=T(),c=_("div"),c.textContent="Authentication",d=T(),p=_("a"),p.innerHTML=`<i class="ri-lock-password-line"></i>
|
||
<span class="txt">Auth providers</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-key-line"></i>
|
||
<span class="txt">Token options</span>`,b=T(),y=_("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
|
||
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(c,"class","sidebar-title"),h(p,"href","/settings/auth-providers"),h(p,"class","sidebar-list-item"),h(v,"href","/settings/tokens"),h(v,"class","sidebar-list-item"),h(y,"href","/settings/admins"),h(y,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(S,M){w(S,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,p),m(t,g),m(t,v),m(t,b),m(t,y),C||($=[Qe(ni.call(null,l,{path:"/settings"})),Qe($n.call(null,l)),Qe(ni.call(null,r,{path:"/settings/mail/?.*"})),Qe($n.call(null,r)),Qe(ni.call(null,u,{path:"/settings/storage/?.*"})),Qe($n.call(null,u)),Qe(ni.call(null,p,{path:"/settings/auth-providers/?.*"})),Qe($n.call(null,p)),Qe(ni.call(null,v,{path:"/settings/tokens/?.*"})),Qe($n.call(null,v)),Qe(ni.call(null,y,{path:"/settings/admins/?.*"})),Qe($n.call(null,y))],C=!0)},p:oe,i:oe,o:oe,d(S){S&&k(e),C=!1,st($)}}}class As extends Pe{constructor(e){super(),Ae(this,e,null,XM,Ee,{})}}function hp(n,e,t){const i=n.slice();return i[31]=e[t],i}function pp(n){let e,t;return e=new Le({props:{class:"form-field disabled",name:"id",$$slots:{default:[QM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","text"),h(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&h(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function mp(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=T(),Xn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[31]),h(e,"tabindex","0"),h(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[X(e,"click",a),X(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(f){f&&k(e),o=!1,st(r)}}}function xM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),r=_("input"),h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[3]),u||(f=X(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&8&&r.value!==c[3]&&Ce(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function gp(n){let e,t;return e=new Le({props:{class:"form-field form-field-toggle",$$slots:{default:[eT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function eT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[30]),h(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function _p(n){let e,t,i,s,l,o,r,a,u;return s=new Le({props:{class:"form-field required",name:"password",$$slots:{default:[tT,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new Le({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[nT,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742080|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&1073742336|c[1]&8&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),Dt(()=>{a||(a=ut(t,xt,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),a||(a=ut(t,xt,{duration:150},!1)),a.run(0),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function tT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[8]),u||(f=X(r,"input",n[21]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&256&&r.value!==c[8]&&Ce(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function nT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password confirm",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[9]),u||(f=X(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&512&&r.value!==c[9]&&Ce(r,c[9])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function iT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g=!n[1].isNew&&pp(n),v=[0,1,2,3,4,5,6,7,8,9],b=[];for(let $=0;$<10;$+=1)b[$]=mp(hp(n,v,$));a=new Le({props:{class:"form-field required",name:"email",$$slots:{default:[xM,({uniqueId:$})=>({30:$}),({uniqueId:$})=>[$?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&gp(n),C=(n[1].isNew||n[4])&&_p(n);return{c(){e=_("form"),g&&g.c(),t=T(),i=_("div"),s=_("p"),s.textContent="Avatar",l=T(),o=_("div");for(let $=0;$<10;$+=1)b[$].c();r=T(),z(a.$$.fragment),u=T(),y&&y.c(),f=T(),C&&C.c(),h(s,"class","section-title"),h(o,"class","flex flex-gap-xs flex-wrap"),h(i,"class","content"),h(e,"id",n[11]),h(e,"class","grid"),h(e,"autocomplete","off")},m($,S){w($,e,S),g&&g.m(e,null),m(e,t),m(e,i),m(i,s),m(i,l),m(i,o);for(let M=0;M<10;M+=1)b[M].m(o,null);m(e,r),q(a,e,null),m(e,u),y&&y.m(e,null),m(e,f),C&&C.m(e,null),c=!0,d||(p=X(e,"submit",Bt(n[12])),d=!0)},p($,S){if($[1].isNew?g&&(De(),P(g,1,1,()=>{g=null}),Oe()):g?(g.p($,S),S[0]&2&&A(g,1)):(g=pp($),g.c(),A(g,1),g.m(e,t)),S[0]&4){v=[0,1,2,3,4,5,6,7,8,9];let D;for(D=0;D<10;D+=1){const E=hp($,v,D);b[D]?b[D].p(E,S):(b[D]=mp(E),b[D].c(),b[D].m(o,null))}for(;D<10;D+=1)b[D].d(1)}const M={};S[0]&1073741832|S[1]&8&&(M.$$scope={dirty:S,ctx:$}),a.$set(M),$[1].isNew?y&&(De(),P(y,1,1,()=>{y=null}),Oe()):y?(y.p($,S),S[0]&2&&A(y,1)):(y=gp($),y.c(),A(y,1),y.m(e,f)),$[1].isNew||$[4]?C?(C.p($,S),S[0]&18&&A(C,1)):(C=_p($),C.c(),A(C,1),C.m(e,null)):C&&(De(),P(C,1,1,()=>{C=null}),Oe())},i($){c||(A(g),A(a.$$.fragment,$),A(y),A(C),c=!0)},o($){P(g),P(a.$$.fragment,$),P(y),P(C),c=!1},d($){$&&k(e),g&&g.d(),jn(b,$),V(a),y&&y.d(),C&&C.d(),d=!1,p()}}}function sT(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=_("h4"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New admin":"Edit admin")&&me(i,t)},d(s){s&&k(e)}}}function bp(n){let e,t,i,s,l,o,r,a,u;return o=new os({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[lT]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),z(o.$$.fragment),r=T(),a=_("div"),h(s,"class","ri-more-line"),h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary"),h(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),q(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&k(e),V(o),f&&k(r),f&&k(a)}}}function lT(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function oT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&bp(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ee(l,"btn-loading",n[6])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?p&&(De(),P(p,1,1,()=>{p=null}),Oe()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=bp(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&me(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ee(l,"btn-loading",g[6])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function rT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[oT],header:[sT],default:[iT]},$$scope:{ctx:n}};return e=new wi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function aT(n,e,t){let i;const s=un(),l="admin_"+Y.randomString(5);let o,r=new ks,a=!1,u=!1,f=0,c="",d="",p="",g=!1;function v(W){return y(W),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(W){Ii({}),t(1,r=W!=null&&W.clone?W.clone():new ks),C()}function C(){t(4,g=!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,p="")}function $(){if(a||!i)return;t(6,a=!0);const W={email:c,avatar:f};(r.isNew||g)&&(W.password=d,W.passwordConfirm=p);let J;r.isNew?J=we.Admins.create(W):J=we.Admins.update(r.id,W),J.then(async ie=>{var fe;t(7,u=!1),b(),hn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((fe=we.AuthStore.model)==null?void 0:fe.id)===ie.id&&we.AuthStore.save(we.AuthStore.token,ie)}).catch(ie=>{we.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function S(){!(r!=null&&r.id)||yi("Do you really want to delete the selected admin?",()=>we.Admins.delete(r.id).then(()=>{t(7,u=!1),b(),hn("Successfully deleted admin."),s("delete",r)}).catch(W=>{we.errorResponseHandler(W)}))}const M=()=>S(),D=()=>b(),E=W=>t(2,f=W),O=(W,J)=>{(J.code==="Enter"||J.code==="Space")&&(J.preventDefault(),t(2,f=W))};function F(){c=this.value,t(3,c)}function L(){g=this.checked,t(4,g)}function H(){d=this.value,t(8,d)}function j(){p=this.value,t(9,p)}const Q=()=>i&&u?(yi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function ne(W){he[W?"unshift":"push"](()=>{o=W,t(5,o)})}function B(W){ht.call(this,n,W)}function K(W){ht.call(this,n,W)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,p,i,l,$,S,v,M,D,E,O,F,L,H,j,Q,ne,B,K]}class uT extends Pe{constructor(e){super(),Ae(this,e,aT,rT,Ee,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function vp(n,e,t){const i=n.slice();return i[23]=e[t],i}function fT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",Y.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function cT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",Y.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function dT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function hT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",Y.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function yp(n){let e;function t(l,o){return l[5]?mT:pT}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function pT(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&kp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=kp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function mT(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function kp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[17]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function wp(n){let e;return{c(){e=_("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sp(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g=e[23].email+"",v,b,y,C,$,S,M,D,E,O,F,L,H,j;u=new Zo({props:{id:e[23].id}});let Q=e[23].id===e[7].id&&wp();$=new vi({props:{date:e[23].created}}),D=new vi({props:{date:e[23].updated}});function ne(){return e[15](e[23])}function B(...K){return e[16](e[23],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),z(u.$$.fragment),f=T(),Q&&Q.c(),c=T(),d=_("td"),p=_("span"),v=R(g),y=T(),C=_("td"),z($.$$.fragment),S=T(),M=_("td"),z(D.$$.fragment),E=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),Xn(l.src,o="/_/images/avatars/avatar"+(e[23].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(a,"class","col-type-text col-field-id"),h(p,"class","txt txt-ellipsis"),h(p,"title",b=e[23].email),h(d,"class","col-type-email col-field-email"),h(C,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(K,W){w(K,t,W),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),q(u,a,null),m(a,f),Q&&Q.m(a,null),m(t,c),m(t,d),m(d,p),m(p,v),m(t,y),m(t,C),q($,C,null),m(t,S),m(t,M),q(D,M,null),m(t,E),m(t,O),m(t,F),L=!0,H||(j=[X(t,"click",ne),X(t,"keydown",B)],H=!0)},p(K,W){e=K,(!L||W&16&&!Xn(l.src,o="/_/images/avatars/avatar"+(e[23].avatar||0)+".svg"))&&h(l,"src",o);const J={};W&16&&(J.id=e[23].id),u.$set(J),e[23].id===e[7].id?Q||(Q=wp(),Q.c(),Q.m(a,null)):Q&&(Q.d(1),Q=null),(!L||W&16)&&g!==(g=e[23].email+"")&&me(v,g),(!L||W&16&&b!==(b=e[23].email))&&h(p,"title",b);const ie={};W&16&&(ie.date=e[23].created),$.$set(ie);const fe={};W&16&&(fe.date=e[23].updated),D.$set(fe)},i(K){L||(A(u.$$.fragment,K),A($.$$.fragment,K),A(D.$$.fragment,K),L=!0)},o(K){P(u.$$.fragment,K),P($.$$.fragment,K),P(D.$$.fragment,K),L=!1},d(K){K&&k(t),V(u),Q&&Q.d(),V($),V(D),H=!1,st(j)}}}function $p(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),r=R(o),h(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&me(s,i),u&16&&o!==(o=a[4].length+"")&&me(r,o)},d(a){a&&k(e)}}}function gT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j,Q,ne,B,K,W,J,ie,fe,ye,le,ue,Te=[],Z=new Map,be,x,G,_e,je,Fe;e=new As({}),c=new zo({}),c.$on("refresh",n[8]),y=new Vo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),y.$on("submit",n[10]);function Re(te){n[11](te)}let re={class:"col-type-text",name:"id",$$slots:{default:[fT]},$$scope:{ctx:n}};n[2]!==void 0&&(re.sort=n[2]),F=new tn({props:re}),he.push(()=>Ie(F,"sort",Re));function ae(te){n[12](te)}let ke={class:"col-type-email col-field-email",name:"email",$$slots:{default:[cT]},$$scope:{ctx:n}};n[2]!==void 0&&(ke.sort=n[2]),j=new tn({props:ke}),he.push(()=>Ie(j,"sort",ae));function Ke(te){n[13](te)}let Ye={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dT]},$$scope:{ctx:n}};n[2]!==void 0&&(Ye.sort=n[2]),B=new tn({props:Ye}),he.push(()=>Ie(B,"sort",Ke));function nt(te){n[14](te)}let lt={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[hT]},$$scope:{ctx:n}};n[2]!==void 0&&(lt.sort=n[2]),J=new tn({props:lt}),he.push(()=>Ie(J,"sort",nt));let xe=n[4];const ge=te=>te[23].id;for(let te=0;te<xe.length;te+=1){let ve=vp(n,xe,te),Ze=ge(ve);Z.set(Ze,Te[te]=Sp(Ze,ve))}let de=null;xe.length||(de=yp(n));let qe=n[4].length&&$p(n),ct={};return G=new uT({props:ct}),n[18](G),G.$on("save",n[19]),G.$on("delete",n[20]),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Settings",r=T(),a=_("div"),u=R(n[6]),f=T(),z(c.$$.fragment),d=T(),p=_("div"),g=T(),v=_("button"),v.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">New admin</span>`,b=T(),z(y.$$.fragment),C=T(),$=_("div"),S=_("table"),M=_("thead"),D=_("tr"),E=_("th"),O=T(),z(F.$$.fragment),H=T(),z(j.$$.fragment),ne=T(),z(B.$$.fragment),W=T(),z(J.$$.fragment),fe=T(),ye=_("th"),le=T(),ue=_("tbody");for(let te=0;te<Te.length;te+=1)Te[te].c();de&&de.c(),be=T(),qe&&qe.c(),x=T(),z(G.$$.fragment),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(p,"class","flex-fill"),h(v,"type","button"),h(v,"class","btn btn-expanded"),h(s,"class","page-header"),h(E,"class","min-width"),h(ye,"class","col-type-action min-width"),h(S,"class","table"),ee(S,"table-loading",n[5]),h($,"class","table-wrapper"),h(i,"class","page-wrapper")},m(te,ve){q(e,te,ve),w(te,t,ve),w(te,i,ve),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,u),m(s,f),q(c,s,null),m(s,d),m(s,p),m(s,g),m(s,v),m(i,b),q(y,i,null),m(i,C),m(i,$),m($,S),m(S,M),m(M,D),m(D,E),m(D,O),q(F,D,null),m(D,H),q(j,D,null),m(D,ne),q(B,D,null),m(D,W),q(J,D,null),m(D,fe),m(D,ye),m(S,le),m(S,ue);for(let Ze=0;Ze<Te.length;Ze+=1)Te[Ze].m(ue,null);de&&de.m(ue,null),m(i,be),qe&&qe.m(i,null),w(te,x,ve),q(G,te,ve),_e=!0,je||(Fe=X(v,"click",n[9]),je=!0)},p(te,[ve]){(!_e||ve&64)&&me(u,te[6]);const Ze={};ve&2&&(Ze.value=te[1]),y.$set(Ze);const at={};ve&67108864&&(at.$$scope={dirty:ve,ctx:te}),!L&&ve&4&&(L=!0,at.sort=te[2],He(()=>L=!1)),F.$set(at);const mt={};ve&67108864&&(mt.$$scope={dirty:ve,ctx:te}),!Q&&ve&4&&(Q=!0,mt.sort=te[2],He(()=>Q=!1)),j.$set(mt);const yt={};ve&67108864&&(yt.$$scope={dirty:ve,ctx:te}),!K&&ve&4&&(K=!0,yt.sort=te[2],He(()=>K=!1)),B.$set(yt);const Lt={};ve&67108864&&(Lt.$$scope={dirty:ve,ctx:te}),!ie&&ve&4&&(ie=!0,Lt.sort=te[2],He(()=>ie=!1)),J.$set(Lt),ve&186&&(xe=te[4],De(),Te=ft(Te,ve,ge,1,te,xe,Z,ue,Nt,Sp,null,vp),Oe(),!xe.length&&de?de.p(te,ve):xe.length?de&&(de.d(1),de=null):(de=yp(te),de.c(),de.m(ue,null))),ve&32&&ee(S,"table-loading",te[5]),te[4].length?qe?qe.p(te,ve):(qe=$p(te),qe.c(),qe.m(i,null)):qe&&(qe.d(1),qe=null);const pe={};G.$set(pe)},i(te){if(!_e){A(e.$$.fragment,te),A(c.$$.fragment,te),A(y.$$.fragment,te),A(F.$$.fragment,te),A(j.$$.fragment,te),A(B.$$.fragment,te),A(J.$$.fragment,te);for(let ve=0;ve<xe.length;ve+=1)A(Te[ve]);A(G.$$.fragment,te),_e=!0}},o(te){P(e.$$.fragment,te),P(c.$$.fragment,te),P(y.$$.fragment,te),P(F.$$.fragment,te),P(j.$$.fragment,te),P(B.$$.fragment,te),P(J.$$.fragment,te);for(let ve=0;ve<Te.length;ve+=1)P(Te[ve]);P(G.$$.fragment,te),_e=!1},d(te){V(e,te),te&&k(t),te&&k(i),V(c),V(y),V(F),V(j),V(B),V(J);for(let ve=0;ve<Te.length;ve+=1)Te[ve].d();de&&de.d(),qe&&qe.d(),te&&k(x),n[18](null),V(G,te),je=!1,Fe()}}}function _T(n,e,t){var L;let i,s;At(n,Zt,H=>t(6,i=H)),At(n,ba,H=>t(7,s=H));const l=Y.getQueryParams((L=window.location)==null?void 0:L.href);bn(Zt,i="Admins",i);let o,r=[],a=!1,u=l.filter||"",f=l.sort||"-created";function c(){return t(5,a=!0),t(4,r=[]),we.Admins.getFullList(100,{sort:f||"-created",filter:u}).then(H=>{t(4,r=H),t(5,a=!1)}).catch(H=>{H!=null&&H.isAbort||(t(5,a=!1),console.warn(H),d(),we.errorResponseHandler(H,!1))})}function d(){t(4,r=[])}const p=()=>c(),g=()=>o==null?void 0:o.show(),v=H=>t(1,u=H.detail);function b(H){f=H,t(2,f)}function y(H){f=H,t(2,f)}function C(H){f=H,t(2,f)}function $(H){f=H,t(2,f)}const S=H=>o==null?void 0:o.show(H),M=(H,j)=>{(j.code==="Enter"||j.code==="Space")&&(j.preventDefault(),o==null||o.show(H))},D=()=>t(1,u="");function E(H){he[H?"unshift":"push"](()=>{o=H,t(3,o)})}const O=()=>c(),F=()=>c();return n.$$.update=()=>{n.$$.dirty&6&&f!==-1&&u!==-1&&(Y.replaceClientQueryParams({filter:u,sort:f}),c())},[c,u,f,o,r,a,i,s,p,g,v,b,y,C,$,S,M,D,E,O,F]}class bT extends Pe{constructor(e){super(),Ae(this,e,_T,gT,Ee,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function vT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[7]),h(l,"type","email"),h(l,"id",o=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=X(l,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&h(e,"for",i),f&128&&o!==(o=u[7])&&h(l,"id",o),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function yT(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=R("Password"),s=T(),l=_("input"),r=T(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",h(e,"for",i=n[7]),h(l,"type","password"),h(l,"id",o=n[7]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(d,p){w(d,e,p),m(e,t),w(d,s,p),w(d,l,p),Ce(l,n[1]),w(d,r,p),w(d,a,p),m(a,u),f||(c=[X(l,"input",n[5]),Qe($n.call(null,u))],f=!0)},p(d,p){p&128&&i!==(i=d[7])&&h(e,"for",i),p&128&&o!==(o=d[7])&&h(l,"id",o),p&2&&l.value!==d[1]&&Ce(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,st(c)}}}function kT(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new Le({props:{class:"form-field required",name:"email",$$slots:{default:[vT,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"password",$$slots:{default:[yT,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign in</h4>",i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),a=_("button"),a.innerHTML=`<span class="txt">Login</span>
|
||
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),ee(a,"btn-disabled",n[2]),ee(a,"btn-loading",n[2]),h(e,"class","block")},m(d,p){w(d,e,p),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),m(e,a),u=!0,f||(c=X(e,"submit",Bt(n[3])),f=!0)},p(d,p){const g={};p&385&&(g.$$scope={dirty:p,ctx:d}),s.$set(g);const v={};p&386&&(v.$$scope={dirty:p,ctx:d}),o.$set(v),p&4&&ee(a,"btn-disabled",d[2]),p&4&&ee(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function wT(n){let e,t;return e=new fg({props:{$$slots:{default:[kT]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ST(n,e,t){var f;const i=Y.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",o=!1;function r(){if(!o)return t(2,o=!0),we.Admins.authViaEmail(s,l).then(()=>{Ms("/")}).catch(()=>{lg("Invalid login credentials.")}).finally(()=>{t(2,o=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,o,r,a,u]}class $T extends Pe{constructor(e){super(),Ae(this,e,ST,wT,Ee,{})}}function CT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C;return i=new Le({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[TT,({uniqueId:$})=>({14:$}),({uniqueId:$})=>$?16384:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[DT,({uniqueId:$})=>({14:$}),({uniqueId:$})=>$?16384:0]},$$scope:{ctx:n}}}),a=new Le({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[OT,({uniqueId:$})=>({14:$}),({uniqueId:$})=>$?16384:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),p=_("button"),g=_("span"),g.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(c,"class","flex-fill"),h(g,"class","txt"),h(p,"type","submit"),h(p,"class","btn btn-expanded"),p.disabled=v=!n[3]||n[2],ee(p,"btn-loading",n[2]),h(f,"class","col-lg-12 flex"),h(e,"class","grid")},m($,S){w($,e,S),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,p),m(p,g),b=!0,y||(C=X(p,"click",n[9]),y=!0)},p($,S){const M={};S&49153&&(M.$$scope={dirty:S,ctx:$}),i.$set(M);const D={};S&49153&&(D.$$scope={dirty:S,ctx:$}),o.$set(D);const E={};S&49153&&(E.$$scope={dirty:S,ctx:$}),a.$set(E),(!b||S&12&&v!==(v=!$[3]||$[2]))&&(p.disabled=v),S&4&&ee(p,"btn-loading",$[2])},i($){b||(A(i.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),b=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),b=!1},d($){$&&k(e),V(i),V(o),V(a),y=!1,C()}}}function MT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function TT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application name"),s=T(),l=_("input"),h(e,"for",i=n[14]),h(l,"type","text"),h(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appName),r||(a=X(l,"input",n[6]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&h(e,"for",i),f&16384&&o!==(o=u[14])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Ce(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function DT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application url"),s=T(),l=_("input"),h(e,"for",i=n[14]),h(l,"type","text"),h(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appUrl),r||(a=X(l,"input",n[7]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&h(e,"for",i),f&16384&&o!==(o=u[14])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Ce(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function OT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Logs max days retention"),s=T(),l=_("input"),h(e,"for",i=n[14]),h(l,"type","number"),h(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].logs.maxDays),r||(a=X(l,"input",n[8]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&h(e,"for",i),f&16384&&o!==(o=u[14])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].logs.maxDays&&Ce(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function ET(n){let e,t,i,s,l,o,r,a,u,f,c,d;e=new As({});const p=[MT,CT],g=[];function v(b,y){return b[1]?0:1}return a=v(n),u=g[a]=p[a](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||
<div class="breadcrumb-item">Application</div></nav>`,l=T(),o=_("div"),r=_("form"),u.c(),h(s,"class","page-header"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(b,y){q(e,b,y),w(b,t,y),w(b,i,y),m(i,s),m(i,l),m(i,o),m(o,r),g[a].m(r,null),f=!0,c||(d=X(r,"submit",Bt(n[4])),c=!0)},p(b,[y]){let C=a;a=v(b),a===C?g[a].p(b,y):(De(),P(g[C],1,1,()=>{g[C]=null}),Oe(),u=g[a],u?u.p(b,y):(u=g[a]=p[a](b),u.c()),A(u,1),u.m(r,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){P(e.$$.fragment,b),P(u),f=!1},d(b){V(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function AT(n,e,t){let i,s,l;At(n,_o,y=>t(10,s=y)),At(n,Zt,y=>t(11,l=y)),bn(Zt,l="Application settings",l);let o={},r=!1,a=!1,u="";f();async function f(){t(1,r=!0);try{const y=await we.Settings.getAll()||{};d(y)}catch(y){we.errorResponseHandler(y)}t(1,r=!1)}async function c(){if(!(a||!i)){t(2,a=!0);try{const y=await we.Settings.update(Y.filterRedactedProps(o));d(y),hn("Successfully saved application settings.")}catch(y){we.errorResponseHandler(y)}t(2,a=!1)}}function d(y={}){var C;bn(_o,s=(C=y==null?void 0:y.meta)==null?void 0:C.appName,s),t(0,o={meta:(y==null?void 0:y.meta)||{},logs:(y==null?void 0:y.logs)||{}}),t(5,u=JSON.stringify(o))}function p(){o.meta.appName=this.value,t(0,o)}function g(){o.meta.appUrl=this.value,t(0,o)}function v(){o.logs.maxDays=Ot(this.value),t(0,o)}const b=()=>c();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=u!=JSON.stringify(o))},[o,r,a,i,c,u,p,g,v,b]}class PT extends Pe{constructor(e){super(),Ae(this,e,AT,ET,Ee,{})}}function LT(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=pt(l,s[o]);return{c(){e=_("input"),oi(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Ce(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(o,r){oi(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Ce(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function FT(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=pt(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=T(),s=_("input"),h(t,"type","button"),h(t,"class","btn btn-secondary btn-circle"),h(e,"class","form-field-addon"),oi(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Qe(Ct.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],l=!0)},p(u,f){oi(s,a=pn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,st(o)}}}function IT(n){let e;function t(l,o){return l[3]?FT:LT}let i=t(n),s=i(n);return{c(){s.c(),e=rt()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function NT(n,e,t){const i=["value","mask"];let s=Kt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ai(),r==null||r.focus()}const f=()=>u();function c(p){he[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=pt(pt({},e),ri(p)),t(5,s=Kt(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Wa extends Pe{constructor(e){super(),Ae(this,e,NT,IT,Ee,{value:0,mask:1})}}function RT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F,L,H,j,Q;i=new Le({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[jT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[qT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),a=new Le({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[VT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),f=new Le({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[zT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:{default:[BT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}}),C=new Le({props:{class:"form-field form-field-toggle",$$slots:{default:[UT,({uniqueId:B})=>({23:B}),({uniqueId:B})=>B?8388608:0]},$$scope:{ctx:n}}});let ne=n[0].smtp.enabled&&Cp(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),z(f.$$.fragment),c=T(),z(d.$$.fragment),p=T(),g=_("hr"),v=T(),b=_("div"),b.innerHTML=`<p>By default PocketBase uses the OS <code>sendmail</code> command for sending emails.
|
||
<br/>
|
||
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||
below.</strong></p>`,y=T(),z(C.$$.fragment),$=T(),ne&&ne.c(),S=T(),M=_("div"),D=_("div"),E=T(),O=_("button"),F=_("span"),F.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid"),h(b,"class","content m-b-sm"),h(D,"class","flex-fill"),h(F,"class","txt"),h(O,"type","submit"),h(O,"class","btn btn-expanded"),O.disabled=L=!n[3]||n[2],ee(O,"btn-loading",n[2]),h(M,"class","flex")},m(B,K){w(B,e,K),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),q(f,e,null),m(e,c),q(d,e,null),w(B,p,K),w(B,g,K),w(B,v,K),w(B,b,K),w(B,y,K),q(C,B,K),w(B,$,K),ne&&ne.m(B,K),w(B,S,K),w(B,M,K),m(M,D),m(M,E),m(M,O),m(O,F),H=!0,j||(Q=X(O,"click",n[19]),j=!0)},p(B,K){const W={};K&25165825&&(W.$$scope={dirty:K,ctx:B}),i.$set(W);const J={};K&25165825&&(J.$$scope={dirty:K,ctx:B}),o.$set(J);const ie={};K&25165825&&(ie.$$scope={dirty:K,ctx:B}),a.$set(ie);const fe={};K&25165825&&(fe.$$scope={dirty:K,ctx:B}),f.$set(fe);const ye={};K&25165825&&(ye.$$scope={dirty:K,ctx:B}),d.$set(ye);const le={};K&25165825&&(le.$$scope={dirty:K,ctx:B}),C.$set(le),B[0].smtp.enabled?ne?(ne.p(B,K),K&1&&A(ne,1)):(ne=Cp(B),ne.c(),A(ne,1),ne.m(S.parentNode,S)):ne&&(De(),P(ne,1,1,()=>{ne=null}),Oe()),(!H||K&12&&L!==(L=!B[3]||B[2]))&&(O.disabled=L),K&4&&ee(O,"btn-loading",B[2])},i(B){H||(A(i.$$.fragment,B),A(o.$$.fragment,B),A(a.$$.fragment,B),A(f.$$.fragment,B),A(d.$$.fragment,B),A(C.$$.fragment,B),A(ne),H=!0)},o(B){P(i.$$.fragment,B),P(o.$$.fragment,B),P(a.$$.fragment,B),P(f.$$.fragment,B),P(d.$$.fragment,B),P(C.$$.fragment,B),P(ne),H=!1},d(B){B&&k(e),V(i),V(o),V(a),V(f),V(d),B&&k(p),B&&k(g),B&&k(v),B&&k(b),B&&k(y),V(C,B),B&&k($),ne&&ne.d(B),B&&k(S),B&&k(M),j=!1,Q()}}}function HT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function jT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender name"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderName),r||(a=X(l,"input",n[8]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Ce(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function qT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender address"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","email"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderAddress),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Ce(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function VT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User verification page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
|
||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userVerificationUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[10]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&h(e,"for",i),d&8388608&&o!==(o=c[23])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userVerificationUrl&&Ce(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function zT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User reset password page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
|
||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userResetPasswordUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&h(e,"for",i),d&8388608&&o!==(o=c[23])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&Ce(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function BT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User confirm email change page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
|
||
parameters:
|
||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userConfirmEmailChangeUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[12]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&h(e,"for",i),d&8388608&&o!==(o=c[23])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&Ce(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Use SMTP mail server"),h(e,"type","checkbox"),h(e,"id",t=n[23]),e.required=!0,h(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&h(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&8388608&&o!==(o=u[23])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Cp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$;return i=new Le({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[WT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[YT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[KT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field",name:"smtp.username",$$slots:{default:[ZT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),v=new Le({props:{class:"form-field",name:"smtp.password",$$slots:{default:[JT,({uniqueId:S})=>({23:S}),({uniqueId:S})=>S?8388608:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(S,M){w(S,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),$=!0},p(S,M){const D={};M&25165825&&(D.$$scope={dirty:M,ctx:S}),i.$set(D);const E={};M&25165825&&(E.$$scope={dirty:M,ctx:S}),o.$set(E);const O={};M&25165825&&(O.$$scope={dirty:M,ctx:S}),u.$set(O);const F={};M&25165825&&(F.$$scope={dirty:M,ctx:S}),d.$set(F);const L={};M&25165825&&(L.$$scope={dirty:M,ctx:S}),v.$set(L)},i(S){$||(A(i.$$.fragment,S),A(o.$$.fragment,S),A(u.$$.fragment,S),A(d.$$.fragment,S),A(v.$$.fragment,S),S&&Dt(()=>{C||(C=ut(e,xt,{duration:150},!0)),C.run(1)}),$=!0)},o(S){P(i.$$.fragment,S),P(o.$$.fragment,S),P(u.$$.fragment,S),P(d.$$.fragment,S),P(v.$$.fragment,S),S&&(C||(C=ut(e,xt,{duration:150},!1)),C.run(0)),$=!1},d(S){S&&k(e),V(i),V(o),V(u),V(d),V(v),S&&C&&C.end()}}}function WT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("SMTP server host"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.host),r||(a=X(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Ce(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function YT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Port"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","number"),h(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.port),r||(a=X(l,"input",n[15]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].smtp.port&&Ce(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function KT(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[5]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new rs({props:u}),he.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("TLS Encryption"),s=T(),z(l.$$.fragment),h(e,"for",i=n[23])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&h(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function ZT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Username"),s=T(),l=_("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.username),r||(a=X(l,"input",n[17]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.username&&Ce(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function JT(n){let e,t,i,s,l,o,r;function a(f){n[18](f)}let u={id:n[23]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new Wa({props:u}),he.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Password"),s=T(),z(l.$$.fragment),h(e,"for",i=n[23])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&h(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&1&&(o=!0,d.value=f[0].smtp.password,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function GT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$;e=new As({});const S=[HT,RT],M=[];function D(E,O){return E[1]?0:1}return v=D(n),b=M[v]=S[v](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Settings",r=T(),a=_("div"),u=R(n[4]),f=T(),c=_("div"),d=_("form"),p=_("div"),p.innerHTML="<p>Configure common settings for sending emails.</p>",g=T(),b.c(),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(s,"class","page-header"),h(p,"class","content txt-xl m-b-base"),h(d,"class","panel"),h(d,"autocomplete","off"),h(c,"class","wrapper"),h(i,"class","page-wrapper")},m(E,O){q(e,E,O),w(E,t,O),w(E,i,O),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,u),m(i,f),m(i,c),m(c,d),m(d,p),m(d,g),M[v].m(d,null),y=!0,C||($=X(d,"submit",Bt(n[20])),C=!0)},p(E,[O]){(!y||O&16)&&me(u,E[4]);let F=v;v=D(E),v===F?M[v].p(E,O):(De(),P(M[F],1,1,()=>{M[F]=null}),Oe(),b=M[v],b?b.p(E,O):(b=M[v]=S[v](E),b.c()),A(b,1),b.m(d,null))},i(E){y||(A(e.$$.fragment,E),A(b),y=!0)},o(E){P(e.$$.fragment,E),P(b),y=!1},d(E){V(e,E),E&&k(t),E&&k(i),M[v].d(),C=!1,$()}}}function XT(n,e,t){let i,s;At(n,Zt,L=>t(4,s=L));const l=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];bn(Zt,s="Mail settings",s);let o={},r=!1,a=!1,u="";f();async function f(){t(1,r=!0);try{const L=await we.Settings.getAll()||{};d(L)}catch(L){we.errorResponseHandler(L)}t(1,r=!1)}async function c(){if(!(a||!i)){t(2,a=!0);try{const L=await we.Settings.update(Y.filterRedactedProps(o));d(L),hn("Successfully saved mail settings.")}catch(L){we.errorResponseHandler(L)}t(2,a=!1)}}function d(L={}){t(0,o={meta:(L==null?void 0:L.meta)||{},smtp:(L==null?void 0:L.smtp)||{}}),t(7,u=JSON.stringify(o))}function p(){o.meta.senderName=this.value,t(0,o)}function g(){o.meta.senderAddress=this.value,t(0,o)}function v(){o.meta.userVerificationUrl=this.value,t(0,o)}function b(){o.meta.userResetPasswordUrl=this.value,t(0,o)}function y(){o.meta.userConfirmEmailChangeUrl=this.value,t(0,o)}function C(){o.smtp.enabled=this.checked,t(0,o)}function $(){o.smtp.host=this.value,t(0,o)}function S(){o.smtp.port=Ot(this.value),t(0,o)}function M(L){n.$$.not_equal(o.smtp.tls,L)&&(o.smtp.tls=L,t(0,o))}function D(){o.smtp.username=this.value,t(0,o)}function E(L){n.$$.not_equal(o.smtp.password,L)&&(o.smtp.password=L,t(0,o))}const O=()=>c(),F=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(3,i=u!=JSON.stringify(o))},[o,r,a,i,s,l,c,u,p,g,v,b,y,C,$,S,M,D,E,O,F]}class QT extends Pe{constructor(e){super(),Ae(this,e,XT,GT,Ee,{})}}function xT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;e=new Le({props:{class:"form-field form-field-toggle",$$slots:{default:[tD,({uniqueId:b})=>({19:b}),({uniqueId:b})=>b?524288:0]},$$scope:{ctx:n}}});let g=n[3]!=n[0].enabled&&Mp(n),v=n[0].enabled&&Tp(n);return{c(){z(e.$$.fragment),t=T(),g&&g.c(),i=T(),v&&v.c(),s=T(),l=_("div"),o=_("div"),r=T(),a=_("button"),u=_("span"),u.textContent="Save changes",h(o,"class","flex-fill"),h(u,"class","txt"),h(a,"type","submit"),h(a,"class","btn btn-expanded"),a.disabled=f=!n[4]||n[2],ee(a,"btn-loading",n[2]),h(l,"class","flex")},m(b,y){q(e,b,y),w(b,t,y),g&&g.m(b,y),w(b,i,y),v&&v.m(b,y),w(b,s,y),w(b,l,y),m(l,o),m(l,r),m(l,a),m(a,u),c=!0,d||(p=X(a,"click",n[15]),d=!0)},p(b,y){const C={};y&1572865&&(C.$$scope={dirty:y,ctx:b}),e.$set(C),b[3]!=b[0].enabled?g?(g.p(b,y),y&9&&A(g,1)):(g=Mp(b),g.c(),A(g,1),g.m(i.parentNode,i)):g&&(De(),P(g,1,1,()=>{g=null}),Oe()),b[0].enabled?v?(v.p(b,y),y&1&&A(v,1)):(v=Tp(b),v.c(),A(v,1),v.m(s.parentNode,s)):v&&(De(),P(v,1,1,()=>{v=null}),Oe()),(!c||y&20&&f!==(f=!b[4]||b[2]))&&(a.disabled=f),y&4&&ee(a,"btn-loading",b[2])},i(b){c||(A(e.$$.fragment,b),A(g),A(v),c=!0)},o(b){P(e.$$.fragment,b),P(g),P(v),c=!1},d(b){V(e,b),b&&k(t),g&&g.d(b),b&&k(i),v&&v.d(b),b&&k(s),b&&k(l),d=!1,p()}}}function eD(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function tD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Use S3 storage"),h(e,"type","checkbox"),h(e,"id",t=n[19]),e.required=!0,h(s,"for",o=n[19])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[8]),r=!0)},p(u,f){f&524288&&t!==(t=u[19])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&524288&&o!==(o=u[19])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Mp(n){let e,t,i,s,l,o,r,a=n[3]?"S3 storage":"local file system",u,f,c,d=n[0].enabled?"S3 storage":"local file system",p,g,v,b,y,C,$,S,M,D,E,O;return{c(){e=_("div"),t=_("div"),i=_("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=T(),l=_("div"),o=R(`If you have existing uploaded files, you'll have to migrate them manually from
|
||
the
|
||
`),r=_("strong"),u=R(a),f=R(`
|
||
to the
|
||
`),c=_("strong"),p=R(d),g=R(`.
|
||
`),v=_("br"),b=R(`
|
||
There are numerous command line tools that can help you, such as:
|
||
`),y=_("a"),y.textContent=`rclone
|
||
`,C=R(`,
|
||
`),$=_("a"),$.textContent=`s5cmd
|
||
`,S=R(", etc."),M=T(),D=_("div"),h(i,"class","icon"),h(y,"href","https://github.com/rclone/rclone"),h(y,"target","_blank"),h(y,"rel","noopener"),h(y,"class","txt-bold"),h($,"href","https://github.com/peak/s5cmd"),h($,"target","_blank"),h($,"rel","noopener"),h($,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(D,"class","clearfix m-t-base")},m(F,L){w(F,e,L),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,p),m(l,g),m(l,v),m(l,b),m(l,y),m(l,C),m(l,$),m(l,S),m(e,M),m(e,D),O=!0},p(F,L){(!O||L&8)&&a!==(a=F[3]?"S3 storage":"local file system")&&me(u,a),(!O||L&1)&&d!==(d=F[0].enabled?"S3 storage":"local file system")&&me(p,d)},i(F){O||(F&&Dt(()=>{E||(E=ut(e,xt,{duration:150},!0)),E.run(1)}),O=!0)},o(F){F&&(E||(E=ut(e,xt,{duration:150},!1)),E.run(0)),O=!1},d(F){F&&k(e),F&&E&&E.end()}}}function Tp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D;return i=new Le({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[nD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[iD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field required",name:"s3.region",$$slots:{default:[sD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[lD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),v=new Le({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[oD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),C=new Le({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[rD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),z(C.$$.fragment),$=T(),S=_("div"),h(t,"class","col-lg-12"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(S,"class","col-lg-12"),h(e,"class","grid")},m(E,O){w(E,e,O),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),q(C,y,null),m(e,$),m(e,S),D=!0},p(E,O){const F={};O&1572865&&(F.$$scope={dirty:O,ctx:E}),i.$set(F);const L={};O&1572865&&(L.$$scope={dirty:O,ctx:E}),o.$set(L);const H={};O&1572865&&(H.$$scope={dirty:O,ctx:E}),u.$set(H);const j={};O&1572865&&(j.$$scope={dirty:O,ctx:E}),d.$set(j);const Q={};O&1572865&&(Q.$$scope={dirty:O,ctx:E}),v.$set(Q);const ne={};O&1572865&&(ne.$$scope={dirty:O,ctx:E}),C.$set(ne)},i(E){D||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(u.$$.fragment,E),A(d.$$.fragment,E),A(v.$$.fragment,E),A(C.$$.fragment,E),E&&Dt(()=>{M||(M=ut(e,xt,{duration:150},!0)),M.run(1)}),D=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(d.$$.fragment,E),P(v.$$.fragment,E),P(C.$$.fragment,E),E&&(M||(M=ut(e,xt,{duration:150},!1)),M.run(0)),D=!1},d(E){E&&k(e),V(i),V(o),V(u),V(d),V(v),V(C),E&&M&&M.end()}}}function nD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Endpoint"),s=T(),l=_("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].endpoint),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].endpoint&&Ce(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function iD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Bucket"),s=T(),l=_("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].bucket),r||(a=X(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].bucket&&Ce(l,u[0].bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function sD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Region"),s=T(),l=_("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].region),r||(a=X(l,"input",n[11]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].region&&Ce(l,u[0].region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function lD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Access key"),s=T(),l=_("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].accessKey),r||(a=X(l,"input",n[12]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].accessKey&&Ce(l,u[0].accessKey)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function oD(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[19],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new Wa({props:u}),he.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Secret"),s=T(),z(l.$$.fragment),h(e,"for",i=n[19])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&524288&&i!==(i=f[19]))&&h(e,"for",i);const d={};c&524288&&(d.id=f[19]),!o&&c&1&&(o=!0,d.value=f[0].secret,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function rD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=T(),s=_("label"),l=_("span"),l.textContent="Force path-style addressing",o=T(),r=_("i"),h(e,"type","checkbox"),h(e,"id",t=n[19]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),m(s,l),m(s,o),m(s,r),u||(f=[X(e,"change",n[14]),Qe(Ct.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&524288&&t!==(t=c[19])&&h(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&524288&&a!==(a=c[19])&&h(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,st(f)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$;e=new As({});const S=[eD,xT],M=[];function D(E,O){return E[1]?0:1}return v=D(n),b=M[v]=S[v](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Settings",r=T(),a=_("div"),u=R(n[5]),f=T(),c=_("div"),d=_("form"),p=_("div"),p.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
|
||
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,g=T(),b.c(),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(s,"class","page-header"),h(p,"class","content txt-xl m-b-base"),h(d,"class","panel"),h(d,"autocomplete","off"),h(c,"class","wrapper"),h(i,"class","page-wrapper")},m(E,O){q(e,E,O),w(E,t,O),w(E,i,O),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,u),m(i,f),m(i,c),m(c,d),m(d,p),m(d,g),M[v].m(d,null),y=!0,C||($=X(d,"submit",Bt(n[16])),C=!0)},p(E,[O]){(!y||O&32)&&me(u,E[5]);let F=v;v=D(E),v===F?M[v].p(E,O):(De(),P(M[F],1,1,()=>{M[F]=null}),Oe(),b=M[v],b?b.p(E,O):(b=M[v]=S[v](E),b.c()),A(b,1),b.m(d,null))},i(E){y||(A(e.$$.fragment,E),A(b),y=!0)},o(E){P(e.$$.fragment,E),P(b),y=!1},d(E){V(e,E),E&&k(t),E&&k(i),M[v].d(),C=!1,$()}}}function uD(n,e,t){let i,s;At(n,Zt,D=>t(5,s=D)),bn(Zt,s="Files storage",s);let l={},o=!1,r=!1,a="",u=!1;f();async function f(){t(1,o=!0);try{const D=await we.Settings.getAll()||{};d(D)}catch(D){we.errorResponseHandler(D)}t(1,o=!1)}async function c(){if(!(r||!i)){t(2,r=!0);try{const D=await we.Settings.update(Y.filterRedactedProps({s3:l}));d(D),Ii({}),hn("Successfully saved Files storage settings.")}catch(D){we.errorResponseHandler(D)}t(2,r=!1)}}function d(D={}){t(0,l=(D==null?void 0:D.s3)||{}),t(3,u=l.enabled),t(7,a=JSON.stringify(l))}function p(){l.enabled=this.checked,t(0,l)}function g(){l.endpoint=this.value,t(0,l)}function v(){l.bucket=this.value,t(0,l)}function b(){l.region=this.value,t(0,l)}function y(){l.accessKey=this.value,t(0,l)}function C(D){n.$$.not_equal(l.secret,D)&&(l.secret=D,t(0,l))}function $(){l.forcePathStyle=this.checked,t(0,l)}const S=()=>c(),M=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(4,i=a!=JSON.stringify(l))},[l,o,r,u,i,s,c,a,p,g,v,b,y,C,$,S,M]}class fD extends Pe{constructor(e){super(),Ae(this,e,uD,aD,Ee,{})}}function cD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[16]),h(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Dp(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Le({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[dD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Le({props:{class:"form-field "+(Y.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[hD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field "+(Y.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[pD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-12 m-t-sm"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(e,"class","grid")},m(d,p){w(d,e,p),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),c=!0},p(d,p){const g={};p&196609&&(g.$$scope={dirty:p,ctx:d}),i.$set(g);const v={};p&1&&(v.class="form-field "+(Y.isEmpty(d[0].onlyDomains)?"":"disabled")),p&196609&&(v.$$scope={dirty:p,ctx:d}),o.$set(v);const b={};p&1&&(b.class="form-field "+(Y.isEmpty(d[0].exceptDomains)?"":"disabled")),p&196609&&(b.$$scope={dirty:p,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Dt(()=>{f||(f=ut(e,xt,{duration:150},!0)),f.run(1)}),c=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),d&&(f||(f=ut(e,xt,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),V(i),V(o),V(u),d&&f&&f.end()}}}function dD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Minimum password length"),s=T(),l=_("input"),h(e,"for",i=n[16]),h(l,"type","number"),h(l,"id",o=n[16]),l.required=!0,h(l,"min","5"),h(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].minPasswordLength),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&65536&&i!==(i=u[16])&&h(e,"for",i),f&65536&&o!==(o=u[16])&&h(l,"id",o),f&1&&Ot(l.value)!==u[0].minPasswordLength&&Ce(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function hD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[10](b)}let v={id:n[16],disabled:!Y.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.call(null,s,{text:`Email domains that are NOT allowed to sign up.
|
||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&h(e,"for",l);const C={};y&65536&&(C.id=b[16]),y&1&&(C.disabled=!Y.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function pD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!Y.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new as({props:v}),he.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]+".config.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=Qe(Ct.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
|
||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&h(e,"for",l);const C={};y&65536&&(C.id=b[16]+".config.onlyDomains"),y&1&&(C.disabled=!Y.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function mD(n){let e,t,i,s;e=new Le({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[cD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Dp(n);return{c(){z(e.$$.fragment),t=T(),l&&l.c(),i=rt()},m(o,r){q(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Dp(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(De(),P(l,1,1,()=>{l=null}),Oe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function gD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _D(n){let e;return{c(){e=_("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Op(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Qe(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=ut(e,zn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ut(e,zn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function bD(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].enabled?_D:gD}let u=a(n),f=u(n),c=n[2]&&Op();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||
<span class="txt">Email/Password</span>`,t=T(),f.c(),i=T(),s=_("div"),l=T(),c&&c.c(),o=rt(),h(e,"class","inline-flex"),h(s,"class","flex-fill")},m(d,p){w(d,e,p),w(d,t,p),f.m(d,p),w(d,i,p),w(d,s,p),w(d,l,p),c&&c.m(d,p),w(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?p&4&&A(c,1):(c=Op(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(De(),P(c,1,1,()=>{c=null}),Oe())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function vD(n){let e,t;const i=[n[3]];let s={$$slots:{header:[bD],default:[mD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=pt(s,i[l]);return e=new za({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){z(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&8?pn(i,[ui(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function yD(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Kt(e,s),o;At(n,ss,S=>t(7,o=S));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function p(){r.minPasswordLength=Ot(this.value),t(0,r)}function g(S){n.$$.not_equal(r.exceptDomains,S)&&(r.exceptDomains=S,t(0,r))}function v(S){n.$$.not_equal(r.onlyDomains,S)&&(r.onlyDomains=S,t(0,r))}function b(S){he[S?"unshift":"push"](()=>{a=S,t(1,a)})}function y(S){ht.call(this,n,S)}function C(S){ht.call(this,n,S)}function $(S){ht.call(this,n,S)}return n.$$set=S=>{e=pt(pt({},e),ri(S)),t(3,l=Kt(e,s)),"config"in S&&t(0,r=S.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!Y.isEmpty(o==null?void 0:o.emailPassword))},[r,a,i,l,u,f,c,o,d,p,g,v,b,y,C,$]}class kD extends Pe{constructor(e){super(),Ae(this,e,yD,vD,Ee,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function wD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[22]),h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Ep(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;l=new Le({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[SD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Le({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[$D,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Le({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[CD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Ap(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),z(l.$$.fragment),o=T(),r=_("div"),z(a.$$.fragment),u=T(),f=_("div"),z(c.$$.fragment),d=T(),v&&v.c(),h(t,"class","col-12 spacing"),h(s,"class","col-lg-6"),h(r,"class","col-lg-6"),h(f,"class","col-lg-12"),h(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),q(l,s,null),m(e,o),m(e,r),q(a,r,null),m(e,u),m(e,f),q(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const C={};y&2&&(C.name=b[1]+".clientId"),y&12582913&&(C.$$scope={dirty:y,ctx:b}),l.$set(C);const $={};y&2&&($.name=b[1]+".clientSecret"),y&12582913&&($.$$scope={dirty:y,ctx:b}),a.$set($);const S={};y&2&&(S.name=b[1]+".allowRegistrations"),y&12582913&&(S.$$scope={dirty:y,ctx:b}),c.$set(S),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=Ap(b),v.c(),A(v,1),v.m(e,null)):v&&(De(),P(v,1,1,()=>{v=null}),Oe())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Dt(()=>{p||(p=ut(e,xt,{duration:200},!0)),p.run(1)}),g=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(p||(p=ut(e,xt,{duration:200},!1)),p.run(0)),g=!1},d(b){b&&k(e),V(l),V(a),V(c),v&&v.d(),b&&p&&p.end()}}}function SD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Client ID"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].clientId),r||(a=X(l,"input",n[12]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].clientId&&Ce(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function $D(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[22],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new Wa({props:u}),he.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Client Secret"),s=T(),z(l.$$.fragment),h(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4194304&&i!==(i=f[22]))&&h(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,He(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function CD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Allow registration for new users"),h(e,"type","checkbox"),h(e,"id",t=n[22]),h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].allowRegistrations,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[14]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].allowRegistrations),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Ap(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return o=new Le({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[MD,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),u=new Le({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[TD,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),d=new Le({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[DD,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),t.textContent="Optional endpoints (if you self host the OAUTH2 service)",i=T(),s=_("div"),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),h(t,"class","section-title"),h(l,"class","col-lg-4"),h(a,"class","col-lg-4"),h(c,"class","col-lg-4"),h(s,"class","grid"),h(e,"class","col-lg-12")},m(g,v){w(g,e,v),m(e,t),m(e,i),m(e,s),m(s,l),q(o,l,null),m(s,r),m(s,a),q(u,a,null),m(s,f),m(s,c),q(d,c,null),p=!0},p(g,v){const b={};v&2&&(b.name=g[1]+".authUrl"),v&12582913&&(b.$$scope={dirty:v,ctx:g}),o.$set(b);const y={};v&2&&(y.name=g[1]+".tokenUrl"),v&12582913&&(y.$$scope={dirty:v,ctx:g}),u.$set(y);const C={};v&2&&(C.name=g[1]+".userApiUrl"),v&12582913&&(C.$$scope={dirty:v,ctx:g}),d.$set(C)},i(g){p||(A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),p=!0)},o(g){P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),p=!1},d(g){g&&k(e),V(o),V(u),V(d)}}}function MD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Custom Auth URL"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","url"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].authUrl),r||(a=X(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&Ce(l,u[0].authUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Custom Token URL"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].tokenUrl),r||(a=X(l,"input",n[16]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&Ce(l,u[0].tokenUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function DD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Custom User API URL"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].userApiUrl),r||(a=X(l,"input",n[17]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&Ce(l,u[0].userApiUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function OD(n){let e,t,i,s;e=new Le({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[wD,({uniqueId:o})=>({22:o}),({uniqueId:o})=>o?4194304:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Ep(n);return{c(){z(e.$$.fragment),t=T(),l&&l.c(),i=rt()},m(o,r){q(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&2&&(a.name=o[1]+".enabled"),r&12582913&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Ep(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(De(),P(l,1,1,()=>{l=null}),Oe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function Pp(n){let e;return{c(){e=_("i"),h(e,"class",n[3])},m(t,i){w(t,e,i)},p(t,i){i&8&&h(e,"class",t[3])},d(t){t&&k(e)}}}function ED(n){let e;return{c(){e=_("span"),e.textContent="Disabled",h(e,"class","label label-hint")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function AD(n){let e;return{c(){e=_("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Lp(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Qe(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=ut(e,zn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ut(e,zn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function PD(n){let e,t,i,s,l,o,r,a,u,f,c=n[3]&&Pp(n);function d(b,y){return b[0].enabled?AD:ED}let p=d(n),g=p(n),v=n[6]&&Lp();return{c(){e=_("div"),c&&c.c(),t=T(),i=_("span"),s=R(n[2]),l=T(),g.c(),o=T(),r=_("div"),a=T(),v&&v.c(),u=rt(),h(i,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(b,y){w(b,e,y),c&&c.m(e,null),m(e,t),m(e,i),m(i,s),w(b,l,y),g.m(b,y),w(b,o,y),w(b,r,y),w(b,a,y),v&&v.m(b,y),w(b,u,y),f=!0},p(b,y){b[3]?c?c.p(b,y):(c=Pp(b),c.c(),c.m(e,t)):c&&(c.d(1),c=null),(!f||y&4)&&me(s,b[2]),p!==(p=d(b))&&(g.d(1),g=p(b),g&&(g.c(),g.m(o.parentNode,o))),b[6]?v?y&64&&A(v,1):(v=Lp(),v.c(),A(v,1),v.m(u.parentNode,u)):v&&(De(),P(v,1,1,()=>{v=null}),Oe())},i(b){f||(A(v),f=!0)},o(b){P(v),f=!1},d(b){b&&k(e),c&&c.d(),b&&k(l),g.d(b),b&&k(o),b&&k(r),b&&k(a),v&&v.d(b),b&&k(u)}}}function LD(n){let e,t;const i=[n[7]];let s={$$slots:{header:[PD],default:[OD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=pt(s,i[l]);return e=new za({props:s}),n[18](e),e.$on("expand",n[19]),e.$on("collapse",n[20]),e.$on("toggle",n[21]),{c(){z(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&128?pn(i,[ui(l[7])]):{};o&8388703&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[18](null),V(e,l)}}}function FD(n,e,t){let i;const s=["key","title","icon","config","showSelfHostedFields","expand","collapse"];let l=Kt(e,s),o;At(n,ss,L=>t(10,o=L));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{showSelfHostedFields:c=!1}=e,d;function p(){d==null||d.expand()}function g(){d==null||d.collapse()}function v(){f.enabled=this.checked,t(0,f)}function b(){f.clientId=this.value,t(0,f)}function y(L){n.$$.not_equal(f.clientSecret,L)&&(f.clientSecret=L,t(0,f))}function C(){f.allowRegistrations=this.checked,t(0,f)}function $(){f.authUrl=this.value,t(0,f)}function S(){f.tokenUrl=this.value,t(0,f)}function M(){f.userApiUrl=this.value,t(0,f)}function D(L){he[L?"unshift":"push"](()=>{d=L,t(5,d)})}function E(L){ht.call(this,n,L)}function O(L){ht.call(this,n,L)}function F(L){ht.call(this,n,L)}return n.$$set=L=>{e=pt(pt({},e),ri(L)),t(7,l=Kt(e,s)),"key"in L&&t(1,r=L.key),"title"in L&&t(2,a=L.title),"icon"in L&&t(3,u=L.icon),"config"in L&&t(0,f=L.config),"showSelfHostedFields"in L&&t(4,c=L.showSelfHostedFields)},n.$$.update=()=>{n.$$.dirty&1026&&t(6,i=!Y.isEmpty(Y.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||ug(r))},[f,r,a,u,c,d,i,l,p,g,o,v,b,y,C,$,S,M,D,E,O,F]}class to extends Pe{constructor(e){super(),Ae(this,e,FD,LD,Ee,{key:1,title:2,icon:3,config:0,showSelfHostedFields:4,expand:8,collapse:9})}get expand(){return this.$$.ctx[8]}get collapse(){return this.$$.ctx[9]}}function ID(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S,M,D,E,O,F;function L(fe){n[9](fe)}let H={single:!0};n[0].emailAuth!==void 0&&(H.config=n[0].emailAuth),t=new kD({props:H}),n[8](t),he.push(()=>Ie(t,"config",L));function j(fe){n[10](fe)}let Q={single:!0,key:"googleAuth",title:"Google",icon:"ri-google-line"};n[0].googleAuth!==void 0&&(Q.config=n[0].googleAuth),l=new to({props:Q}),he.push(()=>Ie(l,"config",j));function ne(fe){n[11](fe)}let B={single:!0,key:"facebookAuth",title:"Facebook",icon:"ri-facebook-line"};n[0].facebookAuth!==void 0&&(B.config=n[0].facebookAuth),a=new to({props:B}),he.push(()=>Ie(a,"config",ne));function K(fe){n[12](fe)}let W={single:!0,key:"githubAuth",title:"GitHub",icon:"ri-github-line"};n[0].githubAuth!==void 0&&(W.config=n[0].githubAuth),c=new to({props:W}),he.push(()=>Ie(c,"config",K));function J(fe){n[13](fe)}let ie={single:!0,key:"gitlabAuth",title:"GitLab",icon:"ri-gitlab-line",showSelfHostedFields:!0};return n[0].gitlabAuth!==void 0&&(ie.config=n[0].gitlabAuth),g=new to({props:ie}),he.push(()=>Ie(g,"config",J)),{c(){e=_("div"),z(t.$$.fragment),s=T(),z(l.$$.fragment),r=T(),z(a.$$.fragment),f=T(),z(c.$$.fragment),p=T(),z(g.$$.fragment),b=T(),y=_("div"),C=_("div"),$=T(),S=_("button"),M=_("span"),M.textContent="Save changes",h(e,"class","accordions"),h(C,"class","flex-fill"),h(M,"class","txt"),h(S,"type","submit"),h(S,"class","btn btn-expanded"),S.disabled=D=!n[4]||n[3],ee(S,"btn-loading",n[3]),h(y,"class","flex m-t-base")},m(fe,ye){w(fe,e,ye),q(t,e,null),m(e,s),q(l,e,null),m(e,r),q(a,e,null),m(e,f),q(c,e,null),m(e,p),q(g,e,null),w(fe,b,ye),w(fe,y,ye),m(y,C),m(y,$),m(y,S),m(S,M),E=!0,O||(F=X(S,"click",n[14]),O=!0)},p(fe,ye){const le={};!i&&ye&1&&(i=!0,le.config=fe[0].emailAuth,He(()=>i=!1)),t.$set(le);const ue={};!o&&ye&1&&(o=!0,ue.config=fe[0].googleAuth,He(()=>o=!1)),l.$set(ue);const Te={};!u&&ye&1&&(u=!0,Te.config=fe[0].facebookAuth,He(()=>u=!1)),a.$set(Te);const Z={};!d&&ye&1&&(d=!0,Z.config=fe[0].githubAuth,He(()=>d=!1)),c.$set(Z);const be={};!v&&ye&1&&(v=!0,be.config=fe[0].gitlabAuth,He(()=>v=!1)),g.$set(be),(!E||ye&24&&D!==(D=!fe[4]||fe[3]))&&(S.disabled=D),ye&8&&ee(S,"btn-loading",fe[3])},i(fe){E||(A(t.$$.fragment,fe),A(l.$$.fragment,fe),A(a.$$.fragment,fe),A(c.$$.fragment,fe),A(g.$$.fragment,fe),E=!0)},o(fe){P(t.$$.fragment,fe),P(l.$$.fragment,fe),P(a.$$.fragment,fe),P(c.$$.fragment,fe),P(g.$$.fragment,fe),E=!1},d(fe){fe&&k(e),n[8](null),V(t),V(l),V(a),V(c),V(g),fe&&k(b),fe&&k(y),O=!1,F()}}}function ND(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$;e=new As({});const S=[ND,ID],M=[];function D(E,O){return E[2]?0:1}return v=D(n),b=M[v]=S[v](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Settings",r=T(),a=_("div"),u=R(n[5]),f=T(),c=_("div"),d=_("form"),p=_("h6"),p.textContent="Manage the allowed users sign-in/sign-up methods.",g=T(),b.c(),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(s,"class","page-header"),h(p,"class","m-b-base"),h(d,"class","panel"),h(d,"autocomplete","off"),h(c,"class","wrapper"),h(i,"class","page-wrapper")},m(E,O){q(e,E,O),w(E,t,O),w(E,i,O),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,u),m(i,f),m(i,c),m(c,d),m(d,p),m(d,g),M[v].m(d,null),y=!0,C||($=X(d,"submit",Bt(n[6])),C=!0)},p(E,[O]){(!y||O&32)&&me(u,E[5]);let F=v;v=D(E),v===F?M[v].p(E,O):(De(),P(M[F],1,1,()=>{M[F]=null}),Oe(),b=M[v],b?b.p(E,O):(b=M[v]=S[v](E),b.c()),A(b,1),b.m(d,null))},i(E){y||(A(e.$$.fragment,E),A(b),y=!0)},o(E){P(e.$$.fragment,E),P(b),y=!1},d(E){V(e,E),E&&k(t),E&&k(i),M[v].d(),C=!1,$()}}}function HD(n,e,t){let i,s;At(n,Zt,S=>t(5,s=S)),bn(Zt,s="Auth providers",s);let l,o={},r=!1,a=!1,u="";f();async function f(){t(2,r=!0);try{const S=await we.Settings.getAll()||{};d(S)}catch(S){we.errorResponseHandler(S)}t(2,r=!1)}async function c(){if(!(a||!i)){t(3,a=!0);try{const S=await we.Settings.update(Y.filterRedactedProps(o));d(S),Ii({}),l==null||l.collapseSiblings(),hn("Successfully updated auth providers.")}catch(S){we.errorResponseHandler(S)}t(3,a=!1)}}function d(S){S=S||{},t(0,o={}),t(0,o.emailAuth=Object.assign({enabled:!0},S.emailAuth),o);const M=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const D of M)t(0,o[D]=Object.assign({enabled:!1,allowRegistrations:!0},S[D]),o);t(7,u=JSON.stringify(o))}function p(S){he[S?"unshift":"push"](()=>{l=S,t(1,l)})}function g(S){n.$$.not_equal(o.emailAuth,S)&&(o.emailAuth=S,t(0,o))}function v(S){n.$$.not_equal(o.googleAuth,S)&&(o.googleAuth=S,t(0,o))}function b(S){n.$$.not_equal(o.facebookAuth,S)&&(o.facebookAuth=S,t(0,o))}function y(S){n.$$.not_equal(o.githubAuth,S)&&(o.githubAuth=S,t(0,o))}function C(S){n.$$.not_equal(o.gitlabAuth,S)&&(o.gitlabAuth=S,t(0,o))}const $=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(4,i=u!=JSON.stringify(o))},[o,l,r,a,i,s,c,u,p,g,v,b,y,C,$]}class jD extends Pe{constructor(e){super(),Ae(this,e,HD,RD,Ee,{})}}function Fp(n,e,t){const i=n.slice();return i[13]=e[t],i[14]=e,i[15]=t,i}function qD(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,p=n[5];const g=v=>v[13].key;for(let v=0;v<p.length;v+=1){let b=Fp(n,p,v),y=g(b);t.set(y,e[v]=Ip(y,b))}return{c(){for(let v=0;v<e.length;v+=1)e[v].c();i=T(),s=_("div"),l=_("div"),o=T(),r=_("button"),a=_("span"),a.textContent="Save changes",h(l,"class","flex-fill"),h(a,"class","txt"),h(r,"type","submit"),h(r,"class","btn btn-expanded"),r.disabled=u=!n[3]||n[2],ee(r,"btn-loading",n[2]),h(s,"class","flex")},m(v,b){for(let y=0;y<e.length;y+=1)e[y].m(v,b);w(v,i,b),w(v,s,b),m(s,l),m(s,o),m(s,r),m(r,a),f=!0,c||(d=X(r,"click",n[10]),c=!0)},p(v,b){b&65569&&(p=v[5],De(),e=ft(e,b,g,1,v,p,t,i.parentNode,Nt,Ip,i,Fp),Oe()),(!f||b&12&&u!==(u=!v[3]||v[2]))&&(r.disabled=u),b&4&&ee(r,"btn-loading",v[2])},i(v){if(!f){for(let b=0;b<p.length;b+=1)A(e[b]);f=!0}},o(v){for(let b=0;b<e.length;b+=1)P(e[b]);f=!1},d(v){for(let b=0;b<e.length;b+=1)e[b].d(v);v&&k(i),v&&k(s),c=!1,d()}}}function VD(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function zD(n){let e,t=n[13].label+"",i,s,l,o,r,a,u,f,c,d,p;function g(){n[8].call(r,n[13])}function v(){return n[9](n[13])}return{c(){e=_("label"),i=R(t),s=R(" duration (in seconds)"),o=T(),r=_("input"),u=T(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",h(e,"for",l=n[16]),h(r,"type","number"),h(r,"id",a=n[16]),r.required=!0,h(c,"class","link-primary"),ee(c,"txt-success",n[0][n[13].key].secret),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,i),m(e,s),w(b,o,y),w(b,r,y),Ce(r,n[0][n[13].key].duration),w(b,u,y),w(b,f,y),m(f,c),d||(p=[X(r,"input",g),X(c,"click",v)],d=!0)},p(b,y){n=b,y&65536&&l!==(l=n[16])&&h(e,"for",l),y&65536&&a!==(a=n[16])&&h(r,"id",a),y&33&&Ot(r.value)!==n[0][n[13].key].duration&&Ce(r,n[0][n[13].key].duration),y&33&&ee(c,"txt-success",n[0][n[13].key].secret)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(u),b&&k(f),d=!1,st(p)}}}function Ip(n,e){let t,i,s;return i=new Le({props:{class:"form-field required",name:e[13].key+".duration",$$slots:{default:[zD,({uniqueId:l})=>({16:l}),({uniqueId:l})=>l?65536:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=rt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&196609&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function BD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$;e=new As({});const S=[VD,qD],M=[];function D(E,O){return E[1]?0:1}return v=D(n),b=M[v]=S[v](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Settings",r=T(),a=_("div"),u=R(n[4]),f=T(),c=_("div"),d=_("form"),p=_("div"),p.innerHTML="<p>Adjust common token options.</p>",g=T(),b.c(),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(s,"class","page-header"),h(p,"class","content m-b-sm txt-xl"),h(d,"class","panel"),h(d,"autocomplete","off"),h(c,"class","wrapper"),h(i,"class","page-wrapper")},m(E,O){q(e,E,O),w(E,t,O),w(E,i,O),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,u),m(i,f),m(i,c),m(c,d),m(d,p),m(d,g),M[v].m(d,null),y=!0,C||($=X(d,"submit",Bt(n[6])),C=!0)},p(E,[O]){(!y||O&16)&&me(u,E[4]);let F=v;v=D(E),v===F?M[v].p(E,O):(De(),P(M[F],1,1,()=>{M[F]=null}),Oe(),b=M[v],b?b.p(E,O):(b=M[v]=S[v](E),b.c()),A(b,1),b.m(d,null))},i(E){y||(A(e.$$.fragment,E),A(b),y=!0)},o(E){P(e.$$.fragment,E),P(b),y=!1},d(E){V(e,E),E&&k(t),E&&k(i),M[v].d(),C=!1,$()}}}function UD(n,e,t){let i,s;At(n,Zt,b=>t(4,s=b));const l=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];bn(Zt,s="Token options",s);let o={},r=!1,a=!1,u="";f();async function f(){t(1,r=!0);try{const b=await we.Settings.getAll()||{};d(b)}catch(b){we.errorResponseHandler(b)}t(1,r=!1)}async function c(){if(!(a||!i)){t(2,a=!0);try{const b=await we.Settings.update(Y.filterRedactedProps(o));d(b),hn("Successfully saved tokens options.")}catch(b){we.errorResponseHandler(b)}t(2,a=!1)}}function d(b){var y;b=b||{},t(0,o={});for(const C of l)t(0,o[C.key]={duration:((y=b[C.key])==null?void 0:y.duration)||0},o);t(7,u=JSON.stringify(o))}function p(b){o[b.key].duration=Ot(this.value),t(0,o)}const g=b=>{o[b.key].secret?(delete o[b.key].secret,t(0,o)):t(0,o[b.key].secret=Y.randomString(50),o)},v=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(3,i=u!=JSON.stringify(o))},[o,r,a,i,s,l,c,u,p,g,v]}class WD extends Pe{constructor(e){super(),Ae(this,e,UD,BD,Ee,{})}}const cn=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ms("/"):!0}],YD={"/login":sn({component:$T,conditions:cn.concat([n=>!we.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":sn({asyncComponent:()=>Ji(()=>import("./PageAdminRequestPasswordReset.907c665f.js"),[]),conditions:cn.concat([n=>!we.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":sn({asyncComponent:()=>Ji(()=>import("./PageAdminConfirmPasswordReset.c754d829.js"),[]),conditions:cn.concat([n=>!we.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":sn({component:MM,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":sn({component:Nw,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users":sn({component:GM,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":sn({asyncComponent:()=>Ji(()=>import("./PageUserConfirmPasswordReset.08a62de8.js"),[]),conditions:cn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":sn({asyncComponent:()=>Ji(()=>import("./PageUserConfirmVerification.0773c75a.js"),[]),conditions:cn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":sn({asyncComponent:()=>Ji(()=>import("./PageUserConfirmEmailChange.5632ba17.js"),[]),conditions:cn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/settings":sn({component:PT,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":sn({component:bT,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":sn({component:QT,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":sn({component:fD,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":sn({component:jD,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":sn({component:WD,conditions:cn.concat([n=>we.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"*":sn({component:f1,userData:{showAppSidebar:!1}})};function KD(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=p=>Math.sqrt(p)*120,easing:d=qo}=i;return{delay:f,duration:Wn(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(p,g)=>{const v=g*a,b=g*u,y=p+g*e.width/t.width,C=p+g*e.height/t.height;return`transform: ${l} translate(${v}px, ${b}px) scale(${y}, ${C});`}}}function Np(n,e,t){const i=n.slice();return i[2]=e[t],i}function ZD(n){let e;return{c(){e=_("i"),h(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function JD(n){let e;return{c(){e=_("i"),h(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function GD(n){let e;return{c(){e=_("i"),h(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Rp(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,p=oe,g,v,b;function y(M,D){return M[2].type==="info"?GD:M[2].type==="success"?JD:ZD}let C=y(e),$=C(e);function S(){return e[1](e[2])}return{key:n,first:null,c(){t=_("div"),i=_("div"),$.c(),s=T(),l=_("div"),r=R(o),a=T(),u=_("div"),u.innerHTML='<i class="ri-close-line"></i>',f=T(),h(i,"class","icon"),h(l,"class","content"),h(u,"class","close"),h(t,"class","alert txt-break"),ee(t,"alert-info",e[2].type=="info"),ee(t,"alert-success",e[2].type=="success"),ee(t,"alert-danger",e[2].type=="error"),ee(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,D){w(M,t,D),m(t,i),$.m(i,null),m(t,s),m(t,l),m(l,r),m(t,a),m(t,u),m(t,f),g=!0,v||(b=X(u,"click",Bt(S)),v=!0)},p(M,D){e=M,C!==(C=y(e))&&($.d(1),$=C(e),$&&($.c(),$.m(i,null))),(!g||D&1)&&o!==(o=e[2].message+"")&&me(r,o),D&1&&ee(t,"alert-info",e[2].type=="info"),D&1&&ee(t,"alert-success",e[2].type=="success"),D&1&&ee(t,"alert-danger",e[2].type=="error"),D&1&&ee(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){M_(t),p(),Kp(t,d)},a(){p(),p=C_(t,d,KD,{duration:150})},i(M){g||(Dt(()=>{c||(c=ut(t,bo,{duration:150},!0)),c.run(1)}),g=!0)},o(M){c||(c=ut(t,bo,{duration:150},!1)),c.run(0),g=!1},d(M){M&&k(t),$.d(),M&&c&&c.end(),v=!1,b()}}}function XD(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;r<l.length;r+=1){let a=Np(n,l,r),u=o(a);i.set(u,t[r]=Rp(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","toasts-wrapper")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,[a]){if(a&1){l=r[0],De();for(let u=0;u<t.length;u+=1)t[u].r();t=ft(t,a,o,1,r,l,i,e,E_,Rp,null,Np);for(let u=0;u<t.length;u+=1)t[u].a();Oe()}},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function QD(n,e,t){let i;return At(n,_a,l=>t(0,i=l)),[i,l=>rg(l)]}class xD extends Pe{constructor(e){super(),Ae(this,e,QD,XD,Ee,{})}}function eO(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=_("h4"),i=R(t),h(e,"class","block center txt-break"),h(e,"slot","header")},m(l,o){w(l,e,o),m(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&me(i,t)},d(l){l&&k(e)}}}function tO(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=_("span"),t.textContent="No",i=T(),s=_("button"),l=_("span"),l.textContent="Yes",h(t,"class","txt"),e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded-sm"),e.disabled=n[2],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],ee(s,"btn-loading",n[2])},m(a,u){w(a,e,u),m(e,t),w(a,i,u),w(a,s,u),m(s,l),e.focus(),o||(r=[X(e,"click",n[3]),X(s,"click",n[4])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&ee(s,"btn-loading",a[2])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,st(r)}}}function nO(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:[tO],header:[eO]},$$scope:{ctx:n}};return e=new wi({props:i}),n[5](e),e.$on("hide",n[6]),{c(){z(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&135&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function iO(n,e,t){let i;At(n,Va,f=>t(1,i=f));let s,l=!1;const o=()=>{i!=null&&i.noCallback&&i.noCallback(),s==null||s.hide()},r=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),s==null||s.hide()};function a(f){he[f?"unshift":"push"](()=>{s=f,t(0,s)})}const u=async()=>{i!=null&&i.noCallback&&i.noCallback(),await ai(),u_()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(s==null||s.show())},[s,i,l,o,r,a,u]}class sO extends Pe{constructor(e){super(),Ae(this,e,iO,nO,Ee,{})}}function Hp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,C,$,S;return y=new os({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lO]},$$scope:{ctx:n}}}),{c(){var M;e=_("aside"),t=_("a"),t.innerHTML='<img src="/_/images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=T(),s=_("nav"),l=_("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=T(),r=_("a"),r.innerHTML='<i class="ri-group-line"></i>',a=T(),u=_("a"),u.innerHTML='<i class="ri-line-chart-line"></i>',f=T(),c=_("a"),c.innerHTML='<i class="ri-tools-line"></i>',d=T(),p=_("figure"),g=_("img"),b=T(),z(y.$$.fragment),h(t,"href","/"),h(t,"class","logo logo-sm"),h(l,"href","/collections"),h(l,"class","menu-item"),h(l,"aria-label","Collections"),h(r,"href","/users"),h(r,"class","menu-item"),h(r,"aria-label","Users"),h(u,"href","/logs"),h(u,"class","menu-item"),h(u,"aria-label","Logs"),h(c,"href","/settings"),h(c,"class","menu-item"),h(c,"aria-label","Settings"),h(s,"class","main-menu"),Xn(g.src,v="/_/images/avatars/avatar"+(((M=n[0])==null?void 0:M.avatar)||0)+".svg")||h(g,"src",v),h(g,"alt","Avatar"),h(p,"class","thumb thumb-circle link-hint closable"),h(e,"class","app-sidebar")},m(M,D){w(M,e,D),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),m(s,r),m(s,a),m(s,u),m(s,f),m(s,c),m(e,d),m(e,p),m(p,g),m(p,b),q(y,p,null),C=!0,$||(S=[Qe($n.call(null,t)),Qe($n.call(null,l)),Qe(ni.call(null,l,{path:"/collections/?.*",className:"current-route"})),Qe(Ct.call(null,l,{text:"Collections",position:"right"})),Qe($n.call(null,r)),Qe(ni.call(null,r,{path:"/users/?.*",className:"current-route"})),Qe(Ct.call(null,r,{text:"Users",position:"right"})),Qe($n.call(null,u)),Qe(ni.call(null,u,{path:"/logs/?.*",className:"current-route"})),Qe(Ct.call(null,u,{text:"Logs",position:"right"})),Qe($n.call(null,c)),Qe(ni.call(null,c,{path:"/settings/?.*",className:"current-route"})),Qe(Ct.call(null,c,{text:"Settings",position:"right"}))],$=!0)},p(M,D){var O;(!C||D&1&&!Xn(g.src,v="/_/images/avatars/avatar"+(((O=M[0])==null?void 0:O.avatar)||0)+".svg"))&&h(g,"src",v);const E={};D&512&&(E.$$scope={dirty:D,ctx:M}),y.$set(E)},i(M){C||(A(y.$$.fragment,M),C=!0)},o(M){P(y.$$.fragment,M),C=!1},d(M){M&&k(e),V(y),$=!1,st(S)}}}function lO(n){let e,t,i,s,l,o,r;return{c(){e=_("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
|
||
<span class="txt">Manage admins</span>`,t=T(),i=_("hr"),s=T(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
|
||
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"tabindex","0"),h(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Qe($n.call(null,e)),X(l,"click",n[6])],o=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,st(r)}}}function oO(n){var p;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=Y.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((p=n[0])==null?void 0:p.id)&&n[1]&&Hp(n);return o=new R_({props:{routes:YD}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new xD({}),f=new sO({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),z(f.$$.fragment),h(l,"class","app-body"),h(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),q(o,l,null),w(g,r,v),q(a,g,v),w(g,u,v),q(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=Y.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=Hp(g),d.c(),A(d,1),d.m(i,s)):d&&(De(),P(d,1,1,()=>{d=null}),Oe())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){P(d),P(o.$$.fragment,g),P(a.$$.fragment,g),P(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),V(o),g&&k(r),V(a,g),g&&k(u),V(f,g)}}}function rO(n,e,t){let i,s,l;At(n,_o,d=>t(2,i=d)),At(n,ba,d=>t(0,s=d)),At(n,Zt,d=>t(3,l=d));let o,r=!1;function a(d){var p,g,v,b;((p=d==null?void 0:d.detail)==null?void 0:p.location)!==o&&(t(1,r=!!((v=(g=d==null?void 0:d.detail)==null?void 0:g.userData)!=null&&v.showAppSidebar)),o=(b=d==null?void 0:d.detail)==null?void 0:b.location,bn(Zt,l="",l),Ii({}),u_())}function u(){Ms("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const p=await we.Settings.getAll({$cancelKey:"loadAppName"});bn(_o,i=((d=p==null?void 0:p.meta)==null?void 0:d.appName)||"",i)}catch(p){console.warn("Failed to load app name.",p)}}function c(){we.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class aO extends Pe{constructor(e){super(),Ae(this,e,rO,oO,Ee,{})}}new aO({target:document.getElementById("app")});export{st as A,hn as B,Y as C,Ms as D,rt as E,fg as F,At as G,Cs as H,un as I,An as J,Yn as K,he as L,Pe as S,P as a,T as b,z as c,V as d,_ as e,h as f,w as g,m as h,Ae as i,Qe as j,De as k,$n as l,q as m,Oe as n,k as o,we as p,Le as q,ee as r,Ee as s,A as t,X as u,Bt as v,R as w,me as x,oe as y,Ce as z};
|