pocketbase/ui/dist/assets/index-0b562d0f.js

205 lines
886 KiB
JavaScript
Raw Normal View History

(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function G(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function Xb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function d_(n){return n()}function ou(){return Object.create(null)}function Pe(n){n.forEach(d_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function Hn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Qb(n){return Object.keys(n).length===0}function p_(n,...e){if(n==null)return G;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(p_(e,t))}function Nt(n,e,t,i){if(n){const s=m_(n,e,t,i);return n[0](s)}}function m_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Rt(n,e,t,i,s,l){if(s){const o=m_(e,t,i,l);n.p(o,s)}}function qt(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 Qn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Et(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 Si(n){return n??""}function Kt(n,e,t){return n.set(t),e}function Ie(n){return n&&Bt(n.destroy)?n.destroy:G}const h_=typeof window<"u";let No=h_?()=>window.performance.now():()=>Date.now(),da=h_?n=>requestAnimationFrame(n):G;const bs=new Set;function __(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&da(__)}function Fo(n){let e;return bs.size===0&&da(__),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function g_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function xb(n){const e=b("style");return e1(g_(n),e),e.sheet}function e1(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function B(n){return document.createTextNode(n)}function O(){return B(" ")}function $e(){return B("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function dt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function pt(n){return n===""?null:+n}function t1(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function fe(n,e){n.value=e??""}function Lr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList[t?"add":"remove"](e)}function b_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEven
`;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}}
2023-02-22 04:24:49 +08:00
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${n1(f)}_${r}`,d=g_(n),{stylesheet:m,rules:h}=po.get(d)||i1(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${s}ms 1 both`,mo+=1,c}function al(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),mo-=s,mo||s1())}function s1(){da(()=>{mo||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function l1(n,e,t,i){if(!e)return G;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return G;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=G,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function _(){c&&(h=rl(n,0,1,o,l,r,c)),l||(m=!0)}function v(){c&&al(n,h),d=!1}return Fo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),v()),!d)return!1;if(m){const y=k-a,T=0+1*r(y/o);f(T,1-T)}return!0}),_(),f(0,1),v}function o1(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,v_(n,s)}}function v_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ul;function oi(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function Zt(n){wl().$$.on_mount.push(n)}function r1(n){wl().$$.after_update.push(n)}function y_(n){wl().$$.on_destroy.push(n)}function $t(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=b_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ze(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],se=[],oo=[],Nr=[],k_=Promise.resolve();let Fr=!1;function w_(){Fr||(Fr=!0,k_.then(pa))}function sn(){return w_(),k_}function xe(n){oo.push(n)}function ke(n){Nr.push(n)}const er=new Set;let fs=0;function pa(){if(fs!==0)return;const n=ul;do{try{for(;fs<_s.length;){const e=_s[fs];fs++,oi(e),a1(e.$$)}}catch(e){throw _s.length=0,fs=0,e}for(oi(null),_s.length=0,fs=0;se.length;)se.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];er.has(t)||(er.add(t),t())}oo.length=0}while(_s.length);for(;Nr.length;)Nr.pop()();Fr=!1,er.clear(),oi(n)}function a1(n){if(n.fragment!==null){n.update(),Pe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(xe)}}let Rs;function ma(){return Rs||(Rs=Promise.resolve(),Rs.then(()=>{Rs=null})),Rs}function Ki(n,e,t){n.dispatchEvent(b_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function re(){Jn={r:0,c:[],p:Jn}}function ae(){Jn.r||Pe(Jn.c),Jn=Jn.p}function E(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ha={duration:0};function S_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&al(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:_=G,css:v}=s||ha;v&&(o=rl(n,0,1,m,d,h,v,a++)),_(0,1);const k=No()+d,y=k+m;r&&r.abort(),l=!0,xe(()=>Ki(n,!0,"start")),r=Fo(T=>{if(l){if(T>=y)return _(1,0),Ki(n,!0,"end"),u(),l=!1;if(T>=k){const C=h((T-k)/m);_(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),Bt(s)?(s=s(i),ma().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function T_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=G,css:m}=s||ha;m&&(o=rl(n,1,0,f,u,c,m));const h=No()+u,_=h+f;xe(()=>Ki(n,!1,"start")),Fo(v=>{if(l){if(v>=_)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?ma().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=O(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function jv(n){let e,t,i,s=!n[0]&&Vu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=O(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Vu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):qt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Vv(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[jv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Hv(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Ig extends ye{constructor(e){super(),ve(this,e,Hv,Vv,he,{nobranding:0})}}function Hu(n,e,t){const i=n.slice();return i[11]=e[t],i}const zv=n=>({}),zu=n=>({uniqueId:n[3]});function Bv(n){let e=(n[11]||bo)+"",t;return{c(){t=B(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||bo)+"")&&le(t,e)},d(i){i&&w(t)}}}function Uv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||bo)+"",i;return{c(){e=b("pre"),i=B(t)},m(o,r){S(o,e,r),g(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||bo)+"")&&le(i,t)},d(o){o&&w(e)}}}function Bu(n){let e,t;function i(o,r){return typeof o[11]=="object"?Uv:Bv}let s=i(n),l=s(n);return{c(){e=b("div"),l.c(),t=O(),p(e,"class","help-block help-block-error")},m(o,r){S(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function Wv(n){let e,t,i,s,l;const o=n[8].default,r=Nt(o,n,n[7],zu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Bu(Hu(n,a,f));return{c(){e=b("div"),r&&r.c(),t=O();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),x(e,"error",n[2].length)},m(f,c){S(f,e,c),r&&r.m(e,null),g(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[10](e),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&128)&&Rt(r,o,f,f[7],i?Ft(o,f[7],c,zv):qt(f[7]),zu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const m=Hu(f,a,d);u[d]?u[d].p(m,c):(u[d]=Bu(m),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),(!i||c&5)&&x(e,"error",f[2].length)},i(f){i||(E(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&w(e),r&&r.d(f),ht(u,f),n[10](null),s=!1,l()}}}const bo="Invalid value";function Yv(n,e,t){let i;Ye(n,fi,h=>t(6,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Qi(r)}Zt(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){ze.call(this,n,h)}function m(h){se[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(7,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&80&&t(2,f=H.toArray(H.getNestedVal(i,r)))},[a,u,f,o,r,c,i,l,s,d,m]}class me extends ye{constructor(e){super(),ve(this,e,Yv,Wv,he,{name:4,class:0,changed:5})}get changed(){return this.$$.ctx[5]}}function Kv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Email"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Jv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("la
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){S(h,e,_),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),q(a,e,null),g(e,u),g(e,f),c=!0,d||(m=Y(e,"submit",dt(n[4])),d=!0)},p(h,[_]){const v={};_&1537&&(v.$$scope={dirty:_,ctx:h}),s.$set(v);const k={};_&1538&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&1540&&(y.$$scope={dirty:_,ctx:h}),a.$set(y),(!c||_&8)&&x(f,"btn-disabled",h[3]),(!c||_&8)&&x(f,"btn-loading",h[3])},i(h){c||(E(s.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,m()}}}function Xv(n,e,t){const i=$t();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await pe.admins.create({email:s,password:l,passwordConfirm:o}),await pe.admins.authWithPassword(s,l),i("submit")}catch(d){pe.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class Qv extends ye{constructor(e){super(),ve(this,e,Xv,Gv,he,{})}}function Uu(n){let e,t;return e=new Ig({props:{$$slots:{default:[xv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function xv(n){let e,t;return e=new Qv({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:G,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ey(n){let e,t,i=n[0]&&Uu(n);return{c(){i&&i.c(),e=$e()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&E(i,1)):(i=Uu(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function ty(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){pe.logout(!1),t(0,i=!0);return}pe.authStore.isValid?Oi("/collections"):pe.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class ny extends ye{constructor(e){super(),ve(this,e,ty,ey,he,{})}}const St=Ln(""),vo=Ln(""),$s=Ln(!1);function Bo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function An(n,{delay:e=0,duration:t=400,easing:i=Bo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>`
2023-02-22 04:24:49 +08:00
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function At(n,{delay:e=0,duration:t=400,easing:i=Bo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Bo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function iy(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),fe(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&fe(e,l[7])},i:G,o:G,d(l){l&&w(e),n[13](null),i=!1,s()}}}function sy(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=jt(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=$e()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),o!==(o=a[4])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Wu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Yu();return{c(){r&&r.c(),e=O(),t=b("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&E(r,1):(r=Yu(),r.c(),E(r,1),r.m(e.parentNode,e)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){s||(E(r),a&&xe(()=>{i||(i=je(t,An,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=je(t,An,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Yu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,An,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,An,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function ly(n){let e,t,i,s,l,o,r,a,u,f;const c=[sy,iy],d=[];function m(_,v){return _[4]&&!_[5]?0:1}l=m(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&Wu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=O(),o.c(),r=O(),h&&h.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(_,v){S(_,e,v),g(e,t),g(t,i),g(e,s),d[l].m(e,null),g(e,r),h&&h.m(e,null),a=!0,u||(f=[Y(e,"click",kn(n[11])),Y(e,"submit",dt(n[10]))],u=!0)},p(_,[v]){let k=l;l=m(_),l===k?d[l].p(_,v):(re(),P(d[k],1,1,()=>{d[k]=null}),ae(),o=d[l],o?o.p(_,v):(o=d[l]=c[l](_),o.c()),E(o,1),o.m(e,r)),_[0].length||_[7].length?h?(h.p(_,v),v&129&&E(h,1)):(h=Wu(_),h.c(),E(h,1),h.m(e,null)):h&&(re(),P(h,1,1,()=>{h=null}),ae())},i(_){a||(E(o),E(h),a=!0)},o(_){P(o),P(h),a=!1},d(_){_&&w(e),d[l].d(),h&&h.d(),u=!1,Pe(f)}}}function oy(n,e,t){const i=$t(),s="search_"+H.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new pn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function h(){t(0,l=d),i("submit",l)}async function _(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-8a4f87de.js"),["./FilterAutocompleteInput-8a4f87de.js","./index-96653a6b.js"],import.meta.url)).default),t(5,f=!1))}Zt(()=>{_()});function v(M){ze.call(this,n,M)}function k(M){d=M,t(7,d),t(0,l)}function y(M){se[M?"unshift":"push"](()=>{c=M,t(6,c)})}function T(){d=this.value,t(7,d),t(0,l)}const C=()=>{m(!1),h()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,h,v,k,y,T,C]}class Uo extends ye{cons
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function ky(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="url",p(t,"class",H.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function wy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="referer",p(t,"class",H.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Sy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="User IP",p(t,"class",H.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Ty(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="status",p(t,"class",H.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Cy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Xu(n){let e;function t(l,o){return l[6]?My:$y}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function $y(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Qu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Qu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function My(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Qu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function xu(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ef(n,e){var Se,We,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,h,_,v,k,y=(e[23].referer||"N/A")+"",T,C,M,$,D,A=(e[23].userIp||"N/A")+"",I,L,F,N,R,K=e[23].status+"",Q,U,X,ne,J,ue,Z,de,ge,Ce,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&xu();ne=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function be(...ce){return e[18](e[23],...ce)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("span"),o=B(l),a=O(),u=b("td"),f=b("span"),d=B(c),h=O(),Ne&&Ne.c(),_=O(),v=b("td"),k=b("span"),T=B(y),M=O(),$=b("td"),D=b("span"),I=B(A),F=O(),N=b("td"),R=b("span"),Q=B(K),U=O(),X=b("td"),V(ne.$$.fragment),J=O(),ue=b("td"),ue.innerHTML='<i class="ri-arrow-right-line"></i>',Z=O(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(k,"class","txt txt-ellipsis"),p(k,"title",C=e[23].referer),x(k,"txt-hint",!e[23].referer),p(v,"class","col-type-text col-field-referer"),p(D,"class","txt txt-ellipsis"),p(D,"title",L=e[23].userIp),x(D,"txt-hint",!e[23].userIp),p($,"class","col-type-number col-field-userIp"),p(R,"class","label"),x(R,"label-danger",e[23].status>=400),p(N,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(ue,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ce,He){S(ce,t,He),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,h),Ne&&Ne.m(u,null),g(t,_),g(t,v),g(v,k),g(k,T),g(t,M),g(t,$),g($,D),g(D,I),g(t,F),g(t,N),g(N,R),g(R,Q),g(t,U),g(t,X),q(ne,X,null),g(t,J),g(t,ue),g(t,Z),de=!0,ge||(Ce=[Y(t,"click",Re),Y(t,"keydown",be)],ge=!0)},p(ce,He){var Fe,ot,Vt;e=ce,(!de||He&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||He&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!de||He&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||He&8&&m!==(m=e[23].url))&&p(f,"title",m),(ot=e[23].meta)!=null&&ot.errorMessage||(Vt=e[23].meta)!=null&&Vt.errorData?Ne||(Ne=xu(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||He&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le(T,y),(!de||He&8&&C!==(C=e[23].referer))&&p(k,"title",C),(!de||He&8)&&x(k,"txt-hint",!e[23].referer),(!de||He&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&le(I,A),(!de||He&8&&L!==(L=e[23].userIp))&&p(D,"title",L),(!de||He&8)&&x(D,"txt-hint",!e[23].userIp),(!de||He&8)&&K!==(K=e[23].status+"")&&le(Q,K),(!de||He&8)&&x(R,"label-danger",e[23].status>=400);const te={};He&8&&(te.date=e[23].created),ne.$set(te)},i(ce){de||(E(ne.$$.fragment,ce),de=!0)},o(ce){P(ne.$$.fragment,ce),de=!1},d(ce){ce&&w(t),Ne&&Ne.d(),j(ne),ge=!1,Pe(Ce)}}}function Oy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I=[],L=new Map,F;function N(be){n[11](be)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[yy]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),se.push(()=>_e(s,"sort",N));function K(be){n[12](be)}let Q={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[ky]},$$scope:{ctx:n}};n[1]!==void 0&&(Q.sort=n[1]),r=new Wt({props:Q}),se.push(()=>_e(r,"sort",K));function U(be){n[13](be)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[wy]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new Wt({props:X}),se.push(()=>_e(f,"sort",U));function ne(be){n[14](be)}let J={disable:!0,class:"col-type-number col-field-userI
2023-02-22 04:24:49 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function ni(){}const Iy=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function _t(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ke(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Ct=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Cn(n,e){return Ct(n)?n:e}function Xe(n,e){return typeof n>"u"?e:n}const Py=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Lg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ut(n,e,t,i){let s,l,o;if(_t(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ke(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function ko(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function wo(n){if(_t(n))return n.map(wo);if(Ke(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=wo(n[t[s]]);return e}return n}function Ng(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ly(n,e,t,i){if(!Ng(n))return;const s=e[n],l=t[n];Ke(s)&&Ke(l)?dl(s,l,i):e[n]=wo(l)}function dl(n,e,t){const i=_t(e)?e:[e],s=i.length;if(!Ke(n))return n;t=t||{};const l=t.merger||Ly;for(let o=0;o<s;++o){if(e=i[o],!Ke(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function tl(n,e){return dl(n,e,{merger:Ny})}function Ny(n,e,t){if(!Ng(n))return;const i=e[n],s=t[n];Ke(i)&&Ke(s)?tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=wo(s))}const sf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ci(n,e){return(sf[e]||(sf[e]=Fy(e)))(n)}function Fy(n){const e=Ry(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ry(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ia(n){return n.charAt(0).toUpperCase()+n.slice(1)}const In=n=>typeof n<"u",$i=n=>typeof n=="function",lf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function qy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,ct=2*Tt,jy=ct+Tt,So=Number.POSITIVE_INFINITY,Vy=Tt/180,kt=Tt/2,zs=Tt/4,of=Tt*2/3,Dn=Math.log10,Gn=Math.sign;function rf(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Dn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Hy(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)<t}function zy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Fg(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 Vn(n){return n*(Tt/180)}function Pa(n){return n*(180/Tt)}function af(n){if(!Ct(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Rg(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*Tt&&(l+=ct),{angle:l,distance:s}}function Xr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function By(n,e){return(n-e+jy)%ct-Tt}function bn(n){return(n%ct+ct)%ct}function pl(n,e,t,i){const s=bn(n),l=bn(e),o=bn(t),r=bn(l-s),a=bn(o-s),u=bn(s-l),f=bn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Yt(n,e,t){return Math.max(e,Math.min(t,n))}function Uy(n){return Yt(n,-32768,32767)}function ml(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(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 Yi=(n,e,t,i)=>La(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Wy=(n,e,t)=>La(n,t,i=>n[i][e]>=t);function Yy(n,e,
2023-02-22 04:24:49 +08:00
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Dl(n){return n+.5|0}const bi=(n,e,t)=>Math.max(Math.min(n,t),e);function Xs(n){return bi(Dl(n*2.55),0,255)}function wi(n){return bi(Dl(n*255),0,255)}function li(n){return bi(Dl(n/2.55)/100,0,1)}function pf(n){return bi(Dl(n*100),0,100)}const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Qr=[..."0123456789ABCDEF"],Gy=n=>Qr[n&15],Xy=n=>Qr[(n&240)>>4]+Qr[n&15],Wl=n=>(n&240)>>4===(n&15),Qy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function xy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Tn[n[1]]*17,g:255&Tn[n[2]]*17,b:255&Tn[n[3]]*17,a:e===5?Tn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Tn[n[1]]<<4|Tn[n[2]],g:Tn[n[3]]<<4|Tn[n[4]],b:Tn[n[5]]<<4|Tn[n[6]],a:e===9?Tn[n[7]]<<4|Tn[n[8]]:255})),t}const e2=(n,e)=>n<255?e(n):"";function t2(n){var e=Qy(n)?Gy:Xy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+e2(n.a,e):void 0}const n2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ug(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 i2(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 s2(n,e,t){const i=Ug(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 l2(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 Na(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=l2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Fa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(wi)}function Ra(n,e,t){return Fa(Ug,n,e,t)}function o2(n,e,t){return Fa(s2,n,e,t)}function r2(n,e,t){return Fa(i2,n,e,t)}function Wg(n){return(n%360+360)%360}function a2(n){const e=n2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):wi(+e[5]));const s=Wg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=o2(s,l,o):e[1]==="hsv"?i=r2(s,l,o):i=Ra(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function u2(n,e){var t=Na(n);t[0]=Wg(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function f2(n){if(!n)return;const e=Na(n),t=e[0],i=pf(e[1]),s=pf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const mf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},hf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
2023-02-22 04:24:49 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class pk{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=Vg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ii=new pk;const Mf="transparent",mk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=gf(n||Mf),s=i.valid&&gf(e||Mf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class hk{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||mk[e.type||typeof o],this._easing=il[e.easing]||il.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const _k=["x","y","borderWidth","radius","tension"],gk=["color","borderColor","backgroundColor"];Qe.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 bk=Object.keys(Qe.animation);Qe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});Qe.set("animations",{colors:{type:"color",properties:gk},numbers:{type:"number",properties:_k}});Qe.describe("animations",{_fallback:"animation"});Qe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class ob{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ke(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ke(s))return;const l={};for(con
2023-02-22 04:24:49 +08:00
`)>-1?n.split(`
`):n}function LS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function sc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=vn(e.bodyFont),u=vn(e.titleFont),f=vn(e.footerFont),c=l.length,d=s.length,m=i.length,h=Pn(e.padding);let _=h.height,v=0,k=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const T=function(C){v=Math.max(v,t.measureText(C).width+y)};return t.save(),t.font=u.string,ut(n.title,T),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),T),y=e.displayColors?o+2+e.boxPadding:0,ut(i,C=>{ut(C.before,T),ut(C.lines,T),ut(C.after,T)}),y=0,t.font=f.string,ut(n.footer,T),t.restore(),v+=h.width,{width:v,height:_}}function NS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function FS(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 RS(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"),FS(u,n,e,t)&&(u="center"),u}function lc(n,e,t){const i=t.yAlign||e.yAlign||NS(n,t);return{xAlign:t.xAlign||e.xAlign||RS(n,e,t,i),yAlign:i}}function qS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function jS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function oc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=ys(o);let h=qS(e,r);const _=jS(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:Yt(h,0,i.width-e.width),y:Yt(_,0,i.height-e.height)}}function to(n,e,t){const i=Pn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function rc(n){return Kn([],si(n))}function VS(n,e,t){return Di(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function ac(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ra extends ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new ob(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=VS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}getBeforeBody(e,t){return rc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=ac(i,l);Kn(o.before,si(r.beforeLabel.call(this,l))
2023-02-22 04:24:49 +08:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const r3={datetime:qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:qe.TIME_WITH_SECONDS,minute:qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};cb._date.override({_id:"luxon",_create:function(n){return qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return r3},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=qe.fromFormat(n,e,t):n=qe.fromISO(n,t):n instanceof Date?n=qe.fromJSDate(n,t):i==="object"&&!(n instanceof qe)&&(n=qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function _c(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function a3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=O(),s=B(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function u3(n){let e;return{c(){e=B("Loading...")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function f3(n){let e,t,i,s,l,o=n[2]&&_c();function r(f,c){return f[2]?u3:a3}let a=r(n),u=a(n);return{c(){e=b("div"),o&&o.c(),t=O(),i=b("canvas"),s=O(),l=b("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Lr(i,"height","250px"),Lr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&E(o,1):(o=_c(),o.c(),E(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),c&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){E(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function c3(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),pe.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let h of m)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),pe.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Ao.register(Ei,Jo,Yo,xa,Pl,PS,HS),t(6,o=new Ao(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o
2023-02-22 04:24:49 +08:00
* 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 y(T){return T instanceof a?new a(T.type,y(T.content),T.alias):Array.isArray(T)?T.map(y):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++l}),y.__id},clone:function y(T,C){C=C||{};var M,$;switch(r.util.type(T)){case"Object":if($=r.util.objId(T),C[$])return C[$];M={},C[$]=M;for(var D in T)T.hasOwnProperty(D)&&(M[D]=y(T[D],C));return M;case"Array":return $=r.util.objId(T),C[$]?C[$]:(M=[],C[$]=M,T.forEach(function(A,I){M[I]=y(A,C)}),M);default:return T}},getLanguage:function(y){for(;y;){var T=s.exec(y.className);if(T)return T[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,T){y.className=y.className.replace(RegExp(s,"gi"),""),y.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(y){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==y)return T[C]}return null}},isActive:function(y,T,C){for(var M="no-"+T;y;){var $=y.classList;if($.contains(T))return!0;if($.contains(M))return!1;y=y.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,T){var C=r.util.clone(r.languages[y]);for(var M in T)C[M]=T[M];return C},insertBefore:function(y,T,C,M){M=M||r.languages;var $=M[y],D={};for(var A in $)if($.hasOwnProperty(A)){if(A==T)for(var I in C)C.hasOwnProperty(I)&&(D[I]=C[I]);C.hasOwnProperty(A)||(D[A]=$[A])}var L=M[y];return M[y]=D,r.languages.DFS(r.languages,function(F,N){N===L&&F!=y&&(this[F]=D)}),D},DFS:function y(T,C,M,$){$=$||{};var D=r.util.objId;for(var A in T)if(T.hasOwnProperty(A)){C.call(T,A,T[A],M||A);var I=T[A],L=r.util.type(I);L==="Object"&&!$[D(I)]?($[D(I)]=!0,y(I,C,null,$)):L==="Array"&&!$[D(I)]&&($[D(I)]=!0,y(I,C,A,$))}}},plugins:{},highlightAll:function(y,T){r.highlightAllUnder(document,y,T)},highlightAllUnder:function(y,T,C){var M={callback:C,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var $=0,D;D=M.elements[$++];)r.highlightElement(D,T===!0,M.callback)},highlightElement:function(y,T,C){var M=r.util.getLanguage(y),$=r.languages[M];r.util.setLanguage(y,M);var D=y.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var A=y.textContent,I={element:y,language:M,grammar:$,code:A};function L(N){I.highlightedCode=N,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),D=I.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if(T&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(N){L(N.data)},F.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(y,T,C){var M={code:y,grammar:T,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(y,T){var C=T.rest;if(C){for(var M in C)T[M]=C[M];delete T.rest}var $=new c;return d($,$.head,y),f(y,$,T,$.head,0),h($)},hooks:{all:{},add:function
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(I+1))}k.textContent=$,t.highlightElement(k)},function($){v.setAttribute(r,f),k.textContent=$})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(c),y=0,T;T=k[y++];)t.highlightElement(T)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(p3);const Js=fa;var bc={},m3={get exports(){return bc},set exports(n){bc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
2023-02-22 04:24:49 +08:00
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var m=s(f[d]);c+=m,c>r&&(f[d]=`
`+f[d],c=m)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",h="",_=!1,v=0;v<d.length;++v){var k=d[v];k==o.element?_=!0:k.nodeName==="#text"&&(_?h+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--v)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+h,o.code=r.normalize(o.code,o.settings);else{var y=m+o.element.innerHTML+h;o.element.innerHTML=r.normalize(y,o.settings),o.code=o.element.textContent}}}})})()})(m3);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function h3(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),g(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:G,o:G,d(s){s&&w(e)}}}function _3(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class Ab extends ye{constructor(e){super(),ve(this,e,_3,h3,he,{class:0,content:2,language:3})}}const g3=n=>({}),vc=n=>({}),b3=n=>({}),yc=n=>({});function kc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T=n[4]&&!n[2]&&wc(n);const C=n[19].header,M=Nt(C,n,n[18],yc);let $=n[4]&&n[2]&&Sc(n);const D=n[19].default,A=Nt(D,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],vc);return{c(){e=b("div"),t=b("div"),s=O(),l=b("div"),o=b("div"),T&&T.c(),r=O(),M&&M.c(),a=O(),$&&$.c(),u=O(),f=b("div"),A&&A.c(),c=O(),d=b("div"),L&&L.c(),p(t,
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]),k&1&&(y.disabled=!H.isEmpty(v[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=v[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function TT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[3](v)}let _={id:n[4]+".options.onlyDomains",disabled:!H.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new Ns({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Ue.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]+".options.onlyDomains"))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]+".options.onlyDomains"),k&1&&(y.disabled=!H.isEmpty(v[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=v[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function CT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[ST,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[TT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function $T(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 Nb extends ye{constructor(e){super(),ve(this,e,$T,CT,he,{key:1,options:0})}}function MT(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 Nb({props:r}),se.push(()=>_e(e,"key",l)),se.push(()=>_e(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],ke(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],ke(()=>i=!1)),e.$set(f)},i(a){s||(E(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function OT(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 DT extends ye{constructor(e){super(),ve(this,e,OT,MT,he,{key:0,options:1})}}function ET(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 AT extends ye{constructor(e){super(),ve(this,e,ET,null,he,{key:0,options:1})}}var Tr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onR
2023-02-22 04:24:49 +08:00
<span class='flatpickr-weekday'>
`+W.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ue(){t.calendarContainer.classList.add("hasWeeks");var z=st("div","flatpickr-weekwrapper");z.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=st("div","flatpickr-weeks");return z.appendChild(W),{weekWrapper:z,weekNumbers:W}}function Z(z,W){W===void 0&&(W=!0);var ee=W?z:z-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),R()),N(),Ze("onMonthChange"),Li())}function de(z,W){if(z===void 0&&(z=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Or(t.config),oe=ee.hours,Te=ee.minutes,De=ee.seconds;m(oe,Te,De)}t.redraw(),z&&Ze("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Ce(){t.config!==void 0&&Ze("onDestroy");for(var z=t._handlers.length;z--;)t._handlers[z].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ee){try{delete t[ee]}catch{}})}function Ne(z){return t.calendarContainer.contains(z)}function Re(z){if(t.isOpen&&!t.config.inline){var W=_n(z),ee=Ne(W),oe=W===t.input||W===t.altInput||t.element.contains(W)||z.path&&z.path.indexOf&&(~z.path.indexOf(t.input)||~z.path.indexOf(t.altInput)),Te=!oe&&!ee&&!Ne(z.relatedTarget),De=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(W)});Te&&De&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function be(z){if(!(!z||t.config.minDate&&z<t.config.minDate.getFullYear()||t.config.maxDate&&z>t.config.maxDate.getFullYear())){var W=z,ee=t.currentYear!==W;t.currentYear=W||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ee&&(t.redraw(),Ze("onYearChange"),R())}}function Se(z,W){var ee;W===void 0&&(W=!0);var oe=t.parseDate(z,void 0,W);if(t.config.minDate&&oe&&gn(oe,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&oe&&gn(oe,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retu
`),r=b("code"),r.textContent="multipart/form-data",a=B(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=B(` field is a
`),c=b("strong"),c.textContent="plain string",d=B(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=O(),v=b("li"),v.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=O(),y=b("li"),y.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=O(),C=b("li"),C.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=O(),$=b("li"),A=B(D),I=B(" is converted to the json "),L=b("code"),L.textContent='{"a":1,"b":2}',F=O(),N=b("li"),N.textContent="numeric strings are converted to json number",R=O(),K=b("li"),K.textContent="double quoted strings are left as they are (aka. without normalizations)",Q=O(),U=b("li"),U.textContent="any other string (empty string too) is double quoted",X=B(`
2023-02-22 04:24:49 +08:00
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
an object, eg.`),ne=b("code"),ne.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Z,de){S(Z,e,de),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(m,h),g(m,_),g(m,v),g(m,k),g(m,y),g(m,T),g(m,C),g(m,M),g(m,$),g($,A),g($,I),g($,L),g(m,F),g(m,N),g(m,R),g(m,K),g(m,Q),g(m,U),g(i,X),g(i,ne),ue=!0},i(Z){ue||(Z&&xe(()=>{J||(J=je(e,At,{duration:150},!0)),J.run(1)}),ue=!0)},o(Z){Z&&(J||(J=je(e,At,{duration:150},!1)),J.run(0)),ue=!1},d(Z){Z&&w(e),Z&&J&&J.end()}}}function eC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0]?xT:QT}let u=a(n),f=u(n),c=n[0]&&Xc();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=O(),f.c(),s=O(),c&&c.c(),l=$e(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){S(d,e,m),g(e,t),g(e,i),f.m(e,null),S(d,s,m),c&&c.m(d,m),S(d,l,m),o||(r=Y(e,"click",n[3]),o=!0)},p(d,[m]){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[0]?c?m&1&&E(c,1):(c=Xc(),c.c(),E(c,1),c.m(l.parentNode,l)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){E(c)},o(d){P(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function tC(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class nC extends ye{constructor(e){super(),ve(this,e,tC,eC,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function iC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=B(t),s=O(),l=b("small"),r=B(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),S(a,l,u),g(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:G,o:G,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function sC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Qc extends ye{constructor(e){super(),ve(this,e,sC,iC,he,{item:0})}}const lC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeTy
Leave empty for no restriction.`,position:"top"})),y=!0)},p($,D){(!k||D&4096&&l!==(l=$[12]))&&p(e,"for",l);const A={};D&4096&&(A.id=$[12]),D&4&&(A.items=$[2]),!a&&D&1&&(a=!0,A.keyOfSelected=$[0].mimeTypes,ke(()=>a=!1)),r.$set(A);const I={};D&8193&&(I.$$scope={dirty:D,ctx:$}),v.$set(I)},i($){k||(E(r.$$.fragment,$),E(v.$$.fragment,$),k=!0)},o($){P(r.$$.fragment,$),P(v.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(o),j(r,$),$&&w(u),$&&w(f),j(v),y=!1,T()}}}function fC(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
2023-02-22 04:24:49 +08:00
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function cC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M;function $(A){n[10](A)}let D={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(D.value=n[0].thumbs),r=new Ns({props:D}),se.push(()=>_e(r,"value",$)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[fC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=O(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=O(),v=b("i"),k=O(),V(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(v,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(A,I){S(A,e,I),g(e,t),g(e,i),g(e,s),S(A,o,I),q(r,A,I),S(A,u,I),S(A,f,I),g(f,c),g(f,d),g(f,m),g(m,h),g(m,_),g(m,v),g(m,k),q(y,m,null),T=!0,C||(M=Ie(Ue.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),C=!0)},p(A,I){(!T||I&4096&&l!==(l=A[12]))&&p(e,"for",l);const L={};I&4096&&(L.id=A[12]),!a&&I&1&&(a=!0,L.value=A[0].thumbs,ke(()=>a=!1)),r.$set(L);const F={};I&8192&&(F.$$scope={dirty:I,ctx:A}),y.$set(F)},i(A){T||(E(r.$$.fragment,A),E(y.$$.fragment,A),T=!0)},o(A){P(r.$$.fragment,A),P(y.$$.fragment,A),T=!1},d(A){A&&w(e),A&&w(o),j(r,A),A&&w(u),A&&w(f),j(y),C=!1,M()}}}function dC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[oC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[rC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[uC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[cC,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(h,_){S(h,e,_),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(h,[_]){const v={};_&2&&(v.name="schema."+h[1]+".options.maxSize"),_&12289&&(v.$$scope={dirty:_,ctx:h}),i.$set(v);const k={};_&2&&(k.name="schema."+h[1]+".options.maxSelect"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&2&&(y.name="schema."+h[1]+".options.mimeTypes"),_&12293&&(y.$$scope={dirty:_,ctx:h}),u.$set(y);const T={};_&2&&(T.name="schema."+h[1]+".options.thumbs"),_&12289&&(T.$$scope={dirty:_,ctx:h}),d.$set(T)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(u.$$.fragment,h),E(d.$$.fragment,h),m=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),m=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function pC(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=lC.slice();function o(){if(H.isEmpty(s.mimeTypes))return;const _=[];for(const v of s.mimeTypes)l.find(k=>k.mimeType===v)||_.push({mimeType:v});_.length&&t(2,l=l.concat(_))}function r(){s.maxSize=pt(this.value),t(0,s)}function a(){s.maxSelect=pt(this.value),t(0,s)}function u(_){n.$$.not_equal(s.mimeTypes,_)&&(s.mimeTypes=_,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlfo
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[10]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function _C(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[23],searchable:n[3].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3],$$slots:{afterOptions:[hC]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Collection"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),c&8&&(d.searchable=f[3].length>5),c&8&&(d.items=f[3]),c&16777232&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function gC(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[23],items:n[6]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("Relation type"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function xc(n){let e,t,i,s,l,o;return t=new me({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[bC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[vC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),i=O(),s=b("div"),V(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&25165825&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&25165825&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(E(t.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function bC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Min select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].minSelect&&fe(l,u[0].minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function vC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Max select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].minSelect||2)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||2)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].maxSelect&&fe(l,f[0].maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function yC(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[15](h)}let m={multiple:!0,searchable:!0,id:n[23],selectPlaceholder:"Auto",items:n[5]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new tu({props:m}),se.push(()=>_e(r,"selected",d)),{c(){e=b("label"),t=b("span"),t.textContent="Display fields",i=O(),s=b("i"),o=O(),V(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23])},m(h
2023-02-26 16:47:00 +08:00
(aka. not ${H.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,_){_[1]&4096&&t!==(t=h[43])&&p(e,"id",t),_[0]&1&&(e.checked=h[0].required),_[0]&1&&o!==(o=gs(h[0])+"")&&le(r,o),f&&Bt(f.update)&&_[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])}
(aka. not ${H.zeroDefaultStr(h[0])}).`,position:"right"}),_[1]&4096&&c!==(c=h[43])&&p(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Pe(m)}}}function td(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[jC,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function jC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(s,"for",o=n[43])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function nd(n){let e,t,i,s,l,o,r,a,u,f;a=new ei({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[VC]},$$scope:{ctx:n}}});let c=n[8]&&id(n);return{c(){e=b("div"),t=b("div"),i=O(),s=b("div"),l=b("button"),o=b("i"),r=O(),V(a.$$.fragment),u=O(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,m){S(d,e,m),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),q(a,l,null),g(s,u),c&&c.m(s,null),f=!0},p(d,m){const h={};m[1]&8192&&(h.$$scope={dirty:m,ctx:d}),a.$set(h),d[8]?c?c.p(d,m):(c=id(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(E(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function VC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function id(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[3])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function HC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$;s=new me({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[CC,({uniqueId:N})=>({43:N}),({uniqueId:N})=>[0,N?4096:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:`
2023-02-22 04:24:49 +08:00
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[$C,({uniqueId:N})=>({43:N}),({uniqueId:N})=>[0,N?4096:0]]},$$scope:{ctx:n}}});const D=[RC,FC,NC,LC,PC,IC,AC,EC,DC,OC,MC],A=[];function I(N,R){return N[0].type==="text"?0:N[0].type==="number"?1:N[0].type==="bool"?2:N[0].type==="email"?3:N[0].type==="url"?4:N[0].type==="editor"?5:N[0].type==="date"?6:N[0].type==="select"?7:N[0].type==="json"?8:N[0].type==="file"?9:N[0].type==="relation"?10:-1}~(f=I(n))&&(c=A[f]=D[f](n)),h=new me({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[qC,({uniqueId:N})=>({43:N}),({uniqueId:N})=>[0,N?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&td(n),F=!n[0].toDelete&&nd(n);return{c(){e=b("form"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),a=O(),u=b("div"),c&&c.c(),d=O(),m=b("div"),V(h.$$.fragment),_=O(),v=b("div"),L&&L.c(),k=O(),F&&F.c(),y=O(),T=b("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(v,"class","col-sm-4 flex"),p(t,"class","grid"),p(T,"type","submit"),p(T,"class","hidden"),p(T,"tabindex","-1"),p(e,"class","field-form")},m(N,R){S(N,e,R),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),~f&&A[f].m(u,null),g(t,d),g(t,m),q(h,m,null),g(t,_),g(t,v),L&&L.m(v,null),g(t,k),F&&F.m(t,null),g(e,y),g(e,T),C=!0,M||($=[Y(e,"dragstart",UC),Y(e,"submit",dt(n[32]))],M=!0)},p(N,R){const K={};R[0]&1&&(K.class="form-field required "+(N[0].id?"readonly":"")),R[0]&2&&(K.name="schema."+N[1]+".type"),R[0]&1|R[1]&12288&&(K.$$scope={dirty:R,ctx:N}),s.$set(K);const Q={};R[0]&33&&(Q.class=`
2023-02-22 04:24:49 +08:00
form-field
required
`+(N[5]?"":"invalid")+`
`+(N[0].id&&N[0].system?"disabled":"")+`
`),R[0]&2&&(Q.name="schema."+N[1]+".name"),R[0]&33|R[1]&12288&&(Q.$$scope={dirty:R,ctx:N}),r.$set(Q);let U=f;f=I(N),f===U?~f&&A[f].p(N,R):(c&&(re(),P(A[U],1,1,()=>{A[U]=null}),ae()),~f?(c=A[f],c?c.p(N,R):(c=A[f]=D[f](N),c.c()),E(c,1),c.m(u,null)):c=null);const X={};R[0]&1|R[1]&12288&&(X.$$scope={dirty:R,ctx:N}),h.$set(X),N[0].type!=="file"?L?(L.p(N,R),R[0]&1&&E(L,1)):(L=td(N),L.c(),E(L,1),L.m(v,null)):L&&(re(),P(L,1,1,()=>{L=null}),ae()),N[0].toDelete?F&&(re(),P(F,1,1,()=>{F=null}),ae()):F?(F.p(N,R),R[0]&1&&E(F,1)):(F=nd(N),F.c(),E(F,1),F.m(t,null))},i(N){C||(E(s.$$.fragment,N),E(r.$$.fragment,N),E(c),E(h.$$.fragment,N),E(L),E(F),C=!0)},o(N){P(s.$$.fragment,N),P(r.$$.fragment,N),P(c),P(h.$$.fragment,N),P(L),P(F),C=!1},d(N){N&&w(e),j(s),j(r),~f&&A[f].d(),j(h),L&&L.d(),F&&F.d(),M=!1,Pe($)}}}function sd(n){let e,t,i,s,l=n[0].system&&ld(),o=!n[0].id&&od(n),r=n[0].required&&rd(n),a=n[0].unique&&ad();return{c(){e=b("div"),l&&l.c(),t=O(),o&&o.c(),i=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=ld(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=od(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=rd(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ad(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function ld(n){let e;return{c(){e=b("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function od(n){let e;return{c(){e=b("span"),e.textContent="New",p(e,"class","label"),x(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&x(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function rd(n){let e,t=gs(n[0])+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function ad(n){let e;return{c(){e=b("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ud(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function fd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[16])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function zC(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,_,v,k=!n[0].toDelete&&sd(n),y=n[7]&&!n[0].system&&ud(),T=n[0].toDelete&&fd(n);return{c(){e=b("div"),t=b("span"),i=b("i"),l=O(),o=b("strong"),a=B(r),f=O(),k&&k.c(),c=O(),d=b("div"),m=O(),y&&y.c(),h=O(),T&&T.c(),_=$e(),p(i,"class",s=Si(H.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),x(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),S(C,f,M),k&&k.m(C,M),S(C,c,M),S(C,d,M),S(C,m,M),y&&y.m(C,M),S(C,h,M),T&&T.m(C,M),S(C,_,M),v=!0},p(C,M){(!v||M[0]&1&&s!==(s=Si(H.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!v||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&le(a,r),(!v||M[0]&1&&u!==(u=C[0].name))&&p(o,"title",u),(!v||M[0]&1)&&x(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?k&&(k.d(1),k=null):k?k.p(C,M):(k=sd(C),k.c(),k.m(c.parentNode,c)),C[7]&&!C[0].system?y?M[0]&129&&E(y,1):(y=ud(),y.c(),E(y,1),y.m(h.parentNode,h)):y&&(re(),P(y,1,1,()=>{y=null}),ae()),C[0].toDelete?T?T.p(C,M):(T=fd(C),T.c(),T.m(_.parentNode,_)):T&&(T.d(1),T=null)},i(C){v||(E(y),v=!0)},o(C){P(y),v=!1},d(C){C&&w(e),C&&w(f),k&&k.d(C),C&&w(c),C&&w(d),C&&w(m),y&&y.d(C),C&&w(h),T&&T.d(C),C&&w(_)}}}function B
`),t=b("code"),t.textContent="username",i=B(` ,
`),s=b("code"),s.textContent="email",l=B(` ,
`),o=b("code"),o.textContent="emailVisibility",r=B(` ,
`),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function pd(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new YC({props:f}),se.push(()=>_e(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),q(i,c,d),l=!0},p(c,d){e=c;const m={};d&1&&(m.key=e[15]),d&3&&(m.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,m.field=e[13],ke(()=>s=!1)),i.$set(m)},i(c){l||(E(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function KC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,_,v,k,y,T,C,M,$,D,A,I,L=n[0].isAuth&&dd(),F=n[0].schema;const N=R=>R[13];for(let R=0;R<F.length;R+=1){let K=cd(n,F,R),Q=N(K);h.set(Q,m[R]=pd(Q,K))}return{c(){e=b("div"),t=b("p"),i=B(`System fields:
`),s=b("code"),s.textContent="id",l=B(` ,
`),o=b("code"),o.textContent="created",r=B(` ,
2023-02-24 22:33:57 +08:00
`),a=b("code"),a.textContent="updated",u=O(),L&&L.c(),f=B(`
.`),c=O(),d=b("div");for(let R=0;R<m.length;R+=1)m[R].c();_=O(),v=b("div"),k=O(),y=b("button"),T=b("i"),C=O(),M=b("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(v,"class","clearfix m-t-xs"),p(T,"class","ri-add-line"),p(M,"class","txt"),p(y,"type","button"),p(y,"class",$="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(R,K){S(R,e,K),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),L&&L.m(t,null),g(t,f),S(R,c,K),S(R,d,K);for(let Q=0;Q<m.length;Q+=1)m[Q].m(d,null);S(R,_,K),S(R,v,K),S(R,k,K),S(R,y,K),g(y,T),g(y,C),g(y,M),D=!0,A||(I=Y(y,"click",n[3]),A=!0)},p(R,[K]){R[0].isAuth?L||(L=dd(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),K&55&&(F=R[0].schema,re(),m=wt(m,K,N,1,R,F,h,d,ln,pd,null,cd),ae()),(!D||K&1&&$!==($="btn btn-block "+(R[0].schema.length?"btn-transparent":"btn-secondary")))&&p(y,"class",$)},i(R){if(!D){for(let K=0;K<F.length;K+=1)E(m[K]);D=!0}},o(R){for(let K=0;K<m.length;K+=1)P(m[K]);D=!1},d(R){R&&w(e),L&&L.d(),R&&w(c),R&&w(d);for(let K=0;K<m.length;K+=1)m[K].d();R&&w(_),R&&w(v),R&&w(k),R&&w(y),A=!1,I()}}}function JC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function ZC(n,e,t){let{collection:i=new pn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(v){i.schema[v]&&(i.schema.splice(v,1),t(0,i))}function r(){const v=new mn({name:a()});v.onMountExpand=!0,i.schema.push(v),t(0,i)}function a(v="field"){let k="";for(;u(v+k);)++k;return v+k}function u(v){return!!i.schema.find(k=>k.name===v)}function f(v){let k=[];if(v.toDelete)return k;for(let y of i.schema)y===v||y.toDelete||k.push(y.name);return k}function c(v,k){if(!v)return;v.dataTransfer.dropEffect="move";const y=parseInt(v.dataTransfer.getData("text/plain")),T=i.schema;y<k?(T.splice(k+1,0,T[y]),T.splice(y,1)):(T.splice(k,0,T[y]),T.splice(y+1,1)),t(0,i.schema=T,i)}function d(v,k,y,T){y[T]=v,t(0,i)}const m=v=>o(v),h=(v,k)=>JC(k==null?void 0:k.detail,v),_=(v,k)=>c(k==null?void 0:k.detail,v);return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new pn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,m,h,_]}class GC extends ye{constructor(e){super(),ve(this,e,ZC,KC,he,{collection:0})}}const XC=n=>({isAdminOnly:n&256}),md=n=>({isAdminOnly:n[8]});function QC(n){let e,t;return e=new me({props:{class:"form-field rule-field m-0 "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[l$,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field m-0 "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function xC(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function e$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1izx0et")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function t$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-1izx0et")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function n$(n){let e;return{c(){e=B("Leave empty to grant everyone access.")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function i$(n){let e,t,i,s,l;return{c(){e=B(`Only admins will be able to perform this action (
`),t=b("button"),t.textContent="unlock to change",i=B(`
).`),p(t,"type","button"),p(t,"class","link-primary")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(t,"click",n[9]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function s$(n){let e;function t(l,o){return l[8]?i$:n$}let i=t(n),s=i(n);return{c(){e=b("p"),s.c()},m(l,o){S(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&w(e),s.d()}}}function l$(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,m,h,_;function v(I,L){return I[8]?t$:e$}let k=v(n),y=k(n);function T(I){n[13](I)}var C=n[6];function M(I){let L={id:I[17],baseCollection:I[1],disabled:I[8]};return I[0]!==void 0&&(L.value=I[0]),{props:L}}C&&(c=jt(C,M(n)),n[12](c),se.push(()=>_e(c,"value",T)));const $=n[11].default,D=Nt($,n,n[14],md),A=D||s$(n);return{c(){e=b("label"),t=b("span"),i=B(n[2]),s=O(),l=b("span"),r=B(o),a=O(),y.c(),f=O(),c&&V(c.$$.fragment),m=O(),h=b("div"),A&&A.c(),p(t,"class","txt"),x(t,"txt-hint",n[8]),p(l,"class","label label-sm svelte-1izx0et"),p(e,"for",u=n[17]),p(e,"class","svelte-1izx0et"),p(h,"class","help-block")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(e,s),g(e,l),g(l,r),g(e,a),y.m(e,null),S(I,f,L),c&&q(c,I,L),S(I,m,L),S(I,h,L),A&&A.m(h,null),_=!0},p(I,L){(!_||L&4)&&le(i,I[2]),(!_||L&256)&&x(t,"txt-hint",I[8]),(!_||L&256)&&o!==(o=I[8]?"Admins only":"Custom rule")&&le(r,o),k===(k=v(I))&&y?y.p(I,L):(y.d(1),y=k(I),y&&(y.c(),y.m(e,null))),(!_||L&131072&&u!==(u=I[17]))&&p(e,"for",u);const F={};if(L&131072&&(F.id=I[17]),L&2&&(F.baseCollection=I[1]),L&256&&(F.disabled=I[8]),!d&&L&1&&(d=!0,F.value=I[0],ke(()=>d=!1)),C!==(C=I[6])){if(c){re();const N=c;P(N.$$.fragment,1,0,()=>{j(N,1)}),ae()}C?(c=jt(C,M(I)),I[12](c),se.push(()=>_e(c,"value",T)),V(c.$$.fragment),E(c.$$.fragment,1),q(c,m.parentNode,m)):c=null}else C&&c.$set(F);D?D.p&&(!_||L&16640)&&Rt(D,$,I,I[14],_?Ft($,I[14],L,XC):qt(I[14]),md):A&&A.p&&(!_||L&256)&&A.p(I,_?L:-1)},i(I){_||(c&&E(c.$$.fragment,I),E(A,I),_=!0)},o(I){c&&P(c.$$.fragment,I),P(A,I),_=!1},d(I){I&&w(e),y.d(),I&&w(f),n[12](null),c&&j(c,I),I&&w(m),I&&w(h),A&&A.d(I)}}}function o$(n){let e,t,i,s;const l=[xC,QC],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=$e()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let hd;function r$(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,m=hd,h=!1;_();async function _(){m||h||(t(7,h=!0),t(6,m=(await rt(()=>import("./FilterAutocompleteInput-8a4f87de.js"),["./FilterAutocompleteInput-8a4f87de.js","./index-96653a6b.js"],import.meta.url)).default),hd=m,t(7,h=!1))}async function v(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y(C){se[C?"unshift":"push"](()=>{c=C,t(5,c)})}function T(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"$$scope"in C&&t(14,l=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,v,k,s,y,T,l]}class Ts extends ye{constructor(e){super(),ve(this,e,r$,o$,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function _d(n,e,t){const i=n.slice();return i[10]=e[t],i}function gd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I=n[2],L=[];for(let F=0;F<I.length;F+=1)L[F]=bd(_d(n,I,F));return{c(){e=b("div"),t=b("div"),i=b("div"),s=b("p"),s.textContent="The following record fields are available:",l=O(),o=b("div");for(let F=0;F<L.length;F+=1)L[F].c();r=O(),a=b("hr"),u=O(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=O(),d=b("div"),d.innerHTML=`<code>@request.method</code>
2023-02-22 04:24:49 +08:00
<code>@request.query.*</code>
<code>@request.data.*</code>
2023-02-26 16:47:00 +08:00
<code>@request.auth.*</code>`,m=O(),h=b("hr"),_=O(),v=b("p"),v.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=O(),y=b("div"),y.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=O(),C=b("hr"),M=O(),$=b("p"),$.innerHTML=`Example rule:
2023-02-22 04:24:49 +08:00
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(v,"class","m-b-0"),p(y,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){S(F,e,N),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let R=0;R<L.length;R+=1)L[R].m(o,null);g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(i,h),g(i,_),g(i,v),g(i,k),g(i,y),g(i,T),g(i,C),g(i,M),g(i,$),A=!0},p(F,N){if(N&4){I=F[2];let R;for(R=0;R<I.length;R+=1){const K=_d(F,I,R);L[R]?L[R].p(K,N):(L[R]=bd(K),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=I.length}},i(F){A||(F&&xe(()=>{D||(D=je(e,At,{duration:150},!0)),D.run(1)}),A=!0)},o(F){F&&(D||(D=je(e,At,{duration:150},!1)),D.run(0)),A=!1},d(F){F&&w(e),ht(L,F),F&&D&&D.end()}}}function bd(n){let e,t=n[10]+"",i;return{c(){e=b("code"),i=B(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function vd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;function v($){n[6]($)}let k={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new Ts({props:k}),se.push(()=>_e(i,"rule",v));function y($){n[7]($)}let T={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(T.rule=n[0].updateRule),a=new Ts({props:T}),se.push(()=>_e(a,"rule",y));function C($){n[8]($)}let M={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),m=new Ts({props:M}),se.push(()=>_e(m,"rule",C)),{c(){e=b("hr"),t=O(),V(i.$$.fragment),l=O(),o=b("hr"),r=O(),V(a.$$.fragment),f=O(),c=b("hr"),d=O(),V(m.$$.fragment),p(e,"class","m-t-sm m-b-sm"),p(o,"class","m-t-sm m-b-sm"),p(c,"class","m-t-sm m-b-sm")},m($,D){S($,e,D),S($,t,D),q(i,$,D),S($,l,D),S($,o,D),S($,r,D),q(a,$,D),S($,f,D),S($,c,D),S($,d,D),q(m,$,D),_=!0},p($,D){const A={};D&1&&(A.collection=$[0]),!s&&D&1&&(s=!0,A.rule=$[0].createRule,ke(()=>s=!1)),i.$set(A);const I={};D&1&&(I.collection=$[0]),!u&&D&1&&(u=!0,I.rule=$[0].updateRule,ke(()=>u=!1)),a.$set(I);const L={};D&1&&(L.collection=$[0]),!h&&D&1&&(h=!0,L.rule=$[0].deleteRule,ke(()=>h=!1)),m.$set(L)},i($){_||(E(i.$$.fragment,$),E(a.$$.fragment,$),E(m.$$.fragment,$),_=!0)},o($){P(i.$$.fragment,$),P(a.$$.fragment,$),P(m.$$.fragment,$),_=!1},d($){$&&w(e),$&&w(t),j(i,$),$&&w(l),$&&w(o),$&&w(r),j(a,$),$&&w(f),$&&w(c),$&&w(d),j(m,$)}}}function yd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[a$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new Ts({props:r}),se.push(()=>_e(i,"rule",o)),{c(){e=b("hr"),t=O(),V(i.$$.fragment),p(e,"class","m-t-sm m-b-sm")},m(a,u){S(a,e,u),S(a,t,u),q(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&8192&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,ke(()=>s=!1)),i.$set(f)},i(a){l||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function a$(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
2023-02-22 04:24:49 +08:00
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=O(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:G,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function u$(n){var K,Q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D=n[1]&&gd(n);function A(U){n[4](U)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new Ts({props:I}),se.push(()=>_e(f,"rule",A));function L(U){n[5](U)}let F={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(F.rule=n[0].viewRule),_=new Ts({props:F}),se.push(()=>_e(_,"rule",L));let N=!((K=n[0])!=null&&K.isView)&&vd(n),R=((Q=n[0])==null?void 0:Q.isAuth)&&yd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
2023-02-22 04:24:49 +08:00
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=O(),l=b("button"),r=B(o),a=O(),D&&D.c(),u=O(),V(f.$$.fragment),d=O(),m=b("hr"),h=O(),V(_.$$.fragment),k=O(),N&&N.c(),y=O(),R&&R.c(),T=$e(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base handle"),x(e,"fade",!n[1]),p(m,"class","m-t-sm m-b-sm")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),D&&D.m(e,null),S(U,u,X),q(f,U,X),S(U,d,X),S(U,m,X),S(U,h,X),q(_,U,X),S(U,k,X),N&&N.m(U,X),S(U,y,X),R&&R.m(U,X),S(U,T,X),C=!0,M||($=Y(l,"click",n[3]),M=!0)},p(U,[X]){var ue,Z;(!C||X&2)&&o!==(o=U[1]?"Hide available fields":"Show available fields")&&le(r,o),U[1]?D?(D.p(U,X),X&2&&E(D,1)):(D=gd(U),D.c(),E(D,1),D.m(e,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),(!C||X&2)&&x(e,"fade",!U[1]);const ne={};X&1&&(ne.collection=U[0]),!c&&X&1&&(c=!0,ne.rule=U[0].listRule,ke(()=>c=!1)),f.$set(ne);const J={};X&1&&(J.collection=U[0]),!v&&X&1&&(v=!0,J.rule=U[0].viewRule,ke(()=>v=!1)),_.$set(J),(ue=U[0])!=null&&ue.isView?N&&(re(),P(N,1,1,()=>{N=null}),ae()):N?(N.p(U,X),X&1&&E(N,1)):(N=vd(U),N.c(),E(N,1),N.m(y.parentNode,y)),(Z=U[0])!=null&&Z.isAuth?R?(R.p(U,X),X&1&&E(R,1)):(R=yd(U),R.c(),E(R,1),R.m(T.parentNode,T)):R&&(re(),P(R,1,1,()=>{R=null}),ae())},i(U){C||(E(D),E(f.$$.fragment,U),E(_.$$.fragment,U),E(N),E(R),C=!0)},o(U){P(D),P(f.$$.fragment,U),P(_.$$.fragment,U),P(N),P(R),C=!1},d(U){U&&w(e),D&&D.d(),U&&w(u),j(f,U),U&&w(d),U&&w(m),U&&w(h),j(_,U),U&&w(k),N&&N.d(U),U&&w(y),R&&R.d(U),U&&w(T),M=!1,$()}}}function f$(n,e,t){let i,{collection:s=new pn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class c$ extends ye{constructor(e){super(),ve(this,e,f$,u$,he,{collection:0})}}function kd(n,e,t){const i=n.slice();return i[9]=e[t],i}function d$(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=jt(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=$e()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),o!==(o=a[1])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function p$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function wd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Sd(kd(n,i,l));return{c(){e=b("div"),t=b("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),g(e,t);for(let r=0;r<s.length;r+=1)s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=kd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Sd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),ht(s,l)}}}function Sd(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=B(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function m$(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[p$,d$],m=[];function h(v,k){return v[2]?0:1}l=h(n),o=m[l]=d[l](n);let _=n[3].length&&wd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Sel
2023-02-22 04:24:49 +08:00
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=O(),_&&_.c(),f=$e(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),m[l].m(v,k),S(v,r,k),S(v,a,k),S(v,u,k),_&&_.m(v,k),S(v,f,k),c=!0},p(v,k){(!c||k&256&&i!==(i=v[8]))&&p(e,"for",i);let y=l;l=h(v),l===y?m[l].p(v,k):(re(),P(m[y],1,1,()=>{m[y]=null}),ae(),o=m[l],o?o.p(v,k):(o=m[l]=d[l](v),o.c()),E(o,1),o.m(r.parentNode,r)),v[3].length?_?_.p(v,k):(_=wd(v),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(v){c||(E(o),c=!0)},o(v){P(o),c=!1},d(v){v&&w(e),v&&w(s),m[l].d(v),v&&w(r),v&&w(a),v&&w(u),_&&_.d(v),v&&w(f)}}}function h$(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[m$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function _$(n,e,t){let i;Ye(n,fi,c=>t(4,i=c));let{collection:s=new pn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=H.getNestedVal(c,"schema",null);if(H.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=H.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);H.removeByValue(m,"id"),H.removeByValue(m,"created"),H.removeByValue(m,"updated");for(let _ in d)for(let v in d[_]){const k=d[_][v].message,y=m[_]||_;r.push(H.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-26a8b39e.js"),["./CodeEditor-26a8b39e.js","./index-96653a6b.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&Qi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class g$ extends ye{constructor(e){super(),ve(this,e,_$,h$,he,{collection:0})}}function b$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function v$(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[b$,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function y$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function k$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function w$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowUsernameAuth?k$:y$}let u=a(n),f=u(n),c=n[3]&&Td();return{c(){e=b("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=$e(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?m&8&&E(c,1):(c=Td(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function S$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[T$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[C$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(H.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(H.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(E(i.$$.fragment,u),E(o.$$.fragment,u),u&&xe(()=>{r||(r=je(e,At,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=je(e,At,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function T$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[7](v)}let _={id:n[12],disabled:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Ns({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Ue.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!H.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function C$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[8](v)}let _={id:n[12],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Ns({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Ue.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!H.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function $$(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[S$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Cd(n);return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=$e()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&E(l,1)):(l=Cd(o),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function M$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function O$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $d(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function D$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?O$:M$}let u=a(n),f=u(n),c=n[2]&&$d();return{c(){e=b("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=$e(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?m&4&&E(c,1):(c=$d(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function E$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Md(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,At,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function A$(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[E$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Md();return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=$e()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&E(l,1):(l=Md(),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function I$(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function P$(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Od(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function L$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?P$:I$}let u=a(n),f=u(n),c=n[1]&&Od();return{c(){e=b("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=$e(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?m&2&&E(c,1):(c=Od(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(re(),P(c,1,1,()=>{c=null}),ae())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function N$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Minimum password length"),s=O(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&fe(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function F$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.textContent="Always require email",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(Ue.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function R$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return s=new ks({props:{single:!0,$$slots:{header:[w$],default:[v$]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[D$],default:[$$]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[L$],default:[A$]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[N$,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),v=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[F$,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=O(),i=b("div"),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),f=b("hr"),c=O(),d=b("h4"),d.textContent="General",m=O(),V(h.$$.fragment),_=O(),V(v.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(y,T){S(y,e,T),S(y,t,T),S(y,i,T),q(s,i,null),g(i,l),q(o,i,null),g(i,r),q(a,i,null),S(y,u,T),S(y,f,T),S(y,c,T),S(y,d,T),S(y,m,T),q(h,y,T),S(y,_,T),q(v,y,T),k=!0},p(y,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:y}),s.$set(C);const M={};T&8197&&(M.$$scope={dirty:T,ctx:y}),o.$set(M);const $={};T&8195&&($.$$scope={dirty:T,ctx:y}),a.$set($);const D={};T&12289&&(D.$$scope={dirty:T,ctx:y}),h.$set(D);const A={};T&12289&&(A.$$scope={dirty:T,ctx:y}),v.$set(A)},i(y){k||(E(s.$$.fragment,y),E(o.$$.fragment,y),E(a.$$.fragment,y),E(h.$$.fragment,y),E(v.$$.fragment,y),k=!0)},o(y){P(s.$$.fragment,y),P(o.$$.fragment,y),P(a.$$.fragment,y),P(h.$$.fragment,y),P(v.$$.fragment,y),k=!1},d(y){y&&w(e),y&&w(t),y&&w(i),j(s),j(o),j(a),y&&w(u),y&&w(f),y&&w(c),y&&w(d),y&&w(m),j(h,y),y&&w(_),j(v,y)}}}function q$(n,e,t){let i,s,l,o;Ye(n,fi,_=>t(4,o=_));let{collection:r=new pn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function c(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,v,k,y;n.$$.dirty&1&&r.isAuth&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!H.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,h]}class j$ extends ye{constructor(e){super(),ve(this,e,q$,R$,he,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ad(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Id(n){var r;let e,t,i,s,l=n[2]&&Pd(n),o=!((r=n[1])!=null&&r.isView)&&Ld(n);return{c(){e=b("h6"),e.textContent="Changes:",t=O(),i=b("ul"),l&&l.c(),s=O(),o&&o.c(),p(i,"class","changes-list svelte-1ghly2p")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(a,u){var f;a[2]?l?l.p(a,u):(l=Pd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[1])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Ld(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d
`),s=b("strong"),o=B(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=B(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&2&&l!==(l=m[1].originalName+"")&&le(o,l),h&2&&c!==(c=m[1].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Ld(n){let e,t,i=n[5],s=[];for(let r=0;r<i.length;r+=1)s[r]=Nd(Ed(n,i,r));let l=n[4],o=[];for(let r=0;r<l.length;r+=1)o[r]=Fd(Dd(n,l,r));return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=O();for(let r=0;r<o.length;r+=1)o[r].c();t=$e()},m(r,a){for(let u=0;u<s.length;u+=1)s[u].m(r,a);S(r,e,a);for(let u=0;u<o.length;u+=1)o[u].m(r,a);S(r,t,a)},p(r,a){if(a&32){i=r[5];let u;for(u=0;u<i.length;u+=1){const f=Ed(r,i,u);s[u]?s[u].p(f,a):(s[u]=Nd(f),s[u].c(),s[u].m(e.parentNode,e))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}if(a&16){l=r[4];let u;for(u=0;u<l.length;u+=1){const f=Dd(r,l,u);o[u]?o[u].p(f,a):(o[u]=Fd(f),o[u].c(),o[u].m(t.parentNode,t))}for(;u<o.length;u+=1)o[u].d(1);o.length=l.length}},d(r){ht(s,r),r&&w(e),ht(o,r),r&&w(t)}}}function Nd(n){let e,t,i,s,l=n[15].originalName+"",o,r,a,u,f,c=n[15].name+"",d;return{c(){e=b("li"),t=b("div"),i=B(`Renamed field
`),s=b("strong"),o=B(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=B(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&32&&l!==(l=m[15].originalName+"")&&le(o,l),h&32&&c!==(c=m[15].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Fd(n){let e,t,i,s=n[15].name+"",l,o;return{c(){e=b("li"),t=B("Removed field "),i=b("span"),l=B(s),o=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&16&&s!==(s=r[15].name+"")&&le(l,s)},d(r){r&&w(e)}}}function V$(n){let e,t,i,s,l,o,r,a,u=n[4].length&&Ad(),f=n[6]&&Id(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=O(),u&&u.c(),r=O(),f&&f.c(),a=$e(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[4].length?u||(u=Ad(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[6]?f?f.p(c,d):(f=Id(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function H$(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function z$(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[9]),Y(i,"click",n[10])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function B$(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[z$],header:[H$],default:[V$]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&1048694&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function U$(n,e,t){let i,s,l,o;const r=$t();let a,u;async function f(y){t(1,u=y),await sn(),!i&&!s.length&&!l.length?d():a==null||a.show()}function c(){a==null||a.hide()}function d(){c(),r("confirm")}const m=()=>c(),h=()=>d();function _(y){se[y?"unshift":"push"](()=>{a=y,t(3,a)})}function v(y){ze.call(this,n,y)}function k(y){ze.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=(u==null?void 0:u.originalName)!=(u==null?void 0:u.name)),n.$$.dirty&2&&t(5,s=(u==null?void 0:u.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(4,l=(u==null?void 0:u.schema.filter(y=>y.id&&y.toDelete))||[]),n.$$.dirty&6&&t(6,o=i||!(u!=null&&u.isView))},[c,u,i,a,l,s,o,d,f,m,h,_,v,k]}class W$ extends ye{constructor(e){super(),ve(this,e,U$,B$,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Rd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function Y$(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new GC({props:l}),se.push(()=>_e(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function K$(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new g$({props:l}),se.push(()=>_e(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function qd(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new c$({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function jd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new j$({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===Es)},i(r){s||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function J$(n){let e,t,i,s,l,o,r;const a=[K$,Y$],u=[];function f(m,h){return m[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===bl&&qd(
2023-02-24 22:33:57 +08:00
<span class="txt">Duplicate</span>`,t=O(),i=b("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(dt(n[24])))],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function Hd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[G$]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),V(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function zd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=O(),l=b("span"),r=B(o),a=B(" collection"),u=O(),p(t,"class",i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,h){S(m,e,h),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function G$(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=zd(Rd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=$e()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=Rd(s,t,o);i[o]?i[o].p(r,l):(i[o]=zd(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function Bd(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function X$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k=(n[6][n[2].type]||"N/A")+"",y,T,C,M,$,D,A,I,L,F=n[2].isNew&&Hd(n),N=n[2].system&&Bd();return{c(){e=b("label"),t=B("Name"),s=O(),l=b("input"),f=O(),c=b("div"),d=b("button"),m=b("span"),h=O(),_=b("span"),v=B("Type: "),y=B(k),T=O(),F&&F.c(),$=O(),N&&N.c(),D=$e(),p(e,"for",i=n[46]),p(l,"type","text"),p(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(_,"class","txt"),p(d,"type","button"),p(d,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(R,K){S(R,e,K),g(e,t),S(R,s,K),S(R,l,K),S(R,f,K),S(R,c,K),g(c,d),g(d,m),g(d,h),g(d,_),g(_,v),g(_,y),g(d,T),F&&F.m(d,null),S(R,$,K),N&&N.m(R,K),S(R,D,K),A=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[25]),I=!0)},p(R,K){(!A||K[1]&32768&&i!==(i=R[46]))&&p(e,"for",i),(!A||K[1]&32768&&o!==(o=R[46]))&&p(l,"id",o),(!A||K[0]&8192)&&(l.disabled=R[13]),(!A||K[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!A||K[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!A||K[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!A||K[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le(y,k),R[2].isNew?F?(F.p(R,K),K[0]&4&&E(F,1)):(F=Hd(R),F.c(),E(F,1),F.m(d,null)):F&&(re(),P(F,1,1,()=>{F=null}),ae()),(!A||K[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",C),(!A||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?N||(N=Bd(),N.c(),N.m(D.parentNode,D)):N&&(N.d(1),N=null)},i(R){A||(E(F),A=!0)},o(R){P(F),A=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),F&&F.d(),R&&w($),N&&N.d(R),R&&w(D),I=!1,L()}}}function Ud(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{i||(i=je(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=je(e,It,{duration:
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function i4(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,_,v,k,y,T,C=n[3];const M=I=>I[15].id;for(let I=0;I<C.length;I+=1){let L=Gd(n,C,I),F=M(L);m.set(F,d[I]=xd(F,L))}let $=null;C.length||($=Xd(n));let D=!n[7]&&ep(n),A={};return v=new iu({props:A}),n[13](v),v.$on("save",n[14]),{c(){e=b("aside"),t=b("header"),i=b("div"),s=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',o=O(),r=b("input"),a=O(),u=b("hr"),f=O(),c=b("div");for(let I=0;I<d.length;I+=1)d[I].c();$&&$.c(),h=O(),D&&D.c(),_=O(),V(v.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),x(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),x(c,"fade",n[6]),x(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),fe(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let F=0;F<d.length;F+=1)d[F].m(c,null);$&&$.m(c,null),g(e,h),D&&D.m(e,null),S(I,_,L),q(v,I,L),k=!0,y||(T=[Y(l,"click",n[10]),Y(r,"input",n[11])],y=!0)},p(I,[L]){(!k||L&16)&&x(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&fe(r,I[0]),(!k||L&16)&&x(i,"active",I[4]),L&42&&(C=I[3],d=wt(d,L,M,1,I,C,m,c,es,xd,null,Gd),!C.length&&$?$.p(I,L):C.length?$&&($.d(1),$=null):($=Xd(I),$.c(),$.m(c,null))),(!k||L&64)&&x(c,"fade",I[6]),(!k||L&8)&&x(c,"sidebar-content-compact",I[3].length>20),I[7]?D&&(D.d(1),D=null):D?D.p(I,L):(D=ep(I),D.c(),D.m(e,null));const F={};v.$set(F)},i(I){k||(E(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();$&&$.d(),D&&D.d(),I&&w(_),n[13](null),j(v,I),y=!1,Pe(T)}}}function s4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function l4(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Po,y=>t(6,a=y)),Ye(n,$s,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const _=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var T;(T=y.detail)!=null&&T.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&s4(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,h,_,v,k]}class o4 extends ye{constructor(e){super(),ve(this,e,l4,i4,he,{})}}function tp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function np(n){n[18]=n[19].default}function ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function sp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&sp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=$e(),c&&c.c(),s=O(),l=b("button"),r=B(o),a=O(),p(l,"type","button"),p(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),g(l,r),g(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=sp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&x(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function op(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:u4,then:a4,catch:r4,value:19,blocks:[,,,]};return ru(t=n[15].component,s),{c(){e=$e(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e
`),D&&D.c(),d=O(),h.c(),_=$e(),p(e,"class","flex m-b-base flex-gap-10"),p(l,"class","list picker-list m-b-base svelte-1u8jhky"),p(f,"class","section-title")},m(N,R){S(N,e,R),q(t,e,null),g(e,i),T&&T.m(e,null),S(N,s,R),S(N,l,R);for(let K=0;K<o.length;K+=1)o[K].m(l,null);$&&$.m(l,null),S(N,u,R),S(N,f,R),g(f,c),D&&D.m(f,null),S(N,d,R),I[m].m(N,R),S(N,_,R),v=!0,k||(y=Ie(a=DM.call(null,l,n[36])),k=!0)},p(N,R){var U;const K={};R[0]&4&&(K.value=N[2]),R[0]&1024&&(K.autocompleteCollection=N[10]),t.$set(K),(U=N[10])!=null&&U.isView?T&&(T.d(1),T=null):T?T.p(N,R):(T=$p(N),T.c(),T.m(e,null)),R[0]&145324&&(C=N[3],re(),o=wt(o,R,M,1,N,C,r,l,ln,Ep,null,Cp),ae(),!C.length&&$?$.p(N,R):C.length?$&&($.d(1),$=null):($=Mp(N),$.c(),$.m(l,null))),a&&Bt(a.update)&&R[0]&2064&&a.update.call(null,N[36]),N[5]>1?D?D.p(N,R):(D=Ap(N),D.c(),D.m(f,null)):D&&(D.d(1),D=null);let Q=m;m=L(N),m===Q?I[m].p(N,R):(re(),P(I[Q],1,1,()=>{I[Q]=null}),ae(),h=I[m],h?h.p(N,R):(h=I[m]=A[m](N),h.c()),E(h,1),h.m(_.parentNode,_))},i(N){if(!v){E(t.$$.fragment,N);for(let R=0;R<C.length;R+=1)E(o[R]);E(h),v=!0}},o(N){P(t.$$.fragment,N);for(let R=0;R<o.length;R+=1)P(o[R]);P(h),v=!1},d(N){N&&w(e),j(t),T&&T.d(),N&&w(s),N&&w(l);for(let R=0;R<o.length;R+=1)o[R].d();$&&$.d(),N&&w(u),N&&w(f),D&&D.d(),N&&w(d),I[m].d(N),N&&w(_),k=!1,y()}}}function UM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=b("h4"),t=B("Select "),i=b("strong"),l=B(s),o=B(" records")},m(a,u){S(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function WM(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function YM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[WM],header:[UM],default:[BM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Je(o,l[a]);e=new Nn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new Vb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?on(l,[l[0],l[1],xn(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&1024&&(c.collection=a[10]),i.$set(c)},i(a){s||(E(e.$$.fragment,a),E(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Er=100;function KM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=Et(e,c),m;Ye(n,Ai,Ae=>t(26,m=Ae));const h=$t(),_="picker_"+H.randomString(5);let{value:v}=e,{field:k}=e,y,T,C="",M=[],$=[],D=1,A=0,I=!1,L=!1;function F(){return t(2,C=""),t(3,M=[]),t(6,$=[]),R(),K(!0),y==null?void 0:y.show()}function N(){return y==null?void 0:y.hide()}async function R(){const Ae=H.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Er))et.push(`id="${bt}"`);nt.push(pe.collection(s).getFullList(Er,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,$=[]);for(const et of Ae){const bt=H.findByKey(ie,"id",et);bt&&$.push(bt)}C.trim()||t(3,M=H.filterDuplicatesByKey($.concat(M)))}catch(et){pe.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(C.trim()?t(3,M=[]):t(3,M=H.toArray($).slice()));try{const ie=Ae?1:D+1,we=await pe.collection(s).getList(ie,Er,{filter:C,sort:o!=null&&o.isView?"":"-created",$cancelKey:_+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(we.items))),D=we.page,t(23,A=we.totalItems)}catch(ie){pe.errorResponseHandler(ie)}t(4,I=!1)}}function Q(Ae){i==1?t(6,$=[Ae]):u&&(H.pushOrReplaceByKey($,Ae),t(6,$
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function qp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(m,h){S(m,e,h),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(e,r),a=!0,u||(f=[Ie(Ue.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var v;n=m;const _={};h&16&&(_.record=n[15]),h&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_)},i(m){a||(E(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function ZM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y=n[4],T=[];for(let $=0;$<y.length;$+=1)T[$]=qp(Pp(n,y,$));const C=$=>P(T[$],1,1,()=>{T[$]=null});let M=null;return y.length||(M=Np(n)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("div"),c=b("div");for(let $=0;$<T.length;$+=1)T[$].c();M&&M.c(),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-magic-line"></i>
2023-02-22 04:24:49 +08:00
<span class="txt">Open picker</span>`,p(t,"class",i=Si(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m($,D){S($,e,D),g(e,t),g(e,s),g(e,l),g(l,r),S($,u,D),S($,f,D),g(f,c);for(let A=0;A<T.length;A+=1)T[A].m(c,null);M&&M.m(c,null),g(f,d),g(f,m),g(m,h),_=!0,v||(k=Y(h,"click",n[9]),v=!0)},p($,D){if((!_||D&4&&i!==(i=Si(H.getFieldTypeIcon($[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!_||D&4)&&o!==(o=$[2].name+"")&&le(r,o),(!_||D&16384&&a!==(a=$[14]))&&p(e,"for",a),D&181){y=$[4];let A;for(A=0;A<y.length;A+=1){const I=Pp($,y,A);T[A]?(T[A].p(I,D),E(T[A],1)):(T[A]=qp(I),T[A].c(),E(T[A],1),T[A].m(c,null))}for(re(),A=y.length;A<T.length;A+=1)C(A);ae(),!y.length&&M?M.p($,D):y.length?M&&(M.d(1),M=null):(M=Np($),M.c(),M.m(c,null))}},i($){if(!_){for(let D=0;D<y.length;D+=1)E(T[D]);_=!0}},o($){T=T.filter(Boolean);for(let D=0;D<T.length;D+=1)P(T[D]);_=!1},d($){$&&w(e),$&&w(u),$&&w(f),ht(T,$),M&&M.d(),v=!1,k()}}}function GM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[ZM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new me({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new JM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const jp=100;function XM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var C,M;const k=H.toArray(s);if(!((C=o==null?void 0:o.options)!=null&&C.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),T=[];for(;y.length>0;){const $=[];for(const D of y.splice(0,jp))$.push(`id="${D}"`);T.push(pe.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(jp,{filter:$.join("||"),$autoCancel:!1}))}try{let $=[];await Promise.all(T).then(D=>{$=$.concat(...D)});for(const D of k){const A=H.findByKey($,"id",D);A&&a.push(A)}t(4,a)}catch($){pe.errorResponseHandler($)}t(5,u=!1)}function c(k){var y;H.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,m,h,_,v]}class QM extends ye{constructor(e){super(),ve(this,e,XM,GM,he,{value:0,picker:1,field:2})}}const xM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],e5=(n,e)=>{x
Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,T){T[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${y[2].created}
Updated: ${y[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),T[0]&4&&_!==(_=y[2].id)&&m.value!==_&&(m.value=_)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),v=!1,k()}}}function Wp(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new S4({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Yp();return{c(){V(e.$$.fragment),i=O(),a&&a.c(),s=$e()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,_;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Yp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(E(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Yp(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function P5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new QM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function L5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new OM({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(E(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function N5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new sM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function F5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new eM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function R5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new G4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function q5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new f5({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function j5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Y4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Xp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function W5(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Gp(n),u=n[0].isAuth&&n[7].email&&Xp(n);return{c(){a&&a.c(),e=O(),u&&u.c(),t=O(),i=b("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
2023-02-24 22:33:57 +08:00
<span class="txt">Duplicate</span>`,s=O(),l=b("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[Y(i,"click",n[25]),Y(l,"click",kn(dt(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Gp(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=Xp(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Pe(r)}}}function Qp(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=O(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[10]===Gi),p(s,"type","button"),p(s,"class","tab-item"),x(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[Y(t,"click",n[27]),Y(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&x(t,"active",r[10]===Gi),a[0]&1024&&x(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Pe(o)}}}function Y5(n){var _;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Zp(n),h=n[0].isAuth&&!n[2].isNew&&Qp(n);return{c(){e=b("h4"),i=B(t),s=O(),l=b("strong"),r=B(o),a=B(" record"),u=O(),m&&m.c(),f=O(),h&&h.c(),c=$e()},m(v,k){S(v,e,k),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),S(v,u,k),m&&m.m(v,k),S(v,f,k),h&&h.m(v,k),S(v,c,k),d=!0},p(v,k){var y;(!d||k[0]&4)&&t!==(t=v[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=v[0])==null?void 0:y.name)+"")&&le(r,o),v[2].isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(v,k),k[0]&4&&E(m,1)):(m=Zp(v),m.c(),E(m,1),m.m(f.parentNode,f)),v[0].isAuth&&!v[2].isNew?h?h.p(v,k):(h=Qp(v),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(v){d||(E(m),d=!0)},o(v){P(m),d=!1},d(v){v&&w(e),v&&w(u),m&&m.d(v),v&&w(f),h&&h.d(v),v&&w(c)}}}function K5(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),r=B(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[13]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],x(s,"btn-loading",n[8])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=Y(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&x(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function J5(n){var s;let e,t,i={class:`
2023-02-22 04:24:49 +08:00
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[K5],header:[Y5],default:[U5]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
2023-02-22 04:24:49 +08:00
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function xp(n){return JSON.stringify(n)}function Z5(n,e,t){let i,s,l,o;const r=$t(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ti,m=!1,h=!1,_={},v={},k="",y=Gi;function T(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M(ie){Bn({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ti),t(3,_={}),t(4,v={}),await sn(),t(20,k=xp(d))}function $(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=A();let we;d.isNew?we=pe.collection(u.id).create(ie):we=pe.collection(u.id).update(d.id,ie),we.then(nt=>{zt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),C(),r("save",nt)}).catch(nt=>{pe.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>pe.collection(c.collectionId).delete(c.id).then(()=>{C(),zt("Successfully deleted record."),r("delete",c)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function A(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),H.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=H.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=H.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>pe.collection(u.id).requestVerification(c.email).then(()=>{zt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>pe.collection(u.id).requestPasswordReset(c.email).then(()=>{zt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function F(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}T(ie),await sn(),t(20,k="")}const R=()=>C(),K=()=>I(),Q=()=>L(),U=()=>F(),X=()=>D(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function ue(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ge(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ce(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function be(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function He(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),C()}),!1):(Bn({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){ze.call(this,n,ie)}function Ae(ie){ze.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function FO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function RO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Om(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Dm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new Qo({props:{value:n[55].id}});let c=n[2].isAuth&&Em(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),a=B(r),u=O(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Em(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(E(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Em(n){let e;function t(l,o){return l[55].verified?jO:qO}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function qO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function jO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Am(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Im(n),o=i&&Pm(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=$e()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Im(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Pm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Im(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?HO:VO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function VO(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function HO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Pm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?BO:zO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function zO(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function tD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I,L,F=!n[10]&&Bm(n);c=new Ea({}),c.$on("refresh",n[16]);let N=!n[2].isView&&Um(n);k=new Uo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let Q={collection:n[2]};return n[0]!==void 0&&(Q.filter=n[0]),n[1]!==void 0&&(Q.sort=n[1]),M=new XO({props:Q}),n[20](M),se.push(()=>_e(M,"filter",R)),se.push(()=>_e(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=O(),l=b("div"),r=B(o),a=O(),u=b("div"),F&&F.c(),f=O(),V(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=O(),N&&N.c(),v=O(),V(k.$$.fragment),y=O(),T=b("div"),C=O(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-base")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),F&&F.m(u,null),g(u,f),q(c,u,null),g(e,d),g(e,m),g(m,h),g(m,_),N&&N.m(m,null),S(U,v,X),q(k,U,X),S(U,y,X),S(U,T,X),S(U,C,X),q(M,U,X),A=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,X){(!A||X[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?F&&(F.d(1),F=null):F?F.p(U,X):(F=Bm(U),F.c(),F.m(u,f)),U[2].isView?N&&(N.d(1),N=null):N?N.p(U,X):(N=Um(U),N.c(),N.m(m,null));const ne={};X[0]&1&&(ne.value=U[0]),X[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};X[0]&4&&(J.collection=U[2]),!$&&X[0]&1&&($=!0,J.filter=U[0],ke(()=>$=!1)),!D&&X[0]&2&&(D=!0,J.sort=U[1],ke(()=>D=!1)),M.$set(J)},i(U){A||(E(c.$$.fragment,U),E(k.$$.fragment,U),E(M.$$.fragment,U),A=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),A=!1},d(U){U&&w(e),F&&F.d(),j(c),N&&N.d(),U&&w(v),j(k,U),U&&w(y),U&&w(T),U&&w(C),n[20](null),j(M,U),I=!1,L()}}}function nD(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function iD(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function sD(n){let e,t,i;function s(r,a){return r[10]?iD:nD}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function lD(n){let e;return{c(){e=b("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function oD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[eD,xO,QO],m=[];function h(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new iu({props:_}),n[25](s);let v={};o=new m4({props:v}),n[26](o);let k={collection:n[2]};a=new Vb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new CO({props:y}),n[30](f),{c(){t.c(),i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),q(s,T,C),S(T,l,C),q(o,T,C),S(T,r,C),q(a,T,C),S(T,u,C),q(f,T,C),c=!0},p(T,C){let M=e;e=h(T),e===M?m[e].p(T,C):(re(),P(m[M],1,1,()=>{m[M]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const $={};s.$set($);const D={};o.$set(D);const A={};C[0]&4&&(A.collection=T[2]),a.$set(A);const I={};C[0]&4&&(I.collection=T[2]),f.$set(I)},i(T){c||(E(t),E(s.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(f.$$.fragment,T),c=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),c=!1},d(T){m[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function rD(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,St,Z=>t(31,l=Z)),Ye(n,Po,Z=>t(3,o=Z)),Ye(n,_a,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,$s,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Pb(y);const C=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),$=()=>_==null?void 0:_.load(),D=()=>d==null?void 0:d.show(s),A=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function F(Z){v=Z,t(0,v)}function N(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function Q(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function X(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function ue(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&F3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&T(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Oi("/collections?"+Z)}n.$$.dirty[0]&4&&Kt(St,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,C,M,$,D,A,I,L,F,N,R,K,Q,U,X,ne,J,ue]}class aD extends ye{constructor(e){super(),ve(this,e,rD,oD,he,{},null,[-1,-1])}}function uD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=O(),l=b("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
2023-02-24 22:33:57 +08:00
<span class="txt">Application</span>`,o=O(),r=b("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=O(),u=b("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=O(),c=b("div"),c.innerHTML='<span class="txt">Sync</span>',d=O(),m=b("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
2023-02-26 16:47:00 +08:00
<span class="txt">Export collections</span>`,h=O(),_=b("a"),_.innerHTML=`<i class="ri-install-line"></i>
2023-02-24 22:33:57 +08:00
<span class="txt">Import collections</span>`,v=O(),k=b("div"),k.textContent="Authentication",y=O(),T=b("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,C=O(),M=b("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,$=O(),D=b("a"),D.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(k,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(D,"href","/settings/admins"),p(D,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,F){S(L,e,F),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),g(t,f),g(t,c),g(t,d),g(t,m),g(t,h),g(t,_),g(t,v),g(t,k),g(t,y),g(t,T),g(t,C),g(t,M),g(t,$),g(t,D),A||(I=[Ie(qn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(qn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(qn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(qn.call(null,m,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,m)),Ie(qn.call(null,_,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,_)),Ie(qn.call(null,T,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,T)),Ie(qn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(qn.call(null,D,{path:"/settings/admins/?.*"})),Ie(xt.call(null,D))],A=!0)},p:G,i:G,o:G,d(L){L&&w(e),A=!1,Pe(I)}}}class Ii extends ye{constructor(e){super(),ve(this,e,null,uD,he,{})}}function Wm(n,e,t){const i=n.slice();return i[30]=e[t],i}function Ym(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[fD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function fD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",o=O(),r=b("div"),a=b("i"),f=O(),c=b("input"),p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=m=n[1].id,c.readOnly=!0},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),S(v,r,k),g(r,a),S(v,f,k),S(v,c,k),h||(_=Ie(u=Ue.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&p(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created}
Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c,"id",d),k[0]&2&&m!==(m=v[1].id)&&c.value!==m&&(c.value=m)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(c),h=!1,_()}}}function Km(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=b("button"),t=b("img"),s=O(),Hn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),g(e,t),g(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function cD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Email",o=O(),r=b("input"),p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&fe(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Jm(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[dD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function dD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Zm(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[pD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[mD,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&536871424|c[1]&4&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(E(s.$$.fragment,f),E(r.$$.fragment,f),f&&xe(()=>{a||(a=je(t,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=je(t,At,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function pD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&fe(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&5
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function bD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Gm(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",s=O(),l=b("button"),o=b("span"),a=B(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(h,_){m&&m.m(h,_),S(h,e,_),S(h,t,_),g(t,i),S(h,s,_),S(h,l,_),g(l,o),g(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,_){h[1].isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(h,_),_[0]&2&&E(m,1)):(m=Gm(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=h[6]),(!f||_[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||_[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||_[0]&64)&&x(l,"btn-loading",h[6])},i(h){f||(E(m),f=!0)},o(h){P(m),f=!1},d(h){m&&m.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function vD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[bD],header:[_D],default:[hD]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function yD(n,e,t){let i;const s=$t(),l="admin_"+H.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function _(U){return k(U),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(U){t(1,r=U!=null&&U.clone?U.clone():new Xi),y()}function y(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,m=""),Bn({})}function T(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||h)&&(U.password=d,U.passwordConfirm=m);let X;r.isNew?X=pe.admins.create(U):X=pe.admins.update(r.id,U),X.then(async ne=>{var J;t(7,u=!1),v(),zt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((J=pe.authStore.model)==null?void 0:J.id)===ne.id&&pe.authStore.save(pe.authStore.token,ne)}).catch(ne=>{pe.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>pe.admins.delete(r.id).then(()=>{t(7,u=!1),v(),zt("Successfully deleted admin."),s("delete",r)}).catch(U=>{pe.errorResponseHandler(U)}))}const M=()=>C(),$=()=>v(),D=U=>t(2,f=U);function A(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function F(){m=this.value,t(9,m)}const N=()=>i&&u?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function R(U){se[U?"unshift":"push"](()=>{o=U,t(5,o)})}function K(U){ze.call(this,n,U)}function Q(U){ze.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[v,r,f,c,h,o,a,u,d,m,i,l,T,C,_,M,$,D,A,I,L,F,N,R,K,Q]}class kD extends ye{constructor(e){super(),ve(this,e,yD,vD,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Xm(n,e,t){const i=n.slice();return i[24]=e[t],i}function wD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function SD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function TD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class"
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function xm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function eh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function th(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,_,v,k,y,T=e[24].email+"",C,M,$,D,A,I,L,F,N,R,K,Q,U,X;f=new Qo({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&eh();A=new ui({props:{date:e[24].created}}),F=new ui({props:{date:e[24].updated}});function J(){return e[15](e[24])}function ue(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("figure"),l=b("img"),r=O(),a=b("td"),u=b("div"),V(f.$$.fragment),c=O(),d=b("span"),h=B(m),_=O(),ne&&ne.c(),v=O(),k=b("td"),y=b("span"),C=B(T),$=O(),D=b("td"),V(A.$$.fragment),I=O(),L=b("td"),V(F.$$.fragment),N=O(),R=b("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',K=O(),Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(y,"class","txt txt-ellipsis"),p(y,"title",M=e[24].email),p(k,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(L,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,de){S(Z,t,de),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,u),q(f,u,null),g(u,c),g(u,d),g(d,h),g(a,_),ne&&ne.m(a,null),g(t,v),g(t,k),g(k,y),g(y,C),g(t,$),g(t,D),q(A,D,null),g(t,I),g(t,L),q(F,L,null),g(t,N),g(t,R),g(t,K),Q=!0,U||(X=[Y(t,"click",J),Y(t,"keydown",ue)],U=!0)},p(Z,de){e=Z,(!Q||de&16&&!Hn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ge={};de&16&&(ge.value=e[24].id),f.$set(ge),(!Q||de&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?ne||(ne=eh(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!Q||de&16)&&T!==(T=e[24].email+"")&&le(C,T),(!Q||de&16&&M!==(M=e[24].email))&&p(y,"title",M);const Ce={};de&16&&(Ce.date=e[24].created),A.$set(Ce);const Ne={};de&16&&(Ne.date=e[24].updated),F.$set(Ne)},i(Z){Q||(E(f.$$.fragment,Z),E(A.$$.fragment,Z),E(F.$$.fragment,Z),Q=!0)},o(Z){P(f.$$.fragment,Z),P(A.$$.fragment,Z),P(F.$$.fragment,Z),Q=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(A),j(F),U=!1,Pe(X)}}}function OD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M=[],$=new Map,D;function A(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[wD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Wt({props:I}),se.push(()=>_e(o,"sort",A));function L(J){n[12](J)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[SD]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new Wt({props:F}),se.push(()=>_e(u,"sort",L));function N(J){n[13](J)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[TD]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),se.push(()=>_e(d,"sort",N));function K(J){n[14](J)}let Q={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[CD]},$$scope:{ctx:n}};n[2]!==void 0&&(Q.sort=n[2]),_=new Wt({props:Q}),se.push(()=>_e(_,"sort",K));let U=n[4];const X=J=>J[24].id;for(let J=0;J<U.length;J+=1){let ue=Xm(n,U,J),Z=X(ue);$.set(Z,M[J]=th(Z,ue))}let ne=null;return U.length||(ne=Qm(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),s=b("th"),l=O(),V(o.$$.fragment),a=O(),V(u.$$.fragment),c=O(),V(d.$$.fragment),h=O(),V(_.$$.fragment),k=O(),y=b("th"),T=O(),C=b("tbody");for(let J=0;J<M.length;J+=1)M[J].c();ne&&ne.c(),p(s,"class","min-width"),p(y,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[5])},m(J,ue){S(J,e,ue),g(e,t),g(t,i),g(i,s),g(i,l),q(o,i,null),g(i,a),q(u,i,null),g(i,c),q(d,i,null),g(i,h),q(_,i,null),g(i,k),g(i,y),g(e,T),g(e,C);f
<span class="txt">New admin</span>`,m=O(),V(h.$$.fragment),_=O(),v=b("div"),k=O(),V(y.$$.fragment),T=O(),A&&A.c(),C=$e(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(v,"class","clearfix m-b-base")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),q(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),S(I,m,L),q(h,I,L),S(I,_,L),S(I,v,L),S(I,k,L),q(y,I,L),S(I,T,L),A&&A.m(I,L),S(I,C,L),M=!0,$||(D=Y(d,"click",n[9]),$=!0)},p(I,L){(!M||L&64)&&le(o,I[6]);const F={};L&2&&(F.value=I[1]),h.$set(F);const N={};L&134217918&&(N.$$scope={dirty:L,ctx:I}),y.$set(N),I[4].length?A?A.p(I,L):(A=nh(I),A.c(),A.m(C.parentNode,C)):A&&(A.d(1),A=null)},i(I){M||(E(a.$$.fragment,I),E(h.$$.fragment,I),E(y.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(y.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(m),j(h,I),I&&w(_),I&&w(v),I&&w(k),j(y,I),I&&w(T),A&&A.d(I),I&&w(C),$=!1,D()}}}function ED(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[DD]},$$scope:{ctx:n}}});let r={};return l=new kD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function AD(n,e,t){let i,s,l;Ye(n,_a,F=>t(21,i=F)),Ye(n,St,F=>t(6,s=F)),Ye(n,Da,F=>t(7,l=F)),Kt(St,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),pe.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),m(),pe.errorResponseHandler(F,!1))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),v=F=>t(1,f=F.detail);function k(F){c=F,t(2,c)}function y(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}const M=F=>r==null?void 0:r.show(F),$=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,f="");function A(F){se[F?"unshift":"push"](()=>{r=F,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Oi("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,h,_,v,k,y,T,C,M,$,D,A,I,L]}class ID extends ye{constructor(e){super(),ve(this,e,AD,ED,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function PD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Email"),s=O(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&fe(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function LD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Password"),s=O(),l=b("input"),r=O(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[1]),S(d,r,m),S(d,a,m),g(a,u),f||(c=[Y(l,"input",n[5]),Ie(xt.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&fe(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Pe(c)}}}function ND(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[PD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),g(e,a),u=!0,f||(c=Y(e,"submit",dt(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!u||m&4)&&x(a,"btn-disabled",d[2]),(!u||m&4)&&x(a,"btn-loading",d[2])},i(d){u||(E(s.$$.fragment,d),E(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function FD(n){let e,t;return e=new Ig({props:{$$slots:{default:[ND]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function RD(n,e,t){let i;Ye(n,_a,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),pe.admins.authWithPassword(l,o).then(()=>{Ma(),Oi("/")}).catch(()=>{cl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class qD extends ye{constructor(e){super(),ve(this,e,RD,FD,he,{})}}function jD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[HD,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[zD,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[BD,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[UD,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let $=n[3]&&ih(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),c=O(),d=b("div"),m=b("div"),h=O(),$&&$.c(),_=O(),v=b("button"),k=b("span"),k.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(k,"class","txt"),p(v,"type","submit"),p(v,"class","btn btn-expanded"),v.disabled=y=!n[3]||n[2],x(v,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(D,A){S(D,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),q(a,e,null),g(e,u),q(f,e,null),g(e,c),g(e,d),g(d,m),g(d,h),$&&$.m(d,null),g(d,_),g(d,v),g(v,k),T=!0,C||(M=Y(v,"click",n[13]),C=!0)},p(D,A){const I={};A&1572865&&(I.$$scope={dirty:A,ctx:D}),i.$set(I);const L={};A&1572865&&(L.$$scope={dirty:A,ctx:D}),o.$set(L);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:D}),a.$set(F);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:D}),f.$set(N),D[3]?$?$.p(D,A):($=ih(D),$.c(),$.m(d,_)):$&&($.d(1),$=null),(!T||A&12&&y!==(y=!D[3]||D[2]))&&(v.disabled=y),(!T||A&4)&&x(v,"btn-loading",D[2])},i(D){T||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(a.$$.fragment,D),E(f.$$.fragment,D),T=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),T=!1},d(D){D&&w(e),j(i),j(o),j(a),j(f),$&&$.d(),C=!1,M()}}}function VD(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function HD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Application name"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&fe(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function zD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Application url"),s=O(),l=b("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=O(),i=b("div"),s=b("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",dt(n[4])),a=!0)},p(m,h){let _=l;l=d(m),l===_?c[l].p(m,h):(re(),P(c[_],1,1,()=>{c[_]=null}),ae(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),E(o,1),o.m(s,null))},i(m){r||(E(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),c[l].d(),a=!1,u()}}}function YD(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[WD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function KD(n,e,t){let i,s,l,o;Ye(n,$s,$=>t(14,s=$)),Ye(n,vo,$=>t(15,l=$)),Ye(n,St,$=>t(16,o=$)),Kt(St,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const $=await pe.settings.getAll()||{};h($)}catch($){pe.errorResponseHandler($)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const $=await pe.settings.update(H.filterRedactedProps(a));h($),zt("Successfully saved application settings.")}catch($){pe.errorResponseHandler($)}t(2,f=!1)}}function h($={}){var D,A;Kt(vo,l=(D=$==null?void 0:$.meta)==null?void 0:D.appName,l),Kt($s,s=!!((A=$==null?void 0:$.meta)!=null&&A.hideControls),s),t(0,a={meta:($==null?void 0:$.meta)||{},logs:($==null?void 0:$.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=pt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>_(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,_,r,c,v,k,y,T,C,M]}class JD extends ye{constructor(e){super(),ve(this,e,KD,YD,he,{})}}function ZD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Je(l,s[o]);return{c(){e=b("input"),Xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),fe(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Xn(e,l=on(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&fe(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function GD(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=Je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Xn(s,a)},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(Ue.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Xn(s,a=on(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Pe(o)}}}function XD(n){let e;function t(l,o){return l[3]?GD:ZD}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function QD(n,e,t){const i=["value","mask"];let s=Et(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(5,s=Et(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class lu extends ye{constructor(e){super(),ve(this,e,QD,XD,he,{value:0,mask:1})}}function xD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=B("Subject"),s=O(),l=b("input"),r=O(),a=b("div"),u=B(`Available placeholder paramete
`),f=b("button"),f.textContent=`{APP_NAME}
2023-02-22 04:24:49 +08:00
`,c=B(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=B("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),S(v,l,k),fe(l,n[0].subject),S(v,r,k),S(v,a,k),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),h||(_=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&p(e,"for",i),k[1]&1&&o!==(o=v[31])&&p(l,"id",o),k[0]&1&&l.value!==v[0].subject&&fe(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),h=!1,Pe(_)}}}function eE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=B("Action URL"),s=O(),l=b("input"),r=O(),a=b("div"),u=B(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
2023-02-22 04:24:49 +08:00
`,c=B(`,
`),d=b("button"),d.textContent=`{APP_URL}
2023-02-22 04:24:49 +08:00
`,m=B(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,_=B("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(y,T){S(y,e,T),g(e,t),S(y,s,T),S(y,l,T),fe(l,n[0].actionUrl),S(y,r,T),S(y,a,T),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),v||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],v=!0)},p(y,T){T[1]&1&&i!==(i=y[31])&&p(e,"for",i),T[1]&1&&o!==(o=y[31])&&p(l,"id",o),T[0]&1&&l.value!==y[0].actionUrl&&fe(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),v=!1,Pe(k)}}}function tE(n){let e,t,i,s;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),fe(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&fe(e,l[0].body)},i:G,o:G,d(l){l&&w(e),i=!1,s()}}}function nE(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=jt(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&V(e.$$.fragment),i=$e()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),o!==(o=a[4])){if(e){re();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=jt(o,r(a)),se.push(()=>_e(e,"value",l)),V(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function iE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C;const M=[nE,tE],$=[];function D(A,I){return A[4]&&!A[5]?0:1}return l=D(n),o=$[l]=M[l](n),{c(){e=b("label"),t=B("Body (HTML)"),s=O(),o.c(),r=O(),a=b("div"),u=B(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
2023-02-22 04:24:49 +08:00
`,c=B(`,
`),d=b("button"),d.textContent=`{APP_URL}
2023-02-22 04:24:49 +08:00
`,m=B(`,
`),h=b("button"),h.textContent=`{TOKEN}
2023-02-26 16:47:00 +08:00
`,_=B(`,
`),v=b("button"),v.textContent=`{ACTION_URL}
`,k=B("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(A,I){S(A,e,I),g(e,t),S(A,s,I),$[l].m(A,I),S(A,r,I),S(A,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,T||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],T=!0)},p(A,I){(!y||I[1]&1&&i!==(i=A[31]))&&p(e,"for",i);let L=l;l=D(A),l===L?$[l].p(A,I):(re(),P($[L],1,1,()=>{$[L]=null}),ae(),o=$[l],o?o.p(A,I):(o=$[l]=M[l](A),o.c()),E(o,1),o.m(r.parentNode,r))},i(A){y||(E(o),y=!0)},o(A){P(o),y=!1},d(A){A&&w(e),A&&w(s),$[l].d(A),A&&w(r),A&&w(a),T=!1,Pe(C)}}}function sE(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[xD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[eE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[iE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function sh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function lE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&sh();return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),l=B(n[2]),o=O(),r=b("div"),a=O(),f&&f.c(),u=$e(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&E(f,1):(f=sh(),f.c(),E(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function oE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[lE],default:[sE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?on(i,[xn(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let lh;function rE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Et(e,s),o;Ye(n,fi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=lh,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-26a8b39e.js"),["./CodeEditor-26a8b39e.js","./index-96653a6b.js"],import.meta.url)).default),lh=c,t(5,d=!1))}function k(J){H.copyToClipboard(J),Eg(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function M(){u.actionUrl=t
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function OE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function DE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[gE,_E],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[5]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[27])),_=!0)},p(C,M){(!h||M[0]&32)&&le(o,C[5]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function EE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[DE]},$$scope:{ctx:n}}});let r={};return l=new hE({props:r}),n[28](l),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function AE(n,e,t){let i,s,l;Ye(n,St,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt(St,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ne=await pe.settings.getAll()||{};_(ne)}catch(ne){pe.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await pe.settings.update(H.filterRedactedProps(f));_(ne),Bn({}),zt("Successfully saved mail settings.")}catch(ne){pe.errorResponseHandler(ne)}t(3,d=!1)}}function _(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function T(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function C(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function $(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=pt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function N(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),Q=()=>a==null?v
2023-02-22 04:24:49 +08:00
the
`),r=b("strong"),u=B(a),f=B(`
2023-02-22 04:24:49 +08:00
to the
`),c=b("strong"),m=B(d),h=B(`.
2023-02-26 16:47:00 +08:00
`),_=b("br"),v=B(`
2023-02-22 04:24:49 +08:00
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
2023-02-22 04:24:49 +08:00
`,y=B(`,
`),T=b("a"),T.textContent=`s5cmd
`,C=B(", etc."),M=O(),$=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p($,"class","clearfix m-t-base")},m(L,F){S(L,e,F),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(c,m),g(l,h),g(l,_),g(l,v),g(l,k),g(l,y),g(l,T),g(l,C),g(e,M),g(e,$),A=!0},p(L,F){var N;(!A||F&1)&&a!==(a=(N=L[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!A||F&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(L){A||(L&&xe(()=>{D||(D=je(e,At,{duration:150},!0)),D.run(1)}),A=!0)},o(L){L&&(D||(D=je(e,At,{duration:150},!1)),D.run(0)),A=!1},d(L){L&&w(e),L&&D&&D.end()}}}function ch(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$;return i=new me({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[FE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[RE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"s3.region",$$slots:{default:[qE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[jE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[VE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[HE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),v=O(),k=b("div"),V(y.$$.fragment),T=O(),C=b("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(D,A){S(D,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,T),g(e,C),$=!0},p(D,A){const I={};A&100663298&&(I.$$scope={dirty:A,ctx:D}),i.$set(I);const L={};A&100663298&&(L.$$scope={dirty:A,ctx:D}),o.$set(L);const F={};A&100663298&&(F.$$scope={dirty:A,ctx:D}),u.$set(F);const N={};A&100663298&&(N.$$scope={dirty:A,ctx:D}),d.$set(N);const R={};A&100663298&&(R.$$scope={dirty:A,ctx:D}),_.$set(R);const K={};A&100663298&&(K.$$scope={dirty:A,ctx:D}),y.$set(K)},i(D){$||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(u.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(y.$$.fragment,D),D&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),$=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function FE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Endpoint"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&fe(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function RE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Bucket"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function BE(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function UE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function ph(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[LE,PE],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[7]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[20])),_=!0)},p(C,M){(!h||M&128)&&le(o,C[7]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function YE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[WE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function KE(n,e,t){let i,s,l;Ye(n,St,N=>t(7,l=N)),Kt(St,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const N=await pe.settings.getAll()||{};_(N)}catch(N){pe.errorResponseHandler(N)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{pe.cancelRequest(lo);const N=await pe.settings.update(H.filterRedactedProps(r));Bn({}),await _(N),Ma(),c?Nv("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(N){pe.errorResponseHandler(N)}t(3,u=!1)}}async function _(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){pe.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{pe.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await pe.settings.testS3({$cancelKey:lo})}catch(N){t(5,c=N)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function $(){r.s3.accessKey=this.value,t(1,r)}function D(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function A(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>v(),L=()=>h(),F=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,v,i,y,T,C,M,$,D,A,I,L,F]}class JE extends ye{constructor(e){super(),ve(this,e,KE,YE,he,{})}}function ZE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function GE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Client ID"),s=O(),l=b("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&p(e,"for",i),c&2097152&&o!==(o=f[21])&&p(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&fe(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function XE(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new lu({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Client Secret"),s=O(),V(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for"
<span class="txt">Show all</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[13]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function kh(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function rA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[oA,lA],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[6]),r=O(),a=b("div"),u=b("form"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[7])),_=!0)},p(C,M){(!h||M&64)&&le(o,C[6]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function aA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[rA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&2097279&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function uA(n,e,t){let i,s,l;Ye(n,St,C=>t(6,l=C)),Kt(St,l="Auth providers",l);let o={},r={},a={},u=!1,f=!1,c=!1;d();async function d(){t(2,u=!0);try{const C=await pe.settings.getAll()||{};h(C)}catch(C){pe.errorResponseHandler(C)}t(2,u=!1)}async function m(){var C;if(!(f||!s)){t(3,f=!0);try{const M=await pe.settings.update(H.filterRedactedProps(a));h(M),Bn({}),(C=o[Object.keys(o)[0]])==null||C.collapseSiblings(),zt("Successfully updated auth providers.")}catch(M){pe.errorResponseHandler(M)}t(3,f=!1)}}function h(C){C=C||{},t(0,a={});for(const M in vl)t(0,a[M]=Object.assign({enabled:!1},C[M]),a);t(9,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(C,M){se[C?"unshift":"push"](()=>{o[M]=C,t(1,o)})}function k(C,M){n.$$.not_equal(a[M],C)&&(a[M]=C,t(0,a))}const y=()=>t(4,c=!0),T=()=>_();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(r)),n.$$.dirty&1025&&t(5,s=i!=JSON.stringify(a))},[a,o,u,f,c,s,l,m,_,r,i,v,k,y,T]}class fA extends ye{constructor(e){super(),ve(this,e,uA,aA,he,{})}}function wh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function cA(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,m,h=n[5];const _=k=>k[16].key;for(let k=0;k<h.length;k+=1){let y=wh(n,h,k),T=_(y);t.set(T,e[k]=Sh(T,y))}let v=n[3]&&Th(n);return{c(){for(let k=0;k<e.length;k+=1)e[k].c();i=O(),s=b("div"),l=b("div"),o=O(),v&&v.c(),r=O(),a=b("button"),u=b("span"),u.textContent="Save changes",p(l,"class","flex-fill"),p(u,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-expanded"),a.disabled=f=!n[3]||n[2],x(a,"btn-loading",n[2]),p(s,"class","flex")},m(k,y){for(let T=0;T<e.length;T+=1)e[T].m(k,y);S(k,i,y),S(k,s,y),g(s,l),g(s,o),v&&v.m(s,null),g(s,r),g(s,a),g(a,u),c=!0,d||(m=Y(a,"click",n[13]),d=!0)},p(k,y){y&524321&&(h=k[5],re(),e=wt(e,y,_,1,k,h,t,i.parentNode,ln,Sh,i,wh),ae()),k[3]?v?v.p(k,y):(v=Th(k),v.c(),v.m(s,r)):v&&(v.d(1),v=null),(!c||y&12&&f!==(f=!k[3]||k[2]))&&(a.disabled=f),(!c||y&4)&&x(a,"btn-loading",k[2])},i(k){if(!c){for(let y=0;y<h.length;y+=1)E(e[y]);c=!0}},o(k){for(let y=0;y<e.length;y+=1)P(e[y]);c=!1},d(k){for(let y=0;y<e.length;y+=1)e[y].d(k);k&&w(i),k&&w(s),v&&v.d(),d=!1,m()}}}function dA(n){let e;return{c(){e=b("div"),p(e,"class","
2023-02-26 16:47:00 +08:00
another PocketBase environment.</p>`,t=O(),i=b("div"),s=b("button"),s.innerHTML='<span class="txt">Copy</span>',l=O(),V(o.$$.fragment),r=O(),a=b("div"),u=b("div"),f=O(),c=b("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,v){S(_,e,v),S(_,t,v),S(_,i,v),g(i,s),g(i,l),q(o,i,null),n[8](i),S(_,r,v),S(_,a,v),g(a,u),g(a,f),g(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){d||(E(o.$$.fragment,_),d=!0)},o(_){P(o.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(t),_&&w(i),j(o),n[8](null),_&&w(r),_&&w(a),m=!1,Pe(h)}}}function vA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function yA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[vA,bA],h=[];function _(v,k){return v[1]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[3]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=_(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function kA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[yA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function wA(n,e,t){let i,s;Ye(n,St,v=>t(3,s=v)),Kt(St,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await pe.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let v of r)delete v.created,delete v.updated}catch(v){pe.errorResponseHandler(v)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function c(){H.copyToClipboard(i),Eg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,_]}class SA extends ye{constructor(e){super(),ve(this,e,wA,kA,he,{})}}function Ch(n,e,t){const i=n.slice();return i[14]=e[t],i}function $h(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Mh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Dh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Ah(n,e,t){const i=n.slice();return i[30]=e[t],i}function TA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Ih(),a=n[0].name!==n[1].name&&Ph(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=b("strong"),o=B(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Ih(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Ph(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function CA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),l=B(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=
2023-02-22 04:24:49 +08:00
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=O(),o=b("tbody");for(let C=0;C<h.length;C+=1)h[C].c();r=O(),_&&_.c(),a=O();for(let C=0;C<k.length;C+=1)k[C].c();u=O();for(let C=0;C<T.length;C+=1)T[C].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,M){S(C,e,M),d.m(e,null),S(C,t,M),S(C,i,M),g(i,s),g(i,l),g(i,o);for(let $=0;$<h.length;$+=1)h[$].m(o,null);g(o,r),_&&_.m(o,null),g(o,a);for(let $=0;$<k.length;$+=1)k[$].m(o,null);g(o,u);for(let $=0;$<T.length;$+=1)T[$].m(o,null)},p(C,M){if(c===(c=f(C))&&d?d.p(C,M):(d.d(1),d=c(C),d&&(d.c(),d.m(e,null))),M[0]&7203){m=C[11];let $;for($=0;$<m.length;$+=1){const D=Ah(C,m,$);h[$]?h[$].p(D,M):(h[$]=Lh(D),h[$].c(),h[$].m(o,r))}for(;$<h.length;$+=1)h[$].d(1);h.length=m.length}if(C[2]||C[5]?_?_.p(C,M):(_=Nh(C),_.c(),_.m(o,a)):_&&(_.d(1),_=null),M[0]&4248){v=C[7];let $;for($=0;$<v.length;$+=1){const D=Mh(C,v,$);k[$]?k[$].p(D,M):(k[$]=Vh(D),k[$].c(),k[$].m(o,u))}for(;$<k.length;$+=1)k[$].d(1);k.length=v.length}if(M[0]&4352){y=C[8];let $;for($=0;$<y.length;$+=1){const D=Ch(C,y,$);T[$]?T[$].p(D,M):(T[$]=zh(D),T[$].c(),T[$].m(o,null))}for(;$<T.length;$+=1)T[$].d(1);T.length=y.length}},i:G,o:G,d(C){C&&w(e),d.d(),C&&w(t),C&&w(i),ht(h,C),_&&_.d(),ht(k,C),ht(T,C)}}}function Mn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function un(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function OA(n,e,t){let i,s,l,{collectionA:o=new pn}=e,{collectionB:r=new pn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const h=Object.keys(new pn().export()).filter(k=>!["schema","created","updated"].includes(k));function _(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find(y=>k.id==y.id))))}function v(k){return typeof k>"u"?"":H.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(y=>k.id==y.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(y=>y.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(y=>y.id==k.id))),n.$$.dirty[0]&7&&t(9,l=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,h,v]}class DA extends ye{constructor(e){super(),ve(this,e,OA,MA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Bh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Uh(n){let e,t;return e=new DA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function EA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Uh(Bh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=$e()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Bh(o,i,a);s[a]?(s[a].p(u,r),E(s[a],1)):(s[a]=Uh(u),s[a].c(),E(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(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){ht(s,o),o&&w(e)}}}function AA(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function IA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=B("Close"),i=O(),s=b("button"),l=b("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n
2023-02-22 04:24:49 +08:00
- ${C.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await pe.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch(C){pe.errorResponseHandler(C)}t(4,u=!1),c()}}const _=()=>m(),v=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function y(C){ze.call(this,n,C)}function T(C){ze.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,_,v,k,y,T]}class NA extends ye{constructor(e){super(),ve(this,e,LA,PA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Wh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Yh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Kh(n,e,t){const i=n.slice();return i[32]=e[t],i}function FA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[qA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let A=!1,I=n[6]&&n[1].length&&!n[7]&&Zh(),L=n[6]&&n[1].length&&n[7]&&Gh(n),F=n[13].length&&r_(n),N=!!n[0]&&a_(n);return{c(){e=b("input"),t=O(),i=b("div"),s=b("p"),l=B(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=O(),V(a.$$.fragment),u=O(),f=O(),I&&I.c(),c=O(),L&&L.c(),d=O(),F&&F.c(),m=O(),h=b("div"),N&&N.c(),_=O(),v=b("div"),k=O(),y=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(v,"class","flex-fill"),p(T,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=C=!n[14],p(h,"class","flex m-t-base")},m(R,K){S(R,e,K),n[19](e),S(R,t,K),S(R,i,K),g(i,s),g(s,l),g(s,o),S(R,r,K),q(a,R,K),S(R,u,K),S(R,f,K),I&&I.m(R,K),S(R,c,K),L&&L.m(R,K),S(R,d,K),F&&F.m(R,K),S(R,m,K),S(R,h,K),N&&N.m(h,null),g(h,_),g(h,v),g(h,k),g(h,y),g(y,T),M=!0,$||(D=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],$=!0)},p(R,K){(!M||K[0]&4096)&&x(o,"btn-loading",R[12]);const Q={};K[0]&64&&(Q.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(Q.$$scope={dirty:K,ctx:R}),a.$set(Q),R[6]&&R[1].length&&!R[7]?I||(I=Zh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=Gh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?F?F.p(R,K):(F=r_(R),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),R[0]?N?N.p(R,K):(N=a_(R),N.c(),N.m(h,_)):N&&(N.d(1),N=null),(!M||K[0]&16384&&C!==(C=!R[14]))&&(y.disabled=C)},i(R){M||(E(a.$$.fragment,R),E(A),M=!0)},o(R){P(a.$$.fragment,R),P(A),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),F&&F.d(R),R&&w(m),R&&w(h),N&&N.d(),$=!1,Pe(D)}}}function RA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function Jh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Jh();return{c(){e=b("label"),t=B("Collections"),s=O(),l=b("textarea"),r=O(),c&&c.c(),a=$e(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&fe(l,d[0]),d[0]&&!d[6]?c||(c=Jh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Zh(n){let e;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gh(n){let e,t,i,s,l,o=n[9].length&&Xh(n),r=n[4].length&&e_(n),a=n[8].length&&s_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Xh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=e_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=s_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Xh(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Kh(n,s,o),a=l(r);t.set(a,e[o]=xh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=wt(e,r,l,1,o,s,t,i.parentNode,es,xh,i,Kh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Qh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function xh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Qh(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",s=O(),l=b("strong"),r=B(o),a=O(),f&&f.c(),u=O(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=Qh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function e_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=Yh(n,s,o),a=l(r);t.set(a,e[o]=i_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=wt(e,r,l,1,o,s,t,i.parentNode,es,i_,i,Yh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function t_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=b("strong"),i=B(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function n_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=b("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function i_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&t_(e),m=e[35].new.id&&n_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",s=O(),l=b("div"),d&&d.c(),o=O(),r=b("strong"),u=B(a),f=O(),m&&m.c(),c=O(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(h,_){S(h,t,_),g(t,i),g(t,s),g(t,l),d&&d.m(l,null),g(l,o),g(l,r),g(r,u),g(l,f),m&&m.m(l,null),g(t,c)},p(h,_){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,_):(d=t_(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),_[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,_):(m=n_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(h){h&&w(t),d&&d.d(),m&&m.d()}}}function s_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Wh(n,s,o),a=l(r);t.set(a,e[o]=o_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=$e()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,es,o_,i,Wh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function l_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(
2023-02-22 04:24:49 +08:00
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=O(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:G,d(u){u&&w(e),r=!1,a()}}}function a_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function jA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[RA,FA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[15]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function VA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[jA]},$$scope:{ctx:n}}});let r={};return l=new NA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function HA(n,e,t){let i,s,l,o,r,a,u;Ye(n,St,J=>t(15,u=J)),Kt(St,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;T();async function T(){t(5,y=!0);try{t(2,_=await pe.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){pe.errorResponseHandler(J)}t(5,y=!1)}function C(){if(t(4,k=[]),!!i)for(let J of h){const ue=H.findByKey(_,"id",J.id);!(ue!=null&&ue.id)||!H.hasCollectionChanges(ue,J,v)||k.push({new:J,old:ue})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=H.filterDuplicatesByKey(J.schema)}function $(){var J,ue;for(let Z of h){const de=H.findByKey(_,"name",Z.name)||H.findByKey(_,"id",Z.id);if(!de)continue;const ge=Z.id,Ce=de.id;Z.id=Ce;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const be of Re){const Se=H.findByKey(Ne,"name",be.name);Se&&Se.id&&(be.id=Se.id)}for(let be of h)if(Array.isArray(be.schema))for(let Se of be.schema)(J=Se.options)!=null&&J.collectionId&&((ue=Se.options)==null?void 0:ue.collectionId)===ge&&(Se.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function D(J){t(12,m=!0);const ue=new FileReader;ue.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(cl("Invalid collections configuration."),A())},ue.onerror=Z=>{console.warn(Z),cl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(J)}function A(){t(0,d=""),t(10,f.value="",f),Bn({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>$(),Q=()=>A(),U=()=>c==null?void 0:c.show(_,h,v);function X(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!H.findByKey(h,"id",
2023-02-24 22:33:57 +08:00
<span class="txt">Manage admins</span>`,t=O(),i=b("hr"),s=O(),l=b("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:G,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function s6(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&c_(n);return o=new b1({props:{routes:BA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new XA({}),f=new n6({}),{c(){t=O(),i=b("div"),d&&d.c(),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&E(d,1)):(d=c_(h),d.c(),E(d,1),d.m(i,s)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(h){c||(E(d),E(o.$$.fragment,h),E(a.$$.fragment,h),E(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function l6(n,e,t){let i,s,l,o;Ye(n,$s,m=>t(8,i=m)),Ye(n,vo,m=>t(2,s=m)),Ye(n,Da,m=>t(0,l=m)),Ye(n,St,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt(St,o="",o),Bn({}),Lb())}function f(){Oi("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await pe.settings.getAll({$cancelKey:"initialAppSettings"});Kt(vo,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt($s,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){pe.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class o6 extends ye{constructor(e){super(),ve(this,e,l6,s6,he,{})}}new o6({target:document.getElementById("app")});export{Pe as A,zt as B,H as C,Oi as D,$e as E,Ig as F,ba as G,hu as H,Ye as I,Ai as J,$t as K,Zt as L,se as M,Ab as N,wt as O,es as P,ln as Q,pn as R,ye as S,Lr as T,P as a,O as b,V as c,j as d,b as e,p as f,S as g,g as h,ve as i,Ie as j,re as k,xt as l,q as m,ae as n,w as o,pe as p,me as q,x as r,he as s,E as t,Y as u,dt as v,B as w,le as x,G as y,fe as z};