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

228 lines
1.1 MiB
JavaScript
Raw Normal View History

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-Cf_nIT2z.js","./index-Sijz3BEY.js","./ListApiDocs-CHps0GYD.js","./FieldsQueryParam-CvC9GvON.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-BeNHgDPM.js","./CreateApiDocs-B6chc1dA.js","./UpdateApiDocs-CJ7VXR_s.js","./AuthMethodsDocs-DG9nMnGd.js","./AuthWithPasswordDocs-BguEc707.js","./AuthWithOAuth2Docs-CMVWI2ag.js","./AuthWithOtpDocs-DbGwN84r.js","./AuthRefreshDocs-dmLZGfAd.js","./CodeEditor-DULnQ9Rp.js"])))=>i.map(i=>d[i]);
var Ny=Object.defineProperty;var Py=(n,e,t)=>e in n?Ny(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var dt=(n,e,t)=>Py(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function te(){}const lo=n=>n;function He(n,e){for(const t in e)n[t]=e[t];return n}function Ry(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Yb(n){return n()}function pf(){return Object.create(null)}function Ie(n){n.forEach(Yb)}function It(n){return typeof n=="function"}function ke(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function yn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function Fy(n){return Object.keys(n).length===0}function pu(n,...e){if(n==null){for(const i of e)i(void 0);return te}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Kb(n){let e;return pu(n,t=>e=t)(),e}function Xe(n,e,t){n.$$.on_destroy.push(pu(e,t))}function At(n,e,t,i){if(n){const l=Jb(n,e,t,i);return n[0](l)}}function Jb(n,e,t,i){return n[1]&&i?He(t.ctx.slice(),n[1](i(e))):t.ctx}function Nt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r<o;r+=1)s[r]=e.dirty[r]|l[r];return s}return e.dirty|l}return e.dirty}function Pt(n,e,t,i,l,s){if(l){const o=Jb(e,t,i,s);n.p(o,l)}}function Rt(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 Kt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function st(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 zs(n){return n??""}function On(n,e,t){return n.set(t),e}function Oe(n){return n&&It(n.destroy)?n.destroy:te}function mf(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Zb=typeof window<"u";let Cr=Zb?()=>window.performance.now():()=>Date.now(),mu=Zb?n=>requestAnimationFrame(n):te;const Gl=new Set;function Gb(n){Gl.forEach(e=>{e.c(n)||(Gl.delete(e),e.f())}),Gl.size!==0&&mu(Gb)}function Or(n){let e;return Gl.size===0&&mu(Gb),{promise:new Promise(t=>{Gl.add(e={c:n,f:t})}),abort(){Gl.delete(e)}}}function w(n,e){n.appendChild(e)}function Xb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function qy(n){const e=b("style");return e.textContent="/* empty */",jy(Xb(n),e),e.sheet}function jy(n,e){return w(n.head||n,e),e.sheet}function v(n,e,t){n.insertBefore(e,t||null)}function y(n){n.parentNode&&n.parentNode.removeChild(n)}function ct(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 W(n){return document.createTextNode(n)}function C(){return W(" ")}function ye(){return W("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function it(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Mn(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)}const Hy=["width","height"];function ei(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
2024-12-26 04:24:24 +08:00
`;for(let _=0;_<=1;_+=a){const k=e+(t-e)*s(_);u+=_*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${By(f)}_${r}`,d=Xb(n),{stylesheet:m,rules:h}=fr.get(d)||Wy(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${l}ms 1 both`,cr+=1,c}function Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),cr-=l,cr||Yy())}function Yy(){mu(()=>{cr||(fr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&y(e)}),fr.clear())})}function Ky(n,e,t,i){if(!e)return te;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return te;const{delay:s=0,duration:o=300,easing:r=lo,start:a=Cr()+s,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function g(){c&&(h=Us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Vs(n,h),d=!1}return Or(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),g(),f(0,1),_}function Jy(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,xb(n,l)}}function xb(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function qi(n){Bs=n}function so(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function rn(n){so().$$.on_mount.push(n)}function Zy(n){so().$$.after_update.push(n)}function oo(n){so().$$.on_destroy.push(n)}function yt(){const n=so();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Qb(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Kl=[],ie=[];let Xl=[];const Ra=[],e0=Promise.resolve();let Fa=!1;function t0(){Fa||(Fa=!0,e0.then(hu))}function pn(){return t0(),e0}function tt(n){Xl.push(n)}function $e(n){Ra.push(n)}const Gr=new Set;let zl=0;function hu(){if(zl!==0)return;const n=Bs;do{try{for(;zl<Kl.length;){const e=Kl[zl];zl++,qi(e),Gy(e.$$)}}catch(e){throw Kl.length=0,zl=0,e}for(qi(null),Kl.length=0,zl=0;ie.length;)ie.pop()();for(let e=0;e<Xl.length;e+=1){const t=Xl[e];Gr.has(t)||(Gr.add(t),t())}Xl.length=0}while(Kl.length);for(;Ra.length;)Ra.pop()();Fa=!1,Gr.clear(),qi(n)}function Gy(n){if(n.fragment!==null){n.update(),Ie(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}function Xy(n){const e=[],t=[];Xl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Xl=e}let ks;function _u(){return ks||(ks=Promise.resolve(),ks.then(()=>{ks=null})),ks}function Cl(n,e,t){n.dispatchEvent(Qb(`${e?"intro":"outro"}${t}`))}const Xo=new Set;let Si;function re(){Si={r:0,c:[],p:Si}}function ae(){Si.r||Ie(Si.c),Si=Si.p}function M(n,e){n&&n.i&&(Xo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Xo.has(n))return;Xo.add(n),Si.c.push(()=>{Xo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const gu={duration:0};function n0(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=lo,tick:g=te,css:_}=l||gu;_&&(o=Us(n,0,1,m,d,h,_,a++)),g(0,1);const k=Cr()+d,S=k+m;r&&r.abort(),s=!0,tt(()=>Cl(n,!0,"start")),r=Or($=>{if(s){if($>=S)return g(1,0),Cl(n,!0,"end"),u(),s=!1;if($>=k){const T=h(($-k)/m);g(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),It(l)?(l=l(i),_u().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function bu(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=Si;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=lo,tick:m=te,css:h}=l||gu;h&&(o=Us(n,1,0,c,f,d,h));const g=Cr()+f,_=g+c;tt(()=>Cl(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Or(k=>{if(s){if(k>=_)return m(0,1
2024-12-26 04:24:24 +08:00
`),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=U.parseIndex(e);return i.tableName=t,U.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=U.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?U.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return U.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,hidden:!1,required:!1},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}let Ba,_l;const Wa="app-tooltip";function Yf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function nl(){return _l=_l||document.querySelector("."+Wa),_l||(_l=document.createElement("div"),_l.classList.add(Wa),document.body.appendChild(_l)),_l}function lk(n,e){let t=nl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Ya();return}t.textContent=e.text,t.className=Wa+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Ya(){clearTimeout(Ba),nl().classList.remove("active"),nl().activeNode=void 0}function uw(n,e){nl().activeNode=n,clearTimeout(Ba),Ba=setTimeout(()=>{nl().classList.add("active"),lk(n,e)},isNaN(e.delay)?0:e.delay)}function qe(n,e){let t=Yf(e);function i(){uw(n,t)}function l(){Ya()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",l),nl(),{update(s){var o,r;t=Yf(s),(r=(o=nl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&lk(n,t)},destroy(){var s,o;(o=(s=nl())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Ya(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Ar(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=lo}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function jn(n,{delay:e=0,duration:t=400,easing:i=Ar,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=mf(l),[m,h]=mf(s);return{delay:e,duration:t,easing:i,css:(g,_)=>`
2024-12-26 04:24:24 +08:00
transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*m}${h});
opacity: ${a-f*_}`}}function pt(n,{delay:e=0,duration:t=400,easing:i=Ar,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),h=parseFloat(s[`margin${f[1]}`]),g=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*h}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*_}px;`}}function $t(n,{delay:e=0,duration:t=400,easing:i=Ar,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>`
2024-12-26 04:24:24 +08:00
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}const fw=n=>({}),Kf=n=>({}),cw=n=>({}),Jf=n=>({});function Zf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[4]&&!n[2]&&Gf(n);const T=n[19].header,O=At(T,n,n[18],Jf);let E=n[4]&&n[2]&&Xf(n);const L=n[19].default,I=At(L,n,n[18],null),A=n[19].footer,N=At(A,n,n[18],Kf);return{c(){e=b("div"),t=b("div"),l=C(),s=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),N&&N.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(P,R){v(P,e,R),w(e,t),w(e,l),w(e,s),w(s,o),$&&$.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),N&&N.m(d,null),_=!0,k||(S=[Y(t,"click",it(n[20])),Y(f,"scroll",n[22])],k=!0)},p(P,R){n=P,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=Gf(n),$.c(),M($,1),$.m(o,r)):$&&(re(),D($,1,1,()=>{$=null}),ae()),O&&O.p&&(!_||R[0]&262144)&&Pt(O,T,n,n[18],_?Nt(T,n[18],R,cw):Rt(n[18]),Jf),n[4]&&n[2]?E?E.p(n,R):(E=Xf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?Nt(L,n[18],R,null):Rt(n[18]),null),N&&N.p&&(!_||R[0]&262144)&&Pt(N,A,n,n[18],_?Nt(A,n[18],R,fw):Rt(n[18]),Kf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&x(s,"popup",n[2]),(!_||R[0]&4)&&x(e,"padded",n[2]),(!_||R[0]&1)&&x(e,"active",n[0])},i(P){_||(P&&tt(()=>{_&&(i||(i=je(t,Ys,{duration:Gi,opacity:0},!0)),i.run(1))}),M($),M(O,P),M(I,P),M(N,P),P&&tt(()=>{_&&(g&&g.end(1),h=n0(s,jn,n[2]?{duration:Gi,y:-10}:{duration:Gi,x:50}),h.start())}),_=!0)},o(P){P&&(i||(i=je(t,Ys,{duration:Gi,opacity:0},!1)),i.run(0)),D($),D(O,P),D(I,P),D(N,P),h&&h.invalidate(),P&&(g=bu(s,jn,n[2]?{duration:Gi,y:10}:{duration:Gi,x:50})),_=!1},d(P){P&&y(e),P&&i&&i.end(),$&&$.d(),O&&O.d(P),E&&E.d(),I&&I.d(P),n[21](null),N&&N.d(P),P&&g&&g.end(),k=!1,Ie(S)}}}function Gf(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){v(o,e,r),i=!0,l||(s=Y(e,"click",it(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,Ys,{duration:Gi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,Ys,{duration:Gi},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function Xf(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line txt-lg" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){v(l,e,s),t||(i=Y(e,"click",it(n[5])),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function dw(n){let e,t,i,l,s=n[0]&&Zf(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){v(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Zf(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&y(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let gl,sa=[];function sk(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Gi=150;function Qf(){return 1e3+sk().querySelectorAll(".overlay-panel-container.active").length}function pw(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=yt(),h="op_"+U.randomString(10);let g,_,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await pn(),A()}function A(){g&&(o?t(6,g.
2024-12-26 04:24:24 +08:00
`)})),o=!0)},p(a,u){i&&It(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(gr).join(`
`)})},i(a){s||(a&&tt(()=>{s&&(l||(l=je(t,$t,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=je(t,$t,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&y(e),a&&l&&l.end(),o=!1,r()}}}function _c(n){let e,t,i=gr(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=W(i),s=C(),p(e,"class","help-block help-block-error")},m(a,u){v(a,e,u),w(e,t),w(t,l),w(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=gr(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=je(e,pt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=je(e,pt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&y(e),a&&o&&o.end()}}}function _3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=At(a,n,n[8],hc),f=[h3,m3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){v(m,e,h),u&&u.m(e,null),w(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&Pt(u,a,m,m[8],s?Nt(a,m[8],h,p3):Rt(m[8]),hc);let g=i;i=d(m),i===g?c[i].p(m,h):(re(),D(c[g],1,1,()=>{c[g]=null}),ae(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&y(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const gc="Invalid value";function gr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||gc:n||gc}function g3(n,e,t){let i;Xe(n,wn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Wn(r)}rn(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Pe.call(this,n,g)}function h(g){ie[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,s=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=U.toArray(U.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class de extends Se{constructor(e){super(),we(this,e,g3,_3,ke,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const b3=n=>({}),bc=n=>({});function kc(n){let e,t,i,l,s,o;return{c(){e=b("a"),e.innerHTML='<i class="ri-book-open-line txt-sm"></i> <span class="txt">Docs</span>',t=C(),i=b("span"),i.textContent="|",l=C(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.24.2",p(e,"href","https://pocketbase.io/docs"),p(e,"target","_blank"),p(e,"rel","noopener noreferrer"),p(i,"class","delimiter"),p(o,"class","txt"),p(s,"href","https://github.com/pocketbase/pocketbase/releases"),p(s,"target","_blank"),p(s,"rel","noopener noreferrer"),p(s,"title","Releases")},m(r,a){v(r,e,a),v(r,t,a),v(r,i,a),v(r,l,a),v(r,s,a),w(s,o)},d(r){r&&(y(e),y(t),y(i),y(l),y(s))}}}function k3(n){var m;let e,t,i,l,s,o,r;const a=n[4].default,u=At(a,n,n[3],null),f=n[4].footer,c=At(f,n,n[3],bc);let d=((m=n[2])==null?void 0:m.id)&&kc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),l=b("footer"),c&&c.c(),s=C(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(h,g){v(h,e,g),w(e,t),u&&u.m(t,null),w(e,i),w(e,l),c&&c.m(l,null),w(l,s),d&&d.m(l,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Pt(u,a,h,h[3],r?Nt(a,h[3],g,null):Rt(h[3]),null),c&&c.p&&(!r||g&8)&&Pt(c,f,h,h[3],r?Nt(f,h[3],g,b3):Rt(h[3]),bc),(_=h[2])!=null&&_.id?d||(d=kc(),d.c(),d.m(l,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&x(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&y(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function y3(n,e,t){let i;Xe(n,Rr,a=>t(2,i=a));let{$$slots:l={},$$scope:s}=e,{center:o=!1}=e,{class:r=""}=e;return n.$$set=a=>{"center"in a&&t(0,o=a.center),"class"in a&&t(1,r=a.class),"$$scope"in a&&t(3,s=a.$$scope)},[o,r,i,s,l]}class ii extends Se{constructor(e){super(),we(this,e,y3,k3,ke,{center:0,class:1})}}function v3(n){let e,t
2024-12-26 04:24:24 +08:00
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*/function po(n){return n+.5|0}const Qi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ms(n){return Qi(po(n*2.55),0,255)}function il(n){return Qi(po(n*255),0,255)}function Fi(n){return Qi(po(n/2.55)/100,0,1)}function Nc(n){return Qi(po(n*100),0,100)}const Zn={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},Za=[..."0123456789ABCDEF"],X3=n=>Za[n&15],Q3=n=>Za[(n&240)>>4]+Za[n&15],Io=n=>(n&240)>>4===(n&15),x3=n=>Io(n.r)&&Io(n.g)&&Io(n.b)&&Io(n.a);function e4(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Zn[n[1]]*17,g:255&Zn[n[2]]*17,b:255&Zn[n[3]]*17,a:e===5?Zn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Zn[n[1]]<<4|Zn[n[2]],g:Zn[n[3]]<<4|Zn[n[4]],b:Zn[n[5]]<<4|Zn[n[6]],a:e===9?Zn[n[7]]<<4|Zn[n[8]]:255})),t}const t4=(n,e)=>n<255?e(n):"";function n4(n){var e=x3(n)?X3:Q3;return n?"#"+e(n.r)+e(n.g)+e(n.b)+t4(n.a,e):void 0}const i4=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function wk(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function l4(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function s4(n,e,t){const i=wk(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function o4(n,e,t,i,l){return n===l?(e-t)/i+(e<t?6:0):e===l?(t-n)/i+2:(n-e)/i+4}function Fu(n){const t=n.r/255,i=n.g/255,l=n.b/255,s=Math.max(t,i,l),o=Math.min(t,i,l),r=(s+o)/2;let a,u,f;return s!==o&&(f=s-o,u=r>.5?f/(2-s-o):f/(s+o),a=o4(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function qu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(il)}function ju(n,e,t){return qu(wk,n,e,t)}function r4(n,e,t){return qu(s4,n,e,t)}function a4(n,e,t){return qu(l4,n,e,t)}function Sk(n){return(n%360+360)%360}function u4(n){const e=i4.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ms(+e[5]):il(+e[5]));const l=Sk(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=r4(l,s,o):e[1]==="hsv"?i=a4(l,s,o):i=ju(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function f4(n,e){var t=Fu(n);t[0]=Sk(t[0]+e),t=ju(t),n.r=t[0],n.g=t[1],n.b=t[2]}function c4(n){if(!n)return;const e=Fu(n),t=e[0],i=Nc(e[1]),l=Nc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${Fi(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const Pc={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"},Rc={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:"
2024-12-26 04:24:24 +08:00
* Chart.js v4.4.7
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/function Ni(){}const k4=(()=>{let n=0;return()=>n++})();function Qt(n){return n==null}function fn(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 vt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function vn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return vn(n)?n:e}function Mt(n,e){return typeof n>"u"?e:n}const y4=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ut(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ht(n,e,t,i){let l,s,o;if(fn(n))for(s=n.length,l=0;l<s;l++)e.call(t,n[l],l);else if(vt(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function br(n,e){let t,i,l,s;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(l=n[t],s=e[t],l.datasetIndex!==s.datasetIndex||l.index!==s.index)return!1;return!0}function kr(n){if(fn(n))return n.map(kr);if(vt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=kr(n[t[l]]);return e}return n}function $k(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function v4(n,e,t,i){if(!$k(n))return;const l=e[n],s=t[n];vt(l)&&vt(s)?Gs(l,s,i):e[n]=kr(s)}function Gs(n,e,t){const i=fn(e)?e:[e],l=i.length;if(!vt(n))return n;t=t||{};const s=t.merger||v4;let o;for(let r=0;r<l;++r){if(o=i[r],!vt(o))continue;const a=Object.keys(o);for(let u=0,f=a.length;u<f;++u)s(a[u],n,o,t)}return n}function Ns(n,e){return Gs(n,e,{merger:w4})}function w4(n,e,t){if(!$k(n))return;const i=e[n],l=t[n];vt(i)&&vt(l)?Ns(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=kr(l))}const qc={"":n=>n,x:n=>n.x,y:n=>n.y};function S4(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function T4(n){const e=S4(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function yr(n,e){return(qc[e]||(qc[e]=T4(e)))(n)}function Hu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const vr=n=>typeof n<"u",sl=n=>typeof n=="function",jc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function $4(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const kn=Math.PI,$i=2*kn,C4=$i+kn,wr=Number.POSITIVE_INFINITY,O4=kn/180,ci=kn/2,bl=kn/4,Hc=kn*2/3,Ga=Math.log10,ol=Math.sign;function Ol(n,e,t){return Math.abs(n-e)<t}function zc(n){const e=Math.round(n);n=Ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Ga(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function M4(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((l,s)=>l-s).pop(),e}function Xs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function E4(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function D4(n,e,t){let i,l,s;for(i=0,l=n.length;i<l;i++)s=n[i][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Tl(n){return n*(kn/180)}function I4(n){return n*(180/kn)}function Uc(n){if(!vn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function L4(n,e){const t=e.x-n.x,i=e.y-n.y,l=Math.sqrt(t*t+i*i);let s=Math.atan2(i,t);return s<-.5*kn&&(s+=$i),{angle:s,distance:l}}function Xa(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function A4(n,e){return(n-e+C4)%$i-kn}function ki(n){return(n%$i+$i)%$i}function Ck(n,e,t,i){const l=ki(n),s=ki(e),o=ki(t),r=ki(s-l),a=ki(o-l),u=ki(l-s),f=ki(l-o);return l===s||l===o||i&&s===o||r>a&&u<f}function di(n,e,t){return Math.max(e,Math.min(t,n))}function N4(n){return di(n,-32768,32767)}function Ok(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function zu(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,l=0,s;for(;i-l>1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const $l=(n,e,t,i)=>zu(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),P4=(n,e,t)=>zu(n,t,i=>n[i][e]>=t);function R4(n,e,t){let i=0,l=n.length;for(;i<l&&n[i]<e;)i++;for(;l>i&&n[l-1]>t;)l--;return i>0||l<n.length?n.s
2024-12-26 04:24:24 +08:00
* Chart.js v4.4.7
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/class WS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,l){const s=t.listeners[l],o=t.duration;s.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=Ek.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.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,l)=>Math.max(i,l._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 l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Pi=new WS;const od="transparent",YS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Kc(n||od),l=i.valid&&Kc(e||od);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class KS{constructor(e,t,i,l){const s=t[i];l=Po([e.to,l,s,e.from]);const o=Po([e.from,s,l]);this._active=!0,this._fn=e.fn||YS[e.type||typeof o],this._easing=Ps[e.easing]||Ps.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=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Po([e.to,t,l,e.from]),this._from=Po([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t<i),!this._active){this._target[l]=r,this._notify(!0);return}if(t<0){this._target[l]=s;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,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 l=0;l<i.length;l++)i[l][t]()}}class Vk{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!vt(e))return;const t=Object.keys(sn.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!vt(s))return;const o={};for(const r of t)o[r]=s[r];(fn(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=ZS(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&JS(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}s[u]=c=new KS(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size
2024-12-26 04:24:24 +08:00
`)>-1?n.split(`
`):n}function V6(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function Fd(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Ti(e.bodyFont),u=Ti(e.titleFont),f=Ti(e.footerFont),c=s.length,d=l.length,m=i.length,h=rl(e.padding);let g=h.height,_=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,ht(n.title,$),t.font=a.string,ht(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,ht(i,T=>{ht(T.before,$),ht(T.lines,$),ht(T.after,$)}),S=0,t.font=f.string,ht(n.footer,$),t.restore(),_+=h.width,{width:_,height:g}}function B6(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function W6(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function Y6(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),W6(u,n,e,t)&&(u="center"),u}function qd(n,e,t){const i=t.yAlign||e.yAlign||B6(n,t);return{xAlign:t.xAlign||e.xAlign||Y6(n,e,t,i),yAlign:i}}function K6(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function J6(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function jd(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=lr(o);let h=K6(e,r);const g=J6(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:di(h,0,i.width-e.width),y:di(g,0,i.height-e.height)}}function Bo(n,e,t){const i=rl(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Hd(n){return gi([],Ri(n))}function Z6(n,e,t){return Nl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function zd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const sy={beforeTitle:Ni,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:Ni,beforeBody:Ni,beforeLabel:Ni,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return Qt(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Ni,afterBody:Ni,beforeFooter:Ni,footer:Ni,afterFooter:Ni};function Ln(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?sy[e].call(t,i):l}class lu extends Ll{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,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void
2024-12-26 04:24:24 +08:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const n$={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"}};Wk._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 n$},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 i$(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var oy={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
2024-12-26 04:24:24 +08:00
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */(function(n){(function(e,t,i,l){var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,u=Math.abs,f=Date.now;function c(K,Q,ne){return setTimeout($(K,ne),Q)}function d(K,Q,ne){return Array.isArray(K)?(m(K,ne[Q],ne),!0):!1}function m(K,Q,ne){var me;if(K)if(K.forEach)K.forEach(Q,ne);else if(K.length!==l)for(me=0;me<K.length;)Q.call(ne,K[me],me,K),me++;else for(me in K)K.hasOwnProperty(me)&&Q.call(ne,K[me],me,K)}function h(K,Q,ne){var me="DEPRECATED METHOD: "+Q+`
`+ne+` AT
`;return function(){var Le=new Error("get-stack-trace"),Ze=Le&&Le.stack?Le.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",mt=e.console&&(e.console.warn||e.console.log);return mt&&mt.call(e.console,me,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===l||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(Q),me=1;me<arguments.length;me++){var Le=arguments[me];if(Le!==l&&Le!==null)for(var Ze in Le)Le.hasOwnProperty(Ze)&&(ne[Ze]=Le[Ze])}return ne}:g=Object.assign;var _=h(function(Q,ne,me){for(var Le=Object.keys(ne),Ze=0;Ze<Le.length;)(!me||me&&Q[Le[Ze]]===l)&&(Q[Le[Ze]]=ne[Le[Ze]]),Ze++;return Q},"extend","Use `assign`."),k=h(function(Q,ne){return _(Q,ne,!0)},"merge","Use `assign`.");function S(K,Q,ne){var me=Q.prototype,Le;Le=K.prototype=Object.create(me),Le.constructor=K,Le._super=me,ne&&g(Le,ne)}function $(K,Q){return function(){return K.apply(Q,arguments)}}function T(K,Q){return typeof K==r?K.apply(Q&&Q[0]||l,Q):K}function O(K,Q){return K===l?Q:K}function E(K,Q,ne){m(N(Q),function(me){K.addEventListener(me,ne,!1)})}function L(K,Q,ne){m(N(Q),function(me){K.removeEventListener(me,ne,!1)})}function I(K,Q){for(;K;){if(K==Q)return!0;K=K.parentNode}return!1}function A(K,Q){return K.indexOf(Q)>-1}function N(K){return K.trim().split(/\s+/g)}function P(K,Q,ne){if(K.indexOf&&!ne)return K.indexOf(Q);for(var me=0;me<K.length;){if(ne&&K[me][ne]==Q||!ne&&K[me]===Q)return me;me++}return-1}function R(K){return Array.prototype.slice.call(K,0)}function q(K,Q,ne){for(var me=[],Le=[],Ze=0;Ze<K.length;){var mt=K[Ze][Q];P(Le,mt)<0&&me.push(K[Ze]),Le[Ze]=mt,Ze++}return me=me.sort(function(dn,Tn){return dn[Q]>Tn[Q]}),me}function F(K,Q){for(var ne,me,Le=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze<s.length;){if(ne=s[Ze],me=ne?ne+Le:Q,me in K)return me;Ze++}return l}var B=1;function J(){return B++}function V(K){var Q=K.ownerDocument||K;return Q.defaultView||Q.parentWindow||e}var Z=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in e,fe=F(e,"PointerEvent")!==l,ce=G&&Z.test(navigator.userAgent),ue="touch",Te="pen",Ke="mouse",Je="kinect",ft=25,et=1,xe=2,We=4,at=8,Ut=1,Ve=2,Ee=4,ot=8,De=16,Ye=Ve|Ee,ve=ot|De,nt=Ye|ve,Ht=["x","y"],Ne=["clientX","clientY"];function Ce(K,Q){var ne=this;this.manager=K,this.callback=Q,this.element=K.element,this.target=K.options.inputTarget,this.domHandler=function(me){T(K.options.enable,[K])&&ne.handler(me)},this.init()}Ce.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(V(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(V(this.element),this.evWin,this.domHandler)}};function _t(K){var Q,ne=K.options.inputClass;return ne?Q=ne:fe?Q=cl:ce?Q=se:G?Q=Ge:Q=Ui,new Q(K,zt)}function zt(K,Q,ne){var me=ne.pointers.length,Le=ne.changedPointers.length,Ze=Q&et&&me-Le===0,mt=Q&(We|at)&&me-Le===0;ne.isFirst=!!Ze,ne.isFinal=!!mt,Ze&&(K.session={}),ne.eventType=Q,Lt(K,ne),K.emit("hammer.input",ne),K.recognize(ne),K.session.prevInput=ne}function Lt(K,Q){var ne=K.session,me=Q.pointers,Le=me.length;ne.firstInput||(ne.firstInput=Jt(Q)),Le>1&&!ne.firstMultiple?ne.firstMultiple=Jt(Q):Le===1&&(ne.firstMultiple=!1);var Ze=ne.firstInput,mt=ne.firstMultiple,un=mt?mt.center:Ze.center,dn=Q.center=mn(me);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=bt(un,dn),Q.distance=oi(un,dn),Ae(ne,Q),Q.offsetDirection=Mi(Q.deltaX,Q.deltaY);var Tn=cn(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Tn.x,Q.overallVelocityY=Tn.y,Q.overallVelocity=u(Tn.x)>u(Tn.y)?Tn.x:Tn.y,Q.scale=mt?an(mt.pointers,me):1,Q.rotation=mt?Yn(mt.pointers,me):0,Q.maxPointers=ne.prevInput?Q.pointers.length>ne.prevInput.maxPointers?Q.pointers.length:ne.prevInput.maxPointers:Q.pointers.length,qt(ne,Q);var hi=K.element;I(Q.srcEvent.target,hi)&&(hi=
2024-12-26 04:24:24 +08:00
* chartjs-plugin-zoom v2.2.0
* https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
* (c) 2016-2024 chartjs-plugin-zoom Contributors
* Released under the MIT License
*/const eo=n=>n&&n.enabled&&n.modifierKey,ry=(n,e)=>n&&e[n+"Key"],Qu=(n,e)=>n&&!e[n+"Key"];function al(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function va(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function s$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function o$({x:n,y:e},t){const i=t.scales,l=Object.keys(i);for(let s=0;s<l.length;s++){const o=i[l[s]];if(e>=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function ay(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=o$(e,t),r=va(i,t),a=va(l,t);if(s){const f=va(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return ht(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const ou=new WeakMap;function Wt(n){let e=ou.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},ou.set(n,e)),e}function r$(n){ou.delete(n)}function uy(n,e,t,i){const l=Math.max(0,Math.min(1,(n-e)/t||0)),s=1-l;return{min:i*l,max:i*s}}function fy(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function cy(n,e,t){const i=n.max-n.min,l=i*(e-1),s=fy(n,t);return uy(s,n.min,i,l)}function a$(n,e,t){const i=fy(n,t);if(i===void 0)return{min:n.min,max:n.max};const l=Math.log10(n.min),s=Math.log10(n.max),o=Math.log10(i),r=s-l,a=r*(e-1),u=uy(o,l,r,a);return{min:Math.pow(10,l+u.min),max:Math.pow(10,s-u.max)}}function u$(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Zd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Mt(o.options,o.scale)}return Mt(s,l)}function f$(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function c$(n,{min:e,max:t,minLimit:i,maxLimit:l},s){const o=(n-t+e)/2;e-=o,t+=o;const r=s.min.options??s.min.scale,a=s.max.options??s.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),e<i?(e=i,t=Math.min(i+n,l)):t>l&&(t=l,e=Math.max(l-n,i)),{min:e,max:t}}function Pl(n,{min:e,max:t},i,l=!1){const s=Wt(n.chart),{options:o}=n,r=u$(n,i),{minRange:a=0}=r,u=Zd(s,n,r,"min",-1/0),f=Zd(s,n,r,"max",1/0);if(l==="pan"&&(e<u||t>f))return!0;const c=n.max-n.min,d=l?Math.max(t-e,a):c;if(l&&d===a&&c<=a)return!0;const m=c$(d,{min:e,max:t,minLimit:u,maxLimit:f},s.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,s.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function d$(n,e,t,i){const l=cy(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return Pl(n,s,i,!0)}function p$(n,e,t,i){const l=a$(n,e,t);return Pl(n,l,i,!0)}function m$(n,e,t,i){Pl(n,f$(n,e,t),i,!0)}const Gd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function h$(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<t&&(n.max+=1)}function _$(n,e,t,i){const l=cy(n,e,t);n.min===n.max&&e<1&&h$(n);const s={min:n.min+Gd(l.min),max:n.max-Gd(l.max)};return Pl(n,s,i,!0)}function g$(n){return n.isHorizontal()?n.width:n.height}function b$(n,e,t){const l=n.getLabels().length-1;let{min:s,max:o}=n;const r=Math.max(o-s,1),a=Math.round(g$(n)/Math.max(r,10)),u=Math.round(Math.abs(e/a));let f;return e<-a?(o=Math.min(o+u,l),s=r===1?o:o-r,f=o===l):e>a&&(s=Math.max(0,s-u),o=r===1?s:s+r,f=s===0),Pl(n,{min:s,max:o},t)||f}const k$={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function dy(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=k$[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e);return isNaN(u)||isNaN(f)?!0:Pl(n,{min:u,max:f},t,i?"pan":!1)}function Xd(n,e,t){return dy(n,e,t,!0)}const ru={category:_$,default:d$,logarithmic:p$},au={default:m$},uu={category:b$,default:dy,logarithmic:Xd,timeseries:Xd};function y$(n,e,t){const{id:i,options:{min:l,max:s}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==l||o.max
`),i=b("div");for(let o=0;o<s.length;o+=1)s[o].c();p(i,"class","inline-flex flex-gap-5"),p(e,"class",n[0])},m(o,r){v(o,e,r),w(e,t),w(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(i,null)},p(o,[r]){r&1&&p(e,"class",o[0])},i:te,o:te,d(o){o&&y(e),ct(s,o)}}}function kC(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class yy extends Se{constructor(e){super(),we(this,e,kC,bC,ke,{class:0})}}function yC(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[wC,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[SC,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[TC,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[$C,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),z(t.$$.fragment),i=C(),z(l.$$.fragment),s=C(),z(o.$$.fragment),r=C(),z(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),j(t,e,null),w(e,i),j(l,e,null),w(e,s),j(o,e,null),w(e,r),j(a,e,null),u=!0,f||(c=Y(e,"submit",it(n[7])),f=!0)},p(d,m){const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),t.$set(h);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&y(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function vC(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="loader"></div>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function wC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),l=C(),s=b("input"),r=C(),a=b("div"),a.innerHTML="Set to <code>0</code> to disable logs persistence.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),s.required=!0,p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),_e(s,n[1].logs.maxDays),v(c,r,d),v(c,a,d),u||(f=Y(s,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&2&&gt(s.value)!==c[1].logs.maxDays&&_e(s,c[1].logs.maxDays)},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function SC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new yy({}),{c(){e=b("label"),t=W("Min log level"),l=C(),s=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),z(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),_e(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),j(f,r,null),c=!0,d||(m=Y(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&gt(s.value)!==h[1].logs.minLevel&&_e(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(y(e),y(l),y(s),y(o),y(r)),H(f),d=!1,m()}}}function TC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIP),f&8388608&&o!==(o=u[23])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function $C(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(e,"change",n[14]),r=!0)},p(u,f){f&8388608&&t!==(
`);for(let s=0;s<l.length;s+=1)l[s].c();p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(s,o){if(o&264){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=Mp(s,i,r);l[r]?l[r].p(a,o):(l[r]=Dp(a),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&y(e),ct(l,s)}}}function Dp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[15](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(y(e),y(l)),s=!1,o()}}}function GC(n){var d;let e,t,i,l,s,o,r,a,u,f,c=((d=n[3])==null?void 0:d.length)>0&&Ep(n);return{c(){e=b("label"),t=W("Subject"),l=C(),s=b("input"),r=C(),c&&c.c(),a=ye(),p(e,"for",i=n[24]),p(s,"type","text"),p(s,"id",o=n[24]),p(s,"spellcheck","false"),s.required=!0},m(m,h){v(m,e,h),w(e,t),v(m,l,h),v(m,s,h),_e(s,n[0].subject),v(m,r,h),c&&c.m(m,h),v(m,a,h),u||(f=Y(s,"input",n[14]),u=!0)},p(m,h){var g;h&16777216&&i!==(i=m[24])&&p(e,"for",i),h&16777216&&o!==(o=m[24])&&p(s,"id",o),h&1&&s.value!==m[0].subject&&_e(s,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Ep(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(m),u=!1,f()}}}function XC(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[24]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){v(s,e,o),_e(e,n[0].body),i||(l=Y(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&_e(e,s[0].body)},i:te,o:te,d(s){s&&y(e),i=!1,l()}}}function QC(n){let e,t,i,l;function s(a){n[16](a)}var o=n[5];function r(a,u){let f={id:a[24],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Vt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&j(e,a,u),v(a,i,u),l=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){re();const f=e;D(f.$$.fragment,1,0,()=>{H(f,1)}),ae()}o?(e=Vt(o,r(a)),ie.push(()=>be(e,"value",s)),z(e.$$.fragment),M(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,$e(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&y(i),e&&H(e,a)}}}function Ip(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Lp(Op(n,i,s));return{c(){e=b("div"),t=W(`Available placeholder parameters:
`);for(let s=0;s<l.length;s+=1)l[s].c();p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(s,o){if(o&264){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=Op(s,i,r);l[r]?l[r].p(a,o):(l[r]=Lp(a),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&y(e),ct(l,s)}}}function Lp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[18](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(y(e),y(l)),s=!1,o()}}}function xC(n){var h;let e,t,i,l,s,o,r,a,u;const f=[QC,XC],c=[];function d(g,_){return g[5]&&!g[6]?0:1}s=d(n),o=c[s]=f[s](n);let m=((h=n[3])==null?void 0:h.length)>0&&Ip(n);return{c(){e=b("label"),t=W("Body (HTML)"),l=C(),o.c(),r=C(),m&&m.c(),a=ye(),p(e,"for",i=n[24])},m(g,_){v(g,e,_),w(e,t),v(g,l,_),c[s].m(g,_),v(g,r,_),m&&m.m(g,_),v(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=s;s=d(g),s===k?c[s].p(g,_):(re(),D(c[k],1,1,()=>{c[k]=null}),ae(),o=c[s],o?o.p(g,_):(o=c[s]=f[s](g),o.c()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Ip(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(o),u=!0)},o(g){D(o),u=!1},d(g){g&&(y(e),y(l),y(r),y(a)),c[s].d(g),m&&m.d(g)}}}function e8(n){let e,t,i,l;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[GC,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[xC,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=C(),z(i.$$.fragment)},m(s,o){j(e,s,o),v(s,t,o),j(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function Ap(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function t8(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Ap();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),s=W(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),w(l,s),v(c,o,d),v(c,r,d),v(c,a,d),f&&f.m(c,d),v(c,u,d)},p(c,d){d&4&&oe(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Ap(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(o),y(r),y(a),y(u)),f&&f.d(c)}}}function n8(n){let e,t;const i=[n[9]];let l={$$slots:{header:[t8],default:[e8]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=He(l,i[s]);return e=new zi({props:l}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){z(e.$$.fragment)},m(s,o){j(e,s,o),t=!0},p(s,[o]){const r=o&512?wt(i,[Ft(s[9])]):{};o&1073742063&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}let Np;function i8(n,e,t){let i;const l=["key","title","config","placeholders","expand","collapse","collapseSiblings"];let s=st(e,l),o;Xe(n,wn,R=>t(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Np,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await Tt(async()=>{const{default:R}=await import("./CodeEditor-DULnQ9Rp.js");return{default:R}},__vite__mapDeps([13,1]),import.meta.url)).d
<code>email != &#39;&#39;</code>.`,l=C(),s=b("p"),s.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),v(o,l,r),v(o,s,r)},p:te,d(o){o&&(y(e),y(t),y(i),y(l),y(s))}}}function T8(n){let e,t,i,l,s,o,r,a,u;l=new de({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[w8,({uniqueId:d})=>({5:d}),({uniqueId:d})=>d?32:0]},$$scope:{ctx:n}}});function f(d){n[4](d)}let c={label:"MFA rule",formKey:"mfa.rule",superuserToggle:!1,disabled:!n[0].mfa.enabled,placeholder:"Leave empty to require MFA for everyone",collection:n[0],$$slots:{default:[S8]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new ll({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`<p class="txt-bold">This feature is experimental and may change in the future.</p> <p>Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth
2024-12-26 04:24:24 +08:00
methods (otp, identity/password, oauth2) before issuing an auth token.
<a href="https://pocketbase.io/docs/authentication#multi-factor-authentication" target="_blank" rel="noopener noreferrer" class="txt-sm link-hint" title="Learn more"><em>(Learn more)</em> </a>.</p>`,t=C(),i=b("div"),z(l.$$.fragment),s=C(),o=b("div"),z(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),x(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){v(d,e,m),v(d,t,m),v(d,i,m),j(l,i,null),w(i,s),w(i,o),j(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&x(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(y(e),y(t),y(i)),H(l),H(r)}}}function $8(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function C8(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Wp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function O8(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?C8:$8}let a=r(n),u=a(n),f=n[1]&&Wp();return{c(){e=b("div"),e.innerHTML='<i class="ri-shield-check-line"></i> <span class="txt">Multi-factor authentication (MFA)</span>',t=C(),i=b("div"),l=C(),u.c(),s=C(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){v(c,e,d),v(c,t,d),v(c,i,d),v(c,l,d),u.m(c,d),v(c,s,d),f&&f.m(c,d),v(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&M(f,1):(f=Wp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(re(),D(f,1,1,()=>{f=null}),ae())},d(c){c&&(y(e),y(t),y(i),y(l),y(s),y(o)),u.d(c),f&&f.d(c)}}}function M8(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[O8],default:[T8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function E8(n,e,t){let i,l;Xe(n,wn,a=>t(2,l=a));let{collection:s}=e;function o(){s.mfa.enabled=this.checked,t(0,s)}function r(a){n.$$.not_equal(s.mfa.rule,a)&&(s.mfa.rule=a,t(0,s))}return n.$$set=a=>{"collection"in a&&t(0,s=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!U.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class D8 extends Se{constructor(e){super(),we(this,e,E8,M8,ke,{collection:0})}}const I8=n=>({}),Yp=n=>({});function Kp(n,e,t){const i=n.slice();return i[50]=e[t],i}const L8=n=>({}),Jp=n=>({});function Zp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Gp(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=C(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){v(l,e,s),w(e,t),w(e,i)},p(l,s){s[0]&4&&oe(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&y(e)}}}function A8(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s[0]&1&&t!==(t=l[50]+"")&&oe(i,t)},i:te,o:te,d(l){l&&y(e)}}}function N8(n){let e,t,i;const l=[{item:n[50]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=He(u,l[f]);return a!==void 0&&a[0]&2049&&(u=He(u,wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]))),{props:u}}return s&&(e=Vt(s,o(n))),{c(){e&&z(e.$$.fragment),t=ye()},m(r,a){e&&j(e,r,a),v(r,t,a),i=!0},p(r,a){if(a[0]&1024&&s!==(s=r[10])){if(e){re();const u=e;D(u.$$.fragment,1,0,()=>{H(u,1)}),ae()}s?(e=Vt(s,o(r,a)),z(e.$$.fragment),M(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Ft(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},
2024-12-26 04:24:24 +08:00
...
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),_e(s,n[5]),v(c,r,d),v(c,a,d),u||(f=Y(s,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&_e(s,c[5])},d(c){c&&(y(e),y(l),y(s),y(r),y(a)),u=!1,f()}}}function o5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S;return l=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[t5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[n5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[i5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[l5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[s5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),z(l.$$.fragment),s=C(),o=b("div"),z(r.$$.fragment),a=C(),u=b("div"),z(f.$$.fragment),c=C(),d=b("div"),z(m.$$.fragment),h=C(),z(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){v($,e,T),w(e,t),w(t,i),j(l,i,null),w(t,s),w(t,o),j(r,o,null),w(t,a),w(t,u),j(f,u,null),w(t,c),w(t,d),j(m,d,null),w(t,h),j(g,t,null),_=!0,k||(S=Y(e,"submit",it(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){_||(M(l.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(g.$$.fragment,$),_=!0)},o($){D(l.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),_=!1},d($){$&&y(e),H(l),H(r),H(f),H(m),H(g),k=!1,S()}}}function r5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function a5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),l=b("button"),s=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){v(c,e,d),w(e,t),v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(y(e),y(i),y(l)),u=!1,f()}}}function u5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[a5],header:[r5],default:[o5]},$$scope:{ctx:n}};return e=new en({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ur=15777e3;function f5(n,e,t){let i;const l=yt(),s="apple_secret_"+U.randomString(5);let o,r,a,u,f,c,d=!1;function m(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,c=N.duration||ur),Bt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const N=await he.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),xt("Successfully generated client secret."),l("submit",N),o==null||o.hide()}catch(N){he.error(N)}t(7,d=!1)}function _(){r=
is a direct result of the trusted server code-&gt;token exchange response.</em>`,i=C(),z(l.$$.fragment),s=C(),z(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){v(u,e,f),w(e,t),w(e,i),j(l,e,null),w(e,s),j(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=je(e,pt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=je(e,pt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),H(l),H(o),u&&r&&r.end()}}}function A5(n){let e,t,i,l;return t=new de({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[R5,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","content")},m(s,o){v(s,e,o),j(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=je(e,pt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=je(e,pt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&y(e),H(t),s&&i&&i.end()}}}function N5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),l=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),_e(r,n[0].extra.jwksURL),u||(f=[Oe(qe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&_e(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ie(f)}}}function P5(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new hs({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),l=b("i"),o=C(),z(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),j(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function R5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=C(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),_e(s,n[0].userInfoURL),r||(a=Y(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&_e(s,u[0].userInfoURL)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function F5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){v(c,e,d),e.checked=n[0].pkce,v(c,i,d),v(c,l,d),w(l,s),w(l,o),w(l,r),u||(f=[Y(e,"change",n[11]),Oe(qe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(y(e),y(i),y(l)),u=!1,Ie(f)}}}function q5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new de({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[M5,({uni
`),_&&_.c(),o=C(),r=b("div");for(let N=0;N<S.length;N+=1)S[N].c();a=C(),u=b("button"),u.innerHTML='<span class="txt">+</span> <span class="txt">New index</span>',f=C(),z(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(N,P){v(N,e,P),w(e,t),w(e,l),w(e,s),_&&_.m(e,null),v(N,o,P),v(N,r,P);for(let R=0;R<S.length;R+=1)S[R]&&S[R].m(r,null);w(r,a),w(r,u),v(N,f,P),j(c,N,P),m=!0,h||(g=Y(u,"click",n[5]),h=!0)},p(N,[P]){var q,F,B,J,V;if((!m||P&1)&&i!==(i=(((F=(q=N[0])==null?void 0:q.indexes)==null?void 0:F.length)||0)+"")&&oe(l,i),(J=(B=N[2])==null?void 0:B.indexes)!=null&&J.message?_?(_.p(N,P),P&4&&M(_,1)):(_=jm(N),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),P&7){k=pe(((V=N[0])==null?void 0:V.indexes)||[]);let Z;for(Z=0;Z<k.length;Z+=1){const G=qm(N,k,Z);S[Z]?S[Z].p(G,P):(S[Z]=zm(G),S[Z].c(),S[Z].m(r,a))}for(;Z<S.length;Z+=1)S[Z].d(1);S.length=k.length}const R={};!d&&P&1&&(d=!0,R.collection=N[0],$e(()=>d=!1)),c.$set(R)},i(N){m||(M(_),M(c.$$.fragment,N),m=!0)},o(N){D(_),D(c.$$.fragment,N),m=!1},d(N){N&&(y(e),y(o),y(r),y(f)),_&&_.d(),ct(S,N),n[6](null),H(c,N),h=!1,g()}}}const Um=n=>n.name;function uM(n,e,t){let i;Xe(n,wn,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let g=0;g<l.indexes.length;g++)if(l.indexes[g]==m){t(0,l.indexes[g]=h,l),Wn("indexes."+g);return}l.indexes.push(h),t(0,l)}const r=(m,h)=>s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h<l.indexes.length;h++)if(l.indexes[h]==m.detail){l.indexes.splice(h,1),Wn("indexes."+h);break}t(0,l)},d=m=>{var h;(h=i.indexes)!=null&&h.message&&Wn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class fM extends Se{constructor(e){super(),we(this,e,uM,aM,ke,{collection:0})}}function Vm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Bm(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),l=b("span"),l.textContent=`${n[5].label}`,s=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&y(e),o=!1,r()}}}function cM(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Bm(Vm(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&6){t=pe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=Vm(l,t,o);i[o]?i[o].p(r,s):(i[o]=Bm(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(l){l&&y(e),ct(i,l)}}}function dM(n){let e,t,i,l,s,o,r,a;return o=new zn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[cM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("i"),i=C(),l=b("div"),l.textContent="New field",s=C(),z(o.$$.fragment),p(t,"class","ri-add-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(u,f){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),j(o,e,null),a=!0},p(u,[f]){const c={};f&256&&(c.$$scope={dirty:f,ctx:u}),o.$set(c),(!a||f&1&&r!==(r="field-types-btn "+u[0]+" svelte-1gz9b6p"))&&p(e,"class",r)},i(u){a||(M(o.$$.fragment,u),a=!0)},o(u){D(o.$$.fragment,u),a=!1},d(u){u&&y(e),H(o)}}}function pM(n,e,t){let{class:i=""}=e;const l=yt(),s=[{label:"Plain text",value:"text",icon:U.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:U.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:U.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:U.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:U.getFieldTypeIcon("email")},{label:"URL",value:"url",icon:U.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:U.getFieldTypeIcon("date")},{label:"Autod
2024-12-26 04:24:24 +08:00
<span class='flatpickr-weekday'>
`+ee.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var X=Ot("div","flatpickr-weekwrapper");X.appendChild(Ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ee=Ot("div","flatpickr-weeks");return X.appendChild(ee),{weekWrapper:X,weekNumbers:ee}}function ce(X,ee){ee===void 0&&(ee=!0);var le=ee?X:X-t.currentMonth;le<0&&t._hidePrevMonthArrow===!0||le>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=le,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),q()),R(),Dt("onMonthChange"),Vi())}function ue(X,ee){if(X===void 0&&(X=!0),ee===void 0&&(ee=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ee===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=Aa(t.config),ge=le.hours,Fe=le.minutes,Be=le.seconds;m(ge,Fe,Be)}t.redraw(),X&&Dt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Dt("onClose")}function Ke(){t.config!==void 0&&Dt("onDestroy");for(var X=t._handlers.length;X--;)t._handlers[X].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 ee=t.calendarContainer.parentNode;if(ee.lastChild&&ee.removeChild(ee.lastChild),ee.parentNode){for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}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(le){try{delete t[le]}catch{}})}function Je(X){return t.calendarContainer.contains(X)}function ft(X){if(t.isOpen&&!t.config.inline){var ee=Un(X),le=Je(ee),ge=ee===t.input||ee===t.altInput||t.element.contains(ee)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!ge&&!le&&!Je(X.relatedTarget),Be=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(ee)});Fe&&Be&&(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 et(X){if(!(!X||t.config.minDate&&X<t.config.minDate.getFullYear()||t.config.maxDate&&X>t.config.maxDate.getFullYear())){var ee=X,le=t.currentYear!==ee;t.currentYear=ee||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)),le&&(t.redraw(),Dt("onYearChange"),q())}}function xe(X,ee){var le;ee===void 0&&(ee=!0);var ge=t.parseDate(X,void 0,ee);if(t.config.minDate&&ge&&Vn(ge,t.config.minDate,ee!==void 0?ee:!t.minDateHasTime)<0||t.config.maxDate&&ge&&Vn(ge,t.config.maxDate,ee!==void 0?ee:!t.maxDateHasTime)>0)return!1;if(!t.config.
2024-12-26 04:24:24 +08:00
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]),k&1&&(S.disabled=!U.isEmpty(_[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].exceptDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),H(r,_),d=!1,m()}}}function sE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(_){n[4](_)}let g={id:n[9]+".onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new hs({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),l=b("i"),o=C(),z(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".onlyDomains"),p(f,"class","help-block")},m(_,k){v(_,e,k),w(e,t),w(e,i),w(e,l),v(_,o,k),j(r,_,k),v(_,u,k),v(_,f,k),c=!0,d||(m=Oe(qe.call(null,l,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&s!==(s=_[9]+".onlyDomains"))&&p(e,"for",s);const S={};k&512&&(S.id=_[9]+".onlyDomains"),k&1&&(S.disabled=!U.isEmpty(_[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].onlyDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),H(r,_),d=!1,m()}}}function oE(n){let e,t,i,l,s,o,r;return i=new de({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[lE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[sE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),z(i.$$.fragment),l=C(),s=b("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),j(i,t,null),w(e,l),w(e,s),j(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&y(e),H(i),H(o)}}}function rE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[oE]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=He(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new li({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Ft(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function aE(n,e,t){const i=["field","key"];let l=st(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.exceptDomains,m)&&(s.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.onlyDomains,m)&&(s.onlyDomains=m,t(0,s))}function u(m){s=m,t(0,s)}function f(m){Pe.call(this,n,m)}function c(m){Pe.call(this,n,m)}function d(m){Pe.call(this,n,m)}return n.$$set=m=>{e=He(He({},e),Kt(m)),t(2,l=st(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class Ty extends Se{constructor(e){super(),we(this,e,aE,rE,ke,{field:0,key:1})}}function uE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),l=C(),s=b("small"),r=W(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),v(a,s,u),w(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&oe(i,t),u&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:te,o:te,d(a){a&&(y(e),y(l),y(s))}}}function fE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class rh extends Se{constructor(e){super(),we(this,e,fE,uE,ke,{item:0})}}const cE=[{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"},{e
2024-12-26 04:24:24 +08:00
Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!k||L&8388608&&s!==(s=E[23]))&&p(e,"for",s);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,$e(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){k||(M(r.$$.fragment,E),M(_.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),k=!1},d(E){E&&(y(e),y(o),y(u),y(f)),H(r,E),H(_),S=!1,$()}}}function _E(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
(e.g. 100x50) - crop to WxH viewbox (from center)</li> <li><strong>WxHt</strong>
(e.g. 100x50t) - crop to WxH viewbox (from top)</li> <li><strong>WxHb</strong>
(e.g. 100x50b) - crop to WxH viewbox (from bottom)</li> <li><strong>WxHf</strong>
(e.g. 100x50f) - fit inside a WxH viewbox (without cropping)</li> <li><strong>0xH</strong>
(e.g. 0x50) - resize to H height preserving the aspect ratio</li> <li><strong>Wx0</strong>
(e.g. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function gE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O;function E(I){n[12](I)}let L={id:n[23],placeholder:"e.g. 50x50, 480x720"};return n[0].thumbs!==void 0&&(L.value=n[0].thumbs),r=new hs({props:L}),ie.push(()=>be(r,"value",E)),S=new zn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[_E]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),l=b("i"),o=C(),z(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=C(),_=b("i"),k=C(),z(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(_,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(e,l),v(I,o,A),j(r,I,A),v(I,u,A),v(I,f,A),w(f,c),w(f,d),w(f,m),w(m,h),w(m,g),w(m,_),w(m,k),j(S,m,null),$=!0,T||(O=Oe(qe.call(null,l,{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"})),T=!0)},p(I,A){(!$||A&8388608&&s!==(s=I[23]))&&p(e,"for",s);const N={};A&8388608&&(N.id=I[23]),!a&&A&1&&(a=!0,N.value=I[0].thumbs,$e(()=>a=!1)),r.$set(N);const P={};A&33554432&&(P.$$scope={dirty:A,ctx:I}),S.$set(P)},i(I){$||(M(r.$$.fragment,I),M(S.$$.fragment,I),$=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),$=!1},d(I){I&&(y(e),y(o),y(u),y(f)),H(r,I),H(S),T=!1,O()}}}function bE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),l=C(),s=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(s,"max",Number.MAX_SAFE_INTEGER),s.value=r=n[0].maxSize||"",p(s,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),v(d,a,m),v(d,u,m),f||(c=Y(s,"input",n[13]),f=!0)},p(d,m){m&8388608&&i!==(i=d[23])&&p(e,"for",i),m&8388608&&o!==(o=d[23])&&p(s,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&s.value!==r&&(s.value=r)},d(d){d&&(y(e),y(l),y(s),y(a),y(u)),f=!1,c()}}}function ah(n){let e,t,i;return t=new de({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[kE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){v(l,e,s),j(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function kE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=C(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),p(s,"max",Number.MAX_SAFE_INTEGER),s.required=!0,p(s,"placeholder","Default to single")},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),_e(s,n[0].maxSelect),r||(a=Y(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&gt(s.value)!==u[0].maxSelect&&_e(s,u[0].maxSelect)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function yE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=C(),l=b("label"),s=b("span"),s.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible
<a href="https://pocketbase.io/docs/files-handling#protected-files" class="toggle-info" target="_blank" rel="noopener">(Learn more)</a>`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){v(c,e,d),e.checked=n[0].protected,v(c,i,d),v(c,l,d),w(l,s),v(c,r,d),v(c,a,d),u||(f=Y(e,"change",n[15]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(y(e),y(i),y(l),y(r),y(a)),u=!1,f()}}}function vE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;i=new de({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[hE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[gE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[bE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&ah(n);return h=new de({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[yE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),z(i.$$.fragment),l=C(),s=b("div"),z(o.$$.fragment),a=C(),u=b("div"),z(f.$$.fragment),d=C(),_&&_.c(),m=C(),z(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(k,S){v(k,e,S),w(e,t),j(i,t,null),w(e,l),w(e,s),j(o,s,null),w(e,a),w(e,u),j(f,u,null),w(e,d),_&&_.m(e,null),w(e,m),j(h,e,null),g=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!g||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!g||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&4&&M(_,1)):(_=ah(k),_.c(),M(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),h.$set(E)},i(k){g||(M(i.$$.fragment,k),M(o.$$.fragment,k),M(f.$$.fragment,k),M(_),M(h.$$.fragment,k),g=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(_),D(h.$$.fragment,k),g=!1},d(k){k&&y(e),H(i),H(o),H(f),_&&_.d(),H(h)}}}function wE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[vE],default:[pE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=He(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new li({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Ft(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function SE(n,e,t){const i=["field","key"];let l=st(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=cE.slice(),u=s.maxSelect<=1,f=u;function c(){t(0,s.maxSelect=1,s),t(0,s.thumbs=[],s),t(0,s.mimeTypes=[],s),t(2,u=!0),t(6,f=u)}function d(){if(U.isEmpty(s.mimeTypes))return;const P=[];for(const R of s.mimeTypes)a.find(q=>q.mimeType===R)||P.push({mimeType:R});P.length&&t(3,a=a.concat(P))}function m(P){n.$$.not_equal(s.mimeTypes,P)&&(s.mimeTypes=P,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml
2024-12-26 04:24:24 +08:00
`),r=b("code"),r.textContent="multipart/form-data",a=W(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=W(` field
is a
`),c=b("strong"),c.textContent="plain string",d=W(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=C(),_=b("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=C(),S=b("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",$=C(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=C(),E=b("li"),I=W(L),A=W(" is converted to the json "),N=b("code"),N.textContent='{"a":1,"b":2}',P=C(),R=b("li"),R.textContent="numeric strings are converted to json number",q=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",B=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",V=W(`
2024-12-26 04:24:24 +08:00
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ce,ue){v(ce,e,ue),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(i,r),w(i,a),w(i,u),w(i,f),w(i,c),w(i,d),w(i,m),w(m,h),w(m,g),w(m,_),w(m,k),w(m,S),w(m,$),w(m,T),w(m,O),w(m,E),w(E,I),w(E,A),w(E,N),w(m,P),w(m,R),w(m,q),w(m,F),w(m,B),w(m,J),w(i,V),w(i,Z),fe=!0},i(ce){fe||(ce&&tt(()=>{fe&&(G||(G=je(e,pt,{duration:150},!0)),G.run(1))}),fe=!0)},o(ce){ce&&(G||(G=je(e,pt,{duration:150},!1)),G.run(0)),fe=!1},d(ce){ce&&y(e),ce&&G&&G.end()}}}function ME(n){let e,t,i,l,s,o,r,a,u,f,c;e=new de({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[$E,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,k){return _[2]?OE:CE}let m=d(n),h=m(n),g=n[2]&&uh();return{c(){z(e.$$.fragment),t=C(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=C(),h.c(),r=C(),g&&g.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){j(e,_,k),v(_,t,k),v(_,i,k),w(i,l),w(i,s),h.m(i,null),v(_,r,k),g&&g.m(_,k),v(_,a,k),u=!0,f||(c=Y(i,"click",n[5]),f=!0)},p(_,k){const S={};k&2&&(S.name="fields."+_[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?k&4&&M(g,1):(g=uh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(y(t),y(i),y(r),y(a)),H(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function EE(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[ME]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=He(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new li({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Ft(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function DE(n,e,t){const i=["field","key"];let l=st(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=h=>t(0,s.maxSize=parseInt(h.target.value,10),s),u=()=>{t(2,r=!r)};function f(h){s=h,t(0,s)}function c(h){Pe.call(this,n,h)}function d(h){Pe.call(this,n,h)}function m(h){Pe.call(this,n,h)}return n.$$set=h=>{e=He(He({},e),Kt(h)),t(3,l=st(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,r,l,a,u,f,c,d,m]}class IE extends Se{constructor(e){super(),we(this,e,DE,EE,ke,{field:0,key:1})}}function LE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),_e(s,n[0].min),r||(a=Y(s,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&&gt(s.value)!==u[0].min&&_e(s,u[0].min)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function AE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max"),l=C(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].min)},m(f,c){v(f,e,c),w(e,t),v(f,l,c),v(f,s,c),_e(s,n[0].max),a||(u=Y(s,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].min)&&p(s,"min",r),c&1&&gt(s.value)!==f[0].max&&_e(s,f[0].max)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function NE(n){let e,t,i,l,s,o,r;return i=new de({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[LE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[AE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),z(i.$$.fragment),
2024-12-26 04:24:24 +08:00
`),position:"top"})),c=!0)},p(g,_){var S,$;s&&It(s.update)&&_&20&&s.update.call(null,{text:[`Whether on ${((S=g[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,g[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=g[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
`),position:"top"}),(!f||_&16777216&&o!==(o=g[24]))&&p(e,"for",o);const k={};_&16777216&&(k.id=g[24]),!u&&_&1&&(u=!0,k.keyOfSelected=g[0].cascadeDelete,$e(()=>u=!1)),a.$set(k)},i(g){f||(M(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(y(e),y(r)),H(a,g),c=!1,d()}}}function tD(n){let e,t,i,l,s,o=!n[2]&&fh(n);return l=new de({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[eD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),z(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){v(r,e,a),o&&o.m(e,null),w(e,t),w(e,i),j(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),D(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&M(o,1)):(o=fh(r),o.c(),M(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(M(o),M(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&y(e),o&&o.d(),H(l)}}}function nD(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[tD],default:[XE,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=He(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new li({props:a}),ie.push(()=>be(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new sf({props:u}),n[21](l),l.$on("save",n[22]),{c(){z(e.$$.fragment),i=C(),z(l.$$.fragment)},m(f,c){j(e,f,c),v(f,i,c),j(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Ft(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],$e(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(M(e.$$.fragment,f),M(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&y(i),H(e,f),n[21](null),H(l,f)}}}function iD(n,e,t){let i,l;const s=["field","key"];let o=st(e,s),r;Xe(n,En,R=>t(10,r=R));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=a.maxSelect<=1,h=m;function g(){t(0,a.maxSelect=1,a),t(0,a.collectionId=null,a),t(0,a.cascadeDelete=!1,a),t(2,m=!0),t(9,h=m)}const _=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const $=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Pe.call(this,n,R)}function I(R){Pe.call(this,n,R)}function A(R){Pe.call(this,n,R)}function N(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const P=R=>{var q,F;(F=(q=R==null?void 0:R.detail)==null?void 0:q.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=He(He({},e),Kt(R)),t(8,o=st(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&g(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,k,S,$,T,O,E,L,I,A,N,P]}class lD extends Se{constructor(e){super(),we(this,e,iD,nD,ke,{field:0,key:1})}}function sD(n){let e,t,i,l,s,o;function r(u){n[7](u)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].values!==void 0&&(a.value=n[0].values),t=new hs({props:a}),ie.push(()=>be(t,"value",r)),{c(){e=b("div"),z(t.$$.fragment)},m(u,f){v(u,e,f),j(t,e,null),l=!0,s||(o=Oe(qe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(u,f){const c={};f&16384&&(c.id=u[14]),f&32768&&(c.readonly=!u[15]),!i&&f&1&&(i=!0,c.value=u[0].values,$e(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&y(e),H(t),s=!1,o()}}}func
2024-12-26 04:24:24 +08:00
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li> <li>Expressions must be aliased with a valid formatted field name, e.g.
<code>MAX(balance) as maxBalance</code>.</li> <li>Combined/multi-spaced expressions must be wrapped in parenthesis, e.g.
<code>(MAX(balance) + 1) as maxBalance</code>.</li></ul>`,u=C(),g&&g.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){v(_,e,k),w(e,t),v(_,l,k),m[s].m(_,k),v(_,r,k),v(_,a,k),v(_,u,k),g&&g.m(_,k),v(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=h(_),s===S?m[s].p(_,k):(re(),D(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,k):(g=hh(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(M(o),c=!0)},o(_){D(o),c=!1},d(_){_&&(y(e),y(l),y(r),y(a),y(u),y(f)),m[s].d(_),g&&g.d(_)}}}function ID(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[DD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function LD(n,e,t){let i;Xe(n,wn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=U.getNestedVal(c,"fields",null);if(U.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=U.extractColumnsFromQuery(l==null?void 0:l.viewQuery);U.removeByValue(m,"id"),U.removeByValue(m,"created"),U.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const _=d[h][g].message,k=m[h]||h;r.push(U.sentenize(k+": "+_))}}rn(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-DULnQ9Rp.js");return{default:c}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.viewQuery,c)&&(l.viewQuery=c,t(0,l))}const f=()=>{r.length&&Wn("fields")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class AD extends Se{constructor(e){super(),we(this,e,LD,ID,ke,{collection:0})}}function gh(n,e,t){const i=n.slice();return i[14]=e[t],i}function bh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A=pe(n[4]),N=[];for(let P=0;P<A.length;P+=1)N[P]=yh(gh(n,A,P));return{c(){e=b("div"),t=b("div"),i=b("div"),l=b("p"),l.textContent="The following record fields are available:",s=C(),o=b("div");for(let P=0;P<N.length;P+=1)N[P].c();r=C(),a=b("hr"),u=C(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=C(),d=b("div"),d.innerHTML="<code>@request.headers.*</code> <code>@request.query.*</code> <code>@request.body.*</code> <code>@request.auth.*</code>",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the
2024-12-26 04:24:24 +08:00
<em>@collection</em> filter:`,k=C(),S=b("div"),S.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",$=C(),T=b("hr"),O=C(),E=b("p"),E.innerHTML=`Example rule:
<br/> <code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(l,"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(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,R){v(P,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let q=0;q<N.length;q+=1)N[q]&&N[q].m(o,null);w(i,r),w(i,a),w(i,u),w(i,f),w(i,c),w(i,d),w(i,m),w(i,h),w(i,g),w(i,_),w(i,k),w(i,S),w(i,$),w(i,T),w(i,O),w(i,E),I=!0},p(P,R){if(R&24){A=pe(P[4]);let q;for(q=0;q<A.length;q+=1){const F=gh(P,A,q);N[q]?N[q].p(F,R):(N[q]=yh(F),N[q].c(),N[q].m(o,null))}for(;q<N.length;q+=1)N[q].d(1);N.length=A.length}},i(P){I||(P&&tt(()=>{I&&(L||(L=je(e,pt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=je(e,pt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),ct(N,P),P&&L&&L.end()}}}function kh(n){let e,t=n[14]+"",i;return{c(){e=b("code"),i=W(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[14]+"")&&oe(i,t)},d(l){l&&y(e)}}}function yh(n){let e=!n[3].includes(n[14]),t,i=e&&kh(n);return{c(){i&&i.c(),t=ye()},m(l,s){i&&i.m(l,s),v(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[14])),e?i?i.p(l,s):(i=kh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&y(t),i&&i.d(l)}}}function vh(n){let e,t,i,l,s,o,r,a,u;function f(_){n[8](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new ll({props:c}),ie.push(()=>be(e,"rule",f));function d(_){n[9](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new ll({props:m}),ie.push(()=>be(l,"rule",d));function h(_){n[10](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new ll({props:g}),ie.push(()=>be(r,"rule",h)),{c(){z(e.$$.fragment),i=C(),z(l.$$.fragment),o=C(),z(r.$$.fragment)},m(_,k){j(e,_,k),v(_,i,k),j(l,_,k),v(_,o,k),j(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),!t&&k&1&&(t=!0,S.rule=_[0].createRule,$e(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,$e(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,$e(()=>a=!1)),r.$set(T)},i(_){u||(M(e.$$.fragment,_),M(l.$$.fragment,_),M(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(y(i),y(o)),H(e,_),H(l,_),H(r,_)}}}function wh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,k){return _[2]?PD:ND}let m=d(n),h=m(n),g=n[2]&&Sh(n);return{c(){e=b("hr"),t=C(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=C(),h.c(),r=C(),g&&g.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm m-b-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){v(_,e,k),v(_,t,k),v(_,i,k),w(i,l),w(i,s),h.m(i,null),v(_,r,k),g&&g.m(_,k),v(_,a,k),u=!0,f||(c=Y(i,"click",n[11]),f=!0)},p(_,k){m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?(g.p(_,k),k&4&&M(g,1)):(g=Sh(_),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(g),u=!0)},o(_){D(g),u=!1},d(_){_&&(y(e),y(t),y(i),y(r),y(a)),h.d(),g&&g.d(_),f=!1,c()}}}function ND(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function PD(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Sh(n){let e,t,i,l,s,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[RD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new ll({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",plac
2024-12-26 04:24:24 +08:00
can authenticate.`,t=C(),i=b("p"),i.innerHTML=`For example, to allow only verified users you can set it to
<code>verified = true</code>.`,l=C(),s=b("p"),s.textContent="Leave it empty to allow anyone with an account to authenticate.",o=C(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),v(a,o,u),v(a,r,u)},p:te,d(a){a&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r))}}}function FD(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the <code>create</code> and <code>update</code> API
rules.`,t=C(),i=b("p"),i.textContent=`It enables superuser-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the
verified state or email, etc.`},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,d(l){l&&(y(e),y(t),y(i))}}}function qD(n){var R,q;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,k,S,$,T,O=n[1]&&bh(n);function E(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new ll({props:L}),ie.push(()=>be(f,"rule",E));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new ll({props:A}),ie.push(()=>be(m,"rule",I));let N=((R=n[0])==null?void 0:R.type)!=="view"&&vh(n),P=((q=n[0])==null?void 0:q.type)==="auth"&&wh(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,l=C(),s=b("button"),r=W(o),a=C(),O&&O.c(),u=C(),z(f.$$.fragment),d=C(),z(m.$$.fragment),g=C(),N&&N.c(),_=C(),P&&P.c(),k=ye(),p(s,"type","button"),p(s,"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-sm handle")},m(F,B){v(F,e,B),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),O&&O.m(e,null),v(F,u,B),j(f,F,B),v(F,d,B),j(m,F,B),v(F,g,B),N&&N.m(F,B),v(F,_,B),P&&P.m(F,B),v(F,k,B),S=!0,$||(T=Y(s,"click",n[5]),$=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&oe(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=bh(F),O.c(),M(O,1),O.m(e,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,$e(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!h&&B&1&&(h=!0,V.rule=F[0].viewRule,$e(()=>h=!1)),m.$set(V),((Z=F[0])==null?void 0:Z.type)!=="view"?N?(N.p(F,B),B&1&&M(N,1)):(N=vh(F),N.c(),M(N,1),N.m(_.parentNode,_)):N&&(re(),D(N,1,1,()=>{N=null}),ae()),((G=F[0])==null?void 0:G.type)==="auth"?P?(P.p(F,B),B&1&&M(P,1)):(P=wh(F),P.c(),M(P,1),P.m(k.parentNode,k)):P&&(re(),D(P,1,1,()=>{P=null}),ae())},i(F){S||(M(O),M(f.$$.fragment,F),M(m.$$.fragment,F),M(N),M(P),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(N),D(P),S=!1},d(F){F&&(y(e),y(u),y(d),y(g),y(_),y(k)),O&&O.d(),H(f,F),H(m,F),N&&N.d(F),P&&P.d(F),$=!1,T()}}}function jD(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(s.listRule,k)&&(s.listRule=k,t(0,s))}function f(k){n.$$.not_equal(s.viewRule,k)&&(s.viewRule=k,t(0,s))}function c(k){n.$$.not_equal(s.createRule,k)&&(s.createRule=k,t(0,s))}function d(k){n.$$.not_equal(s.updateRule,k)&&(s.updateRule=k,t(0,s))}function m(k){n.$$.not_equal(s.deleteRule,k)&&(s.deleteRule=k,t(0,s))}const h=()=>{t(2,r=!r)};function g(k){n.$$.not_equal(s.authRule,k)&&(s.authRule=k,t(0,s))}function _(k){n.$$.not_equal(s.manageRule,k)&&(s.manageRule=k,t(0,s))}return n.$$set=k=>{"collection"in k&&t(0,s=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=U.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(k=s.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,g,_]}class HD extends Se{constructor(e){super(),we(this,e,jD,qD,ke,{collection:0})}}function Th(n,e,t){const i=n.slice();return i[27]=e[t],i}function $h(n,e,t){const i=n.slice();return i[30]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[33]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Mh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Eh(n){let e,t,i,l,s,o,r=n[9].length&&Dh();return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=C(),l=b("div"),s=b("p"),s.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=C(),r&&r.c(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),r&&r.m(l,null)},p(a,u){a[9].length?r||(r=Dh(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&y(e),r&&r.d()}}}function Dh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function Ih(n){let e,t,i,l,s,o,r=n[5]&&Lh(n),a=!n[4]&&Ah(n),u=pe(n[3]),f=[];for(let m=0;m<u.length;m+=1)f[m]=Fh($h(n,u,m));let c=pe(n[7]),d=[];for(let m=0;m<c.length;m+=1)d[m]=qh(Th(n,c,m));return{c(){e=b("h6"),e.textContent="Changes:",t=C(),i=b("ul"),r&&r.c(),l=C(),a&&a.c(),s=C();for(let m=0;m<f.length;m+=1)f[m].c();o=C();for(let m=0;m<d.length;m+=1)d[m].c();p(i,"class","changes-list svelte-xqpcsf")},m(m,h){v(m,e,h),v(m,t,h),v(m,i,h),r&&r.m(i,null),w(i,l),a&&a.m(i,null),w(i,s);for(let g=0;g<f.length;g+=1)f[g]&&f[g].m(i,null);w(i,o);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(i,null)},p(m,h){if(m[5]?r?r.p(m,h):(r=Lh(m),r.c(),r.m(i,l)):r&&(r.d(1),r=null),m[4]?a&&(a.d(1),a=null):a?a.p(m,h):(a=Ah(m),a.c(),a.m(i,s)),h[0]&8){u=pe(m[3]);let g;for(g=0;g<u.length;g+=1){const _=$h(m,u,g);f[g]?f[g].p(_,h):(f[g]=Fh(_),f[g].c(),f[g].m(i,o))}for(;g<f.length;g+=1)f[g].d(1);f.length=u.length}if(h[0]&8320){c=pe(m[7]);let g;for(g=0;g<c.length;g+=1){const _=Th(m,c,g);d[g]?d[g].p(_,h):(d[g]=qh(_),d[g].c(),d[g].m(i,null))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(m){m&&(y(e),y(t),y(i)),r&&r.d(),a&&a.d(),ct(f,m),ct(d,m)}}}function Lh(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed collection
`),l=b("strong"),o=W(s),r=C(),a=b("i"),u=C(),f=b("strong"),d=W(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(g,_){v(g,e,_),w(e,t),w(t,i),w(t,l),w(l,o),w(t,r),w(t,a),w(t,u),w(t,f),w(f,d)},p(g,_){var k,S;_[0]&2&&s!==(s=((k=g[1])==null?void 0:k.name)+"")&&oe(o,s),_[0]&4&&c!==(c=((S=g[2])==null?void 0:S.name)+"")&&oe(d,c)},d(g){g&&y(e)}}}function Ah(n){let e,t,i,l=pe(n[8]),s=[];for(let f=0;f<l.length;f+=1)s[f]=Nh(Mh(n,l,f));let o=pe(n[10]),r=[];for(let f=0;f<o.length;f+=1)r[f]=Ph(Oh(n,o,f));let a=pe(n[9]),u=[];for(let f=0;f<a.length;f+=1)u[f]=Rh(Ch(n,a,f));return{c(){for(let f=0;f<s.length;f+=1)s[f].c();e=C();for(let f=0;f<r.length;f+=1)r[f].c();t=C();for(let f=0;f<u.length;f+=1)u[f].c();i=ye()},m(f,c){for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(f,c);v(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);v(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);v(f,i,c)},p(f,c){if(c[0]&256){l=pe(f[8]);let d;for(d=0;d<l.length;d+=1){const m=Mh(f,l,d);s[d]?s[d].p(m,c):(s[d]=Nh(m),s[d].c(),s[d].m(e.parentNode,e))}for(;d<s.length;d+=1)s[d].d(1);s.length=l.length}if(c[0]&1024){o=pe(f[10]);let d;for(d=0;d<o.length;d+=1){const m=Oh(f,o,d);r[d]?r[d].p(m,c):(r[d]=Ph(m),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c[0]&512){a=pe(f[9]);let d;for(d=0;d<a.length;d+=1){const m=Ch(f,a,d);u[d]?u[d].p(m,c):(u[d]=Rh(m),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){f&&(y(e),y(t),y(i)),ct(s,f),ct(r,f),ct(u,f)}}}function Nh(n){let e,t,i,l=n[33].name+"",s,o,r;return{c(){e=b("li"),t=W(`Multiple to single value conversion of field
`),i=b("strong"),s=W(l),o=C(),r=b("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r)},p(a,u){u[0]&256&&l!==(l=a[33].name+"")&&oe(s,l)},d(a){a&&y(e)}}}function Ph(n){let e,t,i,l,s=n[33]._originalName+"",o,r,a,u,f,c=n[33].name+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed field
2024-12-26 04:24:24 +08:00
`),l=b("strong"),o=W(s),r=C(),a=b("i"),u=C(),f=b("strong"),d=W(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,h){v(m,e,h),w(e,t),w(t,i),w(t,l),w(l,o),w(t,r),w(t,a),w(t,u),w(t,f),w(f,d)},p(m,h){h[0]&1024&&s!==(s=m[33]._originalName+"")&&oe(o,s),h[0]&1024&&c!==(c=m[33].name+"")&&oe(d,c)},d(m){m&&y(e)}}}function Rh(n){let e,t,i,l=n[33].name+"",s,o;return{c(){e=b("li"),t=W("Removed field "),i=b("span"),s=W(l),o=C(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(i,s),w(e,o)},p(r,a){a[0]&512&&l!==(l=r[33].name+"")&&oe(s,l)},d(r){r&&y(e)}}}function Fh(n){let e,t,i,l=n[30].prop+"",s,o,r,a,u,f,c,d,m=(n[30].oldRule===null?"null (superusers only)":n[30].oldRule||'""')+"",h,g,_,k,S,$,T,O,E=(n[30].newRule===null?"null (superusers only)":n[30].newRule||'""')+"",L;return{c(){e=b("li"),t=W("Changed API rule "),i=b("code"),s=W(l),o=W(`:
`),r=b("br"),a=C(),u=b("small"),f=b("strong"),f.textContent="Old",c=W(`:
`),d=b("span"),h=W(m),g=C(),_=b("br"),k=C(),S=b("small"),$=b("strong"),$.textContent="New",T=W(`:
`),O=b("span"),L=W(E),p(i,"class","txt-sm"),p(d,"class","txt-preline"),p(u,"class","txt-mono txt-hint"),p(O,"class","txt-preline"),p(S,"class","txt-mono txt-success"),p(e,"class","svelte-xqpcsf")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(e,a),w(e,u),w(u,f),w(u,c),w(u,d),w(d,h),w(e,g),w(e,_),w(e,k),w(e,S),w(S,$),w(S,T),w(S,O),w(O,L)},p(I,A){A[0]&8&&l!==(l=I[30].prop+"")&&oe(s,l),A[0]&8&&m!==(m=(I[30].oldRule===null?"null (superusers only)":I[30].oldRule||'""')+"")&&oe(h,m),A[0]&8&&E!==(E=(I[30].newRule===null?"null (superusers only)":I[30].newRule||'""')+"")&&oe(L,E)},d(I){I&&y(e)}}}function qh(n){let e,t,i,l=n[27].name+"",s,o,r,a,u=n[27].oldHost+"",f,c,d,m,h,g=n[27].newHost+"",_,k,S,$,T,O,E,L,I,A,N,P,R,q,F,B,J;return{c(){e=b("li"),t=W("Changed "),i=b("code"),s=W(l),o=W(` host
2024-12-26 04:24:24 +08:00
`),r=b("div"),a=b("strong"),f=W(u),c=C(),d=b("i"),m=C(),h=b("strong"),_=W(g),k=C(),S=b("br"),$=C(),T=b("em"),O=W(`If the old and new OIDC configuration is not for the same provider consider deleting
all old `),E=b("code"),E.textContent="_externalAuths",L=W(` records associated to the current
collection and provider, otherwise it may result in account linking errors.
`),I=b("a"),A=W("Review existing "),N=b("code"),N.textContent="_externalAuths",P=W(` records
`),R=b("i"),q=C(),B=W("."),J=C(),p(a,"class","txt-strikethrough txt-hint"),p(d,"class","ri-arrow-right-line txt-sm"),p(h,"class","txt"),p(r,"class","inline-flex m-l-5"),p(E,"class","txt-sm"),p(N,"class","txt-sm"),p(R,"class","ri-external-link-line txt-sm"),p(I,"href",F=n[13](n[27].name)),p(I,"target","_blank"),p(T,"class","txt-hint"),p(e,"class","svelte-xqpcsf")},m(V,Z){v(V,e,Z),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(r,c),w(r,d),w(r,m),w(r,h),w(h,_),w(e,k),w(e,S),w(e,$),w(e,T),w(T,O),w(T,E),w(T,L),w(T,I),w(I,A),w(I,N),w(I,P),w(I,R),w(I,q),w(T,B),w(e,J)},p(V,Z){Z[0]&128&&l!==(l=V[27].name+"")&&oe(s,l),Z[0]&128&&u!==(u=V[27].oldHost+"")&&oe(f,u),Z[0]&128&&g!==(g=V[27].newHost+"")&&oe(_,g),Z[0]&128&&F!==(F=V[13](V[27].name))&&p(I,"href",F)},d(V){V&&y(e)}}}function zD(n){let e,t,i=(n[5]||n[9].length||n[10].length)&&Eh(n),l=n[11]&&Ih(n);return{c(){i&&i.c(),e=C(),l&&l.c(),t=ye()},m(s,o){i&&i.m(s,o),v(s,e,o),l&&l.m(s,o),v(s,t,o)},p(s,o){s[5]||s[9].length||s[10].length?i?i.p(s,o):(i=Eh(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),s[11]?l?l.p(s,o):(l=Ih(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(s){s&&(y(e),y(t)),i&&i.d(s),l&&l.d(s)}}}function UD(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function VD(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=C(),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){v(o,e,r),v(o,t,r),v(o,i,r),e.focus(),l||(s=[Y(e,"click",n[15]),Y(i,"click",n[16])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function BD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[VD],header:[UD],default:[zD]},$$scope:{ctx:n}};return e=new en({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,s){const o={};s[0]&4030|s[1]&512&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[17](null),H(e,l)}}}function WD(n,e,t){let i,l,s,o,r,a,u;const f=yt();let c,d,m,h,g=[],_=[];async function k(F,B,J=!0){t(1,d=F),t(2,m=B),h=J,await O(),I(),await pn(),i||o.length||r.length||a.length||g.length||_.length?c==null||c.show():$()}function S(){c==null||c.hide()}function $(){S(),f("confirm",h)}const T=["oidc","oidc2","oidc3"];async function O(){var F,B,J,V;t(7,g=[]);for(let Z of T){let G=(B=(F=d==null?void 0:d.oauth2)==null?void 0:F.providers)==null?void 0:B.find(Te=>Te.name==Z),fe=(V=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:V.find(Te=>Te.name==Z);if(!G||!fe)continue;let ce=new URL(G.authURL).host,ue=new URL(fe.authURL).host;ce!=ue&&await E(Z)&&g.push({name:Z,oldHost:ce,newHost:ue})}}async function E(F){try{return await he.collection("_externalAuths").getFirstListItem(he.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:m==null?void 0:m.id,provider:F})),!0}catch{}return!1}function L(F){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${m==null?void 0:m.id}%22+%26%26+provider%3D%22${F}%22`}function I(){if(t(3,_=[]),window.location.protocol!="https:")return;const F=["listRule","viewRule"];l||F.push("createRule","updateRule","deleteRule"),s&&F.push("manageRule","authRule");let B,J;for(let V of F)B=d==null?void 0:d[V],J=m==null?void 0:m[V],B!==J&&_.push({prop:V,oldRule:B,newRule:J})}const A=()=>S(),N=()=>$();function P(F){ie[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Pe.call(this,n,F)}function q(F){Pe.call(this,n,F)}return n.$$.update=()=>{var F,B,J;n.$$.dirty[0]&6&&t(5,i=(d==null?void 0:d.name)!=(m==null?void 0:m.name)),n.$$.dirty[0]&4&&t(4,l=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(s=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!l&&((F=m==null?void 0:m.fields)==null?void 0:F.filter(V=>V.id&&!V._toDelete&&V._originalName!=V.name))||[]),n.$$.dirty[0]&20&&t(9,r=!l&&((B=m==null?void 0:m.fields)==null?
`+U.truncate(JSON.stringify(U.truncateObject(D_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),Y(l,"click",Mn(n[1])),Y(l,"keydown",Mn(n[2]))],u=!0)},p(c,[d]){const m={};d&1&&(m.record=c[0]),t.$set(m),(!a||d&1&&o!==(o="#/collections?collection="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&It(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab:
`+U.truncate(JSON.stringify(U.truncateObject(D_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(M(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&y(e),H(t),u=!1,Ie(f)}}}function D_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function WI(n,e,t){let{record:i}=e;function l(o){Pe.call(this,n,o)}function s(o){Pe.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,l,s]}class Vr extends Se{constructor(e){super(),we(this,e,WI,BI,ke,{record:0})}}function I_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function L_(n,e,t){const i=n.slice();return i[14]=e[t],i}function A_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function N_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function YI(n){const e=n.slice(),t=U.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function KI(n){var s,o;const e=n.slice(),t=U.toArray(e[3]);e[10]=t;const i=U.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[11]=i;const l=e[2]?20:500;return e[12]=l,e}function JI(n){const e=n.slice(),t=U.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function ZI(n){let e,t;return{c(){e=b("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function GI(n){let e,t=U.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=U.truncate(n[3]))},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=U.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=U.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&y(e)}}}function XI(n){let e,t=[],i=new Map,l,s,o=pe(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;u<o.length;u+=1){let f=I_(n,o,u),c=r(f);i.set(c,t[u]=P_(c,f))}let a=n[17].length>n[18]&&R_();return{c(){e=b("div");for(let u=0;u<t.length;u+=1)t[u].c();l=C(),a&&a.c(),p(e,"class","inline-flex"),x(e,"multiple",n[1].maxSelect!=1)},m(u,f){v(u,e,f);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);w(e,l),a&&a.m(e,null),s=!0},p(u,f){f&13&&(o=pe(u[17].slice(0,u[18])),re(),t=kt(t,f,r,1,u,o,i,e,Yt,P_,l,I_),ae()),u[17].length>u[18]?a||(a=R_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&x(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;f<o.length;f+=1)M(t[f]);s=!0}},o(u){for(let f=0;f<t.length;f+=1)D(t[f]);s=!1},d(u){u&&y(e);for(let f=0;f<t.length;f+=1)t[f].d();a&&a.d()}}}function QI(n){let e,t,i,l,s;const o=[uL,aL],r=[];function a(f,c){return f[11].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[10].length>n[12]&&j_();return{c(){e=b("div"),i.c(),l=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){v(f,e,c),r[t].m(e,null),w(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),D(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),M(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=j_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&y(e),r[t].d(),u&&u.d()}}}function xI(n){let e,t=[],i=new Map,l=pe(U.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o<l.length;o+=1){let r=N_(n,l,o),a=s(r);i.set(a,t[o]=H_(a,r))}return{c(){e=b("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","inline-flex")},m(o,r){v(o,e,r);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null)},p(o,r){r&8&&(l=pe(U.toArray(o[3])),t=kt(t,r,s,1,o,l,i,e,ni,H_,null,N_))},i:te,o:te,d(o){o&&y(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function eL(n){let e,t;return e=new SI({props:{date:n[3]}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.date=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tL(n){let e,t,i,l;const s=[cL,fL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function nL(n){let e,t=U.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=W(t),p(e,"cl
2024-12-26 04:24:24 +08:00
`),position:"left"})),i=!0)},p(s,[o]){t&&It(t.update)&&o&1&&t.update.call(null,{text:s[0].join(`
`),position:"left"})},i:te,o:te,d(s){s&&y(e),i=!1,l()}}}const SL="yyyy-MM-dd HH:mm:ss.SSS";function TL(n,e,t){let i,l;Xe(n,En,a=>t(2,l=a));let{record:s}=e,o=[];function r(){t(0,o=[]);const a=i.fields||[];for(let u of a)u.type=="autodate"&&o.push(u.name+": "+U.formatToLocalDate(s[u.name],SL)+" Local")}return n.$$set=a=>{"record"in a&&t(1,s=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=s&&l.find(a=>a.id==s.collectionId)),n.$$.dirty&2&&s&&r()},[o,s,l]}class $L extends Se{constructor(e){super(),we(this,e,TL,wL,ke,{record:1})}}function W_(n,e,t){const i=n.slice();return i[9]=e[t],i}function CL(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function OL(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Y_(W_(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","list")},m(l,s){v(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s&58){t=pe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=W_(l,t,o);i[o]?i[o].p(r,s):(i[o]=Y_(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&y(e),ct(i,l)}}}function ML(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Y_(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,g,_,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=C(),o=b("span"),a=W(r),u=C(),f=b("div"),c=W("ID: "),m=W(d),h=C(),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=C(),yn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(e,s),w(e,o),w(o,a),w(e,u),w(e,f),w(f,c),w(f,m),w(e,h),w(e,g),w(e,_),k||(S=Y(g,"click",$),k=!0)},p(T,O){var E;n=T,O&2&&!yn(i.src,l="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",l),O&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),O&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d(T){T&&y(e),k=!1,S()}}}function EL(n){let e;function t(s,o){var r;return s[2]?ML:(r=s[0])!=null&&r.id&&s[1].length?OL:CL}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:te,o:te,d(s){s&&y(e),l.d(s)}}}function DL(n,e,t){const i=yt();let{record:l}=e,s=[],o=!1;function r(d){return nf.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||U.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await he.collection("_externalAuths").getFullList({filter:he.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){he.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||bn(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>he.collection("_externalAuths").delete(d.id).then(()=>{xt(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{he.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class IL extends Se{constructor(e){super(),we(this,e,DL,EL,ke,{record:0})}}function LL(n){let e,t,i,l,s,o,r,a,u,f;return s=new Ci({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),l=C(),z(s.$$.fragment),o=C(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){v(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),j(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Oe(qe.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(M(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&
(record: `+n[44].id+")")),Y(e,"click",it(function(){It(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&It(l.update)&&c[0]&32&&l.update.call(null,n[48]+`
(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&y(e),u.d(),s=!1,Ie(o)}}}function og(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=sg(tg(e,l,o));return{key:n,first:null,c(){t=ye();for(let o=0;o<s.length;o+=1)s[o].c();i=ye(),this.first=t},m(o,r){v(o,t,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);v(o,i,r)},p(o,r){if(e=o,r[0]&1638432){l=pe(e[45]);let a;for(a=0;a<l.length;a+=1){const u=tg(e,l,a);s[a]?s[a].p(u,r):(s[a]=sg(u),s[a].c(),s[a].m(i.parentNode,i))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&(y(t),y(i)),ct(s,o)}}}function rg(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function aA(n){let e,t;function i(r,a){if(r[15])return sA;if(!r[6])return lA}let l=i(n),s=l&&l(n),o=n[6]&&rg();return{c(){s&&s.c(),e=C(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),v(r,e,a),o&&o.m(r,a),v(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=rg(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(y(e),y(t)),s&&s.d(r),o&&o.d(r)}}}function uA(n){let e,t,i,l;const s=[iA,nA],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),v(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),D(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&y(i),o[e].d(a)}}}function fA(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&y(e)}}}function ag(n){let e,t;return e=new de({props:{class:"form-field file-picker-size-select",$$slots:{default:[cA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function cA(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new Dn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dA(n){var h;let e,t,i,l=U.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&ag(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),m&&m.c(),s=C(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){v(g,e,_),w(e,t),v(g,i,_),m&&m.m(g,_),v(g,s,_),v(g,o,_),w(o,r),w(r,a),f=!0,c||(d=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(g,_){var k;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=U.hasImageExtension((k=g[9])==null?void 0:k.name)),l?m?(m.p(g,_),_[0]&512&&M(m,1)):(m=ag(g),m.c(),M(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&oe(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(M(m),f=!0)},o(g){D(m),f=!1},d(g){g&&(y(e),y(i),y(s),y(o)),m&&m.d(g),c=!1,Ie(d)}}}function pA(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[dA],header:[fA],default:[uA]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=He(o,s[a]);e=new en({props:o}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let r={collection:n[8]};return i=new af({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){z(e.$$.fragment),t=C(),z(i.$$.fragment)},m(a,u){j(e,a,u),v(a,t,u),j(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?wt(s,[s[0],s[1],Ft(a[22])]):{};u[0]&131059|u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),e.$
2024-12-26 04:24:24 +08:00
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[PA,({uniqueId:o})=>({30:o}),({uniqueId:o})=>[o?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){v(o,e,r),j(t,e,null),i=!0,l||(s=[Y(e,"dragover",it(n[27])),Y(e,"dragleave",n[28]),Y(e,"drop",n[14])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
2024-12-26 04:24:24 +08:00
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
`),r[0]&16&&(a.name=o[4].name),r[0]&1073743359|r[1]&256&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(M(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&y(e),H(t),l=!1,Ie(s)}}}function FA(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1;function h(V){U.removeByValue(f,V),t(2,f)}function g(V){U.pushUnique(f,V),t(2,f)}function _(V){U.isEmpty(u[V])||u.splice(V,1),t(1,u)}function k(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function S(V){var G;V.preventDefault(),t(9,m=!1);const Z=((G=V.dataTransfer)==null?void 0:G.files)||[];if(!(s||!Z.length)){for(const fe of Z){const ce=l.length+u.length-f.length;if(r.maxSelect<=ce)break;u.push(fe)}t(1,u)}}async function $(V){try{let Z=await he.getSuperuserFileToken(o.collectionId),G=he.files.getURL(o,V,{token:Z});window.open(G,"_blank","noreferrer, noopener")}catch(Z){console.warn("openInNewTab file token failure:",Z)}}const T=V=>$(V),O=V=>$(V),E=V=>h(V),L=V=>g(V);function I(V){a=V,t(0,a),t(6,i),t(4,r)}const A=V=>_(V);function N(V){u=V,t(1,u)}function P(V){ie[V?"unshift":"push"](()=>{c=V,t(7,c)})}const R=()=>{for(let V of c.files)u.push(V);t(1,u),t(7,c.value=null,c)},q=()=>c==null?void 0:c.click();function F(V){ie[V?"unshift":"push"](()=>{d=V,t(8,d)})}const B=()=>{t(9,m=!0)},J=()=>{t(9,m=!1)};return n.$$set=V=>{"record"in V&&t(3,o=V.record),"field"in V&&t(4,r=V.field),"value"in V&&t(0,a=V.value),"uploadedFiles"in V&&t(1,u=V.uploadedFiles),"deletedFileNames"in V&&t(2,f=V.deletedFileNames)},n.$$.update=()=>{n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=U.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=U.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&U.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=U.toArray(a)),n.$$.dirty[0]&54&&t(10,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&k()},[a,u,f,o,r,l,i,c,d,m,s,h,g,_,S,$,T,O,E,L,I,A,N,P,R,q,F,B,J]}class qA extends Se{constructor(e){super(),we(this,e,FA,RA,ke,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function jA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function HA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function zA(n){let e,t,i,l;function s(a,u){return a[4]?HA:jA}let o=s(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){v(a,e,u),r.m(e,null),i||(l=Oe(t=qe.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=s(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&It(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&y(e),r.d(),i=!1,l()}}}function UA(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function VA(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Vt(l,s(n)),e.$on("change",n[5])),{c(){e&&z(e.$$.fragment),t=ye()},m(o,r){e&&j(e,o,r),v(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;D(a.$$.fragment,1,0,()=>{H(a,1)}),ae()}l?(e=Vt(l,s(o)),e.$on("change",o[5]),z(e.$$.fragment),M(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&y(t),e&&H(e,o)}}}function BA(n){let e,t,i,l,s,o;e=new si({props:{uniqueId:n[6],field:n[1],$$slots:{default:[zA]},$$scope:{ctx:n}}});const r=[VA,UA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){z(e.$$.fragment),t=C(),l.c(),s=ye()},m(f,c){j(e,f,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){const d={};c&64&&(d.uniqueId=f[6]),c&2&&(d.field=f[1]),c&144&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=i;i=u(f),i===m?a[i].p(f,c):(re(),
`),A&&A.c(),m=C(),g.c(),_=ye(),p(e,"class","flex m-b-base flex-gap-10"),p(s,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(q,F){v(q,e,F),j(t,e,null),w(e,i),T&&T.m(e,null),v(q,l,F),v(q,s,F);for(let B=0;B<o.length;B+=1)o[B]&&o[B].m(s,null);L&&L.m(s,null),w(s,a),I&&I.m(s,null),v(q,f,F),v(q,c,F),w(c,d),A&&A.m(c,null),v(q,m,F),P[h].m(q,F),v(q,_,F),k=!0,S||($=Oe(u=n7.call(null,s,n[38])),S=!0)},p(q,F){const B={};F[0]&4&&(B.value=q[2]),F[0]&32&&(B.autocompleteCollection=q[5]),t.$set(B),q[12]?T&&(T.d(1),T=null):T?T.p(q,F):(T=bg(q),T.c(),T.m(e,null)),F[0]&548756&&(O=pe(q[8]),re(),o=kt(o,F,E,1,q,O,r,s,Yt,Sg,a,gg),ae(),!O.length&&L?L.p(q,F):O.length?L&&(L.d(1),L=null):(L=kg(q),L.c(),L.m(s,a))),q[14]?I||(I=Tg(),I.c(),I.m(s,null)):I&&(I.d(1),I=null),u&&It(u.update)&&F[0]&8200&&u.update.call(null,q[38]),q[4]>1?A?A.p(q,F):(A=$g(q),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(q),h===J?P[h].p(q,F):(re(),D(P[J],1,1,()=>{P[J]=null}),ae(),g=P[h],g?g.p(q,F):(g=P[h]=N[h](q),g.c()),M(g,1),g.m(_.parentNode,_))},i(q){if(!k){M(t.$$.fragment,q);for(let F=0;F<O.length;F+=1)M(o[F]);M(g),k=!0}},o(q){D(t.$$.fragment,q);for(let F=0;F<o.length;F+=1)D(o[F]);D(g),k=!1},d(q){q&&(y(e),y(l),y(s),y(f),y(c),y(m),y(_)),H(t),T&&T.d();for(let F=0;F<o.length;F+=1)o[F].d();L&&L.d(),I&&I.d(),A&&A.d(),P[h].d(q),S=!1,$()}}}function p7(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=W("Select "),i=b("strong"),s=W(l),o=W(" records")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(i,s),w(e,o)},p(a,u){var f;u[0]&32&&l!==(l=(((f=a[5])==null?void 0:f.name)||"")+"")&&oe(s,l)},d(a){a&&y(e)}}}function m7(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=C(),i=b("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=[Y(e,"click",n[30]),Y(i,"click",n[31])],l=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),l=!1,Ie(s)}}}function h7(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[21]];let o={$$slots:{footer:[m7],header:[p7],default:[d7]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=He(o,s[a]);e=new en({props:o}),n[41](e),e.$on("hide",n[42]),e.$on("show",n[43]);let r={collection:n[5]};return i=new af({props:r}),n[44](i),i.$on("save",n[45]),i.$on("delete",n[46]),{c(){z(e.$$.fragment),t=C(),z(i.$$.fragment)},m(a,u){j(e,a,u),v(a,t,u),j(i,a,u),l=!0},p(a,u){const f=u[0]&2097152?wt(s,[s[0],s[1],Ft(a[21])]):{};u[0]&32764|u[1]&268435456&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){l||(M(e.$$.fragment,a),M(i.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),l=!1},d(a){a&&y(t),n[41](null),H(e,a),n[44](null),H(i,a)}}}const Go=50;function _7(n,e,t){let i,l,s,o,r,a,u,f;const c=["value","field","show","hide"];let d=st(e,c),m;Xe(n,En,Ne=>t(28,m=Ne));const h=yt(),g="picker_"+U.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",O=[],E=[],L=1,I=0,A=!1,N=!1,P={};function R(){return t(2,T=""),t(8,O=[]),t(6,E=[]),B(),J(!0),S==null?void 0:S.show()}function q(){return S==null?void 0:S.hide()}function F(){var _t;let Ne=[];const Ce=(_t=s==null?void 0:s.fields)==null?void 0:_t.filter(zt=>!zt.hidden&&zt.presentable&&zt.type=="relation");for(const zt of Ce)Ne=Ne.concat(U.getExpandPresentableRelFields(zt,m,2));return Ne.join(",")}async function B(){const Ne=U.toArray(_);if(!l||!Ne.length)return;t(26,N=!0);let Ce=[];const _t=Ne.slice(),zt=[];for(;_t.length>0;){const Lt=[];for(const Ae of _t.splice(0,Go))Lt.push(`id="${Ae}"`);zt.push(he.collection(l).getFullList({batch:Go,filter:Lt.join("||"),fields:"*:excerpt(200)",expand:F(),requestKey:null}))}try{await Promise.all(zt).then(Lt=>{Ce=Ce.concat(...Lt)}),t(6,E=[]);for(const Lt of Ne){const Ae=U.findByKey(Ce,"id",Lt);Ae&&E.push(Ae)}T.trim()||t(8,O=U.filterDuplicatesByKey(E.concat(O))),t(26,N=!1)}catch(Lt){Lt.isAbort||(he.error(Lt),t(26,N=!1))}}async function J(Ne=!1){if(l){t(3,A=!0),Ne&&(T.trim()?t(8,O=[]):t(8,O=U.toArray(E).slice()));try{co
`),s=b("strong"),r=W(o),a=W(":"),u=C(),z(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),j(f,e,null),c=!0,d||(m=Y(e,"submit",it(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=U.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&y(e),H(f),d=!1,m()}}}function V7(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new Ci({props:{value:n[3].authStore.token}}),u=new z7({props:{class:"m-b-0",js:`
2024-12-26 04:24:24 +08:00
import PocketBase from 'pocketbase';
const token = "...";
const pb = new PocketBase('${n[7]}');
pb.authStore.save(token, null);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final token = "...";
final pb = PocketBase('${n[7]}');
pb.authStore.save(token, null);
`}}),{c(){e=b("div"),t=b("div"),i=b("span"),s=W(l),o=C(),z(r.$$.fragment),a=C(),z(u.$$.fragment),p(i,"class","txt token-holder svelte-1i56uix"),p(t,"class","content txt-bold"),p(e,"class","alert alert-success")},m(c,d){v(c,e,d),w(e,t),w(t,i),w(i,s),w(t,o),j(r,t,null),v(c,a,d),j(u,c,d),f=!0},p(c,d){(!f||d&8)&&l!==(l=c[3].authStore.token+"")&&oe(s,l);const m={};d&8&&(m.value=c[3].authStore.token),r.$set(m);const h={};d&128&&(h.js=`
import PocketBase from 'pocketbase';
const token = "...";
const pb = new PocketBase('${c[7]}');
pb.authStore.save(token, null);
`),d&128&&(h.dart=`
import 'package:pocketbase/pocketbase.dart';
final token = "...";
final pb = PocketBase('${c[7]}');
pb.authStore.save(token, null);
`),u.$set(h)},i(c){f||(M(r.$$.fragment,c),M(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(y(e),y(a)),H(r),H(u,c)}}}function B7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=W("Token duration (in seconds)"),l=C(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","number"),p(s,"id",o=n[20]),p(s,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(s,"min","0"),p(s,"step","1"),s.value=a=n[5]||""},m(c,d){v(c,e,d),w(e,t),v(c,l,d),v(c,s,d),u||(f=Y(s,"input",n[14]),u=!0)},p(c,d){var m,h;d&1048576&&i!==(i=c[20])&&p(e,"for",i),d&1048576&&o!==(o=c[20])&&p(s,"id",o),d&1&&r!==(r="Default to the collection setting ("+(((h=(m=c[0])==null?void 0:m.authToken)==null?void 0:h.duration)||0)+"s)")&&p(s,"placeholder",r),d&32&&a!==(a=c[5]||"")&&s.value!==a&&(s.value=a)},d(c){c&&(y(e),y(l),y(s)),u=!1,f()}}}function W7(n){let e,t,i,l,s,o;const r=[V7,U7],a=[];function u(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?0:1}return i=u(n),l=a[i]=r[i](n),{c(){e=b("div"),t=C(),l.c(),s=ye(),p(e,"class","clearfix")},m(f,c){v(f,e,c),v(f,t,c),a[i].m(f,c),v(f,s,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(re(),D(a[d],1,1,()=>{a[d]=null}),ae(),l=a[i],l?l.p(f,c):(l=a[i]=r[i](f),l.c()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(y(e),y(t),y(s)),a[i].d(f)}}}function Y7(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function K7(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],x(e,"btn-loading",n[6])},m(s,o){v(s,e,o),w(e,t),i||(l=Y(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&x(e,"btn-loading",s[6])},d(s){s&&y(e),i=!1,l()}}}function J7(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Generate a new one",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded"),e.disabled=n[6]},m(s,o){v(s,e,o),w(e,t),i||(l=Y(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&y(e),i=!1,l()}}}function Z7(n){let e,t,i,l,s,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?J7:K7}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){v(f,e,c),w(e,t),v(f,i,c),u.m(f,c),v(f,l,c),s||(o=Y(e,"click",n[2]),s=!0)},p(f,c){c&64&&(e.disabled=f[6]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l.parentNode,l)))},d(f){f&&(y(e),y(i),y(l)),u.d(f),s=!1,o()}}}function G7(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[Z7],header:[Y7],default:[W7]},$$scope:{ctx:n}};return e=new en({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function X7(n,e,t){let i;const l=yt(),s="impersonate_"+U.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(g(),a==null||a.show())}function m(){a==null||a.hide(),g()}async function h(){if(!(f||!o||!r)){t(6,f=!0);try{t(3,c=await he.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(L){he.error(L)}t(6,f=!1)}}function g(){t(5,u=0),t(3,c=void 0)}const _=()=>g(),k=()=>h(),S=L=>t(5,u=L.target.value<<0),$=()=>!f;function T(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Pe.call(this,n,L)}function E(L){Pe.call(this,n,L)}return n.$$set=L=>{"collection"in L&&t(0,o=L.collection),"record"in L&&t(1,r=L.record)},n.$$.update=()=>{n.$$.dirty&8&&t(7,i=U.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,k,S,$,T,O,E]}class Q7 extends Se{constructor(e){super(),we(this,e,X7,G7,ke,{collectio
`),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=C(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(t,a),w(t,u),w(e,f),w(e,c),m=!0,h||(g=[Y(r,"click",n[48]),Oe(qe.call(null,u,"Discard draft")),Y(u,"click",it(n[49]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=bu(e,pt,{duration:150})),m=!1},d(_){_&&y(e),_&&d&&d.end(),h=!1,Ie(g)}}}function Vg(n){let e,t,i;return t=new $L({props:{record:n[3]}}),{c(){e=b("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){v(l,e,s),j(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),H(t)}}}function x7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$=!n[6]&&Vg(n);return{c(){var T,O,E;e=b("label"),t=b("i"),i=C(),l=b("span"),l.textContent="id",s=C(),o=b("span"),a=C(),$&&$.c(),u=C(),f=b("input"),p(t,"class",zs(U.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[87]),p(f,"type","text"),p(f,"id",c=n[87]),p(f,"placeholder",d=!n[7]&&!U.isEmpty((T=n[19])==null?void 0:T.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=((O=n[19])==null?void 0:O.min)||null),p(f,"maxlength",h=((E=n[19])==null?void 0:E.max)||null),f.readOnly=g=!n[6]},m(T,O){v(T,e,O),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),v(T,a,O),$&&$.m(T,O),v(T,u,O),v(T,f,O),_e(f,n[3].id),_=!0,k||(S=Y(f,"input",n[50]),k=!0)},p(T,O){var E,L,I;(!_||O[2]&33554432&&r!==(r=T[87]))&&p(e,"for",r),T[6]?$&&(re(),D($,1,1,()=>{$=null}),ae()):$?($.p(T,O),O[0]&64&&M($,1)):($=Vg(T),$.c(),M($,1),$.m(u.parentNode,u)),(!_||O[2]&33554432&&c!==(c=T[87]))&&p(f,"id",c),(!_||O[0]&524416&&d!==(d=!T[7]&&!U.isEmpty((E=T[19])==null?void 0:E.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!_||O[0]&524288&&m!==(m=((L=T[19])==null?void 0:L.min)||null))&&p(f,"minlength",m),(!_||O[0]&524288&&h!==(h=((I=T[19])==null?void 0:I.max)||null))&&p(f,"maxlength",h),(!_||O[0]&64&&g!==(g=!T[6]))&&(f.readOnly=g),O[0]&8&&f.value!==T[3].id&&_e(f,T[3].id)},i(T){_||(M($),_=!0)},o(T){D($),_=!1},d(T){T&&(y(e),y(a),y(u),y(f)),$&&$.d(T),k=!1,S()}}}function Bg(n){let e,t,i,l,s;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new VL({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Wg();return{c(){z(e.$$.fragment),i=C(),a&&a.c(),l=ye()},m(u,f){j(e,u,f),v(u,i,f),a&&a.m(u,f),v(u,l,f),s=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],$e(()=>t=!1)),e.$set(c),u[16].length?a||(a=Wg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(M(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(y(i),y(l)),H(e,u),a&&a.d(u)}}}function Wg(n){let e;return{c(){e=b("hr")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function eN(n){let e,t,i;function l(o){n[65](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new t7({props:s}),ie.push(()=>be(e,"value",l)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function tN(n){let e,t,i;function l(o){n[64](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new S7({props:s}),ie.push(()=>be(e,"value",l)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),r[0]&4&&(a.original=n[2]),r[0]&8&&(a.record=n[3]),!t&&r[0]&65544&&(t=!0,a.value=n[3][n[84].na
2024-12-26 04:24:24 +08:00
record-panel
`+(n[20]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(n[9]&&!n[17]&&!n[6]?"colored-header":"")+`
`,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[66],$$slots:{footer:[bN],header:[_N],default:[dN]},$$scope:{ctx:n}};e=new en({props:s}),n[67](e),e.$on("hide",n[68]),e.$on("show",n[69]);let o=n[9]&&e1(n);return{c(){z(e.$$.fragment),t=C(),o&&o.c(),i=ye()},m(r,a){j(e,r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a),l=!0},p(r,a){const u={};a[0]&1180224&&(u.class=`
2024-12-26 04:24:24 +08:00
record-panel
`+(r[20]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(r[9]&&!r[17]&&!r[6]?"colored-header":"")+`
`),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[66]),a[0]&1031165|a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&M(o,1)):(o=e1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(y(t),y(i)),n[67](null),H(e,r),o&&o.d(r)}}}const El="form",io="providers";function yN(n,e,t){let i,l,s,o,r,a,u,f;const c=yt(),d="record_"+U.randomString(5);let{collection:m}=e,h,g,_={},k={},S=null,$=!1,T=!1,O={},E={},L=JSON.stringify(_),I=L,A=El,N=!0,P=!0,R=m,q=[];const F=["id"],B=F.concat("email","emailVisibility","verified","tokenKey","password");function J(se){return ce(se),t(14,T=!0),t(15,A=El),h==null?void 0:h.show()}function V(){return h==null?void 0:h.hide()}function Z(){t(14,T=!1),V()}function G(){t(35,R=m),h!=null&&h.isActive()&&(Je(JSON.stringify(k)),Z())}async function fe(se){if(!se)return null;let Me=typeof se=="string"?se:se==null?void 0:se.id;if(Me)try{return await he.collection(m.id).getOne(Me)}catch(Re){Re.isAbort||(Z(),console.warn("resolveModel:",Re),Oi(`Unable to load record with id "${Me}"`))}return typeof se=="object"?se:null}async function ce(se){t(7,P=!0),Bt({}),t(4,O={}),t(5,E={}),t(2,_=typeof se=="string"?{id:se,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:se||{}),t(3,k=structuredClone(_)),t(2,_=await fe(se)||{}),t(3,k=structuredClone(_)),await pn(),t(12,S=Ke()),!S||et(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(k)),t(7,P=!1)}async function ue(se){var Re,ze;Bt({}),t(2,_=se||{}),t(4,O={}),t(5,E={});const Me=((ze=(Re=m==null?void 0:m.fields)==null?void 0:Re.filter(Ge=>Ge.type!="file"))==null?void 0:ze.map(Ge=>Ge.name))||[];for(let Ge in se)Me.includes(Ge)||t(3,k[Ge]=se[Ge],k);await pn(),t(33,L=JSON.stringify(k)),xe()}function Te(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function Ke(se){try{const Me=window.localStorage.getItem(Te());if(Me)return JSON.parse(Me)}catch{}return se}function Je(se){try{window.localStorage.setItem(Te(),se)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(Te())}}function ft(){S&&(t(3,k=S),t(12,S=null))}function et(se,Me){var jt;const Re=structuredClone(se||{}),ze=structuredClone(Me||{}),Ge=(jt=m==null?void 0:m.fields)==null?void 0:jt.filter(Sn=>Sn.type==="file");for(let Sn of Ge)delete Re[Sn.name],delete ze[Sn.name];const tn=["expand","password","passwordConfirm"];for(let Sn of tn)delete Re[Sn],delete ze[Sn];return JSON.stringify(Re)==JSON.stringify(ze)}function xe(){t(12,S=null),window.localStorage.removeItem(Te())}async function We(se=!0){var Me;if(!($||!u||!(m!=null&&m.id))){t(13,$=!0);try{const Re=Ut();let ze;if(N?ze=await he.collection(m.id).create(Re):ze=await he.collection(m.id).update(k.id,Re),xt(N?"Successfully created record.":"Successfully updated record."),xe(),l&&(k==null?void 0:k.id)==((Me=he.authStore.record)==null?void 0:Me.id)&&Re.get("password"))return he.logout();se?Z():ue(ze),c("save",{isNew:N,record:ze})}catch(Re){he.error(Re)}t(13,$=!1)}}function at(){_!=null&&_.id&&bn("Do you really want to delete the selected record?",()=>he.collection(_.collectionId).delete(_.id).then(()=>{Z(),xt("Successfully deleted record."),c("delete",_)}).catch(se=>{he.error(se)}))}function Ut(){const se=structuredClone(k||{}),Me=new FormData,Re={},ze={};for(const Ge of(m==null?void 0:m.fields)||[])Ge.type=="autodate"||i&&Ge.type=="password"||(Re[Ge.name]=!0,Ge.type=="json"&&(ze[Ge.name]=!0));i&&se.password&&(Re.password=!0),i&&se.passwordConfirm&&(Re.passwordConfirm=!0);for(const Ge in se)if(Re[Ge]){if(typeof se[Ge]>"u"&&(se[Ge]=null),ze[Ge]&&se[Ge]!=="")try{JSON.parse(se[Ge])}catch(tn){const jt={};throw jt[Ge]={code:"invalid_json",message:tn.toString()},new qn({status:400,response:{data:jt}})}U.addValueToFormData(Me,Ge,se[Ge])}for(const Ge in O){const tn=U.toArray(O[Ge]);for(const jt of tn)Me.append(Ge+"+",jt)}for(const Ge in E){const tn=U.toArray(
`);for(let O=0;O<T.length;O+=1)T[O].c();p(e,"for",i=n[16]),p(u,"type","button"),p(u,"class","btn btn-sm btn-hint btn-transparent btn-clear"),x(u,"hidden",U.isEmpty(n[0].trustedProxy.headers)),p(a,"class","form-field-addon"),p(c,"class","help-block")},m(O,E){v(O,e,E),w(e,t),v(O,l,E),j(s,O,E),v(O,r,E),v(O,a,E),w(a,u),v(O,f,E),v(O,c,E),w(c,d),w(d,m);for(let L=0;L<T.length;L+=1)T[L]&&T[L].m(d,null);h=!0,g||(_=Y(u,"click",n[12]),g=!0)},p(O,E){(!h||E&65536&&i!==(i=O[16]))&&p(e,"for",i);const L={};if(E&65536&&(L.id=O[16]),!o&&E&1&&(o=!0,L.value=O[0].trustedProxy.headers,$e(()=>o=!1)),s.$set(L),(!h||E&1)&&x(u,"hidden",U.isEmpty(O[0].trustedProxy.headers)),E&68){$=pe(O[2]);let I;for(I=0;I<$.length;I+=1){const A=v1(O,$,I);T[I]?T[I].p(A,E):(T[I]=w1(A),T[I].c(),T[I].m(d,null))}for(;I<T.length;I+=1)T[I].d(1);T.length=$.length}},i(O){h||(M(s.$$.fragment,O),h=!0)},o(O){D(s.$$.fragment,O),h=!1},d(O){O&&(y(e),y(l),y(r),y(a),y(f),y(c)),H(s,O),ct(T,O),g=!1,_()}}}function mP(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[14](h)}let m={items:n[7]};return n[0].trustedProxy.useLeftmostIP!==void 0&&(m.keyOfSelected=n[0].trustedProxy.useLeftmostIP),r=new Dn({props:m}),ie.push(()=>be(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),l=b("i"),o=C(),z(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[16])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),j(r,h,g),u=!0,f||(c=Oe(qe.call(null,l,{text:"This is in case the proxy returns more than 1 IP as header value. The rightmost IP is usually considered to be the more trustworthy but this could vary depending on the proxy.",position:"right"})),f=!0)},p(h,g){(!u||g&65536&&s!==(s=h[16]))&&p(e,"for",s);const _={};!a&&g&1&&(a=!0,_.keyOfSelected=h[0].trustedProxy.useLeftmostIP,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),H(r,h),f=!1,c()}}}function hP(n){let e,t,i,l,s,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,g,_,k,S=(n[1].possibleProxyHeader||"N/A")+"",$,T,O,E,L,I,A,N,P,R,q,F,B;return A=new de({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[pP,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new de({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[mP,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=C(),o=b("strong"),a=W(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=C(),k=b("strong"),$=W(S),T=C(),O=b("div"),O.innerHTML=`<p>When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as
2024-12-26 04:24:24 +08:00
NGINX, requests from different users will originate from the same IP address (the IP of the proxy
connecting to your PocketBase app).</p> <p>In this case to retrieve the actual user IP (used for rate limiting, logging, etc.) you need to
properly configure your proxy and list below the trusted headers that PocketBase could use to
extract the user IP.</p> <p class="txt-bold">When using such proxy, to avoid spoofing it is recommended to:</p> <ul class="m-t-0 txt-bold"><li>use headers that are controlled only by the proxy and cannot be manually set by the users</li> <li>make sure that the PocketBase server can be accessed only through the proxy</li></ul> <p>You can clear the headers field if PocketBase is not deployed behind a proxy.</p>`,E=C(),L=b("div"),I=b("div"),z(A.$$.fragment),N=C(),P=b("div"),z(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(h,"class","inline-flex flex-gap-5"),p(t,"class","content"),p(e,"class","alert alert-info m-b-sm"),p(O,"class","content m-b-sm"),p(I,"class","col-lg-9"),p(P,"class","col-lg-3"),p(L,"class","grid grid-sm")},m(J,V){v(J,e,V),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o),w(o,a),w(i,u),w(i,f),w(t,c),w(t,d),w(t,m),w(t,h),w(h,g),w(h,_),w(h,k),w(k,$),v(J,T,V),v(J,O,V),v(J,E,V),v(J,L,V),w(L,I),j(A,I,null),w(L,N),w(L,P),j(R,P,null),q=!0,F||(B=Oe(qe.call(null,f,`Must show your actual IP.
If not, set the correct proxy header.`)),F=!0)},p(J,V){(!q||V&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&oe(a,r),(!q||V&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&oe($,S);const Z={};V&1114117&&(Z.$$scope={dirty:V,ctx:J}),A.$set(Z);const G={};V&1114113&&(G.$$scope={dirty:V,ctx:J}),R.$set(G)},i(J){q||(M(A.$$.fragment,J),M(R.$$.fragment,J),q=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),q=!1},d(J){J&&(y(e),y(T),y(O),y(E),y(L)),H(A),H(R),F=!1,B()}}}function _P(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(l){l&&y(e),t=!1,i()}}}function gP(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(l,s){v(l,e,s),t||(i=Oe(qe.call(null,e,`Detected proxy header.
It is recommend to list it as trusted.`)),t=!0)},d(l){l&&y(e),t=!1,i()}}}function bP(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function kP(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function S1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Oe(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=je(e,$t,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=je(e,$t,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),l=!1,s()}}}function yP(n){let e,t,i,l,s,o,r,a,u,f,c;function d($,T){if(T&43&&(o=null),!$[3]&&$[1].possibleProxyHeader)return gP;if(o==null&&(o=!!($[3]&&!$[5]&&!$[0].trustedProxy.headers.includes($[1].possibleProxyHeader))),o)return _P}let m=d(n,-1),h=m&&m(n);function g($,T){return $[3]?kP:bP}let _=g(n),k=_(n),S=n[4]&&S1();return{c(){e=b("div"),t=b("i"),i=C(),l=b("span"),l.textContent="User IP proxy headers",s=C(),h&&h.c(),r=C(),a=b("div"),u=C(),k.c(),f=C(),S&&S.c(),c=ye(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m($,T){v($,e,T),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),v($,r,T),v($,a,T),v($,u,T),k.m($,T),v($,f,T),S&&S.m($,T),v($,c,T)},p($,T){m!==(m=d($,T))&&(h&&h.d(1),h=m&&m($),h&&(h.c(),h.m(e,null))),_!==(_=g($))&&(k.d(1),k=_($),k&&(k.c(),k.m(f.parentNode,f))),$[4]?S?T&16&&M(S,1):(S=S1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d($){$&&(y(e),y(r),y(a),y(u),y(f),y(c)),h&&h.d(),k.d($),S&&S.d($)}}}function vP(n){let e,t;return e=new zi({props:{single:!0,$$slots:{header:[yP],default:[hP]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function wP(n,e,t){let i,l,s,o,r,a;Xe(n,wn,$=>t(10,a=$));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m($){t(0,f.trustedProxy.headers=[$],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g($){n.$$.not_equal(f.trustedProxy.headers,$)&&(f.trustedProxy.headers=$,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),k=$=>m($);function S($){n.$$.not_equal(f.trustedProxy.useLeftmostIP,$)&&(f.trustedProxy.useLeftmostIP=$,t(0,f))}return n.$$set=$=>{"formSettings"in $&&t(0,f=$.formSettings),"healthData"in $&&t(1,c=$.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!U.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!U.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter($=>$!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,k,S]}class SP extends Se{constructor(e){super(),we(this,e,wP,vP,ke,{formSettings:0,healthData:1})}}function T1(n,e,t){const i=n.slice();return i[5]=e[t],i}function $1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=W(t),e.__value=l=n[5].value,_e(e,e.__value)},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&oe(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,_e(e,e.__value))},d(s){s&&y(e)}}}function TP(n){let e,t,i,l,s,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c<r.length;c+=1)a=He(a,r[c]);let u=pe(n[1]),f=[];for(let c=0;c<u.length;c+=1)f[c]=$1(T1(n,u,c));return{c(){e=b("input"),i=C(),l=b("datalist");for(let c=0;c<f.length;c+=1)f[c].c();ei(e,a),p(l,"id",n[2])},m(c,d){v(c,e,d),"value"in a&&(e.value=a.value),e.autofocus&&e.focus(),v(c,i,d),v(c,l,d);for(let m=0;m<f.length;m+=1)f[m]&&f[m].m(l,null);s||(o=Y(e,"input",n[4]),s=!0)},p(c,[d]){if(ei(e,a=wt(r,[d&8&&t!==(t=c[3].type||"text")&&{type:t},{list:c[2]},d&1&&e.value!==c[0]&&{value:c[0]},d&8&&c[3]])),"value"in a&&(e.value=a.value),d&2){u=pe(c[1]
2024-12-26 04:24:24 +08:00
"auth"), only the matching audience rule is taken in consideration.`,o=C(),r=b("hr"),a=C(),u=b("p"),u.textContent="The rate limit label could be in one of the following formats:",f=C(),c=b("ul"),d=b("li"),d.innerHTML=`<code>[METHOD ]/my/path</code> - full exact route match (
<strong>must be without trailing slash </strong>; &quot;METHOD&quot; is optional).
<br/> For example:
<ul class="m-0"><li class="m-0"><code>/hello</code> - matches <code>GET /hello</code>, <code>POST /hello</code>, etc.</li> <li class="m-0"><code>POST /hello</code> - matches only <code>POST /hello</code></li></ul>`,m=C(),h=b("li"),h.innerHTML=`<code>[METHOD ]/my/prefix<strong>/</strong></code> - path prefix (
<strong>must end with trailing slash;</strong>
&quot;METHOD&quot; is optional). For example:
<ul class="m-0"><li class="m-0"><code>/hello/</code> - matches <code>GET /hello</code>,
<code>POST /hello/a/b/c</code>, etc.</li> <li class="m-0"><code>POST /hello/</code> - matches <code>POST /hello</code>,
<code>POST /hello/a/b/c</code>, etc.</li></ul>`,g=C(),_=b("li"),k=b("code"),k.textContent="collectionName:predefinedTag",S=W(` - targets a specific action of a single collection. To
apply the rule for all collections you can use the `),$=b("code"),$.textContent="*",T=W(` wildcard. For example:
`),O=b("code"),O.textContent="posts:create",E=W(", "),L=b("code"),L.textContent="users:listAuthMethods",I=W(", "),A=b("code"),A.textContent="*:auth",N=W(`.
`),P=b("br"),R=W(`
2024-12-26 04:24:24 +08:00
The predifined collection tags are (`),q=b("em"),q.textContent="there should be autocomplete once you start typing",F=W(`):
`),B=b("ul");for(let Z=0;Z<V.length;Z+=1)V[Z].c();p(r,"class","m-t-xs m-b-xs"),p(d,"class","m-b-sm"),p(h,"class","m-b-sm")},m(Z,G){v(Z,e,G),v(Z,t,G),v(Z,i,G),v(Z,l,G),v(Z,s,G),v(Z,o,G),v(Z,r,G),v(Z,a,G),v(Z,u,G),v(Z,f,G),v(Z,c,G),w(c,d),w(c,m),w(c,h),w(c,g),w(c,_),w(_,k),w(_,S),w(_,$),w(_,T),w(_,O),w(_,E),w(_,L),w(_,I),w(_,A),w(_,N),w(_,P),w(_,R),w(_,q),w(_,F),w(_,B);for(let fe=0;fe<V.length;fe+=1)V[fe]&&V[fe].m(B,null)},p(Z,G){if(G&64){J=pe(Z[6]);let fe;for(fe=0;fe<J.length;fe+=1){const ce=C1(Z,J,fe);V[fe]?V[fe].p(ce,G):(V[fe]=I1(ce),V[fe].c(),V[fe].m(B,null))}for(;fe<V.length;fe+=1)V[fe].d(1);V.length=J.length}},d(Z){Z&&(y(e),y(t),y(i),y(l),y(s),y(o),y(r),y(a),y(u),y(f),y(c)),ct(V,Z)}}}function qP(n){let e;return{c(){e=b("h4"),e.textContent="Rate limit label format",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function jP(n){let e,t,i;return{c(){e=b("button"),e.textContent="Close",p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=Y(e,"click",n[18]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function HP(n){let e,t,i,l;e=new zi({props:{single:!0,$$slots:{header:[PP],default:[LP]},$$scope:{ctx:n}}});let s={$$slots:{footer:[jP],header:[qP],default:[FP]},$$scope:{ctx:n}};return i=new en({props:s}),n[19](i),{c(){z(e.$$.fragment),t=C(),z(i.$$.fragment)},m(o,r){j(e,o,r),v(o,t,r),j(i,o,r),l=!0},p(o,[r]){const a={};r&536870943&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&536870920&&(u.$$scope={dirty:r,ctx:o}),i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&y(t),H(e,o),n[19](null),H(i,o)}}}function zP(n,e,t){let i,l,s;Xe(n,En,A=>t(20,l=A)),Xe(n,wn,A=>t(1,s=A));let{formSettings:o}=e;const r=[{value:"",label:"All"},{value:"@guest",label:"Guest only"},{value:"@auth",label:"Auth only"}],a=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file",description:"targets the files download endpoint"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth",description:"targets all auth methods"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let u=a,f;c();async function c(){await Au(),t(2,u=[]);for(let A of l)A.system||(u.push({value:A.name+":list"}),u.push({value:A.name+":view"}),A.type!="view"&&(u.push({value:A.name+":create"}),u.push({value:A.name+":update"}),u.push({value:A.name+":delete"})),A.type=="auth"&&(u.push({value:A.name+":listAuthMethods"}),u.push({value:A.name+":authRefresh"}),u.push({value:A.name+":auth"}),u.push({value:A.name+":authWithPassword"}),u.push({value:A.name+":authWithOAuth2"}),u.push({value:A.name+":authWithOTP"}),u.push({value:A.name+":requestOTP"}),u.push({value:A.name+":requestPasswordReset"}),u.push({value:A.name+":confirmPasswordReset"}),u.push({value:A.name+":requestVerification"}),u.push({value:A.name+":confirmVerification"}),u.push({value:A.name+":requestEmailChange"}),u.push({value:A.name+":confirmEmailChange"})),A.fields.find(N=>N.type=="file")&&u.push({value:A.name+":file"}));t(2,u=u.concat(a))}function d(){Bt({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10,audience:""}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function m(A){Bt({}),o.rateLimits.rules.splice(A,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function h(){o.rateLimits.enabled=this.checked,t(0,o)}function g(A,N){n.$$.not_equal(N.label,A)&&(N.label=A,t(0,o))}function _(A,N){A[N].maxRequests=gt(this.value),t(0,o)}function k(A,N){A[N].duration=gt(this.value),t(0,o)}function S(A,N){n.$$.not_equal(N.audience,A)&&(N.audience=A,t(0,o))}const $=A=>{Wn("rateLimits.rules."+A)},T=A=>m(A),O=()=>d(),E=()=>f==null?void 0:f.show(),L=()=>f==null?void 0:f.hide();function I(A){ie[A?"unsh
2024-12-26 04:24:24 +08:00
database will be temporary &quot;locked&quot; (this usually happens only during the ZIP generation).</p> <p class="txt-bold">If you are using S3 storage for the collections file upload, you&#39;ll have to backup them
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=C(),i=b("form"),z(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),j(l,i,null),s=!0,o||(r=Y(i,"submit",it(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(y(e),y(t),y(i)),H(l),o=!1,r()}}}function eR(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function tR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,u){v(a,e,u),w(e,t),v(a,i,u),v(a,l,u),w(l,s),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&x(l,"btn-loading",a[3])},d(a){a&&(y(e),y(i),y(l)),o=!1,r()}}}function nR(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[tR],header:[eR],default:[xP]},$$scope:{ctx:n}};return e=new en({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function iR(n,e,t){const i=yt(),l="backup_create_"+U.randomString(5);let s,o="",r=!1,a;function u(S){Bt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await he.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),xt("Successfully generated new backup.")}catch(S){S.isAbort||he.error(S)}clearTimeout(a),t(3,r=!1)}}oo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ie[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,g,_,k]}class lR extends Se{constructor(e){super(),we(this,e,iR,nR,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function sR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Backup name"),l=C(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),_e(s,n[2]),r||(a=Y(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&_e(s,u[2])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function oR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new Ci({props:{value:n[1]}}),m=new de({props:{class:"form-field required m-0",name:"name",$$slots:{default:[sR,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div> <div class="content"><p class="txt-bold">Please proceed with caution and use it only with trusted backups!</p> <p>Backup restore is experimental and works only on UNIX based systems.</p> <p>The restore operation will attempt to replace your existing <code>pb_data</code> with the one from
2024-12-26 04:24:24 +08:00
the backup and will restart the application process.</p> <p>This means that on success all of your data (including app settings, users, superusers, etc.) will
be replaced with the ones from the backup.</p> <p>Nothing will happen if the backup is invalid or incompatible (ex. missing
<code>data.db</code> file).</p></div>`,t=C(),i=b("div"),l=W(`Type the backup name
`),s=b("div"),o=b("span"),r=W(n[1]),a=C(),z(u.$$.fragment),f=W(`
to confirm:`),c=C(),d=b("form"),z(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){v(k,e,S),v(k,t,S),v(k,i,S),w(i,l),w(i,s),w(s,o),w(o,r),w(s,a),j(u,s,null),w(i,f),v(k,c,S),v(k,d,S),j(m,d,null),h=!0,g||(_=Y(d,"submit",it(n[7])),g=!0)},p(k,S){(!h||S&2)&&oe(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){h||(M(u.$$.fragment,k),M(m.$$.fragment,k),h=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),h=!1},d(k){k&&(y(e),y(t),y(i),y(c),y(d)),H(u),H(m),g=!1,_()}}}function rR(n){let e,t,i,l;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),l=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&y(e)}}}function aR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=C(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){v(u,e,f),w(e,t),v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function uR(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[aR],header:[rR],default:[oR]},$$scope:{ctx:n}};return e=new en({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(l,s){j(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function fR(n,e,t){let i;const l="backup_restore_"+U.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Bt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await he.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),Oi(((S=$.response)==null?void 0:S.message)||$.message))}}}oo(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function g(S){ie[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Pe.call(this,n,S)}function k(S){Pe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,h,g,_,k]}class cR extends Se{constructor(e){super(),we(this,e,fR,uR,ke,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function N1(n,e,t){const i=n.slice();return i[22]=e[t],i}function P1(n,e,t){const i=n.slice();return i[19]=e[t],i}function dR(n){let e=[],t=new Map,i,l,s=pe(n[3]);const o=a=>a[22].key;for(let a=0;a<s.length;a+=1){let u=N1(n,s,a),f=o(u);t.set(f,e[a]=F1(f,u))}let r=null;return s.length||(r=R1()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ye(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);v(a,i,u),r&&r.m(a,u),l=!0},p(a,u){u&876&&(s=pe(a[3]),re(),e=kt(e,u,o,1,a,s,t,i.parentNode,Yt,F1,i,N1),ae(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=R1(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)M(e[u]);l=!0}},o(a){for(let u=0;u<e.length;u+=1)D(e[u]);l=!1},d(a){a&&y(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function pR(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=q1(P1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);v(l,e,s)},p(l,s){if(s&8){t=pe(Array(l[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=P1(l,t,o);i[o]?i[o].p(r,s):(i[o]=q1(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(l){l&&y(e),ct(i,l)}}
2024-12-26 04:24:24 +08:00
Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function u(m){var g,_,k;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await he.backups.upload(h,{requestKey:z1}),t(2,o=!1),i("success"),xt("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(_=(g=S.response)==null?void 0:g.data)==null?void 0:_.file)!=null&&k.message?Oi(S.response.data.file.message):he.error(S))}r()}oo(()=>{he.cancelRequest(z1)});const f=()=>s==null?void 0:s.click();function c(m){ie[m?"unshift":"push"](()=>{s=m,t(1,s)})}const d=m=>{var h,g;a((g=(h=m==null?void 0:m.target)==null?void 0:h.files)==null?void 0:g[0])};return n.$$set=m=>{"class"in m&&t(0,l=m.class)},[l,s,o,a,f,c,d]}class IR extends Se{constructor(e){super(),we(this,e,DR,ER,ke,{class:0})}}function LR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function AR(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function U1(n){var B,J,V;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L;t=new de({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[NR,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&V1(n);function A(Z){n[24](Z)}function N(Z){n[25](Z)}function P(Z){n[26](Z)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new Ey({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",N)),ie.push(()=>be(r,"testError",P));let q=((V=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:V.enabled)&&!n[9]&&!n[5]&&B1(n),F=n[9]&&W1(n);return{c(){e=b("form"),z(t.$$.fragment),i=C(),I&&I.c(),l=C(),s=b("div"),o=C(),z(r.$$.fragment),c=C(),d=b("div"),m=b("div"),h=C(),q&&q.c(),g=C(),F&&F.c(),_=C(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],x(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){v(Z,e,G),j(t,e,null),w(e,i),I&&I.m(e,null),w(e,l),w(e,s),w(e,o),j(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),q&&q.m(d,null),w(d,g),F&&F.m(d,null),w(d,_),w(d,k),w(k,S),O=!0,E||(L=[Y(k,"click",n[28]),Y(e,"submit",it(n[11]))],E=!0)},p(Z,G){var ue,Te,Ke;const fe={};G[0]&4|G[1]&3&&(fe.$$scope={dirty:G,ctx:Z}),t.$set(fe),Z[2]?I?(I.p(Z,G),G[0]&4&&M(I,1)):(I=V1(Z),I.c(),M(I,1),I.m(e,l)):I&&(re(),D(I,1,1,()=>{I=null}),ae());const ce={};G[0]&1&&(ce.originalConfig=(ue=Z[0].backups)==null?void 0:ue.s3),!a&&G[0]&2&&(a=!0,ce.config=Z[1].backups.s3,$e(()=>a=!1)),!u&&G[0]&128&&(u=!0,ce.isTesting=Z[7],$e(()=>u=!1)),!f&&G[0]&256&&(f=!0,ce.testError=Z[8],$e(()=>f=!1)),r.$set(ce),(Ke=(Te=Z[1].backups)==null?void 0:Te.s3)!=null&&Ke.enabled&&!Z[9]&&!Z[5]?q?q.p(Z,G):(q=B1(Z),q.c(),q.m(d,g)):q&&(q.d(1),q=null),Z[9]?F?F.p(Z,G):(F=W1(Z),F.c(),F.m(d,_)):F&&(F.d(1),F=null),(!O||G[0]&544&&$!==($=!Z[9]||Z[5]))&&(k.disabled=$),(!O||G[0]&32)&&x(k,"btn-loading",Z[5])},i(Z){O||(M(t.$$.fragment,Z),M(I),M(r.$$.fragment,Z),Z&&tt(()=>{O&&(T||(T=je(e,pt,{duration:150},!0)),T.run(1))}),O=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=je(e,pt,{duration:150},!1)),T.run(0)),O=!1},d(Z){Z&&y(e),H(t),I&&I.d(),H(r),q&&q.d(),F&&F.d(),Z&&T&&T.end(),E=!1,Ie(L)}}}function NR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=C(),l=b("label"),s=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(y(e),y(i),y(l)),r=!1,a()}}}function V1(n){let e,t,i,l,s,o,r,a,u;return l=new de({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[RR,({uniqueId:f})=>({31:f}),({uniqueId:f})
2024-12-26 04:24:24 +08:00
`),T=b("span"),T.textContent="macros",O=W(`.
`),E=b("br"),L=W(`
The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((R=(P=n[0])==null?void 0:P.backups)!=null&&R.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(P,R){var q,F;v(P,e,R),w(e,t),v(P,l,R),v(P,s,R),_e(s,n[1].backups.cron),v(P,a,R),v(P,u,R),w(u,f),w(f,c),w(f,d),w(f,m),w(f,h),j(g,f,null),v(P,_,R),v(P,k,R),w(k,S),w(S,$),w(S,T),w(S,O),w(S,E),w(S,L),I=!0,(F=(q=n[0])==null?void 0:q.backups)!=null&&F.cron||s.focus(),A||(N=[Y(s,"input",n[18]),Oe(qe.call(null,T,`@yearly
2024-12-26 04:24:24 +08:00
@annually
@monthly
@weekly
@daily
@midnight
@hourly`))],A=!0)},p(P,R){var F,B;(!I||R[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!I||R[1]&1&&o!==(o=P[31]))&&p(s,"id",o),(!I||R[0]&1&&r!==(r=!((B=(F=P[0])==null?void 0:F.backups)!=null&&B.cron)))&&(s.autofocus=r),R[0]&2&&s.value!==P[1].backups.cron&&_e(s,P[1].backups.cron);const q={};R[0]&2|R[1]&2&&(q.$$scope={dirty:R,ctx:P}),g.$set(q)},i(P){I||(M(g.$$.fragment,P),I=!0)},o(P){D(g.$$.fragment,P),I=!1},d(P){P&&(y(e),y(l),y(s),y(a),y(u),y(_),y(k)),H(g),A=!1,Ie(N)}}}function FR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),l=C(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),_e(s,n[1].backups.cronMaxKeep),r||(a=Y(s,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(s,"id",o),f[0]&2&&gt(s.value)!==u[1].backups.cronMaxKeep&&_e(s,u[1].backups.cronMaxKeep)},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function B1(n){let e;function t(s,o){return s[7]?HR:s[8]?jR:qR}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&y(e),l.d(s)}}}function qR(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function jR(n){let e,t,i,l;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(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function HR(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function W1(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){v(o,e,r),w(e,t),l||(s=Y(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&y(e),l=!1,s()}}}function zR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,N,P;m=new Hr({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new IR({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};k=new bR({props:R}),n[15](k);function q(V,Z){return V[6]?AR:LR}let F=q(n),B=F(n),J=n[6]&&!n[4]&&U1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[10]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=C(),z(m.$$.fragment),h=C(),z(g.$$.fragment),_=C(),z(k.$$.fragment),S=C(),$=b("hr"),T=C(),O=b("button"),E=b("span"),E.textContent="Backups options",L=C(),B.c(),I=C(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],x(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(V,Z){v(V,e,Z),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(V,r,Z),v(V,a,Z),w(a,u),w(u,f),w(f,c),w(f,d),j(m,f,null),w(f,h),j(g,f,null),w(u,_),j(k,u,null),w(u,S),w(u,$),w(u,T),w(u,O),w(O,E),w(O,L),B.m(O,null),w(u,I),J&&J.m(u,null),A=!0,N||(P=[Y(O,"click",n[16]),Y(u,"submit",it(n[11]))],N=!0)},p(V,Z){(!A||Z[0]&1024)&&oe(o,V[10]);const G={};k.$set(G),F!==(F=q(V))&&(B.d(1),B=F(V),B&&(B.c(),B.m(O,null))),(!A||Z[0]&16)&&(O.disabled=V[4]),(!A||Z[0]&16)&&x(O,"btn-loading",V[4]),V[6]&&!V[4]?J?(J.p(V,Z),Z[0]&80&&M(J,1)):(J=U1(V),J.c(),M(J,1),J.m(u,null)):J&&(re(),D(J,1,1,()=>{J=null}),ae())},i(V){A||(M(m.$$.fragment,V),M(g.$$.fragment,V),M(k.$$.fragment,V),M(J),A=!0)},o(V){D(m.$$.fragment,V),D(g.$$.fragment,V),
<a href="https://pocketbase.io/docs/go-jobs-scheduling/" target="_blank" rel="noopener noreferrer">Go</a>
2024-12-26 04:24:24 +08:00
or
<a href="https://pocketbase.io/docs/js-jobs-scheduling/" target="_blank" rel="noopener noreferrer">JavaScript
</a>.`,p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(_,"class","list-content"),p(g,"class","list list-compact"),p(S,"class","txt-hint m-t-xs"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(L,I){v(L,e,I),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(L,r,I),v(L,a,I),w(a,u),w(u,f),w(f,c),w(f,d),j(m,f,null),w(u,h),w(u,g),w(g,_),E.m(_,null),w(u,k),w(u,S),$=!0},p(L,I){(!$||I&8)&&oe(o,L[3]),O===(O=T(L))&&E?E.p(L,I):(E.d(1),E=O(L),E&&(E.c(),E.m(_,null)))},i(L){$||(M(m.$$.fragment,L),$=!0)},o(L){D(m.$$.fragment,L),$=!1},d(L){L&&(y(e),y(r),y(a)),H(m),E.d()}}}function JR(n){let e,t,i,l;return e=new Rl({}),i=new ii({props:{$$slots:{default:[KR]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=C(),z(i.$$.fragment)},m(s,o){j(e,s,o),v(s,t,o),j(i,s,o),l=!0},p(s,[o]){const r={};o&1039&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),H(e,s),H(i,s)}}}function ZR(n,e,t){let i;Xe(n,on,f=>t(3,i=f)),On(on,i="Crons",i);let l=[],s=!1,o={};r();async function r(){t(1,s=!0);try{t(0,l=await he.crons.getFullList()),t(1,s=!1)}catch(f){f.isAbort||(he.error(f),t(1,s=!1))}}async function a(f){t(2,o[f]=!0,o);try{await he.crons.run(f),xt(`Successfully triggered ${f}.`),t(2,o[f]=!1,o)}catch(c){c.isAbort||(he.error(c),t(2,o[f]=!1,o))}}return[l,s,o,i,r,a,f=>a(f.id)]}class GR extends Se{constructor(e){super(),we(this,e,ZR,JR,ke,{})}}function Z1(n,e,t){const i=n.slice();return i[22]=e[t],i}function XR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,N,P,R,q;o=new de({props:{class:"form-field",$$slots:{default:[xR,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=pe(n[0]);const B=J=>J[22].id;for(let J=0;J<F.length;J+=1){let V=Z1(n,F,J),Z=B(V);u.set(Z,a[J]=G1(Z,V))}return{c(){e=b("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=C(),i=b("div"),l=b("div"),s=b("div"),z(o.$$.fragment),r=C();for(let J=0;J<a.length;J+=1)a[J].c();f=C(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",g=C(),_=b("pre"),k=W(n[6]),S=C(),$=b("div"),T=b("div"),O=C(),E=b("button"),L=b("i"),I=C(),A=b("span"),A.textContent="Download as JSON",p(e,"class","content txt-xl m-b-base"),p(s,"class","list-item list-item-section"),p(l,"class","export-list"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","btn btn-sm btn-transparent fade copy-schema"),d.disabled=h=!n[2],p(_,"class","code-wrapper"),p(c,"tabindex","0"),p(c,"class","export-preview"),p(i,"class","export-panel"),p(T,"class","flex-fill"),p(L,"class","ri-download-line"),p(A,"class","txt"),p(E,"type","button"),p(E,"class","btn btn-expanded"),E.disabled=N=!n[2],p($,"class","flex m-t-base")},m(J,V){v(J,e,V),v(J,t,V),v(J,i,V),w(i,l),w(l,s),j(o,s,null),w(l,r);for(let Z=0;Z<a.length;Z+=1)a[Z]&&a[Z].m(l,null);w(i,f),w(i,c),w(c,d),w(d,m),w(c,g),w(c,_),w(_,k),n[16](c),v(J,S,V),v(J,$,V),w($,T),w($,O),w($,E),w(E,L),w(E,I),w(E,A),P=!0,R||(q=[Y(d,"click",n[15]),Y(c,"keydown",n[17]),Y(E,"click",n[18])],R=!0)},p(J,V){const Z={};V&33558561&&(Z.$$scope={dirty:V,ctx:J}),o.$set(Z),V&6147&&(F=pe(J[0]),re(),a=kt(a,V,B,1,J,F,u,l,Yt,G1,null,Z1),ae()),(!P||V&4&&h!==(h=!J[2]))&&(d.disabled=h),(!P||V&64)&&oe(k,J[6]),(!P||V&4&&N!==(N=!J[2]))&&(E.disabled=N)},i(J){if(!P){M(o.$$.fragment,J);for(let V=0;V<F.length;V+=1)M(a[V]);P=!0}},o(J){D(o.$$.fragment,J);for(let V=0;V<a.length;V+=1)D(a[V]);P=!1},d(J){J&&(y(e),y(t),y(i),y(S),y($)),H(o);for(let V=0;V<a.length;V+=1)a[V].d();n[16](null),R=!1,Ie(q)}}}function QR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function xR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=W("Select all"),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.disabled=i=!n[0].length,e.checked=n[5],p(s,"for",r=n[12])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=Y(e,"change",n[13]),a=!0)},p(f,c){c&4096&&t!==(t=f[12])&&p(e,"id",t),c&1&&i!==(i=!f[0].length)&&(e.disabled=i),c&32&&(e.checked=f[5]),c&4096&&r!==(r=f[12])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function eF(n){let e,t,i,l,s,o=n[22].name+"",r,a,u,f,c;function d(){return n[14](n[22])}return{c(){e=b("input"),l=C(),s=b("label"),r=W(o),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.checked=i=n[1][n[22].id],p(s,"for",a=n[12]),p(s,"title",u=n[22].name)},m(m,h){v(m,e,h),v(m,l,h),v(m,s,h),w(s,r),f||(c=Y(e,"change",d),f=!0)},p(m,h){n=m,h&4096&&t!==(t=n[12])&&p(e,"id",t),h&3&&i!==(i=n[1][n[22].id])&&(e.checked=i),h&1&&o!==(o=n[22].name+"")&&oe(r,o),h&4096&&a!==(a=n[12])&&p(s,"for",a),h&1&&u!==(u=n[22].name)&&p(s,"title",u)},d(m){m&&(y(e),y(l),y(s)),f=!1,c()}}}function G1(n,e){let t,i,l,s;return i=new de({props:{class:"form-field",$$slots:{default:[eF,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),z(i.$$.fragment),l=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){v(o,t,r),j(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&y(t),H(i)}}}function tF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[QR,XR],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,k),v(_,a,k),w(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k&128)&&oe(o,_[7]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function nF(n){let e,t,i,l;return e=new Rl({}),i=new ii({props:{$$slots:{de
2024-12-26 04:24:24 +08:00
- ${T.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),xt("Successfully imported collections configuration."),i("submit")}catch(T){he.error(T)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function k(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Pe.call(this,n,T)}function $(T){Pe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,g,_,k,S,$]}class _F extends Se{constructor(e){super(),we(this,e,hF,mF,ke,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function gb(n,e,t){const i=n.slice();return i[34]=e[t],i}function bb(n,e,t){const i=n.slice();return i[37]=e[t],i}function kb(n,e,t){const i=n.slice();return i[34]=e[t],i}function gF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[kF,({uniqueId:B})=>({42:B}),({uniqueId:B})=>[0,B?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&vb(n),N=!1,P=n[6]&&n[1].length&&!n[7]&&wb(),R=n[6]&&n[1].length&&n[7]&&Sb(n),q=n[13].length&&Nb(n),F=!!n[0]&&Pb(n);return{c(){e=b("input"),t=C(),i=b("div"),l=b("p"),s=W(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=C(),z(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),P&&P.c(),d=C(),R&&R.c(),m=C(),q&&q.c(),h=C(),g=b("div"),F&&F.c(),_=C(),k=b("div"),S=C(),$=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(k,"class","flex-fill"),p(T,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=O=!n[14],p(g,"class","flex m-t-base")},m(B,J){v(B,e,J),n[22](e),v(B,t,J),v(B,i,J),w(i,l),w(l,s),w(l,o),v(B,r,J),j(a,B,J),v(B,u,J),A&&A.m(B,J),v(B,f,J),v(B,c,J),P&&P.m(B,J),v(B,d,J),R&&R.m(B,J),v(B,m,J),q&&q.m(B,J),v(B,h,J),v(B,g,J),F&&F.m(g,null),w(g,_),w(g,k),w(g,S),w(g,$),w($,T),E=!0,L||(I=[Y(e,"change",n[23]),Y(o,"click",n[24]),Y($,"click",n[20])],L=!0)},p(B,J){(!E||J[0]&4096)&&x(o,"btn-loading",B[12]);const V={};J[0]&64&&(V.class="form-field "+(B[6]?"":"field-error")),J[0]&65|J[1]&6144&&(V.$$scope={dirty:J,ctx:B}),a.$set(V),B[1].length?A?(A.p(B,J),J[0]&2&&M(A,1)):(A=vb(B),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(re(),D(A,1,1,()=>{A=null}),ae()),B[6]&&B[1].length&&!B[7]?P||(P=wb(),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),B[6]&&B[1].length&&B[7]?R?R.p(B,J):(R=Sb(B),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),B[13].length?q?q.p(B,J):(q=Nb(B),q.c(),q.m(h.parentNode,h)):q&&(q.d(1),q=null),B[0]?F?F.p(B,J):(F=Pb(B),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!B[14]))&&($.disabled=O)},i(B){E||(M(a.$$.fragment,B),M(A),M(N),E=!0)},o(B){D(a.$$.fragment,B),D(A),D(N),E=!1},d(B){B&&(y(e),y(t),y(i),y(r),y(u),y(f),y(c),y(d),y(m),y(h),y(g)),n[22](null),H(a,B),A&&A.d(B),P&&P.d(B),R&&R.d(B),q&&q.d(B),F&&F.d(),L=!1,Ie(I)}}}function bF(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function yb(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){v(t,e,i)},d(t){t&&y(e)}}}function kF(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&yb();return{c(){e=b("label"),t=W("Collections"),l=C(),s=b("textarea"),r=C(),c&&c.c(),a=ye(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),_e(s,n[0]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=Y(s,"input",n[25]),u=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&_e(s,d[0]),d[0]&&!d[6]?c||(c=yb(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function vb(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[yF,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yF(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=C(),s=b("label"),o=W("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(f,c){v(f,e,c),e.checked=n[5],v(f,l,c),v(f,s,c),w(s,o),a||(u=Y(e,"change",n[26]),a=!0)},p(f,c){c[1]&2048&&t!==(t=f[42])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&2048&&r!==(r=f[42])&&p(s,"for",r)},d(f){f&&(y(e),y(l),y(s)),a=!1,u()}}}function wb(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){v(t,e,i)},d(t){t&&y(e)}}}function Sb(n){let e,t,i,l,s,o=n[9].length&&Tb(n),r=n[3].length&&Ob(n),a=n[8].length&&Ib(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=C(),i=b("div"),o&&o.c(),l=C(),r&&r.c(),s=C(),a&&a.c(),p(e,"class"
2024-12-26 04:24:24 +08:00
imported with different IDs. You can replace them in the import if you want
to.</string>`,s=C(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(l,"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){v(u,e,f),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),r||(a=Y(o,"click",n[28]),r=!0)},p:te,d(u){u&&y(e),r=!1,a()}}}function Pb(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(l,s){v(l,e,s),t||(i=Y(e,"click",n[29]),t=!0)},p:te,d(l){l&&y(e),t=!1,i()}}}function vF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[bF,gF],h=[];function g(_,k){return _[4]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[15]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){v(_,e,k),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(_,r,k),v(_,a,k),w(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&oe(o,_[15]);let S=f;f=g(_),f===S?h[f].p(_,k):(re(),D(h[S],1,1,()=>{h[S]=null}),ae(),c=h[f],c?c.p(_,k):(c=h[f]=m[f](_),c.c()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function wF(n){let e,t,i,l,s,o;e=new Rl({}),i=new ii({props:{$$slots:{default:[vF]},$$scope:{ctx:n}}});let r={};return s=new _F({props:r}),n[30](s),s.$on("submit",n[31]),{c(){z(e.$$.fragment),t=C(),z(i.$$.fragment),l=C(),z(s.$$.fragment)},m(a,u){j(e,a,u),v(a,t,u),j(i,a,u),v(a,l,u),j(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&4096&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(y(t),y(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function SF(n,e,t){let i,l,s,o,r,a,u;Xe(n,on,ce=>t(15,u=ce)),On(on,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,k=[],S=!1,$=!1;T();async function T(){var ce;t(4,S=!0);try{t(21,g=await he.collections.getFullList(200));for(let ue of g)delete ue.created,delete ue.updated,(ce=ue.oauth2)==null||delete ce.providers}catch(ue){he.error(ue)}t(4,S=!1)}function O(){if(t(3,k=[]),!!i)for(let ce of h){const ue=U.findByKey(g,"id",ce.id);!(ue!=null&&ue.id)||!U.hasCollectionChanges(ue,ce,_)||k.push({new:ce,old:ue})}}function E(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=U.filterDuplicatesByKey(h)):t(1,h=[]);for(let ce of h)delete ce.created,delete ce.updated,ce.fields=U.filterDuplicatesByKey(ce.fields)}function L(){var ce;for(let ue of h){const Te=U.findByKey(g,"name",ue.name)||U.findByKey(g,"id",ue.id);if(!Te)continue;const Ke=ue.id,Je=Te.id;ue.id=Je;const ft=Array.isArray(Te.fields)?Te.fields:[],et=Array.isArray(ue.fields)?ue.fields:[];for(const xe of et){const We=U.findByKey(ft,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===Ke&&(We.collectionId=Je);for(let xe=0;xe<((ce=ue.indexes)==null?void 0:ce.length);xe++)ue.indexes[xe]=ue.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,We=>We.replace(Ke,Je))}t(0,d=JSON.stringify(h,null,4))}function I(ce){t(12,m=!0);const ue=new FileReader;ue.onload=async Te=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Te.target.result),await pn(),h.length||(Oi("Invalid collections configuration."),A())},ue.onerror=Te=>{console.warn(Te),Oi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(ce)}function A(){t(0,d=""),t(10,f.value="",f),Bt({})}function N(){const ce=$?U.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,ce,_)}function P(ce){ie[ce?"unshift":"push"](()=>{f=ce,t(10,f)})}const R=()=>{f.files.length&&I(f.files[0])},q=()=>{f.click()};function F(){d=this.value,t(0,d)}function B(){$=this.checked,t(5,$)}function J(){_=this.checked,t(2,_)}const V=()=>L()
2024-12-26 04:24:24 +08:00
from the
`),r=b("strong"),u=W(a),f=W(`
to the
`),c=b("strong"),m=W(d),h=W(`.
`),g=b("br"),_=W(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
`,S=W(`,
`),$=b("a"),$.textContent=`s5cmd
`,T=W(", etc."),O=C(),E=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($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(N,P){v(N,e,P),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,g),w(s,_),w(s,k),w(s,S),w(s,$),w(s,T),w(e,O),w(e,E),I=!0},p(N,P){var R;(!I||P&1)&&a!==(a=(R=N[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||P&2)&&d!==(d=N[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(N){I||(N&&tt(()=>{I&&(L||(L=je(e,pt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=je(e,pt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&y(e),N&&L&&L.end()}}}function KF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&qb(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),v(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&M(t,1)):(t=qb(l),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(re(),D(t,1,1,()=>{t=null}),ae())},d(l){l&&y(e),t&&t.d(l)}}}function jb(n){let e;function t(s,o){return s[4]?GF:s[5]?ZF:JF}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),v(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&y(e),l.d(s)}}}function JF(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function ZF(n){let e,t,i,l;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(s,o){var r;v(s,e,o),i||(l=Oe(t=qe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&y(e),i=!1,l()}}}function GF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){v(t,e,i)},p:te,d(t){t&&y(e)}}}function Hb(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){v(s,e,o),w(e,t),i||(l=Y(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&y(e),i=!1,l()}}}function XF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const k=[YF,WF],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=C(),s=b("div"),o=W(n[7]),r=C(),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 an S3 compatible storage.</p>",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[16])),g=!0)},p(T,O){(!h||O&128)&&oe(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function QF(n){let e,t,i,l;return e=new Rl({}),i=new ii({props:{$$slots:{default:[XF]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=C(),z(i.$$.fragment)},m(s,o){j(e,s,o),v(s,t,o),j(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&y(t),
One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&4096&&oe(s,r[12])},d(r){r&&y(e)}}}function cq(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Id"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","text"),p(s,"id",o=n[26]),s.value=n[4],p(s,"placeholder",n[11]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),r||(a=Y(s,"change",n[20]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&16&&s.value!==u[4]&&(s.value=u[4]),f&2048&&p(s,"placeholder",u[11])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function dq(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("One-time password"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,s.autofocus=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),_e(s,n[13]),s.focus(),r||(a=Y(s,"input",n[21]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&8192&&s.value!==u[13]&&_e(s,u[13])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function pq(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=C(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","email"),p(s,"id",o=n[26]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),_e(s,n[12]),r||(a=Y(s,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&4096&&s.value!==u[12]&&_e(s,u[12])},d(u){u&&(y(e),y(l),y(s)),r=!1,a()}}}function mq(n){let e,t=U.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=W(t),s=C(),o=b("input"),p(e,"for",l=n[26]),p(o,"id",r=n[26]),p(o,"type",a=n[0].password.identityFields.length==1&&n[0].password.identityFields[0]=="email"?"email":"text"),o.value=n[5],o.required=!0,o.autofocus=!0},m(c,d){v(c,e,d),w(e,i),v(c,s,d),v(c,o,d),o.focus(),u||(f=Y(o,"input",n[17]),u=!0)},p(c,d){d&1&&t!==(t=U.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&oe(i,t),d&67108864&&l!==(l=c[26])&&p(e,"for",l),d&67108864&&r!==(r=c[26])&&p(o,"id",r),d&1&&a!==(a=c[0].password.identityFields.length==1&&c[0].password.identityFields[0]=="email"?"email":"text")&&p(o,"type",a),d&32&&o.value!==c[5]&&(o.value=c[5])},d(c){c&&(y(e),y(s),y(o)),u=!1,f()}}}function hq(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Password"),l=C(),s=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){v(d,e,m),w(e,t),v(d,l,m),v(d,s,m),_e(s,n[6]),v(d,r,m),v(d,a,m),w(a,u),f||(c=[Y(s,"input",n[18]),Oe(Rn.call(null,u))],f=!0)},p(d,m){m&67108864&&i!==(i=d[26])&&p(e,"for",i),m&67108864&&o!==(o=d[26])&&p(s,"id",o),m&64&&s.value!==d[6]&&_e(s,d[6])},d(d){d&&(y(e),y(l),y(s),y(r),y(a)),f=!1,Ie(c)}}}function _q(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&Ub(n);const f=[aq,rq,oq],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=W(`Superuser login
`),u&&u.c(),l=C(),o&&o.c(),r=ye(),p(e,"class","content txt-center m-b-base")},m(m,h){v(m,e,h),w(e,t),w(t,i),u&&u.m(t,null),v(m,l,h),~s&&c[s].m(m,h),v(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=Ub(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=s;s=d(m),s===g?~s&&c[s].p(m,h):(o&&(re(),D(c[g],1,1,()=>{c[g]=null}),ae()),~s?(o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(y(e),y(l),y(r)),u&&u.d(),~s&&c[s].d(m)}}}function gq(n){let e,t;return e=new sq({props:{$$slots:{default:[_q]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,l){j(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bq(n,e,t){let i;Xe(n,Pu,q=>t(23,i=q));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await he.collection("_superusers").listAuthMethods())}catch(q){he.error(q)}t(10,m=!1)}}async function T(){var q,F;if(!f){t(7,f=!0);try{await he.collection("_superusers").authWithPassword(s,o),Ls(),Bt({}),ls("/")}catch(B){B.status==401?(t(3,h=B.response.mfaId),((F=(q=r==null?void 0:r.password)==null?void 0:q.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,k=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,k=s)):B.status!=400?he.error(B):Oi("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const q=await he.collection("_superusers").requestOTP(k);t(4,g=q.otpId),t(11,_=g),Ls(),Bt({})}catch(q){q.status==429&&t(4,g=_),he.error(q)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await he.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Bt({}),ls("/")}catch(q){he.error(q)}t(9,d=!1)}}const L=q=>{t(5,s=q.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const N=q=>{t(4,g=q.target.value||_),q.target.value=g};function P(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var q,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(q=r==null?void 0:r.mfa)!=null&&q.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.enabled&&t(2,u++,u),h!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,h,g,s,o,f,c,d,m,_,k,S,T,O,E,L,I,A,N,P,R]}class kq extends Se{constructor(e){super(),we(this,e,bq,gq,ke,{})}}function Zt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const yq={"/pbinstal/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageInstaller-yNSjIksj.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:kq,conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-CTguAV_u.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-DginxFRV.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:QN,conditions:[n=>he.authStore.isValid],userDat