new schema and indexes ui

This commit is contained in:
Gani Georgiev committed 2023-03-16 19:21:16 +02:00
1 parent 254e691e92
commit 4d16d0e16e
87 files changed
+2807 -1973

No files matched your search

+1 -1
View File
@@ -8,4 +8,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs/"
PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk"
PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk"
PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases"
PB_VERSION = "v0.13.4"
PB_VERSION = "v0.14.0"
@@ -1,4 +1,4 @@
import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n,m as _e,x as G,O as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as m,d as pe,R as Me,C as Se,p as $e,r as H,u as je,N as Ae}from"./index-7cc53b3b.js";import{S as Be}from"./SdkTabs-855be3ab.js";function ue(a,l,o){const s=a.slice();return s[5]=l[o],s}function de(a,l,o){const s=a.slice();return s[5]=l[o],s}function fe(a,l){let o,s=l[5].code+"",_,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),_=b(s),f=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(v,C){h(v,o,C),n(o,_),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&m(o),i=!1,u()}}}function he(a,l){let o,s,_,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),me(s.$$.fragment),_=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),_e(s,o,null),n(o,_),f=!0},p(i,u){l=i;const d={};u&4&&(d.content=l[5].body),s.$set(d),(!f||u&6)&&H(o,"active",l[1]===l[5].code)},i(i){f||(L(s.$$.fragment,i),f=!0)},o(i){Y(s.$$.fragment,i),f=!1},d(i){i&&m(o),pe(s)}}}function Oe(a){var ae,ne;let l,o,s=a[0].name+"",_,f,i,u,d,v,C,F=a[0].name+"",U,R,q,P,D,j,W,M,K,X,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,O,w=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:`
import{S as ke,i as be,s as ge,e as r,w as g,b as w,c as me,f as k,g as h,h as n,m as _e,x as G,O as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as m,d as pe,R as Me,C as Se,p as $e,r as H,u as je,N as Ae}from"./index-3d43ee7c.js";import{S as Be}from"./SdkTabs-720afe62.js";function ue(a,l,o){const s=a.slice();return s[5]=l[o],s}function de(a,l,o){const s=a.slice();return s[5]=l[o],s}function fe(a,l){let o,s=l[5].code+"",_,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),_=g(s),f=w(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(v,C){h(v,o,C),n(o,_),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&m(o),i=!1,u()}}}function he(a,l){let o,s,_,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),me(s.$$.fragment),_=w(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),_e(s,o,null),n(o,_),f=!0},p(i,u){l=i;const d={};u&4&&(d.content=l[5].body),s.$set(d),(!f||u&6)&&H(o,"active",l[1]===l[5].code)},i(i){f||(L(s.$$.fragment,i),f=!0)},o(i){Y(s.$$.fragment,i),f=!1},d(i){i&&m(o),pe(s)}}}function Oe(a){var ae,ne;let l,o,s=a[0].name+"",_,f,i,u,d,v,C,F=a[0].name+"",U,R,q,P,D,j,W,M,K,X,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,O,b=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
@@ -14,7 +14,7 @@ import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n
...
final result = await pb.collection('${(ne=a[0])==null?void 0:ne.name}').listAuthMethods();
`}});let z=a[2];const oe=e=>e[5].code;for(let e=0;e<z.length;e+=1){let t=de(a,z,e),c=oe(t);ee.set(c,w[e]=fe(c,t))}let N=a[2];const se=e=>e[5].code;for(let e=0;e<N.length;e+=1){let t=ue(a,N,e),c=se(t);le.set(c,p[e]=he(c,t))}return{c(){l=r("h3"),o=b("List auth methods ("),_=b(s),f=b(")"),i=g(),u=r("div"),d=r("p"),v=b("Returns a public list with all allowed "),C=r("strong"),U=b(F),R=b(" authentication methods."),q=g(),me(P.$$.fragment),D=g(),j=r("h6"),j.textContent="API details",W=g(),M=r("div"),K=r("strong"),K.textContent="GET",X=g(),Q=r("div"),A=r("p"),Z=b("/api/collections/"),V=r("strong"),E=b(y),x=b("/auth-methods"),I=g(),B=r("div"),B.textContent="Responses",J=g(),S=r("div"),O=r("div");for(let e=0;e<w.length;e+=1)w[e].c();te=g(),T=r("div");for(let e=0;e<p.length;e+=1)p[e].c();k(l,"class","m-b-sm"),k(u,"class","content txt-lg m-b-sm"),k(j,"class","m-b-xs"),k(K,"class","label label-primary"),k(Q,"class","content"),k(M,"class","alert alert-info"),k(B,"class","section-title"),k(O,"class","tabs-header compact left"),k(T,"class","tabs-content"),k(S,"class","tabs")},m(e,t){h(e,l,t),n(l,o),n(l,_),n(l,f),h(e,i,t),h(e,u,t),n(u,d),n(d,v),n(d,C),n(C,U),n(d,R),h(e,q,t),_e(P,e,t),h(e,D,t),h(e,j,t),h(e,W,t),h(e,M,t),n(M,K),n(M,X),n(M,Q),n(Q,A),n(A,Z),n(A,V),n(V,E),n(A,x),h(e,I,t),h(e,B,t),h(e,J,t),h(e,S,t),n(S,O);for(let c=0;c<w.length;c+=1)w[c].m(O,null);n(S,te),n(S,T);for(let c=0;c<p.length;c+=1)p[c].m(T,null);$=!0},p(e,[t]){var ie,ce;(!$||t&1)&&s!==(s=e[0].name+"")&&G(_,s),(!$||t&1)&&F!==(F=e[0].name+"")&&G(U,F);const c={};t&9&&(c.js=`
`}});let z=a[2];const oe=e=>e[5].code;for(let e=0;e<z.length;e+=1){let t=de(a,z,e),c=oe(t);ee.set(c,b[e]=fe(c,t))}let N=a[2];const se=e=>e[5].code;for(let e=0;e<N.length;e+=1){let t=ue(a,N,e),c=se(t);le.set(c,p[e]=he(c,t))}return{c(){l=r("h3"),o=g("List auth methods ("),_=g(s),f=g(")"),i=w(),u=r("div"),d=r("p"),v=g("Returns a public list with all allowed "),C=r("strong"),U=g(F),R=g(" authentication methods."),q=w(),me(P.$$.fragment),D=w(),j=r("h6"),j.textContent="API details",W=w(),M=r("div"),K=r("strong"),K.textContent="GET",X=w(),Q=r("div"),A=r("p"),Z=g("/api/collections/"),V=r("strong"),E=g(y),x=g("/auth-methods"),I=w(),B=r("div"),B.textContent="Responses",J=w(),S=r("div"),O=r("div");for(let e=0;e<b.length;e+=1)b[e].c();te=w(),T=r("div");for(let e=0;e<p.length;e+=1)p[e].c();k(l,"class","m-b-sm"),k(u,"class","content txt-lg m-b-sm"),k(j,"class","m-b-xs"),k(K,"class","label label-primary"),k(Q,"class","content"),k(M,"class","alert alert-info"),k(B,"class","section-title"),k(O,"class","tabs-header compact left"),k(T,"class","tabs-content"),k(S,"class","tabs")},m(e,t){h(e,l,t),n(l,o),n(l,_),n(l,f),h(e,i,t),h(e,u,t),n(u,d),n(d,v),n(d,C),n(C,U),n(d,R),h(e,q,t),_e(P,e,t),h(e,D,t),h(e,j,t),h(e,W,t),h(e,M,t),n(M,K),n(M,X),n(M,Q),n(Q,A),n(A,Z),n(A,V),n(V,E),n(A,x),h(e,I,t),h(e,B,t),h(e,J,t),h(e,S,t),n(S,O);for(let c=0;c<b.length;c+=1)b[c]&&b[c].m(O,null);n(S,te),n(S,T);for(let c=0;c<p.length;c+=1)p[c]&&p[c].m(T,null);$=!0},p(e,[t]){var ie,ce;(!$||t&1)&&s!==(s=e[0].name+"")&&G(_,s),(!$||t&1)&&F!==(F=e[0].name+"")&&G(U,F);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -30,7 +30,7 @@ import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n
...
final result = await pb.collection('${(ce=e[0])==null?void 0:ce.name}').listAuthMethods();
`),P.$set(c),(!$||t&1)&&y!==(y=e[0].name+"")&&G(E,y),t&6&&(z=e[2],w=re(w,t,oe,1,e,z,ee,O,we,fe,null,de)),t&6&&(N=e[2],ve(),p=re(p,t,se,1,e,N,le,T,Ce,he,null,ue),Pe())},i(e){if(!$){L(P.$$.fragment,e);for(let t=0;t<N.length;t+=1)L(p[t]);$=!0}},o(e){Y(P.$$.fragment,e);for(let t=0;t<p.length;t+=1)Y(p[t]);$=!1},d(e){e&&m(l),e&&m(i),e&&m(u),e&&m(q),pe(P,e),e&&m(D),e&&m(j),e&&m(W),e&&m(M),e&&m(I),e&&m(B),e&&m(J),e&&m(S);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<p.length;t+=1)p[t].d()}}}function Te(a,l,o){let s,{collection:_=new Me}=l,f=200,i=[];const u=d=>o(1,f=d.code);return a.$$set=d=>{"collection"in d&&o(0,_=d.collection)},o(3,s=Se.getApiExampleUrl($e.baseUrl)),o(2,i=[{code:200,body:`
`),P.$set(c),(!$||t&1)&&y!==(y=e[0].name+"")&&G(E,y),t&6&&(z=e[2],b=re(b,t,oe,1,e,z,ee,O,we,fe,null,de)),t&6&&(N=e[2],ve(),p=re(p,t,se,1,e,N,le,T,Ce,he,null,ue),Pe())},i(e){if(!$){L(P.$$.fragment,e);for(let t=0;t<N.length;t+=1)L(p[t]);$=!0}},o(e){Y(P.$$.fragment,e);for(let t=0;t<p.length;t+=1)Y(p[t]);$=!1},d(e){e&&m(l),e&&m(i),e&&m(u),e&&m(q),pe(P,e),e&&m(D),e&&m(j),e&&m(W),e&&m(M),e&&m(I),e&&m(B),e&&m(J),e&&m(S);for(let t=0;t<b.length;t+=1)b[t].d();for(let t=0;t<p.length;t+=1)p[t].d()}}}function Te(a,l,o){let s,{collection:_=new Me}=l,f=200,i=[];const u=d=>o(1,f=d.code);return a.$$set=d=>{"collection"in d&&o(0,_=d.collection)},o(3,s=Se.getApiExampleUrl($e.baseUrl)),o(2,i=[{code:200,body:`
{
"usernamePassword": true,
"emailPassword": true,
@@ -1,4 +1,4 @@
import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as c,h as o,m as ne,x as re,O as qe,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as d,d as ie,R as Ie,C as He,p as We,r as x,u as Ge}from"./index-7cc53b3b.js";import{S as Xe}from"./SdkTabs-855be3ab.js";function Ee(r,l,s){const n=r.slice();return n[5]=l[s],n}function Fe(r,l,s){const n=r.slice();return n[5]=l[s],n}function Le(r,l){let s,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){s=a("button"),m=k(n),_=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(g,w){c(g,s,w),o(s,m),o(s,_),i||(f=Ge(s,"click",v),i=!0)},p(g,w){l=g,w&4&&n!==(n=l[5].code+"")&&re(m,n),w&6&&x(s,"active",l[1]===l[5].code)},d(g){g&&d(s),i=!1,f()}}}function Ne(r,l){let s,n,m,_;return n=new Ve({props:{content:l[5].body}}),{key:r,first:null,c(){s=a("div"),ae(n.$$.fragment),m=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(i,f){c(i,s,f),ne(n,s,null),o(s,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&x(s,"active",l[1]===l[5].code)},i(i){_||(U(n.$$.fragment,i),_=!0)},o(i){j(n.$$.fragment,i),_=!1},d(i){i&&d(s),ie(n)}}}function Ye(r){var Be,Me;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,B,J,S,F,ce,L,M,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,P,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,O,se,R,q,$=[],Te=new Map,Ce,H,y=[],Re=new Map,A;g=new Xe({props:{js:`
import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as d,h as o,m as ne,x as re,O as qe,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as u,d as ie,R as Ie,C as He,p as We,r as x,u as Ge}from"./index-3d43ee7c.js";import{S as Xe}from"./SdkTabs-720afe62.js";function Ee(r,l,s){const n=r.slice();return n[5]=l[s],n}function Fe(r,l,s){const n=r.slice();return n[5]=l[s],n}function Le(r,l){let s,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){s=a("button"),m=k(n),_=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(g,w){d(g,s,w),o(s,m),o(s,_),i||(f=Ge(s,"click",v),i=!0)},p(g,w){l=g,w&4&&n!==(n=l[5].code+"")&&re(m,n),w&6&&x(s,"active",l[1]===l[5].code)},d(g){g&&u(s),i=!1,f()}}}function Ne(r,l){let s,n,m,_;return n=new Ve({props:{content:l[5].body}}),{key:r,first:null,c(){s=a("div"),ae(n.$$.fragment),m=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(i,f){d(i,s,f),ne(n,s,null),o(s,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&x(s,"active",l[1]===l[5].code)},i(i){_||(U(n.$$.fragment,i),_=!0)},o(i){j(n.$$.fragment,i),_=!1},d(i){i&&u(s),ie(n)}}}function Ye(r){var Be,Me;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,B,J,$,F,ce,L,M,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,P,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,O,se,R,q,S=[],Te=new Map,Ce,H,y=[],Re=new Map,A;g=new Xe({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${r[3]}');
@@ -24,10 +24,10 @@ import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
`}}),P=new Ve({props:{content:"?expand=relField1,relField2.subRelField"}});let z=r[2];const Pe=e=>e[5].code;for(let e=0;e<z.length;e+=1){let t=Fe(r,z,e),u=Pe(t);Te.set(u,$[e]=Le(u,t))}let E=r[2];const Ae=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=Ee(r,E,e),u=Ae(t);Re.set(u,y[e]=Ne(u,t))}return{c(){l=a("h3"),s=k("Auth refresh ("),m=k(n),_=k(")"),i=p(),f=a("div"),f.innerHTML=`<p>Returns a new auth response (token and record data) for an
`}}),P=new Ve({props:{content:"?expand=relField1,relField2.subRelField"}});let z=r[2];const Pe=e=>e[5].code;for(let e=0;e<z.length;e+=1){let t=Fe(r,z,e),c=Pe(t);Te.set(c,S[e]=Le(c,t))}let E=r[2];const Ae=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=Ee(r,E,e),c=Ae(t);Re.set(c,y[e]=Ne(c,t))}return{c(){l=a("h3"),s=k("Auth refresh ("),m=k(n),_=k(")"),i=p(),f=a("div"),f.innerHTML=`<p>Returns a new auth response (token and record data) for an
<strong>already authenticated record</strong>.</p>
<p><em>This method is usually called by users on page/screen reload to ensure that the previously stored
data in <code>pb.authStore</code> is still valid and up-to-date.</em></p>`,v=p(),ae(g.$$.fragment),w=p(),B=a("h6"),B.textContent="API details",J=p(),S=a("div"),F=a("strong"),F.textContent="POST",ce=p(),L=a("div"),M=a("p"),de=k("/api/collections/"),K=a("strong"),Q=k(N),ue=k("/auth-refresh"),pe=p(),V=a("p"),V.innerHTML="Requires record <code>Authorization:TOKEN</code> header",I=p(),D=a("div"),D.textContent="Query parameters",W=p(),T=a("table"),G=a("thead"),G.innerHTML=`<tr><th>Param</th>
data in <code>pb.authStore</code> is still valid and up-to-date.</em></p>`,v=p(),ae(g.$$.fragment),w=p(),B=a("h6"),B.textContent="API details",J=p(),$=a("div"),F=a("strong"),F.textContent="POST",ce=p(),L=a("div"),M=a("p"),de=k("/api/collections/"),K=a("strong"),Q=k(N),ue=k("/auth-refresh"),pe=p(),V=a("p"),V.innerHTML="Requires record <code>Authorization:TOKEN</code> header",I=p(),D=a("div"),D.textContent="Query parameters",W=p(),T=a("table"),G=a("thead"),G.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,fe=p(),X=a("tbody"),C=a("tr"),Y=a("td"),Y.textContent="expand",he=p(),Z=a("td"),Z.innerHTML='<span class="label">String</span>',be=p(),h=a("td"),me=k(`Auto expand record relations. Ex.:
`),ae(P.$$.fragment),_e=k(`
@@ -35,7 +35,7 @@ import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as
The expanded relations will be appended to the record under the
`),ee=a("code"),ee.textContent="expand",ge=k(" property (eg. "),te=a("code"),te.textContent='"expand": {"relField1": {...}, ...}',ye=k(`).
`),Se=a("br"),$e=k(`
Only the relations to which the request user has permissions to `),oe=a("strong"),oe.textContent="view",we=k(" will be expanded."),le=p(),O=a("div"),O.textContent="Responses",se=p(),R=a("div"),q=a("div");for(let e=0;e<$.length;e+=1)$[e].c();Ce=p(),H=a("div");for(let e=0;e<y.length;e+=1)y[e].c();b(l,"class","m-b-sm"),b(f,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(F,"class","label label-primary"),b(L,"class","content"),b(V,"class","txt-hint txt-sm txt-right"),b(S,"class","alert alert-success"),b(D,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(O,"class","section-title"),b(q,"class","tabs-header compact left"),b(H,"class","tabs-content"),b(R,"class","tabs")},m(e,t){c(e,l,t),o(l,s),o(l,m),o(l,_),c(e,i,t),c(e,f,t),c(e,v,t),ne(g,e,t),c(e,w,t),c(e,B,t),c(e,J,t),c(e,S,t),o(S,F),o(S,ce),o(S,L),o(L,M),o(M,de),o(M,K),o(K,Q),o(M,ue),o(S,pe),o(S,V),c(e,I,t),c(e,D,t),c(e,W,t),c(e,T,t),o(T,G),o(T,fe),o(T,X),o(X,C),o(C,Y),o(C,he),o(C,Z),o(C,be),o(C,h),o(h,me),ne(P,h,null),o(h,_e),o(h,ke),o(h,ve),o(h,ee),o(h,ge),o(h,te),o(h,ye),o(h,Se),o(h,$e),o(h,oe),o(h,we),c(e,le,t),c(e,O,t),c(e,se,t),c(e,R,t),o(R,q);for(let u=0;u<$.length;u+=1)$[u].m(q,null);o(R,Ce),o(R,H);for(let u=0;u<y.length;u+=1)y[u].m(H,null);A=!0},p(e,[t]){var De,Oe;(!A||t&1)&&n!==(n=e[0].name+"")&&re(m,n);const u={};t&9&&(u.js=`
Only the relations to which the request user has permissions to `),oe=a("strong"),oe.textContent="view",we=k(" will be expanded."),le=p(),O=a("div"),O.textContent="Responses",se=p(),R=a("div"),q=a("div");for(let e=0;e<S.length;e+=1)S[e].c();Ce=p(),H=a("div");for(let e=0;e<y.length;e+=1)y[e].c();b(l,"class","m-b-sm"),b(f,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(F,"class","label label-primary"),b(L,"class","content"),b(V,"class","txt-hint txt-sm txt-right"),b($,"class","alert alert-success"),b(D,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(O,"class","section-title"),b(q,"class","tabs-header compact left"),b(H,"class","tabs-content"),b(R,"class","tabs")},m(e,t){d(e,l,t),o(l,s),o(l,m),o(l,_),d(e,i,t),d(e,f,t),d(e,v,t),ne(g,e,t),d(e,w,t),d(e,B,t),d(e,J,t),d(e,$,t),o($,F),o($,ce),o($,L),o(L,M),o(M,de),o(M,K),o(K,Q),o(M,ue),o($,pe),o($,V),d(e,I,t),d(e,D,t),d(e,W,t),d(e,T,t),o(T,G),o(T,fe),o(T,X),o(X,C),o(C,Y),o(C,he),o(C,Z),o(C,be),o(C,h),o(h,me),ne(P,h,null),o(h,_e),o(h,ke),o(h,ve),o(h,ee),o(h,ge),o(h,te),o(h,ye),o(h,Se),o(h,$e),o(h,oe),o(h,we),d(e,le,t),d(e,O,t),d(e,se,t),d(e,R,t),o(R,q);for(let c=0;c<S.length;c+=1)S[c]&&S[c].m(q,null);o(R,Ce),o(R,H);for(let c=0;c<y.length;c+=1)y[c]&&y[c].m(H,null);A=!0},p(e,[t]){var De,Oe;(!A||t&1)&&n!==(n=e[0].name+"")&&re(m,n);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -48,7 +48,7 @@ import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
`),t&9&&(u.dart=`
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -61,7 +61,7 @@ import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as
print(pb.authStore.isValid);
print(pb.authStore.token);
print(pb.authStore.model.id);
`),g.$set(u),(!A||t&1)&&N!==(N=e[0].name+"")&&re(Q,N),t&6&&(z=e[2],$=qe($,t,Pe,1,e,z,Te,q,xe,Le,null,Fe)),t&6&&(E=e[2],Je(),y=qe(y,t,Ae,1,e,E,Re,H,Ke,Ne,null,Ee),Qe())},i(e){if(!A){U(g.$$.fragment,e),U(P.$$.fragment,e);for(let t=0;t<E.length;t+=1)U(y[t]);A=!0}},o(e){j(g.$$.fragment,e),j(P.$$.fragment,e);for(let t=0;t<y.length;t+=1)j(y[t]);A=!1},d(e){e&&d(l),e&&d(i),e&&d(f),e&&d(v),ie(g,e),e&&d(w),e&&d(B),e&&d(J),e&&d(S),e&&d(I),e&&d(D),e&&d(W),e&&d(T),ie(P),e&&d(le),e&&d(O),e&&d(se),e&&d(R);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<y.length;t+=1)y[t].d()}}}function Ze(r,l,s){let n,{collection:m=new Ie}=l,_=200,i=[];const f=v=>s(1,_=v.code);return r.$$set=v=>{"collection"in v&&s(0,m=v.collection)},r.$$.update=()=>{r.$$.dirty&1&&s(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:He.dummyCollectionRecord(m)},null,2)},{code:401,body:`
`),g.$set(c),(!A||t&1)&&N!==(N=e[0].name+"")&&re(Q,N),t&6&&(z=e[2],S=qe(S,t,Pe,1,e,z,Te,q,xe,Le,null,Fe)),t&6&&(E=e[2],Je(),y=qe(y,t,Ae,1,e,E,Re,H,Ke,Ne,null,Ee),Qe())},i(e){if(!A){U(g.$$.fragment,e),U(P.$$.fragment,e);for(let t=0;t<E.length;t+=1)U(y[t]);A=!0}},o(e){j(g.$$.fragment,e),j(P.$$.fragment,e);for(let t=0;t<y.length;t+=1)j(y[t]);A=!1},d(e){e&&u(l),e&&u(i),e&&u(f),e&&u(v),ie(g,e),e&&u(w),e&&u(B),e&&u(J),e&&u($),e&&u(I),e&&u(D),e&&u(W),e&&u(T),ie(P),e&&u(le),e&&u(O),e&&u(se),e&&u(R);for(let t=0;t<S.length;t+=1)S[t].d();for(let t=0;t<y.length;t+=1)y[t].d()}}}function Ze(r,l,s){let n,{collection:m=new Ie}=l,_=200,i=[];const f=v=>s(1,_=v.code);return r.$$set=v=>{"collection"in v&&s(0,m=v.collection)},r.$$.update=()=>{r.$$.dirty&1&&s(2,i=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:He.dummyCollectionRecord(m)},null,2)},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
@@ -1,4 +1,4 @@
import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,O as Ve,P as Ne,k as Qe,Q as ze,n as Ke,t as j,a as H,o as c,d as ue,R as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-7cc53b3b.js";import{S as Ze}from"./SdkTabs-855be3ab.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function xe(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,R){r(k,o,R),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,R){l=k,R&4&&n!==(n=l[5].code+"")&&de(m,n),R&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function Me(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,R,C,N,y,L,pe,x,D,he,Q,M=i[0].name+"",z,be,K,q,Y,I,G,P,X,O,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,Re,ye,Oe,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:`
import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,O as Ve,P as Ne,k as Qe,Q as ze,n as Ke,t as j,a as H,o as c,d as ue,R as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-3d43ee7c.js";import{S as Ze}from"./SdkTabs-720afe62.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function xe(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,R){r(k,o,R),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,R){l=k,R&4&&n!==(n=l[5].code+"")&&de(m,n),R&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function Me(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,R,C,N,y,L,pe,x,D,he,Q,M=i[0].name+"",z,be,K,q,Y,I,G,P,X,O,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,Re,ye,Oe,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}');
@@ -87,7 +87,7 @@ import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as
The expanded relations will be appended to the record under the
`),le=s("code"),le.textContent="expand",Se=v(" property (eg. "),oe=s("code"),oe.textContent='"expand": {"relField1": {...}, ...}',Re=v(`).
`),ye=s("br"),Oe=v(`
Only the relations to which the request user has permissions to `),se=s("strong"),se.textContent="view",$e=v(" will be expanded."),ne=p(),U=s("div"),U.textContent="Responses",ie=p(),A=s("div"),V=s("div");for(let e=0;e<S.length;e+=1)S[e].c();Ee=p(),B=s("div");for(let e=0;e<w.length;e+=1)w[e].c();h(l,"class","m-b-sm"),h(b,"class","content txt-lg m-b-sm"),h(C,"class","m-b-xs"),h(L,"class","label label-primary"),h(x,"class","content"),h(y,"class","alert alert-success"),h(q,"class","section-title"),h(I,"class","table-compact table-border m-b-base"),h(P,"class","section-title"),h(O,"class","table-compact table-border m-b-base"),h(U,"class","section-title"),h(V,"class","tabs-header compact left"),h(B,"class","tabs-content"),h(A,"class","tabs")},m(e,t){r(e,l,t),a(l,o),a(l,m),a(l,_),r(e,d,t),r(e,b,t),r(e,g,t),ce(k,e,t),r(e,R,t),r(e,C,t),r(e,N,t),r(e,y,t),a(y,L),a(y,pe),a(y,x),a(x,D),a(D,he),a(D,Q),a(Q,z),a(D,be),r(e,K,t),r(e,q,t),r(e,Y,t),r(e,I,t),r(e,G,t),r(e,P,t),r(e,X,t),r(e,O,t),a(O,Z),a(O,fe),a(O,ee),a(ee,$),a($,te),a($,me),a($,ae),a($,_e),a($,f),a(f,ve),ce(E,f,null),a(f,ge),a(f,ke),a(f,we),a(f,le),a(f,Se),a(f,oe),a(f,Re),a(f,ye),a(f,Oe),a(f,se),a(f,$e),r(e,ne,t),r(e,U,t),r(e,ie,t),r(e,A,t),a(A,V);for(let u=0;u<S.length;u+=1)S[u].m(V,null);a(A,Ee),a(A,B);for(let u=0;u<w.length;u+=1)w[u].m(B,null);T=!0},p(e,[t]){var Pe,Ue;(!T||t&1)&&n!==(n=e[0].name+"")&&de(m,n);const u={};t&9&&(u.js=`
Only the relations to which the request user has permissions to `),se=s("strong"),se.textContent="view",$e=v(" will be expanded."),ne=p(),U=s("div"),U.textContent="Responses",ie=p(),A=s("div"),V=s("div");for(let e=0;e<S.length;e+=1)S[e].c();Ee=p(),B=s("div");for(let e=0;e<w.length;e+=1)w[e].c();h(l,"class","m-b-sm"),h(b,"class","content txt-lg m-b-sm"),h(C,"class","m-b-xs"),h(L,"class","label label-primary"),h(x,"class","content"),h(y,"class","alert alert-success"),h(q,"class","section-title"),h(I,"class","table-compact table-border m-b-base"),h(P,"class","section-title"),h(O,"class","table-compact table-border m-b-base"),h(U,"class","section-title"),h(V,"class","tabs-header compact left"),h(B,"class","tabs-content"),h(A,"class","tabs")},m(e,t){r(e,l,t),a(l,o),a(l,m),a(l,_),r(e,d,t),r(e,b,t),r(e,g,t),ce(k,e,t),r(e,R,t),r(e,C,t),r(e,N,t),r(e,y,t),a(y,L),a(y,pe),a(y,x),a(x,D),a(D,he),a(D,Q),a(Q,z),a(D,be),r(e,K,t),r(e,q,t),r(e,Y,t),r(e,I,t),r(e,G,t),r(e,P,t),r(e,X,t),r(e,O,t),a(O,Z),a(O,fe),a(O,ee),a(ee,$),a($,te),a($,me),a($,ae),a($,_e),a($,f),a(f,ve),ce(E,f,null),a(f,ge),a(f,ke),a(f,we),a(f,le),a(f,Se),a(f,oe),a(f,Re),a(f,ye),a(f,Oe),a(f,se),a(f,$e),r(e,ne,t),r(e,U,t),r(e,ie,t),r(e,A,t),a(A,V);for(let u=0;u<S.length;u+=1)S[u]&&S[u].m(V,null);a(A,Ee),a(A,B);for(let u=0;u<w.length;u+=1)w[u]&&w[u].m(B,null);T=!0},p(e,[t]){var Pe,Ue;(!T||t&1)&&n!==(n=e[0].name+"")&&de(m,n);const u={};t&9&&(u.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -1,4 +1,4 @@
import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,O as ce,P as ye,k as ge,Q as Pe,n as Re,t as tt,a as et,o as c,d as Ut,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-7cc53b3b.js";import{S as Ae}from"./SdkTabs-855be3ab.js";function ue(n,e,l){const i=n.slice();return i[8]=e[l],i}function fe(n,e,l){const i=n.slice();return i[8]=e[l],i}function Te(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(n){let e;return{c(){e=f("username/email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function pe(n){let e;return{c(){e=s("strong"),e.textContent="username"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function be(n){let e;return{c(){e=f("or")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function me(n){let e;return{c(){e=s("strong"),e.textContent="email"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function he(n,e){let l,i=e[8].code+"",S,m,p,d;function _(){return e[7](e[8])}return{key:n,first:null,c(){l=s("button"),S=f(i),m=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m($,C){r($,l,C),o(l,S),o(l,m),p||(d=Oe(l,"click",_),p=!0)},p($,C){e=$,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&&lt(l,"active",e[3]===e[8].code)},d($){$&&c(l),p=!1,d()}}}function _e(n,e){let l,i,S,m;return i=new ke({props:{content:e[8].body}}),{key:n,first:null,c(){l=s("div"),Ot(i.$$.fragment),S=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(p,d){r(p,l,d),At(i,l,null),o(l,S),m=!0},p(p,d){e=p;const _={};d&16&&(_.content=e[8].body),i.$set(_),(!m||d&24)&&lt(l,"active",e[3]===e[8].code)},i(p){m||(tt(i.$$.fragment,p),m=!0)},o(p){et(i.$$.fragment,p),m=!1},d(p){p&&c(l),Ut(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Mt,ot,T,at,F,st,U,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,M,dt,Lt,V,D,ut,Bt,ft,Ht,g,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Qt,gt,Kt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,Q,A=[],xt=new Map,te,K,P=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Me;if(t[1])return Ue;if(t[2])return Te}let q=le(n),R=q&&q(n);T=new Ae({props:{js:`
import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,O as ce,P as ye,k as ge,Q as Pe,n as Re,t as tt,a as et,o as c,d as Ut,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-3d43ee7c.js";import{S as Ae}from"./SdkTabs-720afe62.js";function ue(n,e,l){const i=n.slice();return i[8]=e[l],i}function fe(n,e,l){const i=n.slice();return i[8]=e[l],i}function Te(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(n){let e;return{c(){e=f("username/email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function pe(n){let e;return{c(){e=s("strong"),e.textContent="username"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function be(n){let e;return{c(){e=f("or")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function me(n){let e;return{c(){e=s("strong"),e.textContent="email"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function he(n,e){let l,i=e[8].code+"",S,m,p,d;function _(){return e[7](e[8])}return{key:n,first:null,c(){l=s("button"),S=f(i),m=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m($,C){r($,l,C),o(l,S),o(l,m),p||(d=Oe(l,"click",_),p=!0)},p($,C){e=$,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&&lt(l,"active",e[3]===e[8].code)},d($){$&&c(l),p=!1,d()}}}function _e(n,e){let l,i,S,m;return i=new ke({props:{content:e[8].body}}),{key:n,first:null,c(){l=s("div"),Ot(i.$$.fragment),S=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(p,d){r(p,l,d),At(i,l,null),o(l,S),m=!0},p(p,d){e=p;const _={};d&16&&(_.content=e[8].body),i.$set(_),(!m||d&24)&&lt(l,"active",e[3]===e[8].code)},i(p){m||(tt(i.$$.fragment,p),m=!0)},o(p){et(i.$$.fragment,p),m=!1},d(p){p&&c(l),Ut(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Mt,ot,T,at,F,st,U,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,M,dt,Lt,V,D,ut,Bt,ft,Ht,P,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Qt,gt,Kt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,Q,A=[],xt=new Map,te,K,v=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Me;if(t[1])return Ue;if(t[2])return Te}let q=le(n),R=q&&q(n);T=new Ae({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[6]}');
@@ -36,13 +36,13 @@ import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as
// "logout" the last authenticated account
pb.authStore.clear();
`}});let v=n[1]&&pe(),w=n[1]&&n[2]&&be(),y=n[2]&&me();H=new ke({props:{content:"?expand=relField1,relField2.subRelField"}});let x=n[4];const oe=t=>t[8].code;for(let t=0;t<x.length;t+=1){let a=fe(n,x,t),b=oe(a);xt.set(b,A[t]=he(b,a))}let z=n[4];const ae=t=>t[8].code;for(let t=0;t<z.length;t+=1){let a=ue(n,z,t),b=ae(a);ee.set(b,P[t]=_e(b,a))}return{c(){e=s("h3"),l=f("Auth with password ("),S=f(i),m=f(")"),p=u(),d=s("div"),_=s("p"),$=f(`Returns new auth token and account data by a combination of
`}});let w=n[1]&&pe(),y=n[1]&&n[2]&&be(),g=n[2]&&me();H=new ke({props:{content:"?expand=relField1,relField2.subRelField"}});let x=n[4];const oe=t=>t[8].code;for(let t=0;t<x.length;t+=1){let a=fe(n,x,t),b=oe(a);xt.set(b,A[t]=he(b,a))}let z=n[4];const ae=t=>t[8].code;for(let t=0;t<z.length;t+=1){let a=ue(n,z,t),b=ae(a);ee.set(b,v[t]=_e(b,a))}return{c(){e=s("h3"),l=f("Auth with password ("),S=f(i),m=f(")"),p=u(),d=s("div"),_=s("p"),$=f(`Returns new auth token and account data by a combination of
`),C=s("strong"),R&&R.c(),O=f(`
and `),B=s("strong"),B.textContent="password",Mt=f("."),ot=u(),Ot(T.$$.fragment),at=u(),F=s("h6"),F.textContent="API details",st=u(),U=s("div"),G=s("strong"),G.textContent="POST",Dt=u(),X=s("div"),N=s("p"),Et=f("/api/collections/"),nt=s("strong"),it=f(Z),Wt=f("/auth-with-password"),rt=u(),I=s("div"),I.textContent="Body Parameters",ct=u(),M=s("table"),dt=s("thead"),dt.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Lt=u(),V=s("tbody"),D=s("tr"),ut=s("td"),ut.innerHTML=`<div class="inline-flex"><span class="label label-success">Required</span>
<span>identity</span></div>`,Bt=u(),ft=s("td"),ft.innerHTML='<span class="label">String</span>',Ht=u(),g=s("td"),Yt=f(`The
`),v&&v.c(),pt=u(),w&&w.c(),bt=u(),y&&y.c(),mt=f(`
<span>identity</span></div>`,Bt=u(),ft=s("td"),ft.innerHTML='<span class="label">String</span>',Ht=u(),P=s("td"),Yt=f(`The
`),w&&w.c(),pt=u(),y&&y.c(),bt=u(),g&&g.c(),mt=f(`
of the record to authenticate.`),qt=u(),ht=s("tr"),ht.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
@@ -54,7 +54,7 @@ import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as
The expanded relations will be appended to the record under the
`),gt=s("code"),gt.textContent="expand",Kt=f(" property (eg. "),Pt=s("code"),Pt.textContent='"expand": {"relField1": {...}, ...}',zt=f(`).
`),Gt=s("br"),Xt=f(`
Only the relations to which the request user has permissions to `),Rt=s("strong"),Rt.textContent="view",Zt=f(" will be expanded."),$t=u(),J=s("div"),J.textContent="Responses",Ct=u(),L=s("div"),Q=s("div");for(let t=0;t<A.length;t+=1)A[t].c();te=u(),K=s("div");for(let t=0;t<P.length;t+=1)P[t].c();h(e,"class","m-b-sm"),h(d,"class","content txt-lg m-b-sm"),h(F,"class","m-b-xs"),h(G,"class","label label-primary"),h(X,"class","content"),h(U,"class","alert alert-success"),h(I,"class","section-title"),h(M,"class","table-compact table-border m-b-base"),h(j,"class","section-title"),h(E,"class","table-compact table-border m-b-base"),h(J,"class","section-title"),h(Q,"class","tabs-header compact left"),h(K,"class","tabs-content"),h(L,"class","tabs")},m(t,a){r(t,e,a),o(e,l),o(e,S),o(e,m),r(t,p,a),r(t,d,a),o(d,_),o(_,$),o(_,C),R&&R.m(C,null),o(_,O),o(_,B),o(_,Mt),r(t,ot,a),At(T,t,a),r(t,at,a),r(t,F,a),r(t,st,a),r(t,U,a),o(U,G),o(U,Dt),o(U,X),o(X,N),o(N,Et),o(N,nt),o(nt,it),o(N,Wt),r(t,rt,a),r(t,I,a),r(t,ct,a),r(t,M,a),o(M,dt),o(M,Lt),o(M,V),o(V,D),o(D,ut),o(D,Bt),o(D,ft),o(D,Ht),o(D,g),o(g,Yt),v&&v.m(g,null),o(g,pt),w&&w.m(g,null),o(g,bt),y&&y.m(g,null),o(g,mt),o(V,qt),o(V,ht),r(t,_t,a),r(t,j,a),r(t,kt,a),r(t,E,a),o(E,St),o(E,Ft),o(E,vt),o(vt,W),o(W,wt),o(W,Nt),o(W,yt),o(W,It),o(W,k),o(k,Vt),At(H,k,null),o(k,jt),o(k,Jt),o(k,Qt),o(k,gt),o(k,Kt),o(k,Pt),o(k,zt),o(k,Gt),o(k,Xt),o(k,Rt),o(k,Zt),r(t,$t,a),r(t,J,a),r(t,Ct,a),r(t,L,a),o(L,Q);for(let b=0;b<A.length;b+=1)A[b].m(Q,null);o(L,te),o(L,K);for(let b=0;b<P.length;b+=1)P[b].m(K,null);Y=!0},p(t,[a]){var ie,re;(!Y||a&1)&&i!==(i=t[0].name+"")&&Tt(S,i),q!==(q=le(t))&&(R&&R.d(1),R=q&&q(t),R&&(R.c(),R.m(C,null)));const b={};a&97&&(b.js=`
Only the relations to which the request user has permissions to `),Rt=s("strong"),Rt.textContent="view",Zt=f(" will be expanded."),$t=u(),J=s("div"),J.textContent="Responses",Ct=u(),L=s("div"),Q=s("div");for(let t=0;t<A.length;t+=1)A[t].c();te=u(),K=s("div");for(let t=0;t<v.length;t+=1)v[t].c();h(e,"class","m-b-sm"),h(d,"class","content txt-lg m-b-sm"),h(F,"class","m-b-xs"),h(G,"class","label label-primary"),h(X,"class","content"),h(U,"class","alert alert-success"),h(I,"class","section-title"),h(M,"class","table-compact table-border m-b-base"),h(j,"class","section-title"),h(E,"class","table-compact table-border m-b-base"),h(J,"class","section-title"),h(Q,"class","tabs-header compact left"),h(K,"class","tabs-content"),h(L,"class","tabs")},m(t,a){r(t,e,a),o(e,l),o(e,S),o(e,m),r(t,p,a),r(t,d,a),o(d,_),o(_,$),o(_,C),R&&R.m(C,null),o(_,O),o(_,B),o(_,Mt),r(t,ot,a),At(T,t,a),r(t,at,a),r(t,F,a),r(t,st,a),r(t,U,a),o(U,G),o(U,Dt),o(U,X),o(X,N),o(N,Et),o(N,nt),o(nt,it),o(N,Wt),r(t,rt,a),r(t,I,a),r(t,ct,a),r(t,M,a),o(M,dt),o(M,Lt),o(M,V),o(V,D),o(D,ut),o(D,Bt),o(D,ft),o(D,Ht),o(D,P),o(P,Yt),w&&w.m(P,null),o(P,pt),y&&y.m(P,null),o(P,bt),g&&g.m(P,null),o(P,mt),o(V,qt),o(V,ht),r(t,_t,a),r(t,j,a),r(t,kt,a),r(t,E,a),o(E,St),o(E,Ft),o(E,vt),o(vt,W),o(W,wt),o(W,Nt),o(W,yt),o(W,It),o(W,k),o(k,Vt),At(H,k,null),o(k,jt),o(k,Jt),o(k,Qt),o(k,gt),o(k,Kt),o(k,Pt),o(k,zt),o(k,Gt),o(k,Xt),o(k,Rt),o(k,Zt),r(t,$t,a),r(t,J,a),r(t,Ct,a),r(t,L,a),o(L,Q);for(let b=0;b<A.length;b+=1)A[b]&&A[b].m(Q,null);o(L,te),o(L,K);for(let b=0;b<v.length;b+=1)v[b]&&v[b].m(K,null);Y=!0},p(t,[a]){var ie,re;(!Y||a&1)&&i!==(i=t[0].name+"")&&Tt(S,i),q!==(q=le(t))&&(R&&R.d(1),R=q&&q(t),R&&(R.c(),R.m(C,null)));const b={};a&97&&(b.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${t[6]}');
@@ -92,7 +92,7 @@ import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as
// "logout" the last authenticated account
pb.authStore.clear();
`),T.$set(b),(!Y||a&1)&&Z!==(Z=t[0].name+"")&&Tt(it,Z),t[1]?v||(v=pe(),v.c(),v.m(g,pt)):v&&(v.d(1),v=null),t[1]&&t[2]?w||(w=be(),w.c(),w.m(g,bt)):w&&(w.d(1),w=null),t[2]?y||(y=me(),y.c(),y.m(g,mt)):y&&(y.d(1),y=null),a&24&&(x=t[4],A=ce(A,a,oe,1,t,x,xt,Q,ye,he,null,fe)),a&24&&(z=t[4],ge(),P=ce(P,a,ae,1,t,z,ee,K,Pe,_e,null,ue),Re())},i(t){if(!Y){tt(T.$$.fragment,t),tt(H.$$.fragment,t);for(let a=0;a<z.length;a+=1)tt(P[a]);Y=!0}},o(t){et(T.$$.fragment,t),et(H.$$.fragment,t);for(let a=0;a<P.length;a+=1)et(P[a]);Y=!1},d(t){t&&c(e),t&&c(p),t&&c(d),R&&R.d(),t&&c(ot),Ut(T,t),t&&c(at),t&&c(F),t&&c(st),t&&c(U),t&&c(rt),t&&c(I),t&&c(ct),t&&c(M),v&&v.d(),w&&w.d(),y&&y.d(),t&&c(_t),t&&c(j),t&&c(kt),t&&c(E),Ut(H),t&&c($t),t&&c(J),t&&c(Ct),t&&c(L);for(let a=0;a<A.length;a+=1)A[a].d();for(let a=0;a<P.length;a+=1)P[a].d()}}}function Ee(n,e,l){let i,S,m,p,{collection:d=new $e}=e,_=200,$=[];const C=O=>l(3,_=O.code);return n.$$set=O=>{"collection"in O&&l(0,d=O.collection)},n.$$.update=()=>{var O,B;n.$$.dirty&1&&l(2,S=(O=d==null?void 0:d.options)==null?void 0:O.allowEmailAuth),n.$$.dirty&1&&l(1,m=(B=d==null?void 0:d.options)==null?void 0:B.allowUsernameAuth),n.$$.dirty&6&&l(5,p=m&&S?"YOUR_USERNAME_OR_EMAIL":m?"YOUR_USERNAME":"YOUR_EMAIL"),n.$$.dirty&1&&l(4,$=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:de.dummyCollectionRecord(d)},null,2)},{code:400,body:`
`),T.$set(b),(!Y||a&1)&&Z!==(Z=t[0].name+"")&&Tt(it,Z),t[1]?w||(w=pe(),w.c(),w.m(P,pt)):w&&(w.d(1),w=null),t[1]&&t[2]?y||(y=be(),y.c(),y.m(P,bt)):y&&(y.d(1),y=null),t[2]?g||(g=me(),g.c(),g.m(P,mt)):g&&(g.d(1),g=null),a&24&&(x=t[4],A=ce(A,a,oe,1,t,x,xt,Q,ye,he,null,fe)),a&24&&(z=t[4],ge(),v=ce(v,a,ae,1,t,z,ee,K,Pe,_e,null,ue),Re())},i(t){if(!Y){tt(T.$$.fragment,t),tt(H.$$.fragment,t);for(let a=0;a<z.length;a+=1)tt(v[a]);Y=!0}},o(t){et(T.$$.fragment,t),et(H.$$.fragment,t);for(let a=0;a<v.length;a+=1)et(v[a]);Y=!1},d(t){t&&c(e),t&&c(p),t&&c(d),R&&R.d(),t&&c(ot),Ut(T,t),t&&c(at),t&&c(F),t&&c(st),t&&c(U),t&&c(rt),t&&c(I),t&&c(ct),t&&c(M),w&&w.d(),y&&y.d(),g&&g.d(),t&&c(_t),t&&c(j),t&&c(kt),t&&c(E),Ut(H),t&&c($t),t&&c(J),t&&c(Ct),t&&c(L);for(let a=0;a<A.length;a+=1)A[a].d();for(let a=0;a<v.length;a+=1)v[a].d()}}}function Ee(n,e,l){let i,S,m,p,{collection:d=new $e}=e,_=200,$=[];const C=O=>l(3,_=O.code);return n.$$set=O=>{"collection"in O&&l(0,d=O.collection)},n.$$.update=()=>{var O,B;n.$$.dirty&1&&l(2,S=(O=d==null?void 0:d.options)==null?void 0:O.allowEmailAuth),n.$$.dirty&1&&l(1,m=(B=d==null?void 0:d.options)==null?void 0:B.allowUsernameAuth),n.$$.dirty&6&&l(5,p=m&&S?"YOUR_USERNAME_OR_EMAIL":m?"YOUR_USERNAME":"YOUR_EMAIL"),n.$$.dirty&1&&l(4,$=[{code:200,body:JSON.stringify({token:"JWT_TOKEN",record:de.dummyCollectionRecord(d)},null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
+14
View File
@@ -0,0 +1,14 @@
import{S as $t,i as gt,s as Pt,e as mt,f as bt,T as E,g as Xt,y as jO,o as Zt,I as xt,J as yt,K as kt,L as vt,C as Yt,M as wt}from"./index-3d43ee7c.js";import{P as Tt,N as Wt,u as Vt,D as Ut,v as vO,T as D,I as YO,w as iO,x as l,y as _t,L as sO,z as nO,A as R,B as lO,F as ke,G as oO,H as _,J as ve,K as Ye,M as we,E as w,O as z,Q as Ct,R as qt,U as Te,V as b,W as jt,X as Gt,a as C,h as Rt,b as zt,c as At,d as It,e as Et,s as Nt,t as Bt,f as Dt,g as Lt,r as Jt,i as Mt,k as Ht,j as Ft,l as Kt,m as Oa,n as ea,o as ta,p as aa,q as GO,C as N}from"./index-20adcf24.js";class H{constructor(O,a,t,r,i,s,n,o,Q,p=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=i,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new H(O,[],a,t,t,0,[],0,r?new RO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:i}=this.p,s=i.dynamicPrecedence(r);if(s&&(this.score+=s),t==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,4,!0),this.reduceContext(r,this.reducePos);return}let n=this.stack.length-(t-1)*3-(O&262144?6:0),o=n?this.stack[n-2]:this.p.ranges[0].from,Q=this.reducePos-o;Q>=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSize<Q&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=o,this.p.lastBigReductionSize=Q));let p=n?this.stack[n-1]:0,c=this.bufferBase+this.buffer.length-p;if(r<i.minRepeatTerm||O&131072){let u=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,o,u,c+4,!0)}if(O&262144)this.state=this.stack[n];else{let u=this.stack[n-3];this.state=i.getGoto(u,r,!0)}for(;this.stack.length>n;)this.stack.pop();this.reduceContext(r,o)}storeNode(O,a,t,r=4,i=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,n=this.buffer.length;if(n==0&&s.parent&&(n=s.bufferBase-s.parent.bufferBase,s=s.parent),n>0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(a==t)return;if(s.buffer[n-2]>=a){s.buffer[n-2]=t;return}}}if(!i||this.pos==t)this.buffer.push(O,a,t,r);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>t;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=r}}shift(O,a,t){let r=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let i=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(i,1)||(this.reducePos=t)),this.pushState(i,r),this.shiftContext(a,r),a<=s.maxNode&&this.buffer.push(a,r,t,4)}}apply(O,a,t){O&65536?this.reduce(O):this.shift(O,a,t)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new H(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new ra(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>4<<1||this.stack.length>=120){let r=[];for(let i=0,s;i<a.length;i+=2)(s=a[i+1])!=this.state&&this.p.parser.hasAction(s,O)&&r.push(a[i],s);if(this.stack.length<120)for(let i=0;r.length<4<<1&&i<a.length;i+=2){let s=a[i+1];r.some((n,o)=>o&1&&n==s)||r.push(a[i],s)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let i=a[r+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(a[r],this.pos),s.score-=200,t.push(s)}return t}forceReduce(){let O=this.p.parser.stateSlot(this.state,5);if(!(O&65536))return!1;let{parser:a}=this.p;if(!a.validAction(this.state,O)){let t=O>>19,Line truncated
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),b("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),b(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),b(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),b('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),b('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],he=new ve,Je=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function q(e){return(O,a)=>{let t=O.node.getChild("VariableDefinition");return t&&a(t,e),!0}}const Rr=["FunctionDeclaration"],zr={FunctionDeclaration:q("function"),ClassDeclaration:q("class"),ClassExpression:()=>!0,EnumDeclaration:q("constant"),TypeAliasDeclaration:q("type"),NamespaceDeclaration:q("namespace"),VariableDefinition(e,O){e.matchContext(Rr)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function Me(e,O){let a=he.get(O);if(a)return a;let t=[],r=!0;function i(s,n){let o=e.sliceString(s.from,s.to);t.push({label:o,type:n})}return O.cursor(YO.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let n=zr[s.name];if(n&&n(s,i)||Je.has(s.name))return!1}else if(s.to-s.from>8192){for(let n of Me(e,s.node))t.push(n);return!1}}),he.set(O,t),t}const pe=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,He=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function Ar(e){let O=_(e.state).resolveInner(e.pos,-1);if(He.indexOf(O.name)>-1)return null;let a=O.name=="VariableName"||O.to-O.from<20&&pe.test(e.state.sliceDoc(O.from,O.to));if(!a&&!e.explicit)return null;let t=[];for(let r=O;r;r=r.parent)Je.has(r.name)&&(t=t.concat(Me(e.state.doc,r)));return{options:t,from:a?O.from:e.pos,validFor:pe}}const y=sO.define({name:"javascript",parser:jr.configure({props:[nO.add({IfStatement:R({except:/^\s*({|else\b)/}),TryStatement:R({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Ct,SwitchBody:e=>{let O=e.textAfter,a=/^\s*\}/.test(O),t=/^\s*(case|default)\b/.test(O);return e.baseIndent+(a?0:t?1:2)*e.unit},Block:qt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":R({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),lO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":ke,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Fe={test:e=>/^JSX/.test(e.name),facet:jt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ke=y.configure({dialect:"ts"},"typescript"),Ot=y.configure({dialect:"jsx",props:[Te.add(e=>e.isTop?[Fe]:void 0)]}),et=y.configure({dialect:"jsx ts",props:[Te.add(e=>e.isTop?[Fe]:void 0)]},"typescript"),Ir="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(e=>({label:e,type:"keyword"}));function tt(e={}){let O=e.jsx?e.typescript?et:Ot:e.typescript?Ke:y;return new oO(O,[y.data.of({autocomplete:Ye(He,we(Gr.concat(Ir)))}),y.data.of({autocomplete:Ar}),e.jsx?Br:[]])}function Er(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(!e.parent)return null;e=e.parent}}function ue(e,O,a=e.length){for(let t=O==null?void 0:O.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return e.sliceString(t.from,Math.min(t.to,a));return""}const Nr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Br=w.inputHandler.of((e,O,a,t)=>{if((Nr?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!y.isActiveAt(e.state,O,-1))return!1;let{state:r}=e,i=r.changeByRange(s=>{var n,o;let{head:Q}=s,p=_(r).resolveInner(Q,-1),c;if(p.name=="JSXStartTag"&&(p=p.parent),t==">"&&p.name=="JSXFragmentTag")return{range:z.cursor(Q+1),changes:{from:Q,insert:"></>"}};if(t=="/"&&p.name=="JSXFragmentTag"){let u=p.parent,h=u==null?void 0:u.parent;if(u.from==Q-1&&((n=h.lastChild)===null||n===void 0?void 0:n.name)!="JSXEndTag"&&(c=ue(r.doc,h==null?void 0:h.firstChild,Q))){let S=`/${c}>`;return{range:z.cursor(Q+S.length),changes:{from:Q,insert:S}}}}else if(t==">"){let u=Er(p);if(u&&((o=u.lastChild)===null||o===void 0?void 0:o.name)!="JSXEndTag"&&r.sliceDoc(Q,Q+2)!="</"&&(c=ue(r.doc,u,Q)))return{range:z.cursor(Q+1),changes:{from:Q,insert:`></${c}>`}}}return{range:s}});return i.changes.empty?!1:(e.dispatch(i,{userEvent:"input.type",scrollIntoView:!0}),!0)}),j=["_blank","_self","_top","_parent"],$O=["ascii","utf-8","utf-16","latin1","latin1"],gO=["get","post","put","delete" Line truncated
`;function ht(e,O,a){let t=Object.create(null);t.true=t.false=ai,t.null=t.unknown=ri;for(let r of e.split(" "))r&&(t[r]=ot);for(let r of O.split(" "))r&&(t[r]=Qt);for(let r of(a||"").split(" "))r&&(t[r]=$i);return t}const bi="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",Xi="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",yO={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ht(Xi,bi)};function Zi(e,O,a,t){let r={};for(let i in yO)r[i]=(e.hasOwnProperty(i)?e:yO)[i];return O&&(r.words=ht(O,a||"",t)),r}function pt(e){return new Z(O=>{var a;let{next:t}=O;if(O.advance(),W(t,Ze)){for(;W(O.next,Ze);)O.advance();O.acceptToken(ei)}else if(t==36&&O.next==36&&e.doubleDollarQuotedStrings)Pi(O),O.acceptToken(B);else if(t==39||t==34&&e.doubleQuotedStrings)Y(O,t,e.backslashEscapes),O.acceptToken(B);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)Xe(O),O.acceptToken($e);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))Xe(O),O.acceptToken($e);else if(t==47&&O.next==42){O.advance();for(let r=-1,i=1;!(O.next<0);)if(O.advance(),r==42&&O.next==47){if(i--,!i){O.advance();break}r=-1}else r==47&&O.next==42?(i++,r=-1):r=O.next;O.acceptToken(ti)}else if((t==101||t==69)&&O.next==39)O.advance(),Y(O,39,!0);else if((t==110||t==78)&&O.next==39&&e.charSetCasts)O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(B);else if(t==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(B);break}if(!xO(O.next))break;O.advance()}else if(t==40)O.acceptToken(ii);else if(t==41)O.acceptToken(si);else if(t==123)O.acceptToken(ni);else if(t==125)O.acceptToken(li);else if(t==91)O.acceptToken(oi);else if(t==93)O.acceptToken(Qi);else if(t==59)O.acceptToken(ci);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),me(O),O.acceptToken(Pe);else if((t==98||t==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(Y(O,r,e.backslashEscapes),O.acceptToken(di)):(me(O,r),O.acceptToken(Pe))}else if(t==48&&(O.next==120||O.next==88)||(t==120||t==88)&&O.next==39){let r=O.next==39;for(O.advance();gi(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(mO)}else if(t==46&&O.next>=48&&O.next<=57)be(O,!0),O.acceptToken(mO);else if(t==46)O.acceptToken(hi);else if(t>=48&&t<=57)be(O,!1),O.acceptToken(mO);else if(W(t,e.operatorChars)){for(;W(O.next,e.operatorChars);)O.advance();O.acceptToken(pi)}else if(W(t,e.specialVar))O.next==t&&O.advance(),mi(O),O.acceptToken(fi);else if(W(t,e.identifierQuotes))Y(O,t,!1),O.acceptToken(Si);else if(t==58||t==44)O.acceptToken(ui);else if(xO(t)){let r=ct(O,String.fromCharCode(t));O.acceptToken(O.next==46?ge:(a=e.words[r.toLowerCase()])!==null&&a!==void 0?a:ge)}})}const ut=pt(yO),xi=T.deserialize({version:1 Line truncated
-14
View File
@@ -1,14 +0,0 @@
import{S as ut,i as St,s as ft,e as dt,f as $t,T as I,g as gt,y as jO,o as Pt,I as mt,J as bt,K as Xt,L as Zt,C as xt,M as yt}from"./index-7cc53b3b.js";import{P as kt,N as vt,u as Yt,D as wt,v as vO,T as B,I as xe,w as rO,x as l,y as Tt,L as iO,z as sO,A as R,B as nO,F as ye,G as lO,H as _,J as ke,K as ve,E as w,M as z,O as Wt,Q as Vt,R as Ye,U as b,V as Ut,W as _t,X as Ct,a as C,h as qt,b as jt,c as Gt,d as Rt,e as zt,s as At,f as It,g as Et,i as Nt,r as Bt,j as Dt,k as Lt,l as Jt,m as Mt,n as Ht,o as Ft,p as Kt,q as Oa,t as GO,C as E}from"./index-a6ccb683.js";class M{constructor(O,a,t,r,i,s,n,o,Q,p=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=i,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new M(O,[],a,t,t,0,[],0,r?new RO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:i}=this.p,s=i.dynamicPrecedence(r);if(s&&(this.score+=s),t==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,4,!0),this.reduceContext(r,this.reducePos);return}let n=this.stack.length-(t-1)*3-(O&262144?6:0),o=n?this.stack[n-2]:this.p.ranges[0].from,Q=this.reducePos-o;Q>=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSize<Q&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=o,this.p.lastBigReductionSize=Q));let p=n?this.stack[n-1]:0,c=this.bufferBase+this.buffer.length-p;if(r<i.minRepeatTerm||O&131072){let u=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,o,u,c+4,!0)}if(O&262144)this.state=this.stack[n];else{let u=this.stack[n-3];this.state=i.getGoto(u,r,!0)}for(;this.stack.length>n;)this.stack.pop();this.reduceContext(r,o)}storeNode(O,a,t,r=4,i=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,n=this.buffer.length;if(n==0&&s.parent&&(n=s.bufferBase-s.parent.bufferBase,s=s.parent),n>0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(a==t)return;if(s.buffer[n-2]>=a){s.buffer[n-2]=t;return}}}if(!i||this.pos==t)this.buffer.push(O,a,t,r);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>t;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=r}}shift(O,a,t){let r=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let i=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(i,1)||(this.reducePos=t)),this.pushState(i,r),this.shiftContext(a,r),a<=s.maxNode&&this.buffer.push(a,r,t,4)}}apply(O,a,t){O&65536?this.reduce(O):this.shift(O,a,t)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new M(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new ea(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>4<<1||this.stack.length>=120){let r=[];for(let i=0,s;i<a.length;i+=2)(s=a[i+1])!=this.state&&this.p.parser.hasAction(s,O)&&r.push(a[i],s);if(this.stack.length<120)for(let i=0;r.length<4<<1&&i<a.length;i+=2){let s=a[i+1];r.some((n,o)=>o&1&&n==s)||r.push(a[i],s)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let i=a[r+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(a[r],this.pos),s.score-=200,t.push(s)}return t}forceReduce(){let O=this.p.parser.stateSlot(this.state,5);if(!(O&65536))return!1;let{parser:a}=this.p;if(!a.validAction(this.state,O)){let t=O>>19,Line truncated
\${}
} catch (\${error}) {
\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),b("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),b(`if (\${}) {
\${}
} else {
\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),b(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{label:"class",detail:"definition",type:"keyword"}),b('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),b('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ce=new _t,Be=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function q(e){return(O,a)=>{let t=O.node.getChild("VariableDefinition");return t&&a(t,e),!0}}const Vr=["FunctionDeclaration"],Ur={FunctionDeclaration:q("function"),ClassDeclaration:q("class"),ClassExpression:()=>!0,EnumDeclaration:q("constant"),TypeAliasDeclaration:q("type"),NamespaceDeclaration:q("namespace"),VariableDefinition(e,O){e.matchContext(Vr)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function De(e,O){let a=ce.get(O);if(a)return a;let t=[],r=!0;function i(s,n){let o=e.sliceString(s.from,s.to);t.push({label:o,type:n})}return O.cursor(xe.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let n=Ur[s.name];if(n&&n(s,i)||Be.has(s.name))return!1}else if(s.to-s.from>8192){for(let n of De(e,s.node))t.push(n);return!1}}),ce.set(O,t),t}const he=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Le=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function _r(e){let O=_(e.state).resolveInner(e.pos,-1);if(Le.indexOf(O.name)>-1)return null;let a=O.name=="VariableName"||O.to-O.from<20&&he.test(e.state.sliceDoc(O.from,O.to));if(!a&&!e.explicit)return null;let t=[];for(let r=O;r;r=r.parent)Be.has(r.name)&&(t=t.concat(De(e.state.doc,r)));return{options:t,from:a?O.from:e.pos,validFor:he}}const y=iO.define({name:"javascript",parser:Tr.configure({props:[sO.add({IfStatement:R({except:/^\s*({|else\b)/}),TryStatement:R({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Wt,SwitchBody:e=>{let O=e.textAfter,a=/^\s*\}/.test(O),t=/^\s*(case|default)\b/.test(O);return e.baseIndent+(a?0:t?1:2)*e.unit},Block:Vt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":R({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),nO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":ye,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Je={test:e=>/^JSX/.test(e.name),facet:Ut({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Me=y.configure({dialect:"ts"},"typescript"),He=y.configure({dialect:"jsx",props:[Ye.add(e=>e.isTop?[Je]:void 0)]}),Fe=y.configure({dialect:"jsx ts",props:[Ye.add(e=>e.isTop?[Je]:void 0)]},"typescript"),Cr="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(e=>({label:e,type:"keyword"}));function Ke(e={}){let O=e.jsx?e.typescript?Fe:He:e.typescript?Me:y;return new lO(O,[y.data.of({autocomplete:ke(Le,ve(Wr.concat(Cr)))}),y.data.of({autocomplete:_r}),e.jsx?Gr:[]])}function qr(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(!e.parent)return null;e=e.parent}}function pe(e,O,a=e.length){for(let t=O==null?void 0:O.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return e.sliceString(t.from,Math.min(t.to,a));return""}const jr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Gr=w.inputHandler.of((e,O,a,t)=>{if((jr?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!y.isActiveAt(e.state,O,-1))return!1;let{state:r}=e,i=r.changeByRange(s=>{var n,o;let{head:Q}=s,p=_(r).resolveInner(Q,-1),c;if(p.name=="JSXStartTag"&&(p=p.parent),t==">"&&p.name=="JSXFragmentTag")return{range:z.cursor(Q+1),changes:{from:Q,insert:"></>"}};if(t=="/"&&p.name=="JSXFragmentTag"){let u=p.parent,h=u==null?void 0:u.parent;if(u.from==Q-1&&((n=h.lastChild)===null||n===void 0?void 0:n.name)!="JSXEndTag"&&(c=pe(r.doc,h==null?void 0:h.firstChild,Q))){let f=`/${c}>`;return{range:z.cursor(Q+f.length),changes:{from:Q,insert:f}}}}else if(t==">"){let u=qr(p);if(u&&((o=u.lastChild)===null||o===void 0?void 0:o.name)!="JSXEndTag"&&r.sliceDoc(Q,Q+2)!="</"&&(c=pe(r.doc,u,Q)))return{range:z.cursor(Q+1),changes:{from:Q,insert:`></${c}>`}}}return{range:s}});return i.changes.empty?!1:(e.dispatch(i,{userEvent:"input.type",scrollIntoView:!0}),!0)}),j=["_blank","_self","_top","_parent"],$O=["ascii","utf-8","utf-16","latin1","latin1"],gO=["get","post","put","delete" Line truncated
`;function ot(e,O,a){let t=Object.create(null);t.true=t.false=Mr,t.null=t.unknown=Hr;for(let r of e.split(" "))r&&(t[r]=st);for(let r of O.split(" "))r&&(t[r]=nt);for(let r of(a||"").split(" "))r&&(t[r]=ci);return t}const Si="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",fi="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",yO={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ot(fi,Si)};function di(e,O,a,t){let r={};for(let i in yO)r[i]=(e.hasOwnProperty(i)?e:yO)[i];return O&&(r.words=ot(O,a||"",t)),r}function Qt(e){return new Z(O=>{var a;let{next:t}=O;if(O.advance(),W(t,Xe)){for(;W(O.next,Xe);)O.advance();O.acceptToken(Lr)}else if(t==36&&O.next==36&&e.doubleDollarQuotedStrings)pi(O),O.acceptToken(N);else if(t==39||t==34&&e.doubleQuotedStrings)Y(O,t,e.backslashEscapes),O.acceptToken(N);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)be(O),O.acceptToken(de);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))be(O),O.acceptToken(de);else if(t==47&&O.next==42){O.advance();for(let r=-1,i=1;!(O.next<0);)if(O.advance(),r==42&&O.next==47){if(i--,!i){O.advance();break}r=-1}else r==47&&O.next==42?(i++,r=-1):r=O.next;O.acceptToken(Jr)}else if((t==101||t==69)&&O.next==39)O.advance(),Y(O,39,!0);else if((t==110||t==78)&&O.next==39&&e.charSetCasts)O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(N);else if(t==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(N);break}if(!xO(O.next))break;O.advance()}else if(t==40)O.acceptToken(Fr);else if(t==41)O.acceptToken(Kr);else if(t==123)O.acceptToken(Oi);else if(t==125)O.acceptToken(ei);else if(t==91)O.acceptToken(ti);else if(t==93)O.acceptToken(ai);else if(t==59)O.acceptToken(ri);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),Pe(O),O.acceptToken(ge);else if((t==98||t==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(Y(O,r,e.backslashEscapes),O.acceptToken(Qi)):(Pe(O,r),O.acceptToken(ge))}else if(t==48&&(O.next==120||O.next==88)||(t==120||t==88)&&O.next==39){let r=O.next==39;for(O.advance();hi(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(mO)}else if(t==46&&O.next>=48&&O.next<=57)me(O,!0),O.acceptToken(mO);else if(t==46)O.acceptToken(ii);else if(t>=48&&t<=57)me(O,!1),O.acceptToken(mO);else if(W(t,e.operatorChars)){for(;W(O.next,e.operatorChars);)O.advance();O.acceptToken(si)}else if(W(t,e.specialVar))O.next==t&&O.advance(),ui(O),O.acceptToken(li);else if(W(t,e.identifierQuotes))Y(O,t,!1),O.acceptToken(oi);else if(t==58||t==44)O.acceptToken(ni);else if(xO(t)){let r=lt(O,String.fromCharCode(t));O.acceptToken(O.next==46?$e:(a=e.words[r.toLowerCase()])!==null&&a!==void 0?a:$e)}})}const ct=Qt(yO),$i=T.deserialize({version:1 Line truncated
@@ -1,4 +1,4 @@
import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n,m as ve,x as Y,O as pe,P as Pe,k as Se,Q as Oe,n as Re,t as Z,a as x,o as f,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,N as qe}from"./index-7cc53b3b.js";import{S as Ae}from"./SdkTabs-855be3ab.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){r(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&f(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){r(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,R,L,P,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,g=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:`
import{S as Ce,i as $e,s as we,e as r,w as g,b as h,c as he,f as b,g as f,h as n,m as ve,x as Y,O as pe,P as Pe,k as Se,Q as Oe,n as Re,t as Z,a as x,o as m,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,N as qe}from"./index-3d43ee7c.js";import{S as Ae}from"./SdkTabs-720afe62.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){f(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){f(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&m(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,R,L,P,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,v=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');
@@ -20,7 +20,7 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
'TOKEN',
'YOUR_PASSWORD',
);
`}});let W=o[2];const ie=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=be(o,W,e),m=ie(t);ae.set(m,g[e]=_e(m,t))}let U=o[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=ue(o,U,e),m=ce(t);ne.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=v("Confirm email change ("),_=v(a),u=v(")"),i=h(),d=c("div"),p=c("p"),C=v("Confirms "),$=c("strong"),H=v(D),ee=v(" email change request."),F=h(),he(w.$$.fragment),I=h(),R=c("h6"),R.textContent="API details",L=h(),P=c("div"),N=c("strong"),N.textContent="POST",te=h(),K=c("div"),T=c("p"),le=v("/api/collections/"),Q=c("strong"),z=v(M),se=v("/confirm-email-change"),G=h(),E=c("div"),E.textContent="Body Parameters",J=h(),y=c("table"),y.innerHTML=`<thead><tr><th>Param</th>
`}});let W=o[2];const ie=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=be(o,W,e),c=ie(t);ae.set(c,v[e]=_e(c,t))}let U=o[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=ue(o,U,e),c=ce(t);ne.set(c,k[e]=ke(c,t))}return{c(){l=r("h3"),s=g("Confirm email change ("),_=g(a),u=g(")"),i=h(),d=r("div"),p=r("p"),C=g("Confirms "),$=r("strong"),H=g(D),ee=g(" email change request."),F=h(),he(w.$$.fragment),I=h(),R=r("h6"),R.textContent="API details",L=h(),P=r("div"),N=r("strong"),N.textContent="POST",te=h(),K=r("div"),T=r("p"),le=g("/api/collections/"),Q=r("strong"),z=g(M),se=g("/confirm-email-change"),G=h(),E=r("div"),E.textContent="Body Parameters",J=h(),y=r("table"),y.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
@@ -30,7 +30,7 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
<tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>The account password to confirm the email change.</td></tr></tbody>`,V=h(),B=c("div"),B.textContent="Responses",X=h(),S=c("div"),q=c("div");for(let e=0;e<g.length;e+=1)g[e].c();oe=h(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(d,"class","content txt-lg m-b-sm"),b(R,"class","m-b-xs"),b(N,"class","label label-primary"),b(K,"class","content"),b(P,"class","alert alert-success"),b(E,"class","section-title"),b(y,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(q,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(S,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,u),r(e,i,t),r(e,d,t),n(d,p),n(p,C),n(p,$),n($,H),n(p,ee),r(e,F,t),ve(w,e,t),r(e,I,t),r(e,R,t),r(e,L,t),r(e,P,t),n(P,N),n(P,te),n(P,K),n(K,T),n(T,le),n(T,Q),n(Q,z),n(T,se),r(e,G,t),r(e,E,t),r(e,J,t),r(e,y,t),r(e,V,t),r(e,B,t),r(e,X,t),r(e,S,t),n(S,q);for(let m=0;m<g.length;m+=1)g[m].m(q,null);n(S,oe),n(S,A);for(let m=0;m<k.length;m+=1)k[m].m(A,null);O=!0},p(e,[t]){var me,de;(!O||t&1)&&a!==(a=e[0].name+"")&&Y(_,a),(!O||t&1)&&D!==(D=e[0].name+"")&&Y(H,D);const m={};t&9&&(m.js=`
<td>The account password to confirm the email change.</td></tr></tbody>`,V=h(),B=r("div"),B.textContent="Responses",X=h(),S=r("div"),q=r("div");for(let e=0;e<v.length;e+=1)v[e].c();oe=h(),A=r("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(d,"class","content txt-lg m-b-sm"),b(R,"class","m-b-xs"),b(N,"class","label label-primary"),b(K,"class","content"),b(P,"class","alert alert-success"),b(E,"class","section-title"),b(y,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(q,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(S,"class","tabs")},m(e,t){f(e,l,t),n(l,s),n(l,_),n(l,u),f(e,i,t),f(e,d,t),n(d,p),n(p,C),n(p,$),n($,H),n(p,ee),f(e,F,t),ve(w,e,t),f(e,I,t),f(e,R,t),f(e,L,t),f(e,P,t),n(P,N),n(P,te),n(P,K),n(K,T),n(T,le),n(T,Q),n(Q,z),n(T,se),f(e,G,t),f(e,E,t),f(e,J,t),f(e,y,t),f(e,V,t),f(e,B,t),f(e,X,t),f(e,S,t),n(S,q);for(let c=0;c<v.length;c+=1)v[c]&&v[c].m(q,null);n(S,oe),n(S,A);for(let c=0;c<k.length;c+=1)k[c]&&k[c].m(A,null);O=!0},p(e,[t]){var me,de;(!O||t&1)&&a!==(a=e[0].name+"")&&Y(_,a),(!O||t&1)&&D!==(D=e[0].name+"")&&Y(H,D);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -41,7 +41,7 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
'TOKEN',
'YOUR_PASSWORD',
);
`),t&9&&(m.dart=`
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -52,7 +52,7 @@ import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n
'TOKEN',
'YOUR_PASSWORD',
);
`),w.$set(m),(!O||t&1)&&M!==(M=e[0].name+"")&&Y(z,M),t&6&&(W=e[2],g=pe(g,t,ie,1,e,W,ae,q,Pe,_e,null,be)),t&6&&(U=e[2],Se(),k=pe(k,t,ce,1,e,U,ne,A,Oe,ke,null,ue),Re())},i(e){if(!O){Z(w.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);O=!0}},o(e){x(w.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);O=!1},d(e){e&&f(l),e&&f(i),e&&f(d),e&&f(F),ge(w,e),e&&f(I),e&&f(R),e&&f(L),e&&f(P),e&&f(G),e&&f(E),e&&f(J),e&&f(y),e&&f(V),e&&f(B),e&&f(X),e&&f(S);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(o,l,s){let a,{collection:_=new Te}=l,u=204,i=[];const d=p=>s(1,u=p.code);return o.$$set=p=>{"collection"in p&&s(0,_=p.collection)},s(3,a=Ee.getApiExampleUrl(ye.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
`),w.$set(c),(!O||t&1)&&M!==(M=e[0].name+"")&&Y(z,M),t&6&&(W=e[2],v=pe(v,t,ie,1,e,W,ae,q,Pe,_e,null,be)),t&6&&(U=e[2],Se(),k=pe(k,t,ce,1,e,U,ne,A,Oe,ke,null,ue),Re())},i(e){if(!O){Z(w.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);O=!0}},o(e){x(w.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);O=!1},d(e){e&&m(l),e&&m(i),e&&m(d),e&&m(F),ge(w,e),e&&m(I),e&&m(R),e&&m(L),e&&m(P),e&&m(G),e&&m(E),e&&m(J),e&&m(y),e&&m(V),e&&m(B),e&&m(X),e&&m(S);for(let t=0;t<v.length;t+=1)v[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(o,l,s){let a,{collection:_=new Te}=l,u=204,i=[];const d=p=>s(1,u=p.code);return o.$$set=p=>{"collection"in p&&s(0,_=p.collection)},s(3,a=Ee.getApiExampleUrl(ye.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
@@ -1,4 +1,4 @@
import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as d,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,N as Ae}from"./index-7cc53b3b.js";import{S as De}from"./SdkTabs-855be3ab.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=c("button"),_=w(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){r(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&d(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=c("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&d(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,P=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:`
import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as f,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,N as Ae}from"./index-3d43ee7c.js";import{S as De}from"./SdkTabs-720afe62.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=P(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){d(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&f(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,w=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');
@@ -22,7 +22,7 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
'NEW_PASSWORD',
'NEW_PASSWORD_CONFIRM',
);
`}});let I=o[2];const ie=e=>e[5].code;for(let e=0;e<I.length;e+=1){let t=be(o,I,e),f=ie(t);ae.set(f,P[e]=_e(f,t))}let y=o[2];const ce=e=>e[5].code;for(let e=0;e<y.length;e+=1){let t=ue(o,y,e),f=ce(t);ne.set(f,k[e]=ke(f,t))}return{c(){s=c("h3"),l=w("Confirm password reset ("),_=w(a),u=w(")"),i=v(),p=c("div"),m=c("p"),S=w("Confirms "),h=c("strong"),j=w(q),ee=w(" password reset request and sets a new password."),H=v(),ve(R.$$.fragment),L=v(),W=c("h6"),W.textContent="API details",Q=v(),O=c("div"),B=c("strong"),B.textContent="POST",te=v(),M=c("div"),$=c("p"),se=w("/api/collections/"),z=c("strong"),G=w(F),le=w("/confirm-password-reset"),J=v(),E=c("div"),E.textContent="Body Parameters",V=v(),T=c("table"),T.innerHTML=`<thead><tr><th>Param</th>
`}});let I=o[2];const ie=e=>e[5].code;for(let e=0;e<I.length;e+=1){let t=be(o,I,e),c=ie(t);ae.set(c,w[e]=_e(c,t))}let y=o[2];const ce=e=>e[5].code;for(let e=0;e<y.length;e+=1){let t=ue(o,y,e),c=ce(t);ne.set(c,k[e]=ke(c,t))}return{c(){s=r("h3"),l=P("Confirm password reset ("),_=P(a),u=P(")"),i=v(),p=r("div"),m=r("p"),S=P("Confirms "),h=r("strong"),j=P(q),ee=P(" password reset request and sets a new password."),H=v(),ve(R.$$.fragment),L=v(),W=r("h6"),W.textContent="API details",Q=v(),O=r("div"),B=r("strong"),B.textContent="POST",te=v(),M=r("div"),$=r("p"),se=P("/api/collections/"),z=r("strong"),G=P(F),le=P("/confirm-password-reset"),J=v(),E=r("div"),E.textContent="Body Parameters",V=v(),T=r("table"),T.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
@@ -36,7 +36,7 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
<tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>passwordConfirm</span></div></td>
<td><span class="label">String</span></td>
<td>The new password confirmation.</td></tr></tbody>`,X=v(),g=c("div"),g.textContent="Responses",Y=v(),N=c("div"),A=c("div");for(let e=0;e<P.length;e+=1)P[e].c();oe=v(),D=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(W,"class","m-b-xs"),b(B,"class","label label-primary"),b(M,"class","content"),b(O,"class","alert alert-success"),b(E,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(g,"class","section-title"),b(A,"class","tabs-header compact left"),b(D,"class","tabs-content"),b(N,"class","tabs")},m(e,t){r(e,s,t),n(s,l),n(s,_),n(s,u),r(e,i,t),r(e,p,t),n(p,m),n(m,S),n(m,h),n(h,j),n(m,ee),r(e,H,t),we(R,e,t),r(e,L,t),r(e,W,t),r(e,Q,t),r(e,O,t),n(O,B),n(O,te),n(O,M),n(M,$),n($,se),n($,z),n(z,G),n($,le),r(e,J,t),r(e,E,t),r(e,V,t),r(e,T,t),r(e,X,t),r(e,g,t),r(e,Y,t),r(e,N,t),n(N,A);for(let f=0;f<P.length;f+=1)P[f].m(A,null);n(N,oe),n(N,D);for(let f=0;f<k.length;f+=1)k[f].m(D,null);C=!0},p(e,[t]){var fe,pe;(!C||t&1)&&a!==(a=e[0].name+"")&&K(_,a),(!C||t&1)&&q!==(q=e[0].name+"")&&K(j,q);const f={};t&9&&(f.js=`
<td>The new password confirmation.</td></tr></tbody>`,X=v(),g=r("div"),g.textContent="Responses",Y=v(),N=r("div"),A=r("div");for(let e=0;e<w.length;e+=1)w[e].c();oe=v(),D=r("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(W,"class","m-b-xs"),b(B,"class","label label-primary"),b(M,"class","content"),b(O,"class","alert alert-success"),b(E,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(g,"class","section-title"),b(A,"class","tabs-header compact left"),b(D,"class","tabs-content"),b(N,"class","tabs")},m(e,t){d(e,s,t),n(s,l),n(s,_),n(s,u),d(e,i,t),d(e,p,t),n(p,m),n(m,S),n(m,h),n(h,j),n(m,ee),d(e,H,t),we(R,e,t),d(e,L,t),d(e,W,t),d(e,Q,t),d(e,O,t),n(O,B),n(O,te),n(O,M),n(M,$),n($,se),n($,z),n(z,G),n($,le),d(e,J,t),d(e,E,t),d(e,V,t),d(e,T,t),d(e,X,t),d(e,g,t),d(e,Y,t),d(e,N,t),n(N,A);for(let c=0;c<w.length;c+=1)w[c]&&w[c].m(A,null);n(N,oe),n(N,D);for(let c=0;c<k.length;c+=1)k[c]&&k[c].m(D,null);C=!0},p(e,[t]){var fe,pe;(!C||t&1)&&a!==(a=e[0].name+"")&&K(_,a),(!C||t&1)&&q!==(q=e[0].name+"")&&K(j,q);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -48,7 +48,7 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
'NEW_PASSWORD',
'NEW_PASSWORD_CONFIRM',
);
`),t&9&&(f.dart=`
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -60,7 +60,7 @@ import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as
'NEW_PASSWORD',
'NEW_PASSWORD_CONFIRM',
);
`),R.$set(f),(!C||t&1)&&F!==(F=e[0].name+"")&&K(G,F),t&6&&(I=e[2],P=me(P,t,ie,1,e,I,ae,A,Oe,_e,null,be)),t&6&&(y=e[2],Ne(),k=me(k,t,ce,1,e,y,ne,D,Ce,ke,null,ue),We())},i(e){if(!C){Z(R.$$.fragment,e);for(let t=0;t<y.length;t+=1)Z(k[t]);C=!0}},o(e){x(R.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);C=!1},d(e){e&&d(s),e&&d(i),e&&d(p),e&&d(H),Pe(R,e),e&&d(L),e&&d(W),e&&d(Q),e&&d(O),e&&d(J),e&&d(E),e&&d(V),e&&d(T),e&&d(X),e&&d(g),e&&d(Y),e&&d(N);for(let t=0;t<P.length;t+=1)P[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function qe(o,s,l){let a,{collection:_=new $e}=s,u=204,i=[];const p=m=>l(1,u=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=Ee.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
`),R.$set(c),(!C||t&1)&&F!==(F=e[0].name+"")&&K(G,F),t&6&&(I=e[2],w=me(w,t,ie,1,e,I,ae,A,Oe,_e,null,be)),t&6&&(y=e[2],Ne(),k=me(k,t,ce,1,e,y,ne,D,Ce,ke,null,ue),We())},i(e){if(!C){Z(R.$$.fragment,e);for(let t=0;t<y.length;t+=1)Z(k[t]);C=!0}},o(e){x(R.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);C=!1},d(e){e&&f(s),e&&f(i),e&&f(p),e&&f(H),Pe(R,e),e&&f(L),e&&f(W),e&&f(Q),e&&f(O),e&&f(J),e&&f(E),e&&f(V),e&&f(T),e&&f(X),e&&f(g),e&&f(Y),e&&f(N);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function qe(o,s,l){let a,{collection:_=new $e}=s,u=204,i=[];const p=m=>l(1,u=m.code);return o.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,a=Ee.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
@@ -1,4 +1,4 @@
import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n,m as he,x as D,O as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as f,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,N as Ne}from"./index-7cc53b3b.js";import{S as Ve}from"./SdkTabs-855be3ab.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=c("button"),_=h(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){r(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&D(_,o),C&6&&H(s,"active",l[1]===l[5].code)},d(w){w&&f(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){r(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&f(s),$e(o)}}}function Ke(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,M=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,R,q,le,z,U=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,N,$=[],oe=new Map,ie,V,k=[],ne=new Map,y;P=new Ve({props:{js:`
import{S as we,i as Ce,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as n,m as he,x as D,O as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as m,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,N as Ne}from"./index-3d43ee7c.js";import{S as Ve}from"./SdkTabs-720afe62.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=r("button"),_=$(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){f(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&D(_,o),C&6&&H(s,"active",l[1]===l[5].code)},d(w){w&&m(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){f(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&m(s),$e(o)}}}function Ke(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,M=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,R,q,le,z,U=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,N,h=[],oe=new Map,ie,V,k=[],ne=new Map,y;P=new Ve({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}');
@@ -14,13 +14,13 @@ import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n
...
await pb.collection('${(fe=i[0])==null?void 0:fe.name}').confirmVerification('TOKEN');
`}});let j=i[2];const ae=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=be(i,j,e),m=ae(t);oe.set(m,$[e]=_e(m,t))}let K=i[2];const ce=e=>e[5].code;for(let e=0;e<K.length;e+=1){let t=ue(i,K,e),m=ce(t);ne.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=h("Confirm verification ("),_=h(o),u=h(")"),a=v(),p=c("div"),d=c("p"),w=h("Confirms "),C=c("strong"),F=h(M),ee=h(" account verification request."),I=v(),ve(P.$$.fragment),L=v(),B=c("h6"),B.textContent="API details",Q=v(),T=c("div"),A=c("strong"),A.textContent="POST",te=v(),R=c("div"),q=c("p"),le=h("/api/collections/"),z=c("strong"),G=h(U),se=h("/confirm-verification"),J=v(),O=c("div"),O.textContent="Body Parameters",W=v(),S=c("table"),S.innerHTML=`<thead><tr><th>Param</th>
`}});let j=i[2];const ae=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=be(i,j,e),c=ae(t);oe.set(c,h[e]=_e(c,t))}let K=i[2];const ce=e=>e[5].code;for(let e=0;e<K.length;e+=1){let t=ue(i,K,e),c=ce(t);ne.set(c,k[e]=ke(c,t))}return{c(){l=r("h3"),s=$("Confirm verification ("),_=$(o),u=$(")"),a=v(),p=r("div"),d=r("p"),w=$("Confirms "),C=r("strong"),F=$(M),ee=$(" account verification request."),I=v(),ve(P.$$.fragment),L=v(),B=r("h6"),B.textContent="API details",Q=v(),T=r("div"),A=r("strong"),A.textContent="POST",te=v(),R=r("div"),q=r("p"),le=$("/api/collections/"),z=r("strong"),G=$(U),se=$("/confirm-verification"),J=v(),O=r("div"),O.textContent="Body Parameters",W=v(),S=r("table"),S.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>token</span></div></td>
<td><span class="label">String</span></td>
<td>The token from the verification request email.</td></tr></tbody>`,X=v(),E=c("div"),E.textContent="Responses",Y=v(),g=c("div"),N=c("div");for(let e=0;e<$.length;e+=1)$[e].c();ie=v(),V=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(A,"class","label label-primary"),b(R,"class","content"),b(T,"class","alert alert-success"),b(O,"class","section-title"),b(S,"class","table-compact table-border m-b-base"),b(E,"class","section-title"),b(N,"class","tabs-header compact left"),b(V,"class","tabs-content"),b(g,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,u),r(e,a,t),r(e,p,t),n(p,d),n(d,w),n(d,C),n(C,F),n(d,ee),r(e,I,t),he(P,e,t),r(e,L,t),r(e,B,t),r(e,Q,t),r(e,T,t),n(T,A),n(T,te),n(T,R),n(R,q),n(q,le),n(q,z),n(z,G),n(q,se),r(e,J,t),r(e,O,t),r(e,W,t),r(e,S,t),r(e,X,t),r(e,E,t),r(e,Y,t),r(e,g,t),n(g,N);for(let m=0;m<$.length;m+=1)$[m].m(N,null);n(g,ie),n(g,V);for(let m=0;m<k.length;m+=1)k[m].m(V,null);y=!0},p(e,[t]){var me,pe;(!y||t&1)&&o!==(o=e[0].name+"")&&D(_,o),(!y||t&1)&&M!==(M=e[0].name+"")&&D(F,M);const m={};t&9&&(m.js=`
<td>The token from the verification request email.</td></tr></tbody>`,X=v(),E=r("div"),E.textContent="Responses",Y=v(),g=r("div"),N=r("div");for(let e=0;e<h.length;e+=1)h[e].c();ie=v(),V=r("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(A,"class","label label-primary"),b(R,"class","content"),b(T,"class","alert alert-success"),b(O,"class","section-title"),b(S,"class","table-compact table-border m-b-base"),b(E,"class","section-title"),b(N,"class","tabs-header compact left"),b(V,"class","tabs-content"),b(g,"class","tabs")},m(e,t){f(e,l,t),n(l,s),n(l,_),n(l,u),f(e,a,t),f(e,p,t),n(p,d),n(d,w),n(d,C),n(C,F),n(d,ee),f(e,I,t),he(P,e,t),f(e,L,t),f(e,B,t),f(e,Q,t),f(e,T,t),n(T,A),n(T,te),n(T,R),n(R,q),n(q,le),n(q,z),n(z,G),n(q,se),f(e,J,t),f(e,O,t),f(e,W,t),f(e,S,t),f(e,X,t),f(e,E,t),f(e,Y,t),f(e,g,t),n(g,N);for(let c=0;c<h.length;c+=1)h[c]&&h[c].m(N,null);n(g,ie),n(g,V);for(let c=0;c<k.length;c+=1)k[c]&&k[c].m(V,null);y=!0},p(e,[t]){var me,pe;(!y||t&1)&&o!==(o=e[0].name+"")&&D(_,o),(!y||t&1)&&M!==(M=e[0].name+"")&&D(F,M);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -28,7 +28,7 @@ import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n
...
await pb.collection('${(me=e[0])==null?void 0:me.name}').confirmVerification('TOKEN');
`),t&9&&(m.dart=`
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -36,7 +36,7 @@ import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n
...
await pb.collection('${(pe=e[0])==null?void 0:pe.name}').confirmVerification('TOKEN');
`),P.$set(m),(!y||t&1)&&U!==(U=e[0].name+"")&&D(G,U),t&6&&(j=e[2],$=de($,t,ae,1,e,j,oe,N,Te,_e,null,be)),t&6&&(K=e[2],ge(),k=de(k,t,ce,1,e,K,ne,V,ye,ke,null,ue),Be())},i(e){if(!y){Z(P.$$.fragment,e);for(let t=0;t<K.length;t+=1)Z(k[t]);y=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);y=!1},d(e){e&&f(l),e&&f(a),e&&f(p),e&&f(I),$e(P,e),e&&f(L),e&&f(B),e&&f(Q),e&&f(T),e&&f(J),e&&f(O),e&&f(W),e&&f(S),e&&f(X),e&&f(E),e&&f(Y),e&&f(g);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Me(i,l,s){let o,{collection:_=new qe}=l,u=204,a=[];const p=d=>s(1,u=d.code);return i.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Oe.getApiExampleUrl(Se.baseUrl)),s(2,a=[{code:204,body:"null"},{code:400,body:`
`),P.$set(c),(!y||t&1)&&U!==(U=e[0].name+"")&&D(G,U),t&6&&(j=e[2],h=de(h,t,ae,1,e,j,oe,N,Te,_e,null,be)),t&6&&(K=e[2],ge(),k=de(k,t,ce,1,e,K,ne,V,ye,ke,null,ue),Be())},i(e){if(!y){Z(P.$$.fragment,e);for(let t=0;t<K.length;t+=1)Z(k[t]);y=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);y=!1},d(e){e&&m(l),e&&m(a),e&&m(p),e&&m(I),$e(P,e),e&&m(L),e&&m(B),e&&m(Q),e&&m(T),e&&m(J),e&&m(O),e&&m(W),e&&m(S),e&&m(X),e&&m(E),e&&m(Y),e&&m(g);for(let t=0;t<h.length;t+=1)h[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Me(i,l,s){let o,{collection:_=new qe}=l,u=204,a=[];const p=d=>s(1,u=d.code);return i.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Oe.getApiExampleUrl(Se.baseUrl)),s(2,a=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
@@ -1,15 +1,15 @@
import{S as Ht,i as Lt,s as Pt,C as Q,N as At,e as a,w as k,b as m,c as Pe,f as h,g as r,h as n,m as Re,x,O as Le,P as ht,k as Rt,Q as Bt,n as Ft,t as fe,a as pe,o as d,d as Be,R as gt,p as jt,r as ue,u as Dt,y as le}from"./index-7cc53b3b.js";import{S as Nt}from"./SdkTabs-855be3ab.js";function wt(o,e,l){const s=o.slice();return s[7]=e[l],s}function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[12]=e[l],s}function $t(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Tt(o){let e,l,s,b,p,c,f,y,T,w,O,g,D,V,L,J,j,B,S,N,q,C,_;function M(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=M(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=a("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
import{S as Ht,i as Lt,s as Pt,C as Q,N as At,e as a,w as k,b as m,c as Pe,f as h,g as r,h as n,m as Re,x,O as Le,P as ht,k as Rt,Q as Bt,n as Ft,t as fe,a as pe,o as d,d as Be,R as gt,p as jt,r as ue,u as Dt,y as le}from"./index-3d43ee7c.js";import{S as Nt}from"./SdkTabs-720afe62.js";function wt(o,e,l){const s=o.slice();return s[7]=e[l],s}function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[12]=e[l],s}function $t(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Tt(o){let e,l,s,b,p,c,f,v,T,w,O,g,D,E,L,I,j,F,S,N,q,C,_;function M(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=M(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=a("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td>
<td><span class="label">String</span></td>
<td>The username of the auth record.
<br/>
If not set, it will be auto generated.</td>`,b=m(),p=a("tr"),c=a("td"),f=a("div"),P.c(),y=m(),T=a("span"),T.textContent="email",w=m(),O=a("td"),O.innerHTML='<span class="label">String</span>',g=m(),D=a("td"),D.textContent="Auth record email address.",V=m(),L=a("tr"),L.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
If not set, it will be auto generated.</td>`,b=m(),p=a("tr"),c=a("td"),f=a("div"),P.c(),v=m(),T=a("span"),T.textContent="email",w=m(),O=a("td"),O.innerHTML='<span class="label">String</span>',g=m(),D=a("td"),D.textContent="Auth record email address.",E=m(),L=a("tr"),L.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>emailVisibility</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,J=m(),j=a("tr"),j.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,I=m(),j=a("tr"),j.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>Auth record password.</td>`,B=m(),S=a("tr"),S.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<td>Auth record password.</td>`,F=m(),S=a("tr"),S.innerHTML=`<td><div class="inline-flex"><span class="label label-success">Required</span>
<span>passwordConfirm</span></div></td>
<td><span class="label">String</span></td>
<td>Auth record password confirmation.</td>`,N=m(),q=a("tr"),q.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
@@ -17,8 +17,8 @@ import{S as Ht,i as Lt,s as Pt,C as Q,N as At,e as a,w as k,b as m,c as Pe,f as
<td><span class="label">Boolean</span></td>
<td>Indicates whether the auth record is verified or not.
<br/>
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,C=m(),_=a("tr"),_.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>',h(f,"class","inline-flex")},m(u,$){r(u,e,$),r(u,l,$),r(u,s,$),r(u,b,$),r(u,p,$),n(p,c),n(c,f),P.m(f,null),n(f,y),n(f,T),n(p,w),n(p,O),n(p,g),n(p,D),r(u,V,$),r(u,L,$),r(u,J,$),r(u,j,$),r(u,B,$),r(u,S,$),r(u,N,$),r(u,q,$),r(u,C,$),r(u,_,$)},p(u,$){z!==(z=M(u))&&(P.d(1),P=z(u),P&&(P.c(),P.m(f,y)))},d(u){u&&d(e),u&&d(l),u&&d(s),u&&d(b),u&&d(p),P.d(),u&&d(V),u&&d(L),u&&d(J),u&&d(j),u&&d(B),u&&d(S),u&&d(N),u&&d(q),u&&d(C),u&&d(_)}}}function Vt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Jt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Et(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function It(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Ut(o){var p;let e,l=((p=o[12].options)==null?void 0:p.maxSelect)===1?"id":"ids",s,b;return{c(){e=k("Relation record "),s=k(l),b=k(".")},m(c,f){r(c,e,f),r(c,s,f),r(c,b,f)},p(c,f){var y;f&1&&l!==(l=((y=c[12].options)==null?void 0:y.maxSelect)===1?"id":"ids")&&x(s,l)},d(c){c&&d(e),c&&d(s),c&&d(b)}}}function Qt(o){let e,l,s,b,p;return{c(){e=k("File object."),l=a("br"),s=k(`
Set to `),b=a("code"),b.textContent="null",p=k(" to delete already uploaded file(s).")},m(c,f){r(c,e,f),r(c,l,f),r(c,s,f),r(c,b,f),r(c,p,f)},p:le,d(c){c&&d(e),c&&d(l),c&&d(s),c&&d(b),c&&d(p)}}}function zt(o){let e;return{c(){e=k("URL address.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Kt(o){let e;return{c(){e=k("Email address.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Wt(o){let e;return{c(){e=k("JSON array or object.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Yt(o){let e;return{c(){e=k("Number value.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Gt(o){let e;return{c(){e=k("Plain text value.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function qt(o,e){let l,s,b,p,c,f=e[12].name+"",y,T,w,O,g=Q.getFieldValueType(e[12])+"",D,V,L,J;function j(_,M){return _[12].required?It:Et}let B=j(e),S=B(e);function N(_,M){if(_[12].type==="text")return Gt;if(_[12].type==="number")return Yt;if(_[12].type==="json")return Wt;if(_[12].type==="email")return Kt;if(_[12].type==="url")return zt;if(_[12].type==="file")return Qt;if(_[12].type==="relation")return Ut}let q=N(e),C=q&&q(e);return{key:o,first:null,c(){l=a("tr"),s=a("td"),b=a("div"),S.c(),p=m(),c=a("span"),y=k(f),T=m(),w=a("td"),O=a("span"),D=k(g),V=m(),L=a("td"),C&&C.c(),J=m(),h(b,"class","inline-flex"),h(O,"class","label"),this.first=l},m(_,M){r(_,l,M),n(l,s),n(s,b),S.m(b,null),n(b,p),n(b,c),n(c,y),n(l,T),n(l,w),n(w,O),n(O,D),n(l,V),n(l,L),C&&C.m(L,null),n(l,J)},p(_,M){e=_,B!==(B=j(e))&&(S.d(1),S=B(e),S&&(S.c(),S.m(b,p))),M&1&&f!==(f=e[12].name+"")&&x(y,f),M&1&&g!==(g=Q.getFieldValueType(e[12])+"")&&x(D,g),q===(q=N(e))&&C?C.p(e,M):(C&&C.d(1),C=q&&q(e),C&&(C.c(),C.m(L,null)))},d(_){_&&d(l),S.d(),C&&C.d()}}}function Ot(o,e){let l,s=e[7].code+"",b,p,c,f;function y(){return e[6](e[7])}return{key:o,first:null,c(){l=a("button"),b=k(s),p=m(),h(l,"class","tab-item"),ue(l,"active",e[1]===e[7].code),this.first=l},m(T,w){r(T,l,w),n(l,b),n(l,p),c||(f=Dt(l,"click",y),c=!0)},p(T,w){e=T,w&4&&s!==(s=e[7].code+"")&&x(b,s),w&6&&ue(l,"active",e[1]===e[7].code)},d(T){T&&d(l),c=!1,f()}}}function Mt(o,e){let l,s,b,p;return s=new At({props:{content:e[7].body}}),{key:o,first:null,c(){l=a("div"),Pe(s.$$.fragment),b=m(),h(l,"class","tab-item"),ue(l,"active",e[1]===e[7].code),this.first=l},m(c,f){r(c,l,f),Re(s,l,null),n(l,b),p=!0},p(c,f){e=c;const y={};f&4&&(y.content=e[7].body),s.$set(y),(!p||f&6)&&ue(l,"active",e[1]===e[7].code)},i(c){p||(fe(s.$$.fragment,c),p=!0)},o(c){pe(s.$$.fragment,c),p=!1},d(c){c&&d(l),Be(s)}}}function Xt(o){var st,it,at,ot,rt,dt,ct,ft;let e,l,s=o[0].name+"",b,p,c,f,y,T,w,O=o[0].name+"",g,D,V,L,J,j,B,S,N,q,C,_,M,z,P,u,$,ee,K=o[0].name+"",me,Fe,ge,be,ne,_e,W,ke,je,E,ye,De,ve,I=[],Ne=new Map,he,se,we,Y,Ce,Ve,Se,G,$e,Je,Te,Ee,A,Ie,te,Ue,Qe,ze,qe,Ke,Oe,We,Ye,Ge,Me,Xe,Ae,ie,He,X,ae,U=[],Ze=new Map,xe,oe,F=[],et=new Map,Z;S=new Nt({props:{js:`
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,C=m(),_=a("tr"),_.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>',h(f,"class","inline-flex")},m(u,$){r(u,e,$),r(u,l,$),r(u,s,$),r(u,b,$),r(u,p,$),n(p,c),n(c,f),P.m(f,null),n(f,v),n(f,T),n(p,w),n(p,O),n(p,g),n(p,D),r(u,E,$),r(u,L,$),r(u,I,$),r(u,j,$),r(u,F,$),r(u,S,$),r(u,N,$),r(u,q,$),r(u,C,$),r(u,_,$)},p(u,$){z!==(z=M(u))&&(P.d(1),P=z(u),P&&(P.c(),P.m(f,v)))},d(u){u&&d(e),u&&d(l),u&&d(s),u&&d(b),u&&d(p),P.d(),u&&d(E),u&&d(L),u&&d(I),u&&d(j),u&&d(F),u&&d(S),u&&d(N),u&&d(q),u&&d(C),u&&d(_)}}}function Vt(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Jt(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Et(o){let e;return{c(){e=a("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function It(o){let e;return{c(){e=a("span"),e.textContent="Required",h(e,"class","label label-success")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Ut(o){var p;let e,l=((p=o[12].options)==null?void 0:p.maxSelect)===1?"id":"ids",s,b;return{c(){e=k("Relation record "),s=k(l),b=k(".")},m(c,f){r(c,e,f),r(c,s,f),r(c,b,f)},p(c,f){var v;f&1&&l!==(l=((v=c[12].options)==null?void 0:v.maxSelect)===1?"id":"ids")&&x(s,l)},d(c){c&&d(e),c&&d(s),c&&d(b)}}}function Qt(o){let e,l,s,b,p;return{c(){e=k("File object."),l=a("br"),s=k(`
Set to `),b=a("code"),b.textContent="null",p=k(" to delete already uploaded file(s).")},m(c,f){r(c,e,f),r(c,l,f),r(c,s,f),r(c,b,f),r(c,p,f)},p:le,d(c){c&&d(e),c&&d(l),c&&d(s),c&&d(b),c&&d(p)}}}function zt(o){let e;return{c(){e=k("URL address.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Kt(o){let e;return{c(){e=k("Email address.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Wt(o){let e;return{c(){e=k("JSON array or object.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Yt(o){let e;return{c(){e=k("Number value.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function Gt(o){let e;return{c(){e=k("Plain text value.")},m(l,s){r(l,e,s)},p:le,d(l){l&&d(e)}}}function qt(o,e){let l,s,b,p,c,f=e[12].name+"",v,T,w,O,g=Q.getFieldValueType(e[12])+"",D,E,L,I;function j(_,M){return _[12].required?It:Et}let F=j(e),S=F(e);function N(_,M){if(_[12].type==="text")return Gt;if(_[12].type==="number")return Yt;if(_[12].type==="json")return Wt;if(_[12].type==="email")return Kt;if(_[12].type==="url")return zt;if(_[12].type==="file")return Qt;if(_[12].type==="relation")return Ut}let q=N(e),C=q&&q(e);return{key:o,first:null,c(){l=a("tr"),s=a("td"),b=a("div"),S.c(),p=m(),c=a("span"),v=k(f),T=m(),w=a("td"),O=a("span"),D=k(g),E=m(),L=a("td"),C&&C.c(),I=m(),h(b,"class","inline-flex"),h(O,"class","label"),this.first=l},m(_,M){r(_,l,M),n(l,s),n(s,b),S.m(b,null),n(b,p),n(b,c),n(c,v),n(l,T),n(l,w),n(w,O),n(O,D),n(l,E),n(l,L),C&&C.m(L,null),n(l,I)},p(_,M){e=_,F!==(F=j(e))&&(S.d(1),S=F(e),S&&(S.c(),S.m(b,p))),M&1&&f!==(f=e[12].name+"")&&x(v,f),M&1&&g!==(g=Q.getFieldValueType(e[12])+"")&&x(D,g),q===(q=N(e))&&C?C.p(e,M):(C&&C.d(1),C=q&&q(e),C&&(C.c(),C.m(L,null)))},d(_){_&&d(l),S.d(),C&&C.d()}}}function Ot(o,e){let l,s=e[7].code+"",b,p,c,f;function v(){return e[6](e[7])}return{key:o,first:null,c(){l=a("button"),b=k(s),p=m(),h(l,"class","tab-item"),ue(l,"active",e[1]===e[7].code),this.first=l},m(T,w){r(T,l,w),n(l,b),n(l,p),c||(f=Dt(l,"click",v),c=!0)},p(T,w){e=T,w&4&&s!==(s=e[7].code+"")&&x(b,s),w&6&&ue(l,"active",e[1]===e[7].code)},d(T){T&&d(l),c=!1,f()}}}function Mt(o,e){let l,s,b,p;return s=new At({props:{content:e[7].body}}),{key:o,first:null,c(){l=a("div"),Pe(s.$$.fragment),b=m(),h(l,"class","tab-item"),ue(l,"active",e[1]===e[7].code),this.first=l},m(c,f){r(c,l,f),Re(s,l,null),n(l,b),p=!0},p(c,f){e=c;const v={};f&4&&(v.content=e[7].body),s.$set(v),(!p||f&6)&&ue(l,"active",e[1]===e[7].code)},i(c){p||(fe(s.$$.fragment,c),p=!0)},o(c){pe(s.$$.fragment,c),p=!1},d(c){c&&d(l),Be(s)}}}function Xt(o){var st,it,at,ot,rt,dt,ct,ft;let e,l,s=o[0].name+"",b,p,c,f,v,T,w,O=o[0].name+"",g,D,E,L,I,j,F,S,N,q,C,_,M,z,P,u,$,ee,K=o[0].name+"",me,Fe,ge,be,ne,_e,W,ke,je,U,ye,De,ve,V=[],Ne=new Map,he,se,we,Y,Ce,Ve,Se,G,$e,Je,Te,Ee,A,Ie,te,Ue,Qe,ze,qe,Ke,Oe,We,Ye,Ge,Me,Xe,Ae,ie,He,X,ae,J=[],Ze=new Map,xe,oe,R=[],et=new Map,Z;S=new Nt({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[4]}');
@@ -46,19 +46,19 @@ final record = await pb.collection('${(ot=o[0])==null?void 0:ot.name}').create(b
`+((rt=o[0])!=null&&rt.isAuth?`
// (optional) send an email verification request
await pb.collection('${(dt=o[0])==null?void 0:dt.name}').requestVerification('test@example.com');
`:"")}});let R=o[5]&&$t(),H=((ct=o[0])==null?void 0:ct.isAuth)&&Tt(o),de=(ft=o[0])==null?void 0:ft.schema;const tt=t=>t[12].name;for(let t=0;t<de.length;t+=1){let i=St(o,de,t),v=tt(i);Ne.set(v,I[t]=qt(v,i))}te=new At({props:{content:"?expand=relField1,relField2.subRelField"}});let ce=o[2];const lt=t=>t[7].code;for(let t=0;t<ce.length;t+=1){let i=Ct(o,ce,t),v=lt(i);Ze.set(v,U[t]=Ot(v,i))}let re=o[2];const nt=t=>t[7].code;for(let t=0;t<re.length;t+=1){let i=wt(o,re,t),v=nt(i);et.set(v,F[t]=Mt(v,i))}return{c(){e=a("h3"),l=k("Create ("),b=k(s),p=k(")"),c=m(),f=a("div"),y=a("p"),T=k("Create a new "),w=a("strong"),g=k(O),D=k(" record."),V=m(),L=a("p"),L.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,J=m(),j=a("p"),j.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
`:"")}});let B=o[5]&&$t(),H=((ct=o[0])==null?void 0:ct.isAuth)&&Tt(o),de=(ft=o[0])==null?void 0:ft.schema;const tt=t=>t[12].name;for(let t=0;t<de.length;t+=1){let i=St(o,de,t),y=tt(i);Ne.set(y,V[t]=qt(y,i))}te=new At({props:{content:"?expand=relField1,relField2.subRelField"}});let ce=o[2];const lt=t=>t[7].code;for(let t=0;t<ce.length;t+=1){let i=Ct(o,ce,t),y=lt(i);Ze.set(y,J[t]=Ot(y,i))}let re=o[2];const nt=t=>t[7].code;for(let t=0;t<re.length;t+=1){let i=wt(o,re,t),y=nt(i);et.set(y,R[t]=Mt(y,i))}return{c(){e=a("h3"),l=k("Create ("),b=k(s),p=k(")"),c=m(),f=a("div"),v=a("p"),T=k("Create a new "),w=a("strong"),g=k(O),D=k(" record."),E=m(),L=a("p"),L.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,I=m(),j=a("p"),j.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
<br/>
For more info and examples you could check the detailed
<a href="https://pocketbase.io/docs/files-handling/" target="_blank" rel="noopener noreferrer">Files upload and handling docs
</a>.`,B=m(),Pe(S.$$.fragment),N=m(),q=a("h6"),q.textContent="API details",C=m(),_=a("div"),M=a("strong"),M.textContent="POST",z=m(),P=a("div"),u=a("p"),$=k("/api/collections/"),ee=a("strong"),me=k(K),Fe=k("/records"),ge=m(),R&&R.c(),be=m(),ne=a("div"),ne.textContent="Body Parameters",_e=m(),W=a("table"),ke=a("thead"),ke.innerHTML=`<tr><th>Param</th>
</a>.`,F=m(),Pe(S.$$.fragment),N=m(),q=a("h6"),q.textContent="API details",C=m(),_=a("div"),M=a("strong"),M.textContent="POST",z=m(),P=a("div"),u=a("p"),$=k("/api/collections/"),ee=a("strong"),me=k(K),Fe=k("/records"),ge=m(),B&&B.c(),be=m(),ne=a("div"),ne.textContent="Body Parameters",_e=m(),W=a("table"),ke=a("thead"),ke.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,je=m(),E=a("tbody"),ye=a("tr"),ye.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<th width="50%">Description</th></tr>`,je=m(),U=a("tbody"),ye=a("tr"),ye.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,De=m(),H&&H.c(),ve=m();for(let t=0;t<I.length;t+=1)I[t].c();he=m(),se=a("div"),se.textContent="Query parameters",we=m(),Y=a("table"),Ce=a("thead"),Ce.innerHTML=`<tr><th>Param</th>
If not set, it will be auto generated.</td>`,De=m(),H&&H.c(),ve=m();for(let t=0;t<V.length;t+=1)V[t].c();he=m(),se=a("div"),se.textContent="Query parameters",we=m(),Y=a("table"),Ce=a("thead"),Ce.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ve=m(),Se=a("tbody"),G=a("tr"),$e=a("td"),$e.textContent="expand",Je=m(),Te=a("td"),Te.innerHTML='<span class="label">String</span>',Ee=m(),A=a("td"),Ie=k(`Auto expand relations when returning the created record. Ex.:
`),Pe(te.$$.fragment),Ue=k(`
@@ -66,7 +66,7 @@ await pb.collection('${(dt=o[0])==null?void 0:dt.name}').requestVerification('te
The expanded relations will be appended to the record under the
`),qe=a("code"),qe.textContent="expand",Ke=k(" property (eg. "),Oe=a("code"),Oe.textContent='"expand": {"relField1": {...}, ...}',We=k(`).
`),Ye=a("br"),Ge=k(`
Only the relations to which the request user has permissions to `),Me=a("strong"),Me.textContent="view",Xe=k(" will be expanded."),Ae=m(),ie=a("div"),ie.textContent="Responses",He=m(),X=a("div"),ae=a("div");for(let t=0;t<U.length;t+=1)U[t].c();xe=m(),oe=a("div");for(let t=0;t<F.length;t+=1)F[t].c();h(e,"class","m-b-sm"),h(f,"class","content txt-lg m-b-sm"),h(q,"class","m-b-xs"),h(M,"class","label label-primary"),h(P,"class","content"),h(_,"class","alert alert-success"),h(ne,"class","section-title"),h(W,"class","table-compact table-border m-b-base"),h(se,"class","section-title"),h(Y,"class","table-compact table-border m-b-base"),h(ie,"class","section-title"),h(ae,"class","tabs-header compact left"),h(oe,"class","tabs-content"),h(X,"class","tabs")},m(t,i){r(t,e,i),n(e,l),n(e,b),n(e,p),r(t,c,i),r(t,f,i),n(f,y),n(y,T),n(y,w),n(w,g),n(y,D),n(f,V),n(f,L),n(f,J),n(f,j),r(t,B,i),Re(S,t,i),r(t,N,i),r(t,q,i),r(t,C,i),r(t,_,i),n(_,M),n(_,z),n(_,P),n(P,u),n(u,$),n(u,ee),n(ee,me),n(u,Fe),n(_,ge),R&&R.m(_,null),r(t,be,i),r(t,ne,i),r(t,_e,i),r(t,W,i),n(W,ke),n(W,je),n(W,E),n(E,ye),n(E,De),H&&H.m(E,null),n(E,ve);for(let v=0;v<I.length;v+=1)I[v].m(E,null);r(t,he,i),r(t,se,i),r(t,we,i),r(t,Y,i),n(Y,Ce),n(Y,Ve),n(Y,Se),n(Se,G),n(G,$e),n(G,Je),n(G,Te),n(G,Ee),n(G,A),n(A,Ie),Re(te,A,null),n(A,Ue),n(A,Qe),n(A,ze),n(A,qe),n(A,Ke),n(A,Oe),n(A,We),n(A,Ye),n(A,Ge),n(A,Me),n(A,Xe),r(t,Ae,i),r(t,ie,i),r(t,He,i),r(t,X,i),n(X,ae);for(let v=0;v<U.length;v+=1)U[v].m(ae,null);n(X,xe),n(X,oe);for(let v=0;v<F.length;v+=1)F[v].m(oe,null);Z=!0},p(t,[i]){var pt,ut,mt,bt,_t,kt,yt,vt;(!Z||i&1)&&s!==(s=t[0].name+"")&&x(b,s),(!Z||i&1)&&O!==(O=t[0].name+"")&&x(g,O);const v={};i&25&&(v.js=`
Only the relations to which the request user has permissions to `),Me=a("strong"),Me.textContent="view",Xe=k(" will be expanded."),Ae=m(),ie=a("div"),ie.textContent="Responses",He=m(),X=a("div"),ae=a("div");for(let t=0;t<J.length;t+=1)J[t].c();xe=m(),oe=a("div");for(let t=0;t<R.length;t+=1)R[t].c();h(e,"class","m-b-sm"),h(f,"class","content txt-lg m-b-sm"),h(q,"class","m-b-xs"),h(M,"class","label label-primary"),h(P,"class","content"),h(_,"class","alert alert-success"),h(ne,"class","section-title"),h(W,"class","table-compact table-border m-b-base"),h(se,"class","section-title"),h(Y,"class","table-compact table-border m-b-base"),h(ie,"class","section-title"),h(ae,"class","tabs-header compact left"),h(oe,"class","tabs-content"),h(X,"class","tabs")},m(t,i){r(t,e,i),n(e,l),n(e,b),n(e,p),r(t,c,i),r(t,f,i),n(f,v),n(v,T),n(v,w),n(w,g),n(v,D),n(f,E),n(f,L),n(f,I),n(f,j),r(t,F,i),Re(S,t,i),r(t,N,i),r(t,q,i),r(t,C,i),r(t,_,i),n(_,M),n(_,z),n(_,P),n(P,u),n(u,$),n(u,ee),n(ee,me),n(u,Fe),n(_,ge),B&&B.m(_,null),r(t,be,i),r(t,ne,i),r(t,_e,i),r(t,W,i),n(W,ke),n(W,je),n(W,U),n(U,ye),n(U,De),H&&H.m(U,null),n(U,ve);for(let y=0;y<V.length;y+=1)V[y]&&V[y].m(U,null);r(t,he,i),r(t,se,i),r(t,we,i),r(t,Y,i),n(Y,Ce),n(Y,Ve),n(Y,Se),n(Se,G),n(G,$e),n(G,Je),n(G,Te),n(G,Ee),n(G,A),n(A,Ie),Re(te,A,null),n(A,Ue),n(A,Qe),n(A,ze),n(A,qe),n(A,Ke),n(A,Oe),n(A,We),n(A,Ye),n(A,Ge),n(A,Me),n(A,Xe),r(t,Ae,i),r(t,ie,i),r(t,He,i),r(t,X,i),n(X,ae);for(let y=0;y<J.length;y+=1)J[y]&&J[y].m(ae,null);n(X,xe),n(X,oe);for(let y=0;y<R.length;y+=1)R[y]&&R[y].m(oe,null);Z=!0},p(t,[i]){var pt,ut,mt,bt,_t,kt,yt,vt;(!Z||i&1)&&s!==(s=t[0].name+"")&&x(b,s),(!Z||i&1)&&O!==(O=t[0].name+"")&&x(g,O);const y={};i&25&&(y.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${t[4]}');
@@ -80,7 +80,7 @@ const record = await pb.collection('${(pt=t[0])==null?void 0:pt.name}').create(d
`+((ut=t[0])!=null&&ut.isAuth?`
// (optional) send an email verification request
await pb.collection('${(mt=t[0])==null?void 0:mt.name}').requestVerification('test@example.com');
`:"")),i&25&&(v.dart=`
`:"")),i&25&&(y.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${t[4]}');
@@ -94,7 +94,7 @@ final record = await pb.collection('${(bt=t[0])==null?void 0:bt.name}').create(b
`+((_t=t[0])!=null&&_t.isAuth?`
// (optional) send an email verification request
await pb.collection('${(kt=t[0])==null?void 0:kt.name}').requestVerification('test@example.com');
`:"")),S.$set(v),(!Z||i&1)&&K!==(K=t[0].name+"")&&x(me,K),t[5]?R||(R=$t(),R.c(),R.m(_,null)):R&&(R.d(1),R=null),(yt=t[0])!=null&&yt.isAuth?H?H.p(t,i):(H=Tt(t),H.c(),H.m(E,ve)):H&&(H.d(1),H=null),i&1&&(de=(vt=t[0])==null?void 0:vt.schema,I=Le(I,i,tt,1,t,de,Ne,E,ht,qt,null,St)),i&6&&(ce=t[2],U=Le(U,i,lt,1,t,ce,Ze,ae,ht,Ot,null,Ct)),i&6&&(re=t[2],Rt(),F=Le(F,i,nt,1,t,re,et,oe,Bt,Mt,null,wt),Ft())},i(t){if(!Z){fe(S.$$.fragment,t),fe(te.$$.fragment,t);for(let i=0;i<re.length;i+=1)fe(F[i]);Z=!0}},o(t){pe(S.$$.fragment,t),pe(te.$$.fragment,t);for(let i=0;i<F.length;i+=1)pe(F[i]);Z=!1},d(t){t&&d(e),t&&d(c),t&&d(f),t&&d(B),Be(S,t),t&&d(N),t&&d(q),t&&d(C),t&&d(_),R&&R.d(),t&&d(be),t&&d(ne),t&&d(_e),t&&d(W),H&&H.d();for(let i=0;i<I.length;i+=1)I[i].d();t&&d(he),t&&d(se),t&&d(we),t&&d(Y),Be(te),t&&d(Ae),t&&d(ie),t&&d(He),t&&d(X);for(let i=0;i<U.length;i+=1)U[i].d();for(let i=0;i<F.length;i+=1)F[i].d()}}}function Zt(o,e,l){let s,b,{collection:p=new gt}=e,c=200,f=[],y={};const T=w=>l(1,c=w.code);return o.$$set=w=>{"collection"in w&&l(0,p=w.collection)},o.$$.update=()=>{var w,O;o.$$.dirty&1&&l(5,s=(p==null?void 0:p.createRule)===null),o.$$.dirty&1&&l(2,f=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(p),null,2)},{code:400,body:`
`:"")),S.$set(y),(!Z||i&1)&&K!==(K=t[0].name+"")&&x(me,K),t[5]?B||(B=$t(),B.c(),B.m(_,null)):B&&(B.d(1),B=null),(yt=t[0])!=null&&yt.isAuth?H?H.p(t,i):(H=Tt(t),H.c(),H.m(U,ve)):H&&(H.d(1),H=null),i&1&&(de=(vt=t[0])==null?void 0:vt.schema,V=Le(V,i,tt,1,t,de,Ne,U,ht,qt,null,St)),i&6&&(ce=t[2],J=Le(J,i,lt,1,t,ce,Ze,ae,ht,Ot,null,Ct)),i&6&&(re=t[2],Rt(),R=Le(R,i,nt,1,t,re,et,oe,Bt,Mt,null,wt),Ft())},i(t){if(!Z){fe(S.$$.fragment,t),fe(te.$$.fragment,t);for(let i=0;i<re.length;i+=1)fe(R[i]);Z=!0}},o(t){pe(S.$$.fragment,t),pe(te.$$.fragment,t);for(let i=0;i<R.length;i+=1)pe(R[i]);Z=!1},d(t){t&&d(e),t&&d(c),t&&d(f),t&&d(F),Be(S,t),t&&d(N),t&&d(q),t&&d(C),t&&d(_),B&&B.d(),t&&d(be),t&&d(ne),t&&d(_e),t&&d(W),H&&H.d();for(let i=0;i<V.length;i+=1)V[i].d();t&&d(he),t&&d(se),t&&d(we),t&&d(Y),Be(te),t&&d(Ae),t&&d(ie),t&&d(He),t&&d(X);for(let i=0;i<J.length;i+=1)J[i].d();for(let i=0;i<R.length;i+=1)R[i].d()}}}function Zt(o,e,l){let s,b,{collection:p=new gt}=e,c=200,f=[],v={};const T=w=>l(1,c=w.code);return o.$$set=w=>{"collection"in w&&l(0,p=w.collection)},o.$$.update=()=>{var w,O;o.$$.dirty&1&&l(5,s=(p==null?void 0:p.createRule)===null),o.$$.dirty&1&&l(2,f=[{code:200,body:JSON.stringify(Q.dummyCollectionRecord(p),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
@@ -111,4 +111,4 @@ await pb.collection('${(kt=t[0])==null?void 0:kt.name}').requestVerification('te
"message": "You are not allowed to perform this request.",
"data": {}
}
`}]),o.$$.dirty&1&&(p.isAuth?l(3,y={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):l(3,y={}))},l(4,b=Q.getApiExampleUrl(jt.baseUrl)),[p,c,f,y,b,s,T]}class tl extends Ht{constructor(e){super(),Lt(this,e,Zt,Xt,Pt,{collection:0})}}export{tl as default};
`}]),o.$$.dirty&1&&(p.isAuth?l(3,v={username:"test_username",email:"test@example.com",emailVisibility:!0,password:"12345678",passwordConfirm:"12345678"}):l(3,v={}))},l(4,b=Q.getApiExampleUrl(jt.baseUrl)),[p,c,f,v,b,s,T]}class tl extends Ht{constructor(e){super(),Lt(this,e,Zt,Xt,Pt,{collection:0})}}export{tl as default};
-58
View File
@@ -1,58 +0,0 @@
import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n,m as we,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as f,d as ge,R as Ie,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-7cc53b3b.js";import{S as He}from"./SdkTabs-855be3ab.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){d(s,l,a)},d(s){s&&f(l)}}}function ye(o,l){let s,a=l[6].code+"",h,i,r,u;function $(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),h=D(a),i=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){d(b,s,g),n(s,h),n(s,i),r||(u=Se(s,"click",$),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&f(s),r=!1,u()}}}function De(o,l){let s,a,h,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){d(r,s,u),we(a,s,null),n(s,h),i=!0},p(r,u){l=r,(!i||u&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&f(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",h,i,r,u,$,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,w=[],ie=new Map,re,M,v=[],ce=new Map,P;C=new He({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');
...
await pb.collection('${(ue=o[0])==null?void 0:ue.name}').delete('RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${o[3]}');
...
await pb.collection('${(pe=o[0])==null?void 0:pe.name}').delete('RECORD_ID');
`}});let _=o[1]&&ve(),j=o[4];const de=e=>e[6].code;for(let e=0;e<j.length;e+=1){let t=he(o,j,e),p=de(t);ie.set(p,w[e]=ye(p,t))}let S=o[4];const fe=e=>e[6].code;for(let e=0;e<S.length;e+=1){let t=ke(o,S,e),p=fe(t);ce.set(p,v[e]=De(p,t))}return{c(){l=c("h3"),s=D("Delete ("),h=D(a),i=D(")"),r=k(),u=c("div"),$=c("p"),b=D("Delete a single "),g=c("strong"),z=D(q),le=D(" record."),F=k(),$e(C.$$.fragment),K=k(),O=c("h6"),O.textContent="API details",Q=k(),y=c("div"),H=c("strong"),H.textContent="DELETE",se=k(),L=c("div"),E=c("p"),oe=D("/api/collections/"),G=c("strong"),J=D(U),ae=D("/records/"),V=c("strong"),V.textContent=":id",ne=k(),_&&_.c(),W=k(),T=c("div"),T.textContent="Path parameters",X=k(),B=c("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,Y=k(),I=c("div"),I.textContent="Responses",Z=k(),R=c("div"),A=c("div");for(let e=0;e<w.length;e+=1)w[e].c();re=k(),M=c("div");for(let e=0;e<v.length;e+=1)v[e].c();m(l,"class","m-b-sm"),m(u,"class","content txt-lg m-b-sm"),m(O,"class","m-b-xs"),m(H,"class","label label-primary"),m(L,"class","content"),m(y,"class","alert alert-danger"),m(T,"class","section-title"),m(B,"class","table-compact table-border m-b-base"),m(I,"class","section-title"),m(A,"class","tabs-header compact left"),m(M,"class","tabs-content"),m(R,"class","tabs")},m(e,t){d(e,l,t),n(l,s),n(l,h),n(l,i),d(e,r,t),d(e,u,t),n(u,$),n($,b),n($,g),n(g,z),n($,le),d(e,F,t),we(C,e,t),d(e,K,t),d(e,O,t),d(e,Q,t),d(e,y,t),n(y,H),n(y,se),n(y,L),n(L,E),n(E,oe),n(E,G),n(G,J),n(E,ae),n(E,V),n(y,ne),_&&_.m(y,null),d(e,W,t),d(e,T,t),d(e,X,t),d(e,B,t),d(e,Y,t),d(e,I,t),d(e,Z,t),d(e,R,t),n(R,A);for(let p=0;p<w.length;p+=1)w[p].m(A,null);n(R,re),n(R,M);for(let p=0;p<v.length;p+=1)v[p].m(M,null);P=!0},p(e,[t]){var me,be;(!P||t&1)&&a!==(a=e[0].name+"")&&x(h,a),(!P||t&1)&&q!==(q=e[0].name+"")&&x(z,q);const p={};t&9&&(p.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(me=e[0])==null?void 0:me.name}').delete('RECORD_ID');
`),t&9&&(p.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${(be=e[0])==null?void 0:be.name}').delete('RECORD_ID');
`),C.$set(p),(!P||t&1)&&U!==(U=e[0].name+"")&&x(J,U),e[1]?_||(_=ve(),_.c(),_.m(y,null)):_&&(_.d(1),_=null),t&20&&(j=e[4],w=_e(w,t,de,1,e,j,ie,A,Ee,ye,null,he)),t&20&&(S=e[4],Oe(),v=_e(v,t,fe,1,e,S,ce,M,Te,De,null,ke),Be())},i(e){if(!P){ee(C.$$.fragment,e);for(let t=0;t<S.length;t+=1)ee(v[t]);P=!0}},o(e){te(C.$$.fragment,e);for(let t=0;t<v.length;t+=1)te(v[t]);P=!1},d(e){e&&f(l),e&&f(r),e&&f(u),e&&f(F),ge(C,e),e&&f(K),e&&f(O),e&&f(Q),e&&f(y),_&&_.d(),e&&f(W),e&&f(T),e&&f(X),e&&f(B),e&&f(Y),e&&f(I),e&&f(Z),e&&f(R);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<v.length;t+=1)v[t].d()}}}function Ue(o,l,s){let a,h,{collection:i=new Ie}=l,r=204,u=[];const $=b=>s(2,r=b.code);return o.$$set=b=>{"collection"in b&&s(0,i=b.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(1,a=(i==null?void 0:i.deleteRule)===null),o.$$.dirty&3&&i!=null&&i.id&&(u.push({code:204,body:`
null
`}),u.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),a&&u.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),u.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},s(3,h=Ae.getApiExampleUrl(Me.baseUrl)),[i,a,r,h,u,$]}class ze extends Ce{constructor(l){super(),Re(this,l,Ue,Le,Pe,{collection:0})}}export{ze as default};
+58
View File
@@ -0,0 +1,58 @@
import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n,m as we,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as u,d as ge,R as Ie,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-3d43ee7c.js";import{S as He}from"./SdkTabs-720afe62.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){f(s,l,a)},d(s){s&&u(l)}}}function ye(o,l){let s,a=l[6].code+"",v,i,r,p;function w(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),v=$(a),i=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){f(b,s,g),n(s,v),n(s,i),r||(p=Se(s,"click",w),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&u(s),r=!1,p()}}}function De(o,l){let s,a,v,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),v=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,p){f(r,s,p),we(a,s,null),n(s,v),i=!0},p(r,p){l=r,(!i||p&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&u(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",v,i,r,p,w,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,D=[],ie=new Map,re,M,_=[],ce=new Map,P;C=new He({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');
...
await pb.collection('${(ue=o[0])==null?void 0:ue.name}').delete('RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${o[3]}');
...
await pb.collection('${(pe=o[0])==null?void 0:pe.name}').delete('RECORD_ID');
`}});let k=o[1]&&ve(),j=o[4];const de=e=>e[6].code;for(let e=0;e<j.length;e+=1){let t=he(o,j,e),d=de(t);ie.set(d,D[e]=ye(d,t))}let S=o[4];const fe=e=>e[6].code;for(let e=0;e<S.length;e+=1){let t=ke(o,S,e),d=fe(t);ce.set(d,_[e]=De(d,t))}return{c(){l=c("h3"),s=$("Delete ("),v=$(a),i=$(")"),r=h(),p=c("div"),w=c("p"),b=$("Delete a single "),g=c("strong"),z=$(q),le=$(" record."),F=h(),$e(C.$$.fragment),K=h(),O=c("h6"),O.textContent="API details",Q=h(),y=c("div"),H=c("strong"),H.textContent="DELETE",se=h(),L=c("div"),E=c("p"),oe=$("/api/collections/"),G=c("strong"),J=$(U),ae=$("/records/"),V=c("strong"),V.textContent=":id",ne=h(),k&&k.c(),W=h(),T=c("div"),T.textContent="Path parameters",X=h(),B=c("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,Y=h(),I=c("div"),I.textContent="Responses",Z=h(),R=c("div"),A=c("div");for(let e=0;e<D.length;e+=1)D[e].c();re=h(),M=c("div");for(let e=0;e<_.length;e+=1)_[e].c();m(l,"class","m-b-sm"),m(p,"class","content txt-lg m-b-sm"),m(O,"class","m-b-xs"),m(H,"class","label label-primary"),m(L,"class","content"),m(y,"class","alert alert-danger"),m(T,"class","section-title"),m(B,"class","table-compact table-border m-b-base"),m(I,"class","section-title"),m(A,"class","tabs-header compact left"),m(M,"class","tabs-content"),m(R,"class","tabs")},m(e,t){f(e,l,t),n(l,s),n(l,v),n(l,i),f(e,r,t),f(e,p,t),n(p,w),n(w,b),n(w,g),n(g,z),n(w,le),f(e,F,t),we(C,e,t),f(e,K,t),f(e,O,t),f(e,Q,t),f(e,y,t),n(y,H),n(y,se),n(y,L),n(L,E),n(E,oe),n(E,G),n(G,J),n(E,ae),n(E,V),n(y,ne),k&&k.m(y,null),f(e,W,t),f(e,T,t),f(e,X,t),f(e,B,t),f(e,Y,t),f(e,I,t),f(e,Z,t),f(e,R,t),n(R,A);for(let d=0;d<D.length;d+=1)D[d]&&D[d].m(A,null);n(R,re),n(R,M);for(let d=0;d<_.length;d+=1)_[d]&&_[d].m(M,null);P=!0},p(e,[t]){var me,be;(!P||t&1)&&a!==(a=e[0].name+"")&&x(v,a),(!P||t&1)&&q!==(q=e[0].name+"")&&x(z,q);const d={};t&9&&(d.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(me=e[0])==null?void 0:me.name}').delete('RECORD_ID');
`),t&9&&(d.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${(be=e[0])==null?void 0:be.name}').delete('RECORD_ID');
`),C.$set(d),(!P||t&1)&&U!==(U=e[0].name+"")&&x(J,U),e[1]?k||(k=ve(),k.c(),k.m(y,null)):k&&(k.d(1),k=null),t&20&&(j=e[4],D=_e(D,t,de,1,e,j,ie,A,Ee,ye,null,he)),t&20&&(S=e[4],Oe(),_=_e(_,t,fe,1,e,S,ce,M,Te,De,null,ke),Be())},i(e){if(!P){ee(C.$$.fragment,e);for(let t=0;t<S.length;t+=1)ee(_[t]);P=!0}},o(e){te(C.$$.fragment,e);for(let t=0;t<_.length;t+=1)te(_[t]);P=!1},d(e){e&&u(l),e&&u(r),e&&u(p),e&&u(F),ge(C,e),e&&u(K),e&&u(O),e&&u(Q),e&&u(y),k&&k.d(),e&&u(W),e&&u(T),e&&u(X),e&&u(B),e&&u(Y),e&&u(I),e&&u(Z),e&&u(R);for(let t=0;t<D.length;t+=1)D[t].d();for(let t=0;t<_.length;t+=1)_[t].d()}}}function Ue(o,l,s){let a,v,{collection:i=new Ie}=l,r=204,p=[];const w=b=>s(2,r=b.code);return o.$$set=b=>{"collection"in b&&s(0,i=b.collection)},o.$$.update=()=>{o.$$.dirty&1&&s(1,a=(i==null?void 0:i.deleteRule)===null),o.$$.dirty&3&&i!=null&&i.id&&(p.push({code:204,body:`
null
`}),p.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),a&&p.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),p.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},s(3,v=Ae.getApiExampleUrl(Me.baseUrl)),[i,a,r,v,p,w]}class ze extends Ce{constructor(l){super(),Re(this,l,Ue,Le,Pe,{collection:0})}}export{ze as default};
@@ -1 +1 @@
import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as M,o as de,I as he,J as ge,K as pe,L as ye,C as q,M as me}from"./index-7cc53b3b.js";import{C as E,E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,g as we,i as Le,r as Ie,j as Ee,k as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Me,t as Y,S as De}from"./index-a6ccb683.js";function He(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s<o.length;s++){var l=o[s];d.push(new Ue(l,e)),(l.indent||l.dedent)&&(g=!0)}return{name:n.name,startState:function(){return{state:"start",pending:null,indent:g?[]:null}},copyState:function(a){var b={state:a.state,pending:a.pending,indent:a.indent&&a.indent.slice(0)};return a.stack&&(b.stack=a.stack.slice(0)),b},token:We(i),indent:Ne(i,n),languageData:n}}function Z(e,i){if(!e.hasOwnProperty(i))throw new Error("Undefined state "+i+" in simple mode")}function Fe(e,i){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((i===!1?"":"^")+"(?:"+e+")",n)}function Te(e){if(!e)return null;if(e.apply)return e;if(typeof e=="string")return e.replace(/\./g," ");for(var i=[],n=0;n<e.length;n++)i.push(e[n]&&e[n].replace(/\./g," "));return i}function Ue(e,i){(e.next||e.push)&&Z(i,e.next||e.push),this.regex=Fe(e.regex),this.token=Te(e.token),this.data=e}function We(e){return function(i,n){if(n.pending){var g=n.pending.shift();return n.pending.length==0&&(n.pending=null),i.pos+=g.text.length,g.token}for(var p=e[n.state],d=0;d<p.length;d++){var o=p[d],s=(!o.data.sol||i.sol())&&i.match(o.regex);if(s){o.data.next?n.state=o.data.next:o.data.push?((n.stack||(n.stack=[])).push(n.state),n.state=o.data.push):o.data.pop&&n.stack&&n.stack.length&&(n.state=n.stack.pop()),o.data.indent&&n.indent.push(i.indentation()+i.indentUnit),o.data.dedent&&n.indent.pop();var l=o.token;if(l&&l.apply&&(l=l(s)),s.length>2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a<s.length;a++)s[a]&&n.pending.push({text:s[a],token:o.token[a-1]});return i.backUp(s[0].length-(s[1]?s[1].length:0)),l[0]}else return l&&l.join?l[0]:l}}return i.next(),null}}function Ne(e,i){return function(n,g){if(n.indent==null||i.dontIndentStates&&i.doneIndentState.indexOf(n.state)>-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;o<d.length;o++){var s=d[o];if(s.data.dedent&&s.data.dedentIfLineStart!==!1){var l=s.regex.exec(g);if(l&&l[0]){p--,(s.next||s.push)&&(d=e[s.next||s.push]),g=g.slice(l[0].length);continue e}}}break}return p<0?0:n.indent[p]}}function Je(e){let i;return{c(){i=ue("div"),ce(i,"class","code-editor")},m(n,g){fe(n,i,g),e[15](i)},p:M,i:M,o:M,d(n){n&&de(i),e[15](null)}}}function Pe(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.schema])}function Ve(e,i,n){let g;he(e,ge,t=>n(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,H=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&q.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=q.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const r=L.filter(h=>h.isAuth);for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)q.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indLine truncated
import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as M,o as de,I as he,J as ge,K as pe,L as ye,C as q,M as me}from"./index-3d43ee7c.js";import{E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,g as we,r as Le,i as Ie,k as Ee,j as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as E,S as Me,t as De}from"./index-20adcf24.js";function He(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s<o.length;s++){var l=o[s];d.push(new Ue(l,e)),(l.indent||l.dedent)&&(g=!0)}return{name:n.name,startState:function(){return{state:"start",pending:null,indent:g?[]:null}},copyState:function(a){var b={state:a.state,pending:a.pending,indent:a.indent&&a.indent.slice(0)};return a.stack&&(b.stack=a.stack.slice(0)),b},token:We(i),indent:Ne(i,n),languageData:n}}function Z(e,i){if(!e.hasOwnProperty(i))throw new Error("Undefined state "+i+" in simple mode")}function Fe(e,i){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((i===!1?"":"^")+"(?:"+e+")",n)}function Te(e){if(!e)return null;if(e.apply)return e;if(typeof e=="string")return e.replace(/\./g," ");for(var i=[],n=0;n<e.length;n++)i.push(e[n]&&e[n].replace(/\./g," "));return i}function Ue(e,i){(e.next||e.push)&&Z(i,e.next||e.push),this.regex=Fe(e.regex),this.token=Te(e.token),this.data=e}function We(e){return function(i,n){if(n.pending){var g=n.pending.shift();return n.pending.length==0&&(n.pending=null),i.pos+=g.text.length,g.token}for(var p=e[n.state],d=0;d<p.length;d++){var o=p[d],s=(!o.data.sol||i.sol())&&i.match(o.regex);if(s){o.data.next?n.state=o.data.next:o.data.push?((n.stack||(n.stack=[])).push(n.state),n.state=o.data.push):o.data.pop&&n.stack&&n.stack.length&&(n.state=n.stack.pop()),o.data.indent&&n.indent.push(i.indentation()+i.indentUnit),o.data.dedent&&n.indent.pop();var l=o.token;if(l&&l.apply&&(l=l(s)),s.length>2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a<s.length;a++)s[a]&&n.pending.push({text:s[a],token:o.token[a-1]});return i.backUp(s[0].length-(s[1]?s[1].length:0)),l[0]}else return l&&l.join?l[0]:l}}return i.next(),null}}function Ne(e,i){return function(n,g){if(n.indent==null||i.dontIndentStates&&i.doneIndentState.indexOf(n.state)>-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;o<d.length;o++){var s=d[o];if(s.data.dedent&&s.data.dedentIfLineStart!==!1){var l=s.regex.exec(g);if(l&&l[0]){p--,(s.next||s.push)&&(d=e[s.next||s.push]),g=g.slice(l[0].length);continue e}}}break}return p<0?0:n.indent[p]}}function Je(e){let i;return{c(){i=ue("div"),ce(i,"class","code-editor")},m(n,g){fe(n,i,g),e[15](i)},p:M,i:M,o:M,d(n){n&&de(i),e[15](null)}}}function Pe(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.schema])}function Ve(e,i,n){let g;he(e,ge,t=>n(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,H=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&q.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=q.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const r=L.filter(h=>h.isAuth);for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)q.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indLine truncated
@@ -1,14 +1,14 @@
import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o as m,w as _,h as t,N as he,c as Yt,m as Zt,x as we,O as Le,P as Me,k as Be,Q as Ie,n as Ge,t as Bt,a as It,d as te,R as Ue,C as _e,p as je,r as xe}from"./index-7cc53b3b.js";import{S as Qe}from"./SdkTabs-855be3ab.js";function ze(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,R,Ut,q,it,F,W,ee,I,G,le,at,ht,X,xt,se,rt,ct,Y,O,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,E,Jt,Tt,Kt,Pt,C,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S,Nt,fe,T,k,pe,N,v,ot,ue,P,qt,me,Dt,be,Ht,Xt,Mt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format
import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o as m,w as _,h as t,N as he,c as Yt,m as Zt,x as we,O as Le,P as Me,k as Be,Q as Ie,n as Ge,t as Bt,a as It,d as te,R as Ue,C as _e,p as je,r as xe}from"./index-3d43ee7c.js";import{S as Qe}from"./SdkTabs-720afe62.js";function ze(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,O,Ut,q,it,F,W,ee,I,G,le,at,ht,X,xt,se,rt,ct,Y,E,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,S,Jt,Tt,Kt,Pt,k,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,T,Nt,fe,P,g,pe,N,v,ot,ue,R,qt,me,Dt,be,Ht,Xt,Mt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,a=s(),r=e("ul"),f=e("li"),f.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single
or double quoted), number, null, true, false`,p=s(),b=e("li"),x=e("code"),x.textContent="OPERATOR",$=_(` - is one of:
`),h=e("br"),w=s(),c=e("ul"),V=e("li"),bt=e("code"),bt.textContent="=",Gt=s(),R=e("span"),R.textContent="Equal",Ut=s(),q=e("li"),it=e("code"),it.textContent="!=",F=s(),W=e("span"),W.textContent="NOT equal",ee=s(),I=e("li"),G=e("code"),G.textContent=">",le=s(),at=e("span"),at.textContent="Greater than",ht=s(),X=e("li"),xt=e("code"),xt.textContent=">=",se=s(),rt=e("span"),rt.textContent="Greater than or equal",ct=s(),Y=e("li"),O=e("code"),O.textContent="<",jt=s(),wt=e("span"),wt.textContent="Less than",y=s(),Z=e("li"),_t=e("code"),_t.textContent="<=",Qt=s(),$t=e("span"),$t.textContent="Less than or equal",U=s(),tt=e("li"),Ct=e("code"),Ct.textContent="~",zt=s(),kt=e("span"),kt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
`),h=e("br"),w=s(),c=e("ul"),V=e("li"),bt=e("code"),bt.textContent="=",Gt=s(),O=e("span"),O.textContent="Equal",Ut=s(),q=e("li"),it=e("code"),it.textContent="!=",F=s(),W=e("span"),W.textContent="NOT equal",ee=s(),I=e("li"),G=e("code"),G.textContent=">",le=s(),at=e("span"),at.textContent="Greater than",ht=s(),X=e("li"),xt=e("code"),xt.textContent=">=",se=s(),rt=e("span"),rt.textContent="Greater than or equal",ct=s(),Y=e("li"),E=e("code"),E.textContent="<",jt=s(),wt=e("span"),wt.textContent="Less than",y=s(),Z=e("li"),_t=e("code"),_t.textContent="<=",Qt=s(),$t=e("span"),$t.textContent="Less than or equal",U=s(),tt=e("li"),Ct=e("code"),Ct.textContent="~",zt=s(),kt=e("span"),kt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,L=s(),dt=e("li"),gt=e("code"),gt.textContent="!~",ne=s(),ft=e("span"),ft.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,oe=s(),D=e("li"),vt=e("code"),vt.textContent="?=",et=s(),yt=e("em"),yt.textContent="Any/At least one of",j=s(),pt=e("span"),pt.textContent="Equal",ie=s(),H=e("li"),Ft=e("code"),Ft.textContent="?!=",lt=s(),Lt=e("em"),Lt.textContent="Any/At least one of",st=s(),At=e("span"),At.textContent="NOT equal",nt=s(),Q=e("li"),E=e("code"),E.textContent="?>",Jt=s(),Tt=e("em"),Tt.textContent="Any/At least one of",Kt=s(),Pt=e("span"),Pt.textContent="Greater than",C=s(),z=e("li"),M=e("code"),M.textContent="?>=",ae=s(),Rt=e("em"),Rt.textContent="Any/At least one of",re=s(),ut=e("span"),ut.textContent="Greater than or equal",ce=s(),B=e("li"),Ot=e("code"),Ot.textContent="?<",de=s(),Et=e("em"),Et.textContent="Any/At least one of",Vt=s(),St=e("span"),St.textContent="Less than",Wt=s(),A=e("li"),mt=e("code"),mt.textContent="?<=",J=s(),K=e("em"),K.textContent="Any/At least one of",S=s(),Nt=e("span"),Nt.textContent="Less than or equal",fe=s(),T=e("li"),k=e("code"),k.textContent="?~",pe=s(),N=e("em"),N.textContent="Any/At least one of",v=s(),ot=e("span"),ot.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ue=s(),P=e("li"),qt=e("code"),qt.textContent="?!~",me=s(),Dt=e("em"),Dt.textContent="Any/At least one of",be=s(),Ht=e("span"),Ht.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,oe=s(),D=e("li"),vt=e("code"),vt.textContent="?=",et=s(),yt=e("em"),yt.textContent="Any/At least one of",j=s(),pt=e("span"),pt.textContent="Equal",ie=s(),H=e("li"),Ft=e("code"),Ft.textContent="?!=",lt=s(),Lt=e("em"),Lt.textContent="Any/At least one of",st=s(),At=e("span"),At.textContent="NOT equal",nt=s(),Q=e("li"),S=e("code"),S.textContent="?>",Jt=s(),Tt=e("em"),Tt.textContent="Any/At least one of",Kt=s(),Pt=e("span"),Pt.textContent="Greater than",k=s(),z=e("li"),M=e("code"),M.textContent="?>=",ae=s(),Rt=e("em"),Rt.textContent="Any/At least one of",re=s(),ut=e("span"),ut.textContent="Greater than or equal",ce=s(),B=e("li"),Ot=e("code"),Ot.textContent="?<",de=s(),Et=e("em"),Et.textContent="Any/At least one of",Vt=s(),St=e("span"),St.textContent="Less than",Wt=s(),A=e("li"),mt=e("code"),mt.textContent="?<=",J=s(),K=e("em"),K.textContent="Any/At least one of",T=s(),Nt=e("span"),Nt.textContent="Less than or equal",fe=s(),P=e("li"),g=e("code"),g.textContent="?~",pe=s(),N=e("em"),N.textContent="Any/At least one of",v=s(),ot=e("span"),ot.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ue=s(),R=e("li"),qt=e("code"),qt.textContent="?!~",me=s(),Dt=e("em"),Dt.textContent="Any/At least one of",be=s(),Ht=e("span"),Ht.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,Xt=s(),Mt=e("p"),Mt.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,o(x,"class","txt-danger"),o(bt,"class","filter-op svelte-1w7s5nw"),o(R,"class","txt"),o(it,"class","filter-op svelte-1w7s5nw"),o(W,"class","txt"),o(G,"class","filter-op svelte-1w7s5nw"),o(at,"class","txt"),o(xt,"class","filter-op svelte-1w7s5nw"),o(rt,"class","txt"),o(O,"class","filter-op svelte-1w7s5nw"),o(wt,"class","txt"),o(_t,"class","filter-op svelte-1w7s5nw"),o($t,"class","txt"),o(Ct,"class","filter-op svelte-1w7s5nw"),o(kt,"class","txt"),o(gt,"class","filter-op svelte-1w7s5nw"),o(ft,"class","txt"),o(vt,"class","filter-op svelte-1w7s5nw"),o(yt,"class","txt-hint"),o(pt,"class","txt"),o(Ft,"class","filter-op svelte-1w7s5nw"),o(Lt,"class","txt-hint"),o(At,"class","txt"),o(E,"class","filter-op svelte-1w7s5nw"),o(Tt,"class","txt-hint"),o(Pt,"class","txt"),o(M,"class","filter-op svelte-1w7s5nw"),o(Rt,"class","txt-hint"),o(ut,"class","txt"),o(Ot,"class","filter-op svelte-1w7s5nw"),o(Et,"class","txt-hint"),o(St,"class","txt"),o(mt,"class","filter-op svelte-1w7s5nw"),o(K,"class","txt-hint"),o(Nt,"class","txt"),o(k,"class","filter-op svelte-1w7s5nw"),o(N,"class","txt-hint"),o(ot,"class","txt"),o(qt,"class","filter-op svelte-1w7s5nw"),o(Dt,"class","txt-hint"),o(Ht,"class","txt")},m(l,i){u(l,n,i),u(l,a,i),u(l,r,i),t(r,f),t(r,p),t(r,b),t(b,x),t(b,$),t(b,h),t(b,w),t(b,c),t(c,V),t(V,bt),t(V,Gt),t(V,R),t(c,Ut),t(c,q),t(q,it),t(q,F),t(q,W),t(c,ee),t(c,I),t(I,G),t(I,le),t(I,at),t(c,ht),t(c,X),t(X,xt),t(X,se),t(X,rt),t(c,ct),t(c,Y),t(Y,O),t(Y,jt),t(Y,wt),t(c,y),t(c,Z),t(Z,_t),t(Z,Qt),t(Z,$t),t(c,U),t(c,tt),t(tt,Ct),t(tt,zt),t(tt,kt),t(c,L),t(c,dt),t(dt,gt),t(dt,ne),t(dt,ft),t(c,oe),t(c,D),t(D,vt),t(D,et),t(D,yt),t(D,j),t(D,pt),t(c,ie),t(c,H),t(H,Ft),t(H,lt),t(H,Lt),t(H,st),t(H,At),t(c,nt),t(c,Q),t(Q,E),t(Q,Jt),t(Q,Tt),t(Q,Kt),t(Q,Pt),t(c,C),t(c,z),t(z,M),t(z,ae),t(z,Rt),t(z,re),t(z,ut),t(c,ce),t(c,B),t(B,Ot),t(B,de),t(B,Et),t(B,Vt),t(B,St),t(c,Wt),t(c,A),t(A,mt),t(A,J),t(A,K),t(A,S),t(A,Nt),t(c,fe),t(c,T),t(T,k),t(T,pe),t(T,N),t(T,v),t(T,ot),t(c,ue),t(c,P),t(P,qt),t(P,me),t(P,Dt),t(P,be),t(P,Ht),u(l,Xt,i),u(l,Mt,i)},d(l){l&&m(n),l&&m(a),l&&m(r),l&&m(Xt),l&&m(Mt)}}}function Ke(d){let n,a,r,f,p;function b(w,c){return w[0]?Je:ze}let x=b(d),$=x(d),h=d[0]&&Ae();return{c(){n=e("button"),$.c(),a=s(),h&&h.c(),r=He(),o(n,"class","btn btn-sm btn-transparent m-t-5")},m(w,c){u(w,n,c),$.m(n,null),u(w,a,c),h&&h.m(w,c),u(w,r,c),f||(p=De(n,"click",d[1]),f=!0)},p(w,[c]){x!==(x=b(w))&&($.d(1),$=x(w),$&&($.c(),$.m(n,null))),w[0]?h||(h=Ae(),h.c(),h.m(r.parentNode,r)):h&&(h.d(1),h=null)},i:Fe,o:Fe,d(w){w&&m(n),$.d(),w&&m(a),h&&h.d(w),w&&m(r),f=!1,p()}}}function Ve(d,n,a){let r=!1;function f(){a(0,r=!r)}return[r,f]}class We extends Se{constructor(n){super(),Ne(this,n,Ve,Ke,qe,{})}}function Te(d,n,a){const r=d.slice();return r[6]=n[a],r}function Pe(d,n,a){const r=d.slice();return r[6]=n[a],r}function Re(d){let n;return{c(){n=e("p"),n.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",o(n,"class","txt-hint txt-sm txt-right")},m(a,r){u(a,n,r)},d(a){a&&m(n)}}}function Oe(d,n){let a,r=n[6].code+"",f,p,b,x;function $(){return n[5](n[6])}return{key:d,first:null,c(){a=e("div"),f=_(r),p=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(h,w){u(h,a,w),t(a,f),t(a,p),b||(x=De(a,"click",$),b=!0)},p(h,w){n=h,w&20&&xe(a,"active",n[2]===n[6].code)},d(h){h&&m(a),b=!1,x()}}}function Ee(d,n){let a,r,f,p;return r=new he({props:{content:n[6].body}}),{key:d,first:null,c(){a=e("div"),Yt(r.$$.fragment),f=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(b,x){u(b,a,x),Zt(r,a,null),t(a,f),p=!0},p(b,x){n=b,(!p||x&20)&&xe(a,"active",n[2]===n[6].code)},i(b){p||(Bt(r.$$.fragment,b),p=!0)},o(b){It(r.$$.fragment,b),p=!1},d(b){b&&m(a),te(r)}}}function Xe(d){var me,Dt,be,Ht,Xt,Mt;let n,a,r=d[0].name+"",f,p,b,x,$,h,w,c=d[0].name+"",V,bt,Gt,R,Ut,q,it,F,W,ee,I,G,le,at,ht=d[0].name+"",X,xt,se,rt,ct,Y,O,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,E,Jt,Tt,Kt,Pt,C,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S=[],Nt=new Map,fe,T,k=[],pe=new Map,N;R=new Qe({props:{js:`
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,o(x,"class","txt-danger"),o(bt,"class","filter-op svelte-1w7s5nw"),o(O,"class","txt"),o(it,"class","filter-op svelte-1w7s5nw"),o(W,"class","txt"),o(G,"class","filter-op svelte-1w7s5nw"),o(at,"class","txt"),o(xt,"class","filter-op svelte-1w7s5nw"),o(rt,"class","txt"),o(E,"class","filter-op svelte-1w7s5nw"),o(wt,"class","txt"),o(_t,"class","filter-op svelte-1w7s5nw"),o($t,"class","txt"),o(Ct,"class","filter-op svelte-1w7s5nw"),o(kt,"class","txt"),o(gt,"class","filter-op svelte-1w7s5nw"),o(ft,"class","txt"),o(vt,"class","filter-op svelte-1w7s5nw"),o(yt,"class","txt-hint"),o(pt,"class","txt"),o(Ft,"class","filter-op svelte-1w7s5nw"),o(Lt,"class","txt-hint"),o(At,"class","txt"),o(S,"class","filter-op svelte-1w7s5nw"),o(Tt,"class","txt-hint"),o(Pt,"class","txt"),o(M,"class","filter-op svelte-1w7s5nw"),o(Rt,"class","txt-hint"),o(ut,"class","txt"),o(Ot,"class","filter-op svelte-1w7s5nw"),o(Et,"class","txt-hint"),o(St,"class","txt"),o(mt,"class","filter-op svelte-1w7s5nw"),o(K,"class","txt-hint"),o(Nt,"class","txt"),o(g,"class","filter-op svelte-1w7s5nw"),o(N,"class","txt-hint"),o(ot,"class","txt"),o(qt,"class","filter-op svelte-1w7s5nw"),o(Dt,"class","txt-hint"),o(Ht,"class","txt")},m(l,i){u(l,n,i),u(l,a,i),u(l,r,i),t(r,f),t(r,p),t(r,b),t(b,x),t(b,$),t(b,h),t(b,w),t(b,c),t(c,V),t(V,bt),t(V,Gt),t(V,O),t(c,Ut),t(c,q),t(q,it),t(q,F),t(q,W),t(c,ee),t(c,I),t(I,G),t(I,le),t(I,at),t(c,ht),t(c,X),t(X,xt),t(X,se),t(X,rt),t(c,ct),t(c,Y),t(Y,E),t(Y,jt),t(Y,wt),t(c,y),t(c,Z),t(Z,_t),t(Z,Qt),t(Z,$t),t(c,U),t(c,tt),t(tt,Ct),t(tt,zt),t(tt,kt),t(c,L),t(c,dt),t(dt,gt),t(dt,ne),t(dt,ft),t(c,oe),t(c,D),t(D,vt),t(D,et),t(D,yt),t(D,j),t(D,pt),t(c,ie),t(c,H),t(H,Ft),t(H,lt),t(H,Lt),t(H,st),t(H,At),t(c,nt),t(c,Q),t(Q,S),t(Q,Jt),t(Q,Tt),t(Q,Kt),t(Q,Pt),t(c,k),t(c,z),t(z,M),t(z,ae),t(z,Rt),t(z,re),t(z,ut),t(c,ce),t(c,B),t(B,Ot),t(B,de),t(B,Et),t(B,Vt),t(B,St),t(c,Wt),t(c,A),t(A,mt),t(A,J),t(A,K),t(A,T),t(A,Nt),t(c,fe),t(c,P),t(P,g),t(P,pe),t(P,N),t(P,v),t(P,ot),t(c,ue),t(c,R),t(R,qt),t(R,me),t(R,Dt),t(R,be),t(R,Ht),u(l,Xt,i),u(l,Mt,i)},d(l){l&&m(n),l&&m(a),l&&m(r),l&&m(Xt),l&&m(Mt)}}}function Ke(d){let n,a,r,f,p;function b(w,c){return w[0]?Je:ze}let x=b(d),$=x(d),h=d[0]&&Ae();return{c(){n=e("button"),$.c(),a=s(),h&&h.c(),r=He(),o(n,"class","btn btn-sm btn-transparent m-t-5")},m(w,c){u(w,n,c),$.m(n,null),u(w,a,c),h&&h.m(w,c),u(w,r,c),f||(p=De(n,"click",d[1]),f=!0)},p(w,[c]){x!==(x=b(w))&&($.d(1),$=x(w),$&&($.c(),$.m(n,null))),w[0]?h||(h=Ae(),h.c(),h.m(r.parentNode,r)):h&&(h.d(1),h=null)},i:Fe,o:Fe,d(w){w&&m(n),$.d(),w&&m(a),h&&h.d(w),w&&m(r),f=!1,p()}}}function Ve(d,n,a){let r=!1;function f(){a(0,r=!r)}return[r,f]}class We extends Se{constructor(n){super(),Ne(this,n,Ve,Ke,qe,{})}}function Te(d,n,a){const r=d.slice();return r[6]=n[a],r}function Pe(d,n,a){const r=d.slice();return r[6]=n[a],r}function Re(d){let n;return{c(){n=e("p"),n.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",o(n,"class","txt-hint txt-sm txt-right")},m(a,r){u(a,n,r)},d(a){a&&m(n)}}}function Oe(d,n){let a,r=n[6].code+"",f,p,b,x;function $(){return n[5](n[6])}return{key:d,first:null,c(){a=e("div"),f=_(r),p=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(h,w){u(h,a,w),t(a,f),t(a,p),b||(x=De(a,"click",$),b=!0)},p(h,w){n=h,w&20&&xe(a,"active",n[2]===n[6].code)},d(h){h&&m(a),b=!1,x()}}}function Ee(d,n){let a,r,f,p;return r=new he({props:{content:n[6].body}}),{key:d,first:null,c(){a=e("div"),Yt(r.$$.fragment),f=s(),o(a,"class","tab-item"),xe(a,"active",n[2]===n[6].code),this.first=a},m(b,x){u(b,a,x),Zt(r,a,null),t(a,f),p=!0},p(b,x){n=b,(!p||x&20)&&xe(a,"active",n[2]===n[6].code)},i(b){p||(Bt(r.$$.fragment,b),p=!0)},o(b){It(r.$$.fragment,b),p=!1},d(b){b&&m(a),te(r)}}}function Xe(d){var me,Dt,be,Ht,Xt,Mt;let n,a,r=d[0].name+"",f,p,b,x,$,h,w,c=d[0].name+"",V,bt,Gt,O,Ut,q,it,F,W,ee,I,G,le,at,ht=d[0].name+"",X,xt,se,rt,ct,Y,E,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,S,Jt,Tt,Kt,Pt,k,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,T=[],Nt=new Map,fe,P,g=[],pe=new Map,N;O=new Qe({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${d[3]}');
@@ -58,7 +58,7 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o
?sort=-created,id
`}}),st=new he({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),nt=new We({}),M=new he({props:{content:"?expand=relField1,relField2.subRelField"}});let ot=d[4];const ue=l=>l[6].code;for(let l=0;l<ot.length;l+=1){let i=Pe(d,ot,l),g=ue(i);Nt.set(g,S[l]=Oe(g,i))}let P=d[4];const qt=l=>l[6].code;for(let l=0;l<P.length;l+=1){let i=Te(d,P,l),g=qt(i);pe.set(g,k[l]=Ee(g,i))}return{c(){n=e("h3"),a=_("List/Search ("),f=_(r),p=_(")"),b=s(),x=e("div"),$=e("p"),h=_("Fetch a paginated "),w=e("strong"),V=_(c),bt=_(" records list, supporting sorting and filtering."),Gt=s(),Yt(R.$$.fragment),Ut=s(),q=e("h6"),q.textContent="API details",it=s(),F=e("div"),W=e("strong"),W.textContent="GET",ee=s(),I=e("div"),G=e("p"),le=_("/api/collections/"),at=e("strong"),X=_(ht),xt=_("/records"),se=s(),v&&v.c(),rt=s(),ct=e("div"),ct.textContent="Query parameters",Y=s(),O=e("table"),jt=e("thead"),jt.innerHTML=`<tr><th>Param</th>
`}}),nt=new We({}),M=new he({props:{content:"?expand=relField1,relField2.subRelField"}});let ot=d[4];const ue=l=>l[6].code;for(let l=0;l<ot.length;l+=1){let i=Pe(d,ot,l),C=ue(i);Nt.set(C,T[l]=Oe(C,i))}let R=d[4];const qt=l=>l[6].code;for(let l=0;l<R.length;l+=1){let i=Te(d,R,l),C=qt(i);pe.set(C,g[l]=Ee(C,i))}return{c(){n=e("h3"),a=_("List/Search ("),f=_(r),p=_(")"),b=s(),x=e("div"),$=e("p"),h=_("Fetch a paginated "),w=e("strong"),V=_(c),bt=_(" records list, supporting sorting and filtering."),Gt=s(),Yt(O.$$.fragment),Ut=s(),q=e("h6"),q.textContent="API details",it=s(),F=e("div"),W=e("strong"),W.textContent="GET",ee=s(),I=e("div"),G=e("p"),le=_("/api/collections/"),at=e("strong"),X=_(ht),xt=_("/records"),se=s(),v&&v.c(),rt=s(),ct=e("div"),ct.textContent="Query parameters",Y=s(),E=e("table"),jt=e("thead"),jt.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,wt=s(),y=e("tbody"),Z=e("tr"),Z.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
@@ -68,13 +68,13 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o
Add `),ft=e("code"),ft.textContent="-",oe=_(" / "),D=e("code"),D.textContent="+",vt=_(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),Yt(et.$$.fragment),yt=s(),j=e("tr"),pt=e("td"),pt.textContent="filter",ie=s(),H=e("td"),H.innerHTML='<span class="label">String</span>',Ft=s(),lt=e("td"),Lt=_(`Filter the returned records. Ex.:
`),Yt(st.$$.fragment),At=s(),Yt(nt.$$.fragment),Q=s(),E=e("tr"),Jt=e("td"),Jt.textContent="expand",Tt=s(),Kt=e("td"),Kt.innerHTML='<span class="label">String</span>',Pt=s(),C=e("td"),z=_(`Auto expand record relations. Ex.:
`),Yt(st.$$.fragment),At=s(),Yt(nt.$$.fragment),Q=s(),S=e("tr"),Jt=e("td"),Jt.textContent="expand",Tt=s(),Kt=e("td"),Kt.innerHTML='<span class="label">String</span>',Pt=s(),k=e("td"),z=_(`Auto expand record relations. Ex.:
`),Yt(M.$$.fragment),ae=_(`
Supports up to 6-levels depth nested relations expansion. `),Rt=e("br"),re=_(`
The expanded relations will be appended to each individual record under the
`),ut=e("code"),ut.textContent="expand",ce=_(" property (eg. "),B=e("code"),B.textContent='"expand": {"relField1": {...}, ...}',Ot=_(`).
`),de=e("br"),Et=_(`
Only the relations to which the request user has permissions to `),Vt=e("strong"),Vt.textContent="view",St=_(" will be expanded."),Wt=s(),A=e("div"),A.textContent="Responses",mt=s(),J=e("div"),K=e("div");for(let l=0;l<S.length;l+=1)S[l].c();fe=s(),T=e("div");for(let l=0;l<k.length;l+=1)k[l].c();o(n,"class","m-b-sm"),o(x,"class","content txt-lg m-b-sm"),o(q,"class","m-b-xs"),o(W,"class","label label-primary"),o(I,"class","content"),o(F,"class","alert alert-info"),o(ct,"class","section-title"),o(O,"class","table-compact table-border m-b-base"),o(A,"class","section-title"),o(K,"class","tabs-header compact left"),o(T,"class","tabs-content"),o(J,"class","tabs")},m(l,i){u(l,n,i),t(n,a),t(n,f),t(n,p),u(l,b,i),u(l,x,i),t(x,$),t($,h),t($,w),t(w,V),t($,bt),u(l,Gt,i),Zt(R,l,i),u(l,Ut,i),u(l,q,i),u(l,it,i),u(l,F,i),t(F,W),t(F,ee),t(F,I),t(I,G),t(G,le),t(G,at),t(at,X),t(G,xt),t(F,se),v&&v.m(F,null),u(l,rt,i),u(l,ct,i),u(l,Y,i),u(l,O,i),t(O,jt),t(O,wt),t(O,y),t(y,Z),t(y,_t),t(y,Qt),t(y,$t),t(y,U),t(U,tt),t(U,Ct),t(U,zt),t(U,kt),t(U,L),t(L,dt),t(L,gt),t(L,ne),t(L,ft),t(L,oe),t(L,D),t(L,vt),Zt(et,L,null),t(y,yt),t(y,j),t(j,pt),t(j,ie),t(j,H),t(j,Ft),t(j,lt),t(lt,Lt),Zt(st,lt,null),t(lt,At),Zt(nt,lt,null),t(y,Q),t(y,E),t(E,Jt),t(E,Tt),t(E,Kt),t(E,Pt),t(E,C),t(C,z),Zt(M,C,null),t(C,ae),t(C,Rt),t(C,re),t(C,ut),t(C,ce),t(C,B),t(C,Ot),t(C,de),t(C,Et),t(C,Vt),t(C,St),u(l,Wt,i),u(l,A,i),u(l,mt,i),u(l,J,i),t(J,K);for(let g=0;g<S.length;g+=1)S[g].m(K,null);t(J,fe),t(J,T);for(let g=0;g<k.length;g+=1)k[g].m(T,null);N=!0},p(l,[i]){var $e,Ce,ke,ge,ve,ye;(!N||i&1)&&r!==(r=l[0].name+"")&&we(f,r),(!N||i&1)&&c!==(c=l[0].name+"")&&we(V,c);const g={};i&9&&(g.js=`
Only the relations to which the request user has permissions to `),Vt=e("strong"),Vt.textContent="view",St=_(" will be expanded."),Wt=s(),A=e("div"),A.textContent="Responses",mt=s(),J=e("div"),K=e("div");for(let l=0;l<T.length;l+=1)T[l].c();fe=s(),P=e("div");for(let l=0;l<g.length;l+=1)g[l].c();o(n,"class","m-b-sm"),o(x,"class","content txt-lg m-b-sm"),o(q,"class","m-b-xs"),o(W,"class","label label-primary"),o(I,"class","content"),o(F,"class","alert alert-info"),o(ct,"class","section-title"),o(E,"class","table-compact table-border m-b-base"),o(A,"class","section-title"),o(K,"class","tabs-header compact left"),o(P,"class","tabs-content"),o(J,"class","tabs")},m(l,i){u(l,n,i),t(n,a),t(n,f),t(n,p),u(l,b,i),u(l,x,i),t(x,$),t($,h),t($,w),t(w,V),t($,bt),u(l,Gt,i),Zt(O,l,i),u(l,Ut,i),u(l,q,i),u(l,it,i),u(l,F,i),t(F,W),t(F,ee),t(F,I),t(I,G),t(G,le),t(G,at),t(at,X),t(G,xt),t(F,se),v&&v.m(F,null),u(l,rt,i),u(l,ct,i),u(l,Y,i),u(l,E,i),t(E,jt),t(E,wt),t(E,y),t(y,Z),t(y,_t),t(y,Qt),t(y,$t),t(y,U),t(U,tt),t(U,Ct),t(U,zt),t(U,kt),t(U,L),t(L,dt),t(L,gt),t(L,ne),t(L,ft),t(L,oe),t(L,D),t(L,vt),Zt(et,L,null),t(y,yt),t(y,j),t(j,pt),t(j,ie),t(j,H),t(j,Ft),t(j,lt),t(lt,Lt),Zt(st,lt,null),t(lt,At),Zt(nt,lt,null),t(y,Q),t(y,S),t(S,Jt),t(S,Tt),t(S,Kt),t(S,Pt),t(S,k),t(k,z),Zt(M,k,null),t(k,ae),t(k,Rt),t(k,re),t(k,ut),t(k,ce),t(k,B),t(k,Ot),t(k,de),t(k,Et),t(k,Vt),t(k,St),u(l,Wt,i),u(l,A,i),u(l,mt,i),u(l,J,i),t(J,K);for(let C=0;C<T.length;C+=1)T[C]&&T[C].m(K,null);t(J,fe),t(J,P);for(let C=0;C<g.length;C+=1)g[C]&&g[C].m(P,null);N=!0},p(l,[i]){var $e,Ce,ke,ge,ve,ye;(!N||i&1)&&r!==(r=l[0].name+"")&&we(f,r),(!N||i&1)&&c!==(c=l[0].name+"")&&we(V,c);const C={};i&9&&(C.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${l[3]}');
@@ -95,7 +95,7 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o
const record = await pb.collection('${(ke=l[0])==null?void 0:ke.name}').getFirstListItem('someField="test"', {
expand: 'relField1,relField2.subRelField',
});
`),i&9&&(g.dart=`
`),i&9&&(C.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${l[3]}');
@@ -119,7 +119,7 @@ import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o
'someField="test"',
expand: 'relField1,relField2.subRelField',
);
`),R.$set(g),(!N||i&1)&&ht!==(ht=l[0].name+"")&&we(X,ht),l[1]?v||(v=Re(),v.c(),v.m(F,null)):v&&(v.d(1),v=null),i&20&&(ot=l[4],S=Le(S,i,ue,1,l,ot,Nt,K,Me,Oe,null,Pe)),i&20&&(P=l[4],Be(),k=Le(k,i,qt,1,l,P,pe,T,Ie,Ee,null,Te),Ge())},i(l){if(!N){Bt(R.$$.fragment,l),Bt(et.$$.fragment,l),Bt(st.$$.fragment,l),Bt(nt.$$.fragment,l),Bt(M.$$.fragment,l);for(let i=0;i<P.length;i+=1)Bt(k[i]);N=!0}},o(l){It(R.$$.fragment,l),It(et.$$.fragment,l),It(st.$$.fragment,l),It(nt.$$.fragment,l),It(M.$$.fragment,l);for(let i=0;i<k.length;i+=1)It(k[i]);N=!1},d(l){l&&m(n),l&&m(b),l&&m(x),l&&m(Gt),te(R,l),l&&m(Ut),l&&m(q),l&&m(it),l&&m(F),v&&v.d(),l&&m(rt),l&&m(ct),l&&m(Y),l&&m(O),te(et),te(st),te(nt),te(M),l&&m(Wt),l&&m(A),l&&m(mt),l&&m(J);for(let i=0;i<S.length;i+=1)S[i].d();for(let i=0;i<k.length;i+=1)k[i].d()}}}function Ye(d,n,a){let r,f,{collection:p=new Ue}=n,b=200,x=[];const $=h=>a(2,b=h.code);return d.$$set=h=>{"collection"in h&&a(0,p=h.collection)},d.$$.update=()=>{d.$$.dirty&1&&a(1,r=(p==null?void 0:p.listRule)===null),d.$$.dirty&3&&p!=null&&p.id&&(x.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[_e.dummyCollectionRecord(p),_e.dummyCollectionRecord(p)]},null,2)}),x.push({code:400,body:`
`),O.$set(C),(!N||i&1)&&ht!==(ht=l[0].name+"")&&we(X,ht),l[1]?v||(v=Re(),v.c(),v.m(F,null)):v&&(v.d(1),v=null),i&20&&(ot=l[4],T=Le(T,i,ue,1,l,ot,Nt,K,Me,Oe,null,Pe)),i&20&&(R=l[4],Be(),g=Le(g,i,qt,1,l,R,pe,P,Ie,Ee,null,Te),Ge())},i(l){if(!N){Bt(O.$$.fragment,l),Bt(et.$$.fragment,l),Bt(st.$$.fragment,l),Bt(nt.$$.fragment,l),Bt(M.$$.fragment,l);for(let i=0;i<R.length;i+=1)Bt(g[i]);N=!0}},o(l){It(O.$$.fragment,l),It(et.$$.fragment,l),It(st.$$.fragment,l),It(nt.$$.fragment,l),It(M.$$.fragment,l);for(let i=0;i<g.length;i+=1)It(g[i]);N=!1},d(l){l&&m(n),l&&m(b),l&&m(x),l&&m(Gt),te(O,l),l&&m(Ut),l&&m(q),l&&m(it),l&&m(F),v&&v.d(),l&&m(rt),l&&m(ct),l&&m(Y),l&&m(E),te(et),te(st),te(nt),te(M),l&&m(Wt),l&&m(A),l&&m(mt),l&&m(J);for(let i=0;i<T.length;i+=1)T[i].d();for(let i=0;i<g.length;i+=1)g[i].d()}}}function Ye(d,n,a){let r,f,{collection:p=new Ue}=n,b=200,x=[];const $=h=>a(2,b=h.code);return d.$$set=h=>{"collection"in h&&a(0,p=h.collection)},d.$$.update=()=>{d.$$.dirty&1&&a(1,r=(p==null?void 0:p.listRule)===null),d.$$.dirty&3&&p!=null&&p.id&&(x.push({code:200,body:JSON.stringify({page:1,perPage:30,totalPages:1,totalItems:2,items:[_e.dummyCollectionRecord(p),_e.dummyCollectionRecord(p)]},null,2)}),x.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
@@ -1,4 +1,4 @@
import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s,m as Ee,x as U,O as Pe,P as Le,k as Me,Q as Re,n as We,t as te,a as le,o as d,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,N as je}from"./index-7cc53b3b.js";import{S as Ne}from"./SdkTabs-855be3ab.js";function ye(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ae(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ce(a,l){let o,n=l[5].code+"",f,h,c,u;function m(){return l[4](l[5])}return{key:a,first:null,c(){o=i("button"),f=v(n),h=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(g,P){r(g,o,P),s(o,f),s(o,h),c||(u=Ue(o,"click",m),c=!0)},p(g,P){l=g,P&4&&n!==(n=l[5].code+"")&&U(f,n),P&6&&j(o,"active",l[1]===l[5].code)},d(g){g&&d(o),c=!1,u()}}}function Te(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Se(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Ee(n,o,null),s(o,f),h=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),n.$set(m),(!h||u&6)&&j(o,"active",l[1]===l[5].code)},i(c){h||(te(n.$$.fragment,c),h=!0)},o(c){le(n.$$.fragment,c),h=!1},d(c){c&&d(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,u,m,g,P,M=a[0].name+"",N,oe,se,G,K,y,Q,S,F,w,R,ae,W,A,ne,J,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,$=[],de=new Map,ue,O,k=[],pe=new Map,T;y=new Ne({props:{js:`
import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as d,h as s,m as Ee,x as U,O as Pe,P as Le,k as Me,Q as Re,n as We,t as te,a as le,o as u,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,N as je}from"./index-3d43ee7c.js";import{S as Ne}from"./SdkTabs-720afe62.js";function ye(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ae(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ce(a,l){let o,n=l[5].code+"",f,h,c,p;function m(){return l[4](l[5])}return{key:a,first:null,c(){o=i("button"),f=v(n),h=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(g,P){d(g,o,P),s(o,f),s(o,h),c||(p=Ue(o,"click",m),c=!0)},p(g,P){l=g,P&4&&n!==(n=l[5].code+"")&&U(f,n),P&6&&j(o,"active",l[1]===l[5].code)},d(g){g&&u(o),c=!1,p()}}}function Te(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Se(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ee(n,o,null),s(o,f),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),n.$set(m),(!h||p&6)&&j(o,"active",l[1]===l[5].code)},i(c){h||(te(n.$$.fragment,c),h=!0)},o(c){le(n.$$.fragment,c),h=!1},d(c){c&&u(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,p,m,g,P,M=a[0].name+"",N,oe,se,G,K,y,Q,S,F,$,R,ae,W,A,ne,J,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,w=[],de=new Map,ue,O,k=[],pe=new Map,T;y=new Ne({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
@@ -22,12 +22,12 @@ import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s
final result = await pb.collection('${(ke=a[0])==null?void 0:ke.name}').listExternalAuths(
pb.authStore.model.id,
);
`}});let H=a[2];const fe=e=>e[5].code;for(let e=0;e<H.length;e+=1){let t=Ae(a,H,e),p=fe(t);de.set(p,$[e]=Ce(p,t))}let L=a[2];const me=e=>e[5].code;for(let e=0;e<L.length;e+=1){let t=ye(a,L,e),p=me(t);pe.set(p,k[e]=Te(p,t))}return{c(){l=i("h3"),o=v("List OAuth2 accounts ("),f=v(n),h=v(")"),c=_(),u=i("div"),m=i("p"),g=v("Returns a list with all OAuth2 providers linked to a single "),P=i("strong"),N=v(M),oe=v("."),se=_(),G=i("p"),G.textContent="Only admins and the account owner can access this action.",K=_(),Se(y.$$.fragment),Q=_(),S=i("h6"),S.textContent="API details",F=_(),w=i("div"),R=i("strong"),R.textContent="GET",ae=_(),W=i("div"),A=i("p"),ne=v("/api/collections/"),J=i("strong"),V=v(z),ie=v("/records/"),X=i("strong"),X.textContent=":id",ce=v("/external-auths"),re=_(),D=i("p"),D.innerHTML="Requires <code>Authorization:TOKEN</code> header",Y=_(),E=i("div"),E.textContent="Path Parameters",Z=_(),I=i("table"),I.innerHTML=`<thead><tr><th>Param</th>
`}});let H=a[2];const fe=e=>e[5].code;for(let e=0;e<H.length;e+=1){let t=Ae(a,H,e),r=fe(t);de.set(r,w[e]=Ce(r,t))}let L=a[2];const me=e=>e[5].code;for(let e=0;e<L.length;e+=1){let t=ye(a,L,e),r=me(t);pe.set(r,k[e]=Te(r,t))}return{c(){l=i("h3"),o=v("List OAuth2 accounts ("),f=v(n),h=v(")"),c=_(),p=i("div"),m=i("p"),g=v("Returns a list with all OAuth2 providers linked to a single "),P=i("strong"),N=v(M),oe=v("."),se=_(),G=i("p"),G.textContent="Only admins and the account owner can access this action.",K=_(),Se(y.$$.fragment),Q=_(),S=i("h6"),S.textContent="API details",F=_(),$=i("div"),R=i("strong"),R.textContent="GET",ae=_(),W=i("div"),A=i("p"),ne=v("/api/collections/"),J=i("strong"),V=v(z),ie=v("/records/"),X=i("strong"),X.textContent=":id",ce=v("/external-auths"),re=_(),D=i("p"),D.innerHTML="Requires <code>Authorization:TOKEN</code> header",Y=_(),E=i("div"),E.textContent="Path Parameters",Z=_(),I=i("table"),I.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the auth record.</td></tr></tbody>`,x=_(),B=i("div"),B.textContent="Responses",ee=_(),C=i("div"),q=i("div");for(let e=0;e<$.length;e+=1)$[e].c();ue=_(),O=i("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(u,"class","content txt-lg m-b-sm"),b(S,"class","m-b-xs"),b(R,"class","label label-primary"),b(W,"class","content"),b(D,"class","txt-hint txt-sm txt-right"),b(w,"class","alert alert-info"),b(E,"class","section-title"),b(I,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(q,"class","tabs-header compact left"),b(O,"class","tabs-content"),b(C,"class","tabs")},m(e,t){r(e,l,t),s(l,o),s(l,f),s(l,h),r(e,c,t),r(e,u,t),s(u,m),s(m,g),s(m,P),s(P,N),s(m,oe),s(u,se),s(u,G),r(e,K,t),Ee(y,e,t),r(e,Q,t),r(e,S,t),r(e,F,t),r(e,w,t),s(w,R),s(w,ae),s(w,W),s(W,A),s(A,ne),s(A,J),s(J,V),s(A,ie),s(A,X),s(A,ce),s(w,re),s(w,D),r(e,Y,t),r(e,E,t),r(e,Z,t),r(e,I,t),r(e,x,t),r(e,B,t),r(e,ee,t),r(e,C,t),s(C,q);for(let p=0;p<$.length;p+=1)$[p].m(q,null);s(C,ue),s(C,O);for(let p=0;p<k.length;p+=1)k[p].m(O,null);T=!0},p(e,[t]){var ve,we,$e,ge;(!T||t&1)&&n!==(n=e[0].name+"")&&U(f,n),(!T||t&1)&&M!==(M=e[0].name+"")&&U(N,M);const p={};t&9&&(p.js=`
<td>ID of the auth record.</td></tr></tbody>`,x=_(),B=i("div"),B.textContent="Responses",ee=_(),C=i("div"),q=i("div");for(let e=0;e<w.length;e+=1)w[e].c();ue=_(),O=i("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(S,"class","m-b-xs"),b(R,"class","label label-primary"),b(W,"class","content"),b(D,"class","txt-hint txt-sm txt-right"),b($,"class","alert alert-info"),b(E,"class","section-title"),b(I,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(q,"class","tabs-header compact left"),b(O,"class","tabs-content"),b(C,"class","tabs")},m(e,t){d(e,l,t),s(l,o),s(l,f),s(l,h),d(e,c,t),d(e,p,t),s(p,m),s(m,g),s(m,P),s(P,N),s(m,oe),s(p,se),s(p,G),d(e,K,t),Ee(y,e,t),d(e,Q,t),d(e,S,t),d(e,F,t),d(e,$,t),s($,R),s($,ae),s($,W),s(W,A),s(A,ne),s(A,J),s(J,V),s(A,ie),s(A,X),s(A,ce),s($,re),s($,D),d(e,Y,t),d(e,E,t),d(e,Z,t),d(e,I,t),d(e,x,t),d(e,B,t),d(e,ee,t),d(e,C,t),s(C,q);for(let r=0;r<w.length;r+=1)w[r]&&w[r].m(q,null);s(C,ue),s(C,O);for(let r=0;r<k.length;r+=1)k[r]&&k[r].m(O,null);T=!0},p(e,[t]){var ve,we,$e,ge;(!T||t&1)&&n!==(n=e[0].name+"")&&U(f,n),(!T||t&1)&&M!==(M=e[0].name+"")&&U(N,M);const r={};t&9&&(r.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -39,7 +39,7 @@ import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s
const result = await pb.collection('${(we=e[0])==null?void 0:we.name}').listExternalAuths(
pb.authStore.model.id
);
`),t&9&&(p.dart=`
`),t&9&&(r.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -51,7 +51,7 @@ import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s
final result = await pb.collection('${(ge=e[0])==null?void 0:ge.name}').listExternalAuths(
pb.authStore.model.id,
);
`),y.$set(p),(!T||t&1)&&z!==(z=e[0].name+"")&&U(V,z),t&6&&(H=e[2],$=Pe($,t,fe,1,e,H,de,q,Le,Ce,null,Ae)),t&6&&(L=e[2],Me(),k=Pe(k,t,me,1,e,L,pe,O,Re,Te,null,ye),We())},i(e){if(!T){te(y.$$.fragment,e);for(let t=0;t<L.length;t+=1)te(k[t]);T=!0}},o(e){le(y.$$.fragment,e);for(let t=0;t<k.length;t+=1)le(k[t]);T=!1},d(e){e&&d(l),e&&d(c),e&&d(u),e&&d(K),Ie(y,e),e&&d(Q),e&&d(S),e&&d(F),e&&d(w),e&&d(Y),e&&d(E),e&&d(Z),e&&d(I),e&&d(x),e&&d(B),e&&d(ee),e&&d(C);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Ke(a,l,o){let n,{collection:f=new ze}=l,h=200,c=[];const u=m=>o(1,h=m.code);return a.$$set=m=>{"collection"in m&&o(0,f=m.collection)},a.$$.update=()=>{a.$$.dirty&1&&o(2,c=[{code:200,body:`
`),y.$set(r),(!T||t&1)&&z!==(z=e[0].name+"")&&U(V,z),t&6&&(H=e[2],w=Pe(w,t,fe,1,e,H,de,q,Le,Ce,null,Ae)),t&6&&(L=e[2],Me(),k=Pe(k,t,me,1,e,L,pe,O,Re,Te,null,ye),We())},i(e){if(!T){te(y.$$.fragment,e);for(let t=0;t<L.length;t+=1)te(k[t]);T=!0}},o(e){le(y.$$.fragment,e);for(let t=0;t<k.length;t+=1)le(k[t]);T=!1},d(e){e&&u(l),e&&u(c),e&&u(p),e&&u(K),Ie(y,e),e&&u(Q),e&&u(S),e&&u(F),e&&u($),e&&u(Y),e&&u(E),e&&u(Z),e&&u(I),e&&u(x),e&&u(B),e&&u(ee),e&&u(C);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Ke(a,l,o){let n,{collection:f=new ze}=l,h=200,c=[];const p=m=>o(1,h=m.code);return a.$$set=m=>{"collection"in m&&o(0,f=m.collection)},a.$$.update=()=>{a.$$.dirty&1&&o(2,c=[{code:200,body:`
[
{
"id": "8171022dc95a4e8",
@@ -90,4 +90,4 @@ import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s
"message": "The requested resource wasn't found.",
"data": {}
}
`}])},o(3,n=De.getApiExampleUrl(He.baseUrl)),[f,h,c,n,u]}class Je extends Be{constructor(l){super(),qe(this,l,Ke,Ge,Oe,{collection:0})}}export{Je as default};
`}])},o(3,n=De.getApiExampleUrl(He.baseUrl)),[f,h,c,n,p]}class Je extends Be{constructor(l){super(),qe(this,l,Ke,Ge,Oe,{collection:0})}}export{Je as default};
@@ -1,2 +1,2 @@
import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index-7cc53b3b.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,P,v,k,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index-3d43ee7c.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,P,v,k,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
`),m&&m.c(),t=C(),A(r.$$.fragment),p=C(),A(d.$$.fragment),n=C(),i=c("button"),g=c("span"),g.textContent="Set new password",R=C(),P=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(P,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,P,$),_(P,v),k=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!k||$&4)&&(i.disabled=a[2]),(!k||$&4)&&L(i,"btn-loading",a[2])},i(a){k||(H(r.$$.fragment,a),H(d.$$.fragment,a),k=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),k=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(P),F=!1,V(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default};
@@ -1,2 +1,2 @@
import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index-7cc53b3b.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4>
import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index-3d43ee7c.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4>
<p>Enter the email associated with your account and we’ll send you a recovery link:</p>`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),(!a||$&2)&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='<i class="ri-checkbox-circle-line"></i>',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){S(e,n)}}}function W(c,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default};
@@ -1,4 +1,4 @@
import{S as z,i as G,s as I,F as J,c as S,m as L,t as v,a as y,d as R,C as M,E as N,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as C,b as h,f as d,r as H,h as k,u as P,v as K,y as E,x as O,z as T}from"./index-7cc53b3b.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&F(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address
import{S as z,i as G,s as I,F as J,c as S,m as L,t as v,a as y,d as R,C as M,E as N,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as C,b as h,f as d,r as H,h as k,u as P,v as K,y as E,x as O,z as T}from"./index-3d43ee7c.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&F(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address
`),p&&p.c(),n=h(),S(o.$$.fragment),c=h(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","content txt-center m-b-base"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,t),k(t,l),k(l,s),p&&p.m(l,null),k(e,n),L(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||($=P(e,"submit",K(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=F(f),p.c(),p.m(l,null)):p&&(p.d(1),p=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:f}),o.$set(q),(!u||w&2)&&(a.disabled=f[1]),(!u||w&2)&&H(a,"btn-loading",f[1])},i(f){u||(v(o.$$.fragment,f),u=!0)},o(f){y(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),R(o),g=!1,$()}}}function U(r){let e,t,l,s,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully changed the user email address.</p>
<p>You can now sign in with your new email address.</p></div>`,t=h(),l=m("button"),l.textContent="Close",d(e,"class","alert alert-success"),d(l,"type","button"),d(l,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,t,c),_(o,l,c),s||(n=P(l,"click",r[6]),s=!0)},p:E,i:E,o:E,d(o){o&&b(e),o&&b(t),o&&b(l),s=!1,n()}}}function F(r){let e,t,l;return{c(){e=C("to "),t=m("strong"),l=C(r[3]),d(t,"class","txt-nowrap")},m(s,n){_(s,e,n),_(s,t,n),k(t,l)},p(s,n){n&8&&O(l,s[3])},d(s){s&&b(e),s&&b(t)}}}function V(r){let e,t,l,s,n,o,c,a;return{c(){e=m("label"),t=C("Password"),s=h(),n=m("input"),d(e,"for",l=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,t),_(i,s,u),_(i,n,u),T(n,r[0]),n.focus(),c||(a=P(n,"input",r[7]),c=!0)},p(i,u){u&256&&l!==(l=i[8])&&d(e,"for",l),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&T(n,i[0])},d(i){i&&b(e),i&&b(s),i&&b(n),c=!1,a()}}}function X(r){let e,t,l,s;const n=[U,Q],o=[];function c(a,i){return a[2]?0:1}return e=c(r),t=o[e]=n[e](r),{c(){t.c(),l=N()},m(a,i){o[e].m(a,i),_(a,l,i),s=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(W(),y(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,i):(t=o[e]=n[e](a),t.c()),v(t,1),t.m(l.parentNode,l))},i(a){s||(v(t),s=!0)},o(a){y(t),s=!1},d(a){o[e].d(a),a&&b(l)}}}function Z(r){let e,t;return e=new J({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(l,s){L(e,l,s),t=!0},p(l,[s]){const n={};s&527&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){t||(v(e.$$.fragment,l),t=!0)},o(l){y(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function x(r,e,t){let l,{params:s}=e,n="",o=!1,c=!1;async function a(){if(o)return;t(1,o=!0);const g=new j("../");try{const $=A(s==null?void 0:s.token);await g.collection($.collectionId).confirmEmailChange(s==null?void 0:s.token,n),t(2,c=!0)}catch($){B.errorResponseHandler($)}t(1,o=!1)}const i=()=>window.close();function u(){n=this.value,t(0,n)}return r.$$set=g=>{"params"in g&&t(5,s=g.params)},r.$$.update=()=>{r.$$.dirty&32&&t(3,l=M.getJWTPayload(s==null?void 0:s.token).newEmail||"")},[n,o,c,l,a,s,i,u]}class te extends z{constructor(e){super(),G(this,e,x,Z,I,{params:5})}}export{te as default};
@@ -1,4 +1,4 @@
import{S as J,i as M,s as W,F as Y,c as F,m as N,t as y,a as q,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as R,b as P,f as p,r as G,h as w,u as H,v as U,y as S,x as V,z as h}from"./index-7cc53b3b.js";function X(r){let e,l,s,n,t,o,c,a,i,u,v,k,g,C,d=r[4]&&I(r);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=R(`Reset your user password
import{S as J,i as M,s as W,F as Y,c as F,m as N,t as y,a as q,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as R,b as P,f as p,r as G,h as w,u as H,v as U,y as S,x as V,z as h}from"./index-3d43ee7c.js";function X(r){let e,l,s,n,t,o,c,a,i,u,v,k,g,C,d=r[4]&&I(r);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=R(`Reset your user password
`),d&&d.c(),t=P(),F(o.$$.fragment),c=P(),F(a.$$.fragment),i=P(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=r[2],G(u,"btn-loading",r[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),N(o,e,null),w(e,c),N(a,e,null),w(e,i),w(e,u),w(u,v),k=!0,g||(C=H(e,"submit",U(r[5])),g=!0)},p(f,$){f[4]?d?d.p(f,$):(d=I(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const L={};$&3073&&(L.$$scope={dirty:$,ctx:f}),o.$set(L);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),a.$set(z),(!k||$&4)&&(u.disabled=f[2]),(!k||$&4)&&G(u,"btn-loading",f[2])},i(f){k||(y(o.$$.fragment,f),y(a.$$.fragment,f),k=!0)},o(f){q(o.$$.fragment,f),q(a.$$.fragment,f),k=!1},d(f){f&&m(e),d&&d.d(),T(o),T(a),g=!1,C()}}}function Z(r){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully changed the user password.</p>
<p>You can now sign in with your new password.</p></div>`,l=P(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=H(s,"click",r[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function I(r){let e,l,s;return{c(){e=R("for "),l=b("strong"),s=R(r[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&m(e),n&&m(l)}}}function x(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[0]),t.focus(),c||(a=H(t,"input",r[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&h(t,i[0])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function ee(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password confirm"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[1]),c||(a=H(t,"input",r[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&h(t,i[1])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function te(r){let e,l,s,n;const t=[Z,X],o=[];function c(a,i){return a[3]?0:1}return e=c(r),l=o[e]=t[e](r),{c(){l.c(),s=A()},m(a,i){o[e].m(a,i),_(a,s,i),n=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(B(),q(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(a,i):(l=o[e]=t[e](a),l.c()),y(l,1),l.m(s.parentNode,s))},i(a){n||(y(l),n=!0)},o(a){q(l),n=!1},d(a){o[e].d(a),a&&m(s)}}}function se(r){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(y(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(r,e,l){let s,{params:n}=e,t="",o="",c=!1,a=!1;async function i(){if(c)return;l(2,c=!0);const g=new K("../");try{const C=O(n==null?void 0:n.token);await g.collection(C.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,a=!0)}catch(C){Q.errorResponseHandler(C)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function k(){o=this.value,l(1,o)}return r.$$set=g=>{"params"in g&&l(6,n=g.params)},r.$$.update=()=>{r.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,a,s,i,n,u,v,k]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default};
@@ -1,3 +1,3 @@
import{S as v,i as y,s as w,F as C,c as g,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-7cc53b3b.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
import{S as v,i as y,s as w,F as C,c as g,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-3d43ee7c.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
<div class="content txt-bold"><p>Invalid or expired verification token.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[4]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function F(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
<div class="content txt-bold"><p>Successfully verified email address.</p></div>`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[3]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function I(o){let t;return{c(){t=u("div"),t.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function V(o){let t;function s(l,i){return l[1]?I:l[0]?F:S}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),r(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){n.d(l),l&&a(t)}}}function q(o){let t,s;return t=new C({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){g(t.$$.fragment)},m(e,n){x(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function E(o,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const d=new P("../");try{const m=T(e==null?void 0:e.token);await d.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const c=()=>window.close(),k=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,l,e,c,k]}class N extends v{constructor(t){super(),y(this,t,E,q,w,{params:2})}}export{N as default};
@@ -1,4 +1,4 @@
import{S as re,i as ae,s as be,N as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,R as me,p as de}from"./index-7cc53b3b.js";import{S as fe}from"./SdkTabs-855be3ab.js";function $e(o){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:`
import{S as re,i as ae,s as be,N as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,R as me,p as de}from"./index-3d43ee7c.js";import{S as fe}from"./SdkTabs-720afe62.js";function $e(o){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[1]}');
+70
View File
@@ -0,0 +1,70 @@
import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x as L,O as ve,P as Se,k as Re,Q as Me,n as Ae,t as x,a as ee,o as d,d as ye,R as We,C as ze,p as He,r as N,u as Oe,N as Ue}from"./index-3d43ee7c.js";import{S as je}from"./SdkTabs-720afe62.js";function we(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=w(a),b=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){m($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&d(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),Pe(a.$$.fragment),_=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){m(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&N(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&d(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,g,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,R,Z,C,M,v=[],ne=new Map,ie,A,h=[],ce=new Map,y;P=new je({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');
...
await pb.collection('${(de=o[0])==null?void 0:de.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(pe=o[0])==null?void 0:pe.name}').requestEmailChange('new@example.com');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${o[3]}');
...
await pb.collection('${(ue=o[0])==null?void 0:ue.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestEmailChange('new@example.com');
`}});let D=o[2];const re=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=ge(o,D,e),c=re(t);ne.set(c,v[e]=$e(c,t))}let W=o[2];const me=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=we(o,W,e),c=me(t);ce.set(c,h[e]=qe(c,t))}return{c(){l=r("h3"),s=w("Request email change ("),_=w(a),b=w(")"),i=k(),p=r("div"),u=r("p"),$=w("Sends "),q=r("strong"),F=w(z),te=w(" email change request."),I=k(),Pe(P.$$.fragment),K=k(),T=r("h6"),T.textContent="API details",Q=k(),g=r("div"),H=r("strong"),H.textContent="POST",le=k(),O=r("div"),E=r("p"),se=w("/api/collections/"),G=r("strong"),J=w(U),ae=w("/request-email-change"),oe=k(),j=r("p"),j.innerHTML="Requires record <code>Authorization:TOKEN</code> header",V=k(),B=r("div"),B.textContent="Body Parameters",X=k(),S=r("table"),S.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>newEmail</span></div></td>
<td><span class="label">String</span></td>
<td>The new email address to send the change email request.</td></tr></tbody>`,Y=k(),R=r("div"),R.textContent="Responses",Z=k(),C=r("div"),M=r("div");for(let e=0;e<v.length;e+=1)v[e].c();ie=k(),A=r("div");for(let e=0;e<h.length;e+=1)h[e].c();f(l,"class","m-b-sm"),f(p,"class","content txt-lg m-b-sm"),f(T,"class","m-b-xs"),f(H,"class","label label-primary"),f(O,"class","content"),f(j,"class","txt-hint txt-sm txt-right"),f(g,"class","alert alert-success"),f(B,"class","section-title"),f(S,"class","table-compact table-border m-b-base"),f(R,"class","section-title"),f(M,"class","tabs-header compact left"),f(A,"class","tabs-content"),f(C,"class","tabs")},m(e,t){m(e,l,t),n(l,s),n(l,_),n(l,b),m(e,i,t),m(e,p,t),n(p,u),n(u,$),n(u,q),n(q,F),n(u,te),m(e,I,t),Ce(P,e,t),m(e,K,t),m(e,T,t),m(e,Q,t),m(e,g,t),n(g,H),n(g,le),n(g,O),n(O,E),n(E,se),n(E,G),n(G,J),n(E,ae),n(g,oe),n(g,j),m(e,V,t),m(e,B,t),m(e,X,t),m(e,S,t),m(e,Y,t),m(e,R,t),m(e,Z,t),m(e,C,t),n(C,M);for(let c=0;c<v.length;c+=1)v[c]&&v[c].m(M,null);n(C,ie),n(C,A);for(let c=0;c<h.length;c+=1)h[c]&&h[c].m(A,null);y=!0},p(e,[t]){var be,_e,he,ke;(!y||t&1)&&a!==(a=e[0].name+"")&&L(_,a),(!y||t&1)&&z!==(z=e[0].name+"")&&L(F,z);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(be=e[0])==null?void 0:be.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(_e=e[0])==null?void 0:_e.name}').requestEmailChange('new@example.com');
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${(he=e[0])==null?void 0:he.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(ke=e[0])==null?void 0:ke.name}').requestEmailChange('new@example.com');
`),P.$set(c),(!y||t&1)&&U!==(U=e[0].name+"")&&L(J,U),t&6&&(D=e[2],v=ve(v,t,re,1,e,D,ne,M,Se,$e,null,ge)),t&6&&(W=e[2],Re(),h=ve(h,t,me,1,e,W,ce,A,Me,qe,null,we),Ae())},i(e){if(!y){x(P.$$.fragment,e);for(let t=0;t<W.length;t+=1)x(h[t]);y=!0}},o(e){ee(P.$$.fragment,e);for(let t=0;t<h.length;t+=1)ee(h[t]);y=!1},d(e){e&&d(l),e&&d(i),e&&d(p),e&&d(I),ye(P,e),e&&d(K),e&&d(T),e&&d(Q),e&&d(g),e&&d(V),e&&d(B),e&&d(X),e&&d(S),e&&d(Y),e&&d(R),e&&d(Z),e&&d(C);for(let t=0;t<v.length;t+=1)v[t].d();for(let t=0;t<h.length;t+=1)h[t].d()}}}function Le(o,l,s){let a,{collection:_=new We}=l,b=204,i=[];const p=u=>s(1,b=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=ze.getApiExampleUrl(He.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
"data": {
"newEmail": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
"data": {}
}
`},{code:403,body:`
{
"code": 403,
"message": "The authorized record model is not allowed to perform this action.",
"data": {}
}
`}]),[_,b,i,a,p]}class Ie extends Te{constructor(l){super(),Ee(this,l,Le,De,Be,{collection:0})}}export{Ie as default};
-70
View File
@@ -1,70 +0,0 @@
import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as Ce,x as L,O as ve,P as Se,k as Re,Q as Me,n as Ae,t as x,a as ee,o as m,d as ye,R as We,C as ze,p as He,r as N,u as Oe,N as Ue}from"./index-7cc53b3b.js";import{S as je}from"./SdkTabs-855be3ab.js";function we(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),b=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){r($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&m(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Pe(a.$$.fragment),_=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){r(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&N(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&m(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,w,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,R,Z,C,M,g=[],ne=new Map,ie,A,k=[],ce=new Map,y;P=new je({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${o[3]}');
...
await pb.collection('${(de=o[0])==null?void 0:de.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(pe=o[0])==null?void 0:pe.name}').requestEmailChange('new@example.com');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${o[3]}');
...
await pb.collection('${(ue=o[0])==null?void 0:ue.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(fe=o[0])==null?void 0:fe.name}').requestEmailChange('new@example.com');
`}});let D=o[2];const re=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=ge(o,D,e),d=re(t);ne.set(d,g[e]=$e(d,t))}let W=o[2];const me=e=>e[5].code;for(let e=0;e<W.length;e+=1){let t=we(o,W,e),d=me(t);ce.set(d,k[e]=qe(d,t))}return{c(){l=c("h3"),s=v("Request email change ("),_=v(a),b=v(")"),i=h(),p=c("div"),u=c("p"),$=v("Sends "),q=c("strong"),F=v(z),te=v(" email change request."),I=h(),Pe(P.$$.fragment),K=h(),T=c("h6"),T.textContent="API details",Q=h(),w=c("div"),H=c("strong"),H.textContent="POST",le=h(),O=c("div"),E=c("p"),se=v("/api/collections/"),G=c("strong"),J=v(U),ae=v("/request-email-change"),oe=h(),j=c("p"),j.innerHTML="Requires record <code>Authorization:TOKEN</code> header",V=h(),B=c("div"),B.textContent="Body Parameters",X=h(),S=c("table"),S.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>newEmail</span></div></td>
<td><span class="label">String</span></td>
<td>The new email address to send the change email request.</td></tr></tbody>`,Y=h(),R=c("div"),R.textContent="Responses",Z=h(),C=c("div"),M=c("div");for(let e=0;e<g.length;e+=1)g[e].c();ie=h(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();f(l,"class","m-b-sm"),f(p,"class","content txt-lg m-b-sm"),f(T,"class","m-b-xs"),f(H,"class","label label-primary"),f(O,"class","content"),f(j,"class","txt-hint txt-sm txt-right"),f(w,"class","alert alert-success"),f(B,"class","section-title"),f(S,"class","table-compact table-border m-b-base"),f(R,"class","section-title"),f(M,"class","tabs-header compact left"),f(A,"class","tabs-content"),f(C,"class","tabs")},m(e,t){r(e,l,t),n(l,s),n(l,_),n(l,b),r(e,i,t),r(e,p,t),n(p,u),n(u,$),n(u,q),n(q,F),n(u,te),r(e,I,t),Ce(P,e,t),r(e,K,t),r(e,T,t),r(e,Q,t),r(e,w,t),n(w,H),n(w,le),n(w,O),n(O,E),n(E,se),n(E,G),n(G,J),n(E,ae),n(w,oe),n(w,j),r(e,V,t),r(e,B,t),r(e,X,t),r(e,S,t),r(e,Y,t),r(e,R,t),r(e,Z,t),r(e,C,t),n(C,M);for(let d=0;d<g.length;d+=1)g[d].m(M,null);n(C,ie),n(C,A);for(let d=0;d<k.length;d+=1)k[d].m(A,null);y=!0},p(e,[t]){var be,_e,he,ke;(!y||t&1)&&a!==(a=e[0].name+"")&&L(_,a),(!y||t&1)&&z!==(z=e[0].name+"")&&L(F,z);const d={};t&9&&(d.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(be=e[0])==null?void 0:be.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(_e=e[0])==null?void 0:_e.name}').requestEmailChange('new@example.com');
`),t&9&&(d.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${(he=e[0])==null?void 0:he.name}').authWithPassword('test@example.com', '1234567890');
await pb.collection('${(ke=e[0])==null?void 0:ke.name}').requestEmailChange('new@example.com');
`),P.$set(d),(!y||t&1)&&U!==(U=e[0].name+"")&&L(J,U),t&6&&(D=e[2],g=ve(g,t,re,1,e,D,ne,M,Se,$e,null,ge)),t&6&&(W=e[2],Re(),k=ve(k,t,me,1,e,W,ce,A,Me,qe,null,we),Ae())},i(e){if(!y){x(P.$$.fragment,e);for(let t=0;t<W.length;t+=1)x(k[t]);y=!0}},o(e){ee(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)ee(k[t]);y=!1},d(e){e&&m(l),e&&m(i),e&&m(p),e&&m(I),ye(P,e),e&&m(K),e&&m(T),e&&m(Q),e&&m(w),e&&m(V),e&&m(B),e&&m(X),e&&m(S),e&&m(Y),e&&m(R),e&&m(Z),e&&m(C);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Le(o,l,s){let a,{collection:_=new We}=l,b=204,i=[];const p=u=>s(1,b=u.code);return o.$$set=u=>{"collection"in u&&s(0,_=u.collection)},s(3,a=ze.getApiExampleUrl(He.baseUrl)),s(2,i=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
"data": {
"newEmail": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
"data": {}
}
`},{code:403,body:`
{
"code": 403,
"message": "The authorized record model is not allowed to perform this action.",
"data": {}
}
`}]),[_,b,i,a,p]}class Ie extends Te{constructor(l){super(),Ee(this,l,Le,De,Be,{collection:0})}}export{Ie as default};
+50
View File
@@ -0,0 +1,50 @@
import{S as Pe,i as $e,s as qe,e as r,w as h,b as v,c as ve,f as b,g as d,h as n,m as we,x as I,O as me,P as Re,k as ge,Q as ye,n as Be,t as Z,a as x,o as f,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,N as Ae}from"./index-3d43ee7c.js";import{S as Ue}from"./SdkTabs-720afe62.js";function ue(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:a,first:null,c(){l=r("button"),_=h(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){d(P,l,$),n(l,_),n(l,u),i||(p=Me(l,"click",m),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&f(l),i=!1,p()}}}function ke(a,s){let l,o,_,u;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=r("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(i,l,p),we(o,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),o.$set(m),(!u||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){u||(Z(o.$$.fragment,i),u=!0)},o(i){x(o.$$.fragment,i),u=!1},d(i){i&&f(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,u,i,p,m,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,R,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,g,A,w=[],oe=new Map,ae,U,k=[],ne=new Map,y;q=new Ue({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
...
await pb.collection('${(re=a[0])==null?void 0:re.name}').requestPasswordReset('test@example.com');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${a[3]}');
...
await pb.collection('${(de=a[0])==null?void 0:de.name}').requestPasswordReset('test@example.com');
`}});let F=a[2];const ie=e=>e[5].code;for(let e=0;e<F.length;e+=1){let t=be(a,F,e),c=ie(t);oe.set(c,w[e]=_e(c,t))}let j=a[2];const ce=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=ue(a,j,e),c=ce(t);ne.set(c,k[e]=ke(c,t))}return{c(){s=r("h3"),l=h("Request password reset ("),_=h(o),u=h(")"),i=v(),p=r("div"),m=r("p"),P=h("Sends "),$=r("strong"),N=h(D),ee=h(" password reset email request."),Q=v(),ve(q.$$.fragment),z=v(),B=r("h6"),B.textContent="API details",G=v(),R=r("div"),H=r("strong"),H.textContent="POST",te=v(),O=r("div"),C=r("p"),se=h("/api/collections/"),J=r("strong"),K=h(E),le=h("/request-password-reset"),V=v(),S=r("div"),S.textContent="Body Parameters",W=v(),T=r("table"),T.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>email</span></div></td>
<td><span class="label">String</span></td>
<td>The auth record email address to send the password reset request (if exists).</td></tr></tbody>`,X=v(),M=r("div"),M.textContent="Responses",Y=v(),g=r("div"),A=r("div");for(let e=0;e<w.length;e+=1)w[e].c();ae=v(),U=r("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(H,"class","label label-primary"),b(O,"class","content"),b(R,"class","alert alert-success"),b(S,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(M,"class","section-title"),b(A,"class","tabs-header compact left"),b(U,"class","tabs-content"),b(g,"class","tabs")},m(e,t){d(e,s,t),n(s,l),n(s,_),n(s,u),d(e,i,t),d(e,p,t),n(p,m),n(m,P),n(m,$),n($,N),n(m,ee),d(e,Q,t),we(q,e,t),d(e,z,t),d(e,B,t),d(e,G,t),d(e,R,t),n(R,H),n(R,te),n(R,O),n(O,C),n(C,se),n(C,J),n(J,K),n(C,le),d(e,V,t),d(e,S,t),d(e,W,t),d(e,T,t),d(e,X,t),d(e,M,t),d(e,Y,t),d(e,g,t),n(g,A);for(let c=0;c<w.length;c+=1)w[c]&&w[c].m(A,null);n(g,ae),n(g,U);for(let c=0;c<k.length;c+=1)k[c]&&k[c].m(U,null);y=!0},p(e,[t]){var fe,pe;(!y||t&1)&&o!==(o=e[0].name+"")&&I(_,o),(!y||t&1)&&D!==(D=e[0].name+"")&&I(N,D);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(fe=e[0])==null?void 0:fe.name}').requestPasswordReset('test@example.com');
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${(pe=e[0])==null?void 0:pe.name}').requestPasswordReset('test@example.com');
`),q.$set(c),(!y||t&1)&&E!==(E=e[0].name+"")&&I(K,E),t&6&&(F=e[2],w=me(w,t,ie,1,e,F,oe,A,Re,_e,null,be)),t&6&&(j=e[2],ge(),k=me(k,t,ce,1,e,j,ne,U,ye,ke,null,ue),Be())},i(e){if(!y){Z(q.$$.fragment,e);for(let t=0;t<j.length;t+=1)Z(k[t]);y=!0}},o(e){x(q.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);y=!1},d(e){e&&f(s),e&&f(i),e&&f(p),e&&f(Q),he(q,e),e&&f(z),e&&f(B),e&&f(G),e&&f(R),e&&f(V),e&&f(S),e&&f(W),e&&f(T),e&&f(X),e&&f(M),e&&f(Y),e&&f(g);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(a,s,l){let o,{collection:_=new Ce}=s,u=204,i=[];const p=m=>l(1,u=m.code);return a.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,o=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
"data": {
"email": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`}]),[_,u,i,o,p]}class Ee extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Ee as default};
-50
View File
@@ -1,50 +0,0 @@
import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as I,O as me,P as Re,k as ge,Q as ye,n as Be,t as Z,a as x,o as d,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,N as Ae}from"./index-7cc53b3b.js";import{S as Ue}from"./SdkTabs-855be3ab.js";function ue(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:a,first:null,c(){l=c("button"),_=w(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){r(P,l,$),n(l,_),n(l,u),i||(p=Me(l,"click",m),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&d(l),i=!1,p()}}}function ke(a,s){let l,o,_,u;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=c("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(o,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),o.$set(m),(!u||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){u||(Z(o.$$.fragment,i),u=!0)},o(i){x(o.$$.fragment,i),u=!1},d(i){i&&d(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,u,i,p,m,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,R,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,g,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,y;q=new Ue({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
...
await pb.collection('${(re=a[0])==null?void 0:re.name}').requestPasswordReset('test@example.com');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${a[3]}');
...
await pb.collection('${(de=a[0])==null?void 0:de.name}').requestPasswordReset('test@example.com');
`}});let F=a[2];const ie=e=>e[5].code;for(let e=0;e<F.length;e+=1){let t=be(a,F,e),f=ie(t);oe.set(f,h[e]=_e(f,t))}let j=a[2];const ce=e=>e[5].code;for(let e=0;e<j.length;e+=1){let t=ue(a,j,e),f=ce(t);ne.set(f,k[e]=ke(f,t))}return{c(){s=c("h3"),l=w("Request password reset ("),_=w(o),u=w(")"),i=v(),p=c("div"),m=c("p"),P=w("Sends "),$=c("strong"),N=w(D),ee=w(" password reset email request."),Q=v(),ve(q.$$.fragment),z=v(),B=c("h6"),B.textContent="API details",G=v(),R=c("div"),H=c("strong"),H.textContent="POST",te=v(),O=c("div"),C=c("p"),se=w("/api/collections/"),J=c("strong"),K=w(E),le=w("/request-password-reset"),V=v(),S=c("div"),S.textContent="Body Parameters",W=v(),T=c("table"),T.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>email</span></div></td>
<td><span class="label">String</span></td>
<td>The auth record email address to send the password reset request (if exists).</td></tr></tbody>`,X=v(),M=c("div"),M.textContent="Responses",Y=v(),g=c("div"),A=c("div");for(let e=0;e<h.length;e+=1)h[e].c();ae=v(),U=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(s,"class","m-b-sm"),b(p,"class","content txt-lg m-b-sm"),b(B,"class","m-b-xs"),b(H,"class","label label-primary"),b(O,"class","content"),b(R,"class","alert alert-success"),b(S,"class","section-title"),b(T,"class","table-compact table-border m-b-base"),b(M,"class","section-title"),b(A,"class","tabs-header compact left"),b(U,"class","tabs-content"),b(g,"class","tabs")},m(e,t){r(e,s,t),n(s,l),n(s,_),n(s,u),r(e,i,t),r(e,p,t),n(p,m),n(m,P),n(m,$),n($,N),n(m,ee),r(e,Q,t),we(q,e,t),r(e,z,t),r(e,B,t),r(e,G,t),r(e,R,t),n(R,H),n(R,te),n(R,O),n(O,C),n(C,se),n(C,J),n(J,K),n(C,le),r(e,V,t),r(e,S,t),r(e,W,t),r(e,T,t),r(e,X,t),r(e,M,t),r(e,Y,t),r(e,g,t),n(g,A);for(let f=0;f<h.length;f+=1)h[f].m(A,null);n(g,ae),n(g,U);for(let f=0;f<k.length;f+=1)k[f].m(U,null);y=!0},p(e,[t]){var fe,pe;(!y||t&1)&&o!==(o=e[0].name+"")&&I(_,o),(!y||t&1)&&D!==(D=e[0].name+"")&&I(N,D);const f={};t&9&&(f.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
...
await pb.collection('${(fe=e[0])==null?void 0:fe.name}').requestPasswordReset('test@example.com');
`),t&9&&(f.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
...
await pb.collection('${(pe=e[0])==null?void 0:pe.name}').requestPasswordReset('test@example.com');
`),q.$set(f),(!y||t&1)&&E!==(E=e[0].name+"")&&I(K,E),t&6&&(F=e[2],h=me(h,t,ie,1,e,F,oe,A,Re,_e,null,be)),t&6&&(j=e[2],ge(),k=me(k,t,ce,1,e,j,ne,U,ye,ke,null,ue),Be())},i(e){if(!y){Z(q.$$.fragment,e);for(let t=0;t<j.length;t+=1)Z(k[t]);y=!0}},o(e){x(q.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);y=!1},d(e){e&&d(s),e&&d(i),e&&d(p),e&&d(Q),he(q,e),e&&d(z),e&&d(B),e&&d(G),e&&d(R),e&&d(V),e&&d(S),e&&d(W),e&&d(T),e&&d(X),e&&d(M),e&&d(Y),e&&d(g);for(let t=0;t<h.length;t+=1)h[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function De(a,s,l){let o,{collection:_=new Ce}=s,u=204,i=[];const p=m=>l(1,u=m.code);return a.$$set=m=>{"collection"in m&&l(0,_=m.collection)},l(3,o=Se.getApiExampleUrl(Te.baseUrl)),l(2,i=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
"data": {
"email": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`}]),[_,u,i,o,p]}class Ee extends Pe{constructor(s){super(),$e(this,s,De,je,qe,{collection:0})}}export{Ee as default};
@@ -1,4 +1,4 @@
import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as f,d as $e,R as Se,C as Te,p as Re,r as I,u as Ve,N as Me}from"./index-7cc53b3b.js";import{S as Ae}from"./SdkTabs-855be3ab.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=c("button"),_=h(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){r(q,s,w),i(s,_),i(s,p),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&f(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){r(n,s,u),he(o,s,null),i(s,_),p=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!p||u&6)&&I(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&f(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,R,X,V,Y,y,M,$=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:`
import{S as qe,i as we,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as m,d as $e,R as Se,C as Te,p as Re,r as I,u as Ve,N as Me}from"./index-3d43ee7c.js";import{S as Ae}from"./SdkTabs-720afe62.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=r("button"),_=$(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){f(q,s,w),i(s,_),i(s,p),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&m(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){f(n,s,u),he(o,s,null),i(s,_),p=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!p||u&6)&&I(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&m(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,R,X,V,Y,y,M,h=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${a[3]}');
@@ -14,13 +14,13 @@ import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i
...
await pb.collection('${(fe=a[0])==null?void 0:fe.name}').requestVerification('test@example.com');
`}});let E=a[2];const ne=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=be(a,E,e),m=ne(t);oe.set(m,$[e]=_e(m,t))}let U=a[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=pe(a,U,e),m=ce(t);ie.set(m,k[e]=ke(m,t))}return{c(){l=c("h3"),s=h("Request verification ("),_=h(o),p=h(")"),n=v(),u=c("div"),d=c("p"),q=h("Sends "),w=c("strong"),L=h(j),ee=h(" verification email request."),N=v(),ve(P.$$.fragment),Q=v(),C=c("h6"),C.textContent="API details",z=v(),g=c("div"),D=c("strong"),D.textContent="POST",te=v(),H=c("div"),S=c("p"),le=h("/api/collections/"),G=c("strong"),J=h(O),se=h("/request-verification"),K=v(),T=c("div"),T.textContent="Body Parameters",W=v(),R=c("table"),R.innerHTML=`<thead><tr><th>Param</th>
`}});let E=a[2];const ne=e=>e[5].code;for(let e=0;e<E.length;e+=1){let t=be(a,E,e),c=ne(t);oe.set(c,h[e]=_e(c,t))}let U=a[2];const ce=e=>e[5].code;for(let e=0;e<U.length;e+=1){let t=pe(a,U,e),c=ce(t);ie.set(c,k[e]=ke(c,t))}return{c(){l=r("h3"),s=$("Request verification ("),_=$(o),p=$(")"),n=v(),u=r("div"),d=r("p"),q=$("Sends "),w=r("strong"),L=$(j),ee=$(" verification email request."),N=v(),ve(P.$$.fragment),Q=v(),C=r("h6"),C.textContent="API details",z=v(),g=r("div"),D=r("strong"),D.textContent="POST",te=v(),H=r("div"),S=r("p"),le=$("/api/collections/"),G=r("strong"),J=$(O),se=$("/request-verification"),K=v(),T=r("div"),T.textContent="Body Parameters",W=v(),R=r("table"),R.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr></thead>
<tbody><tr><td><div class="inline-flex"><span class="label label-success">Required</span>
<span>email</span></div></td>
<td><span class="label">String</span></td>
<td>The auth record email address to send the verification request (if exists).</td></tr></tbody>`,X=v(),V=c("div"),V.textContent="Responses",Y=v(),y=c("div"),M=c("div");for(let e=0;e<$.length;e+=1)$[e].c();ae=v(),A=c("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(u,"class","content txt-lg m-b-sm"),b(C,"class","m-b-xs"),b(D,"class","label label-primary"),b(H,"class","content"),b(g,"class","alert alert-success"),b(T,"class","section-title"),b(R,"class","table-compact table-border m-b-base"),b(V,"class","section-title"),b(M,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(y,"class","tabs")},m(e,t){r(e,l,t),i(l,s),i(l,_),i(l,p),r(e,n,t),r(e,u,t),i(u,d),i(d,q),i(d,w),i(w,L),i(d,ee),r(e,N,t),he(P,e,t),r(e,Q,t),r(e,C,t),r(e,z,t),r(e,g,t),i(g,D),i(g,te),i(g,H),i(H,S),i(S,le),i(S,G),i(G,J),i(S,se),r(e,K,t),r(e,T,t),r(e,W,t),r(e,R,t),r(e,X,t),r(e,V,t),r(e,Y,t),r(e,y,t),i(y,M);for(let m=0;m<$.length;m+=1)$[m].m(M,null);i(y,ae),i(y,A);for(let m=0;m<k.length;m+=1)k[m].m(A,null);B=!0},p(e,[t]){var me,ue;(!B||t&1)&&o!==(o=e[0].name+"")&&F(_,o),(!B||t&1)&&j!==(j=e[0].name+"")&&F(L,j);const m={};t&9&&(m.js=`
<td>The auth record email address to send the verification request (if exists).</td></tr></tbody>`,X=v(),V=r("div"),V.textContent="Responses",Y=v(),y=r("div"),M=r("div");for(let e=0;e<h.length;e+=1)h[e].c();ae=v(),A=r("div");for(let e=0;e<k.length;e+=1)k[e].c();b(l,"class","m-b-sm"),b(u,"class","content txt-lg m-b-sm"),b(C,"class","m-b-xs"),b(D,"class","label label-primary"),b(H,"class","content"),b(g,"class","alert alert-success"),b(T,"class","section-title"),b(R,"class","table-compact table-border m-b-base"),b(V,"class","section-title"),b(M,"class","tabs-header compact left"),b(A,"class","tabs-content"),b(y,"class","tabs")},m(e,t){f(e,l,t),i(l,s),i(l,_),i(l,p),f(e,n,t),f(e,u,t),i(u,d),i(d,q),i(d,w),i(w,L),i(d,ee),f(e,N,t),he(P,e,t),f(e,Q,t),f(e,C,t),f(e,z,t),f(e,g,t),i(g,D),i(g,te),i(g,H),i(H,S),i(S,le),i(S,G),i(G,J),i(S,se),f(e,K,t),f(e,T,t),f(e,W,t),f(e,R,t),f(e,X,t),f(e,V,t),f(e,Y,t),f(e,y,t),i(y,M);for(let c=0;c<h.length;c+=1)h[c]&&h[c].m(M,null);i(y,ae),i(y,A);for(let c=0;c<k.length;c+=1)k[c]&&k[c].m(A,null);B=!0},p(e,[t]){var me,ue;(!B||t&1)&&o!==(o=e[0].name+"")&&F(_,o),(!B||t&1)&&j!==(j=e[0].name+"")&&F(L,j);const c={};t&9&&(c.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -28,7 +28,7 @@ import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i
...
await pb.collection('${(me=e[0])==null?void 0:me.name}').requestVerification('test@example.com');
`),t&9&&(m.dart=`
`),t&9&&(c.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -36,7 +36,7 @@ import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i
...
await pb.collection('${(ue=e[0])==null?void 0:ue.name}').requestVerification('test@example.com');
`),P.$set(m),(!B||t&1)&&O!==(O=e[0].name+"")&&F(J,O),t&6&&(E=e[2],$=de($,t,ne,1,e,E,oe,M,ge,_e,null,be)),t&6&&(U=e[2],ye(),k=de(k,t,ce,1,e,U,ie,A,Be,ke,null,pe),Ce())},i(e){if(!B){Z(P.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);B=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);B=!1},d(e){e&&f(l),e&&f(n),e&&f(u),e&&f(N),$e(P,e),e&&f(Q),e&&f(C),e&&f(z),e&&f(g),e&&f(K),e&&f(T),e&&f(W),e&&f(R),e&&f(X),e&&f(V),e&&f(Y),e&&f(y);for(let t=0;t<$.length;t+=1)$[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function je(a,l,s){let o,{collection:_=new Se}=l,p=204,n=[];const u=d=>s(1,p=d.code);return a.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Te.getApiExampleUrl(Re.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:`
`),P.$set(c),(!B||t&1)&&O!==(O=e[0].name+"")&&F(J,O),t&6&&(E=e[2],h=de(h,t,ne,1,e,E,oe,M,ge,_e,null,be)),t&6&&(U=e[2],ye(),k=de(k,t,ce,1,e,U,ie,A,Be,ke,null,pe),Ce())},i(e){if(!B){Z(P.$$.fragment,e);for(let t=0;t<U.length;t+=1)Z(k[t]);B=!0}},o(e){x(P.$$.fragment,e);for(let t=0;t<k.length;t+=1)x(k[t]);B=!1},d(e){e&&m(l),e&&m(n),e&&m(u),e&&m(N),$e(P,e),e&&m(Q),e&&m(C),e&&m(z),e&&m(g),e&&m(K),e&&m(T),e&&m(W),e&&m(R),e&&m(X),e&&m(V),e&&m(Y),e&&m(y);for(let t=0;t<h.length;t+=1)h[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function je(a,l,s){let o,{collection:_=new Se}=l,p=204,n=[];const u=d=>s(1,p=d.code);return a.$$set=d=>{"collection"in d&&s(0,_=d.collection)},s(3,o=Te.getApiExampleUrl(Re.baseUrl)),s(2,n=[{code:204,body:"null"},{code:400,body:`
{
"code": 400,
"message": "Failed to authenticate.",
+1
View File
@@ -0,0 +1 @@
import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-3d43ee7c.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=z(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&R(r,g),f&6&&S(l,"active",e[1]===e[6].language)},d(_){_&&w(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=j(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),H(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=o[2];const p=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=K(o,f,t),u=p(a);g.set(u,s[t]=T(u,a))}let d=o[2];const b=t=>t[6].language;for(let t=0;t<d.length;t+=1){let a=D(o,d,t),u=b(a);k.set(u,n[t]=I(u,a))}return{c(){e=v("div"),l=v("div");for(let t=0;t<s.length;t+=1)s[t].c();r=j(),i=v("div");for(let t=0;t<n.length;t+=1)n[t].c();h(l,"class","tabs-header compact left"),h(i,"class","tabs-content"),h(e,"class",c="tabs sdk-tabs "+o[0]+" svelte-1maocj6")},m(t,a){y(t,e,a),m(e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(l,null);m(e,r),m(e,i);for(let u=0;u<n.length;u+=1)n[u]&&n[u].m(i,null);_=!0},p(t,[a]){a&6&&(f=t[2],s=C(s,a,p,1,t,f,g,l,J,T,null,K)),a&6&&(d=t[2],O(),n=C(n,a,b,1,t,d,k,i,Q,I,null,D),Y()),(!_||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!_){for(let a=0;a<d.length;a+=1)N(n[a]);_=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);_=!1},d(t){t&&w(e);for(let a=0;a<s.length;a+=1)s[a].d();for(let a=0;a<n.length;a+=1)n[a].d()}}}const M="pb_sdk_preference";function V(o,e,l){let s,{class:g="m-b-base"}=e,{js:r=""}=e,{dart:i=""}=e,n=localStorage.getItem(M)||"javascript";const k=c=>l(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S};
-1
View File
@@ -1 +0,0 @@
import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-7cc53b3b.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(u,_){y(u,l,_),m(l,s),m(s,r),m(l,i),n||(k=z(l,"click",c),n=!0)},p(u,_){e=u,_&4&&g!==(g=e[6].title+"")&&R(r,g),_&6&&S(l,"active",e[1]===e[6].language)},d(u){u&&w(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,u,_,p,f;return s=new A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),u=E(" SDK"),p=j(),h(n,"href",_=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),H(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,u),m(l,p),f=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!f||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!f||t&4&&_!==(_=e[6].url))&&h(n,"href",_),(!f||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){f||(N(s.$$.fragment,b),f=!0)},o(b){P(s.$$.fragment,b),f=!1},d(b){b&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,u,_=o[2];const p=t=>t[6].language;for(let t=0;t<_.length;t+=1){let a=K(o,_,t),d=p(a);g.set(d,s[t]=T(d,a))}let f=o[2];const b=t=>t[6].language;for(let t=0;t<f.length;t+=1){let a=D(o,f,t),d=b(a);k.set(d,n[t]=I(d,a))}return{c(){e=v("div"),l=v("div");for(let t=0;t<s.length;t+=1)s[t].c();r=j(),i=v("div");for(let t=0;t<n.length;t+=1)n[t].c();h(l,"class","tabs-header compact left"),h(i,"class","tabs-content"),h(e,"class",c="tabs sdk-tabs "+o[0]+" svelte-1maocj6")},m(t,a){y(t,e,a),m(e,l);for(let d=0;d<s.length;d+=1)s[d].m(l,null);m(e,r),m(e,i);for(let d=0;d<n.length;d+=1)n[d].m(i,null);u=!0},p(t,[a]){a&6&&(_=t[2],s=C(s,a,p,1,t,_,g,l,J,T,null,K)),a&6&&(f=t[2],O(),n=C(n,a,b,1,t,f,k,i,Q,I,null,D),Y()),(!u||a&1&&c!==(c="tabs sdk-tabs "+t[0]+" svelte-1maocj6"))&&h(e,"class",c)},i(t){if(!u){for(let a=0;a<f.length;a+=1)N(n[a]);u=!0}},o(t){for(let a=0;a<n.length;a+=1)P(n[a]);u=!1},d(t){t&&w(e);for(let a=0;a<s.length;a+=1)s[a].d();for(let a=0;a<n.length;a+=1)n[a].d()}}}const M="pb_sdk_preference";function V(o,e,l){let s,{class:g="m-b-base"}=e,{js:r=""}=e,{dart:i=""}=e,n=localStorage.getItem(M)||"javascript";const k=c=>l(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S};
@@ -1,4 +1,4 @@
import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as Be,x as j,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as d,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,N as Ne}from"./index-7cc53b3b.js";import{S as Ke}from"./SdkTabs-855be3ab.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,u;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m($,P){r($,o,P),s(o,_),s(o,b),c||(u=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&I(o,"active",l[1]===l[5].code)},d($){$&&d(o),c=!1,u()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Be(a,o,null),s(o,_),b=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!b||u&6)&&I(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&d(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,u,m,$,P,M=n[0].name+"",N,se,ae,K,Q,A,F,E,G,g,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,w=[],ue=new Map,pe,O,k=[],me=new Map,T;A=new Ke({props:{js:`
import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as d,h as s,m as Be,x as j,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as u,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,N as Ne}from"./index-3d43ee7c.js";import{S as Ke}from"./SdkTabs-720afe62.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),s(o,_),s(o,b),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&I(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Be(a,o,null),s(o,_),b=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),a.$set(m),(!b||p&6)&&I(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&u(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,p,m,$,P,M=n[0].name+"",N,se,ae,K,Q,A,F,E,G,w,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,g=[],ue=new Map,pe,O,k=[],me=new Map,T;A=new Ke({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${n[3]}');
@@ -24,7 +24,7 @@ import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
pb.authStore.model.id,
'google',
);
`}});let R=n[2];const fe=e=>e[5].code;for(let e=0;e<R.length;e+=1){let t=Ce(n,R,e),p=fe(t);ue.set(p,w[e]=Te(p,t))}let D=n[2];const be=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=Ae(n,D,e),p=be(t);me.set(p,k[e]=Ee(p,t))}return{c(){l=i("h3"),o=v("Unlink OAuth2 account ("),_=v(a),b=v(")"),c=h(),u=i("div"),m=i("p"),$=v("Unlink a single external OAuth2 provider from "),P=i("strong"),N=v(M),se=v(" record."),ae=h(),K=i("p"),K.textContent="Only admins and the account owner can access this action.",Q=h(),Se(A.$$.fragment),F=h(),E=i("h6"),E.textContent="API details",G=h(),g=i("div"),W=i("strong"),W.textContent="DELETE",ne=h(),z=i("div"),y=i("p"),ie=v("/api/collections/"),J=i("strong"),V=v(H),ce=v("/records/"),X=i("strong"),X.textContent=":id",re=v("/external-auths/"),Y=i("strong"),Y.textContent=":provider",de=h(),L=i("p"),L.innerHTML="Requires <code>Authorization:TOKEN</code> header",Z=h(),S=i("div"),S.textContent="Path Parameters",x=h(),B=i("table"),B.innerHTML=`<thead><tr><th>Param</th>
`}});let R=n[2];const fe=e=>e[5].code;for(let e=0;e<R.length;e+=1){let t=Ce(n,R,e),r=fe(t);ue.set(r,g[e]=Te(r,t))}let D=n[2];const be=e=>e[5].code;for(let e=0;e<D.length;e+=1){let t=Ae(n,D,e),r=be(t);me.set(r,k[e]=Ee(r,t))}return{c(){l=i("h3"),o=v("Unlink OAuth2 account ("),_=v(a),b=v(")"),c=h(),p=i("div"),m=i("p"),$=v("Unlink a single external OAuth2 provider from "),P=i("strong"),N=v(M),se=v(" record."),ae=h(),K=i("p"),K.textContent="Only admins and the account owner can access this action.",Q=h(),Se(A.$$.fragment),F=h(),E=i("h6"),E.textContent="API details",G=h(),w=i("div"),W=i("strong"),W.textContent="DELETE",ne=h(),z=i("div"),y=i("p"),ie=v("/api/collections/"),J=i("strong"),V=v(H),ce=v("/records/"),X=i("strong"),X.textContent=":id",re=v("/external-auths/"),Y=i("strong"),Y.textContent=":provider",de=h(),L=i("p"),L.innerHTML="Requires <code>Authorization:TOKEN</code> header",Z=h(),S=i("div"),S.textContent="Path Parameters",x=h(),B=i("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
@@ -33,7 +33,7 @@ import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
<tr><td>provider</td>
<td><span class="label">String</span></td>
<td>The name of the auth provider to unlink, eg. <code>google</code>, <code>twitter</code>,
<code>github</code>, etc.</td></tr></tbody>`,ee=h(),U=i("div"),U.textContent="Responses",te=h(),C=i("div"),q=i("div");for(let e=0;e<w.length;e+=1)w[e].c();pe=h(),O=i("div");for(let e=0;e<k.length;e+=1)k[e].c();f(l,"class","m-b-sm"),f(u,"class","content txt-lg m-b-sm"),f(E,"class","m-b-xs"),f(W,"class","label label-primary"),f(z,"class","content"),f(L,"class","txt-hint txt-sm txt-right"),f(g,"class","alert alert-danger"),f(S,"class","section-title"),f(B,"class","table-compact table-border m-b-base"),f(U,"class","section-title"),f(q,"class","tabs-header compact left"),f(O,"class","tabs-content"),f(C,"class","tabs")},m(e,t){r(e,l,t),s(l,o),s(l,_),s(l,b),r(e,c,t),r(e,u,t),s(u,m),s(m,$),s(m,P),s(P,N),s(m,se),s(u,ae),s(u,K),r(e,Q,t),Be(A,e,t),r(e,F,t),r(e,E,t),r(e,G,t),r(e,g,t),s(g,W),s(g,ne),s(g,z),s(z,y),s(y,ie),s(y,J),s(J,V),s(y,ce),s(y,X),s(y,re),s(y,Y),s(g,de),s(g,L),r(e,Z,t),r(e,S,t),r(e,x,t),r(e,B,t),r(e,ee,t),r(e,U,t),r(e,te,t),r(e,C,t),s(C,q);for(let p=0;p<w.length;p+=1)w[p].m(q,null);s(C,pe),s(C,O);for(let p=0;p<k.length;p+=1)k[p].m(O,null);T=!0},p(e,[t]){var ge,we,$e,Pe;(!T||t&1)&&a!==(a=e[0].name+"")&&j(_,a),(!T||t&1)&&M!==(M=e[0].name+"")&&j(N,M);const p={};t&9&&(p.js=`
<code>github</code>, etc.</td></tr></tbody>`,ee=h(),U=i("div"),U.textContent="Responses",te=h(),C=i("div"),q=i("div");for(let e=0;e<g.length;e+=1)g[e].c();pe=h(),O=i("div");for(let e=0;e<k.length;e+=1)k[e].c();f(l,"class","m-b-sm"),f(p,"class","content txt-lg m-b-sm"),f(E,"class","m-b-xs"),f(W,"class","label label-primary"),f(z,"class","content"),f(L,"class","txt-hint txt-sm txt-right"),f(w,"class","alert alert-danger"),f(S,"class","section-title"),f(B,"class","table-compact table-border m-b-base"),f(U,"class","section-title"),f(q,"class","tabs-header compact left"),f(O,"class","tabs-content"),f(C,"class","tabs")},m(e,t){d(e,l,t),s(l,o),s(l,_),s(l,b),d(e,c,t),d(e,p,t),s(p,m),s(m,$),s(m,P),s(P,N),s(m,se),s(p,ae),s(p,K),d(e,Q,t),Be(A,e,t),d(e,F,t),d(e,E,t),d(e,G,t),d(e,w,t),s(w,W),s(w,ne),s(w,z),s(z,y),s(y,ie),s(y,J),s(J,V),s(y,ce),s(y,X),s(y,re),s(y,Y),s(w,de),s(w,L),d(e,Z,t),d(e,S,t),d(e,x,t),d(e,B,t),d(e,ee,t),d(e,U,t),d(e,te,t),d(e,C,t),s(C,q);for(let r=0;r<g.length;r+=1)g[r]&&g[r].m(q,null);s(C,pe),s(C,O);for(let r=0;r<k.length;r+=1)k[r]&&k[r].m(O,null);T=!0},p(e,[t]){var ge,we,$e,Pe;(!T||t&1)&&a!==(a=e[0].name+"")&&j(_,a),(!T||t&1)&&M!==(M=e[0].name+"")&&j(N,M);const r={};t&9&&(r.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -46,7 +46,7 @@ import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
pb.authStore.model.id,
'google'
);
`),t&9&&(p.dart=`
`),t&9&&(r.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -59,7 +59,7 @@ import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
pb.authStore.model.id,
'google',
);
`),A.$set(p),(!T||t&1)&&H!==(H=e[0].name+"")&&j(V,H),t&6&&(R=e[2],w=ye(w,t,fe,1,e,R,ue,q,Me,Te,null,Ce)),t&6&&(D=e[2],We(),k=ye(k,t,be,1,e,D,me,O,ze,Ee,null,Ae),He())},i(e){if(!T){le(A.$$.fragment,e);for(let t=0;t<D.length;t+=1)le(k[t]);T=!0}},o(e){oe(A.$$.fragment,e);for(let t=0;t<k.length;t+=1)oe(k[t]);T=!1},d(e){e&&d(l),e&&d(c),e&&d(u),e&&d(Q),Ue(A,e),e&&d(F),e&&d(E),e&&d(G),e&&d(g),e&&d(Z),e&&d(S),e&&d(x),e&&d(B),e&&d(ee),e&&d(U),e&&d(te),e&&d(C);for(let t=0;t<w.length;t+=1)w[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Fe(n,l,o){let a,{collection:_=new Le}=l,b=204,c=[];const u=m=>o(1,b=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,a=Re.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:`
`),A.$set(r),(!T||t&1)&&H!==(H=e[0].name+"")&&j(V,H),t&6&&(R=e[2],g=ye(g,t,fe,1,e,R,ue,q,Me,Te,null,Ce)),t&6&&(D=e[2],We(),k=ye(k,t,be,1,e,D,me,O,ze,Ee,null,Ae),He())},i(e){if(!T){le(A.$$.fragment,e);for(let t=0;t<D.length;t+=1)le(k[t]);T=!0}},o(e){oe(A.$$.fragment,e);for(let t=0;t<k.length;t+=1)oe(k[t]);T=!1},d(e){e&&u(l),e&&u(c),e&&u(p),e&&u(Q),Ue(A,e),e&&u(F),e&&u(E),e&&u(G),e&&u(w),e&&u(Z),e&&u(S),e&&u(x),e&&u(B),e&&u(ee),e&&u(U),e&&u(te),e&&u(C);for(let t=0;t<g.length;t+=1)g[t].d();for(let t=0;t<k.length;t+=1)k[t].d()}}}function Fe(n,l,o){let a,{collection:_=new Le}=l,b=204,c=[];const p=m=>o(1,b=m.code);return n.$$set=m=>{"collection"in m&&o(0,_=m.collection)},o(3,a=Re.getApiExampleUrl(je.baseUrl)),o(2,c=[{code:204,body:"null"},{code:401,body:`
{
"code": 401,
"message": "The request requires valid record authorization token to be set.",
@@ -77,4 +77,4 @@ import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as
"message": "The requested resource wasn't found.",
"data": {}
}
`}]),[_,b,c,a,u]}class Ve extends qe{constructor(l){super(),Oe(this,l,Fe,Qe,De,{collection:0})}}export{Ve as default};
`}]),[_,b,c,a,p]}class Ve extends qe{constructor(l){super(),Oe(this,l,Fe,Qe,De,{collection:0})}}export{Ve as default};
@@ -1,4 +1,4 @@
import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as T,g as a,h as i,m as Be,x as I,O as Pe,P as ut,k as Mt,Q as $t,n as Rt,t as pe,a as fe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-7cc53b3b.js";import{S as Lt}from"./SdkTabs-855be3ab.js";function bt(p,t,l){const s=p.slice();return s[7]=t[l],s}function mt(p,t,l){const s=p.slice();return s[7]=t[l],s}function _t(p,t,l){const s=p.slice();return s[12]=t[l],s}function yt(p){let t;return{c(){t=r("p"),t.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function kt(p){let t,l,s,b,u,d,f,k,C,v,O,D,A,F,M,N,B;return{c(){t=r("tr"),t.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=r("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as T,g as a,h as i,m as Be,x as I,O as Pe,P as ut,k as Mt,Q as $t,n as Rt,t as fe,a as pe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-3d43ee7c.js";import{S as Lt}from"./SdkTabs-720afe62.js";function bt(f,t,l){const s=f.slice();return s[7]=t[l],s}function mt(f,t,l){const s=f.slice();return s[7]=t[l],s}function _t(f,t,l){const s=f.slice();return s[12]=t[l],s}function yt(f){let t;return{c(){t=r("p"),t.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function kt(f){let t,l,s,b,u,d,p,k,C,w,O,H,A,j,M,E,B;return{c(){t=r("tr"),t.innerHTML='<td colspan="3" class="txt-hint">Auth fields</td>',l=m(),s=r("tr"),s.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>username</span></div></td>
<td><span class="label">String</span></td>
<td>The username of the auth record.</td>`,b=m(),u=r("tr"),u.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
@@ -8,7 +8,7 @@ import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as
<br/>
This field can be updated only by admins or auth records with &quot;Manage&quot; access.
<br/>
Regular accounts can update their email by calling &quot;Request email change&quot;.</td>`,d=m(),f=r("tr"),f.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
Regular accounts can update their email by calling &quot;Request email change&quot;.</td>`,d=m(),p=r("tr"),p.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>emailVisibility</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Whether to show/hide the auth record email when fetching the record data.</td>`,k=m(),C=r("tr"),C.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
@@ -17,60 +17,60 @@ import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as
<td>Old auth record password.
<br/>
This field is required only when changing the record password. Admins and auth records with
&quot;Manage&quot; access can skip this field.</td>`,v=m(),O=r("tr"),O.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
&quot;Manage&quot; access can skip this field.</td>`,w=m(),O=r("tr"),O.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>password</span></div></td>
<td><span class="label">String</span></td>
<td>New auth record password.</td>`,D=m(),A=r("tr"),A.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<td>New auth record password.</td>`,H=m(),A=r("tr"),A.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>passwordConfirm</span></div></td>
<td><span class="label">String</span></td>
<td>New auth record password confirmation.</td>`,F=m(),M=r("tr"),M.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<td>New auth record password confirmation.</td>`,j=m(),M=r("tr"),M.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>verified</span></div></td>
<td><span class="label">Boolean</span></td>
<td>Indicates whether the auth record is verified or not.
<br/>
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,N=m(),B=r("tr"),B.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>'},m(c,_){a(c,t,_),a(c,l,_),a(c,s,_),a(c,b,_),a(c,u,_),a(c,d,_),a(c,f,_),a(c,k,_),a(c,C,_),a(c,v,_),a(c,O,_),a(c,D,_),a(c,A,_),a(c,F,_),a(c,M,_),a(c,N,_),a(c,B,_)},d(c){c&&o(t),c&&o(l),c&&o(s),c&&o(b),c&&o(u),c&&o(d),c&&o(f),c&&o(k),c&&o(C),c&&o(v),c&&o(O),c&&o(D),c&&o(A),c&&o(F),c&&o(M),c&&o(N),c&&o(B)}}}function Pt(p){let t;return{c(){t=r("span"),t.textContent="Optional",T(t,"class","label label-warning")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function At(p){let t;return{c(){t=r("span"),t.textContent="Required",T(t,"class","label label-success")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function Bt(p){var u;let t,l=((u=p[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("User "),s=y(l),b=y(".")},m(d,f){a(d,t,f),a(d,s,f),a(d,b,f)},p(d,f){var k;f&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&I(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function Ft(p){var u;let t,l=((u=p[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("Relation record "),s=y(l),b=y(".")},m(d,f){a(d,t,f),a(d,s,f),a(d,b,f)},p(d,f){var k;f&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&I(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function Nt(p){let t,l,s,b,u;return{c(){t=y("File object."),l=r("br"),s=y(`
Set to `),b=r("code"),b.textContent="null",u=y(" to delete already uploaded file(s).")},m(d,f){a(d,t,f),a(d,l,f),a(d,s,f),a(d,b,f),a(d,u,f)},p:G,d(d){d&&o(t),d&&o(l),d&&o(s),d&&o(b),d&&o(u)}}}function jt(p){let t;return{c(){t=y("URL address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Et(p){let t;return{c(){t=y("Email address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Ut(p){let t;return{c(){t=y("JSON array or object.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function It(p){let t;return{c(){t=y("Number value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Jt(p){let t;return{c(){t=y("Plain text value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function ht(p,t){let l,s,b,u,d,f=t[12].name+"",k,C,v,O,D=U.getFieldValueType(t[12])+"",A,F,M,N;function B(h,L){return h[12].required?At:Pt}let c=B(t),_=c(t);function K(h,L){if(h[12].type==="text")return Jt;if(h[12].type==="number")return It;if(h[12].type==="json")return Ut;if(h[12].type==="email")return Et;if(h[12].type==="url")return jt;if(h[12].type==="file")return Nt;if(h[12].type==="relation")return Ft;if(h[12].type==="user")return Bt}let H=K(t),S=H&&H(t);return{key:p,first:null,c(){l=r("tr"),s=r("td"),b=r("div"),_.c(),u=m(),d=r("span"),k=y(f),C=m(),v=r("td"),O=r("span"),A=y(D),F=m(),M=r("td"),S&&S.c(),N=m(),T(b,"class","inline-flex"),T(O,"class","label"),this.first=l},m(h,L){a(h,l,L),i(l,s),i(s,b),_.m(b,null),i(b,u),i(b,d),i(d,k),i(l,C),i(l,v),i(v,O),i(O,A),i(l,F),i(l,M),S&&S.m(M,null),i(l,N)},p(h,L){t=h,c!==(c=B(t))&&(_.d(1),_=c(t),_&&(_.c(),_.m(b,u))),L&1&&f!==(f=t[12].name+"")&&I(k,f),L&1&&D!==(D=U.getFieldValueType(t[12])+"")&&I(A,D),H===(H=K(t))&&S?S.p(t,L):(S&&S.d(1),S=H&&H(t),S&&(S.c(),S.m(M,null)))},d(h){h&&o(l),_.d(),S&&S.d()}}}function vt(p,t){let l,s=t[7].code+"",b,u,d,f;function k(){return t[6](t[7])}return{key:p,first:null,c(){l=r("button"),b=y(s),u=m(),T(l,"class","tab-item"),ce(l,"active",t[1]===t[7].code),this.first=l},m(C,v){a(C,l,v),i(l,b),i(l,u),d||(f=Ht(l,"click",k),d=!0)},p(C,v){t=C,v&4&&s!==(s=t[7].code+"")&&I(b,s),v&6&&ce(l,"active",t[1]===t[7].code)},d(C){C&&o(l),d=!1,f()}}}function wt(p,t){let l,s,b,u;return s=new Tt({props:{content:t[7].body}}),{key:p,first:null,c(){l=r("div"),Ae(s.$$.fragment),b=m(),T(l,"class","tab-item"),ce(l,"active",t[1]===t[7].code),this.first=l},m(d,f){a(d,l,f),Be(s,l,null),i(l,b),u=!0},p(d,f){t=d;const k={};f&4&&(k.content=t[7].body),s.$set(k),(!u||f&6)&&ce(l,"active",t[1]===t[7].code)},i(d){u||(pe(s.$$.fragment,d),u=!0)},o(d){fe(s.$$.fragment,d),u=!1},d(d){d&&o(l),Fe(s)}}}function gt(p){var it,at,ot,dt;let t,l,s=p[0].name+"",b,u,d,f,k,C,v,O=p[0].name+"",D,A,F,M,N,B,c,_,K,H,S,h,L,Ne,ae,W,je,ue,oe=p[0].name+"",be,Ee,me,Ue,_e,X,ye,Z,ke,ee,he,J,ve,Ie,g,we,j=[],Je=new Map,Te,te,Ce,V,Se,ge,Oe,x,Me,Ve,$e,xe,$,Qe,Y,ze,Ke,We,Re,Ye,qe,Ge,De,Xe,He,le,Le,Q,se,E=[],Ze=new Map,et,ne,P=[],tt=new Map,z;_=new Lt({props:{js:`
This field can be set only by admins or auth records with &quot;Manage&quot; access.</td>`,E=m(),B=r("tr"),B.innerHTML='<td colspan="3" class="txt-hint">Schema fields</td>'},m(c,_){a(c,t,_),a(c,l,_),a(c,s,_),a(c,b,_),a(c,u,_),a(c,d,_),a(c,p,_),a(c,k,_),a(c,C,_),a(c,w,_),a(c,O,_),a(c,H,_),a(c,A,_),a(c,j,_),a(c,M,_),a(c,E,_),a(c,B,_)},d(c){c&&o(t),c&&o(l),c&&o(s),c&&o(b),c&&o(u),c&&o(d),c&&o(p),c&&o(k),c&&o(C),c&&o(w),c&&o(O),c&&o(H),c&&o(A),c&&o(j),c&&o(M),c&&o(E),c&&o(B)}}}function Pt(f){let t;return{c(){t=r("span"),t.textContent="Optional",T(t,"class","label label-warning")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function At(f){let t;return{c(){t=r("span"),t.textContent="Required",T(t,"class","label label-success")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function Bt(f){var u;let t,l=((u=f[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("User "),s=y(l),b=y(".")},m(d,p){a(d,t,p),a(d,s,p),a(d,b,p)},p(d,p){var k;p&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&I(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function Ft(f){var u;let t,l=((u=f[12].options)==null?void 0:u.maxSelect)>1?"ids":"id",s,b;return{c(){t=y("Relation record "),s=y(l),b=y(".")},m(d,p){a(d,t,p),a(d,s,p),a(d,b,p)},p(d,p){var k;p&1&&l!==(l=((k=d[12].options)==null?void 0:k.maxSelect)>1?"ids":"id")&&I(s,l)},d(d){d&&o(t),d&&o(s),d&&o(b)}}}function Nt(f){let t,l,s,b,u;return{c(){t=y("File object."),l=r("br"),s=y(`
Set to `),b=r("code"),b.textContent="null",u=y(" to delete already uploaded file(s).")},m(d,p){a(d,t,p),a(d,l,p),a(d,s,p),a(d,b,p),a(d,u,p)},p:G,d(d){d&&o(t),d&&o(l),d&&o(s),d&&o(b),d&&o(u)}}}function jt(f){let t;return{c(){t=y("URL address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Et(f){let t;return{c(){t=y("Email address.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Ut(f){let t;return{c(){t=y("JSON array or object.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function It(f){let t;return{c(){t=y("Number value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function Jt(f){let t;return{c(){t=y("Plain text value.")},m(l,s){a(l,t,s)},p:G,d(l){l&&o(t)}}}function ht(f,t){let l,s,b,u,d,p=t[12].name+"",k,C,w,O,H=U.getFieldValueType(t[12])+"",A,j,M,E;function B(h,P){return h[12].required?At:Pt}let c=B(t),_=c(t);function K(h,P){if(h[12].type==="text")return Jt;if(h[12].type==="number")return It;if(h[12].type==="json")return Ut;if(h[12].type==="email")return Et;if(h[12].type==="url")return jt;if(h[12].type==="file")return Nt;if(h[12].type==="relation")return Ft;if(h[12].type==="user")return Bt}let L=K(t),S=L&&L(t);return{key:f,first:null,c(){l=r("tr"),s=r("td"),b=r("div"),_.c(),u=m(),d=r("span"),k=y(p),C=m(),w=r("td"),O=r("span"),A=y(H),j=m(),M=r("td"),S&&S.c(),E=m(),T(b,"class","inline-flex"),T(O,"class","label"),this.first=l},m(h,P){a(h,l,P),i(l,s),i(s,b),_.m(b,null),i(b,u),i(b,d),i(d,k),i(l,C),i(l,w),i(w,O),i(O,A),i(l,j),i(l,M),S&&S.m(M,null),i(l,E)},p(h,P){t=h,c!==(c=B(t))&&(_.d(1),_=c(t),_&&(_.c(),_.m(b,u))),P&1&&p!==(p=t[12].name+"")&&I(k,p),P&1&&H!==(H=U.getFieldValueType(t[12])+"")&&I(A,H),L===(L=K(t))&&S?S.p(t,P):(S&&S.d(1),S=L&&L(t),S&&(S.c(),S.m(M,null)))},d(h){h&&o(l),_.d(),S&&S.d()}}}function vt(f,t){let l,s=t[7].code+"",b,u,d,p;function k(){return t[6](t[7])}return{key:f,first:null,c(){l=r("button"),b=y(s),u=m(),T(l,"class","tab-item"),ce(l,"active",t[1]===t[7].code),this.first=l},m(C,w){a(C,l,w),i(l,b),i(l,u),d||(p=Ht(l,"click",k),d=!0)},p(C,w){t=C,w&4&&s!==(s=t[7].code+"")&&I(b,s),w&6&&ce(l,"active",t[1]===t[7].code)},d(C){C&&o(l),d=!1,p()}}}function wt(f,t){let l,s,b,u;return s=new Tt({props:{content:t[7].body}}),{key:f,first:null,c(){l=r("div"),Ae(s.$$.fragment),b=m(),T(l,"class","tab-item"),ce(l,"active",t[1]===t[7].code),this.first=l},m(d,p){a(d,l,p),Be(s,l,null),i(l,b),u=!0},p(d,p){t=d;const k={};p&4&&(k.content=t[7].body),s.$set(k),(!u||p&6)&&ce(l,"active",t[1]===t[7].code)},i(d){u||(fe(s.$$.fragment,d),u=!0)},o(d){pe(s.$$.fragment,d),u=!1},d(d){d&&o(l),Fe(s)}}}function gt(f){var it,at,ot,dt;let t,l,s=f[0].name+"",b,u,d,p,k,C,w,O=f[0].name+"",H,A,j,M,E,B,c,_,K,L,S,h,P,Ne,ae,W,je,ue,oe=f[0].name+"",be,Ee,me,Ue,_e,X,ye,Z,ke,ee,he,J,ve,Ie,g,we,F=[],Je=new Map,Te,te,Ce,V,Se,ge,Oe,x,Me,Ve,$e,xe,$,Qe,Y,ze,Ke,We,Re,Ye,qe,Ge,De,Xe,He,le,Le,Q,se,N=[],Ze=new Map,et,ne,R=[],tt=new Map,z;_=new Lt({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${p[4]}');
const pb = new PocketBase('${f[4]}');
...
// example update data
const data = ${JSON.stringify(Object.assign({},p[3],U.dummyCollectionSchemaData(p[0])),null,4)};
const data = ${JSON.stringify(Object.assign({},f[3],U.dummyCollectionSchemaData(f[0])),null,4)};
const record = await pb.collection('${(it=p[0])==null?void 0:it.name}').update('RECORD_ID', data);
const record = await pb.collection('${(it=f[0])==null?void 0:it.name}').update('RECORD_ID', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${p[4]}');
final pb = PocketBase('${f[4]}');
...
// example update body
final body = <String, dynamic>${JSON.stringify(Object.assign({},p[3],U.dummyCollectionSchemaData(p[0])),null,2)};
final body = <String, dynamic>${JSON.stringify(Object.assign({},f[3],U.dummyCollectionSchemaData(f[0])),null,2)};
final record = await pb.collection('${(at=p[0])==null?void 0:at.name}').update('RECORD_ID', body: body);
`}});let R=p[5]&&yt(),q=((ot=p[0])==null?void 0:ot.isAuth)&&kt(),de=(dt=p[0])==null?void 0:dt.schema;const lt=e=>e[12].name;for(let e=0;e<de.length;e+=1){let n=_t(p,de,e),w=lt(n);Je.set(w,j[e]=ht(w,n))}Y=new Tt({props:{content:"?expand=relField1,relField2.subRelField21"}});let re=p[2];const st=e=>e[7].code;for(let e=0;e<re.length;e+=1){let n=mt(p,re,e),w=st(n);Ze.set(w,E[e]=vt(w,n))}let ie=p[2];const nt=e=>e[7].code;for(let e=0;e<ie.length;e+=1){let n=bt(p,ie,e),w=nt(n);tt.set(w,P[e]=wt(w,n))}return{c(){t=r("h3"),l=y("Update ("),b=y(s),u=y(")"),d=m(),f=r("div"),k=r("p"),C=y("Update a single "),v=r("strong"),D=y(O),A=y(" record."),F=m(),M=r("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,N=m(),B=r("p"),B.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
final record = await pb.collection('${(at=f[0])==null?void 0:at.name}').update('RECORD_ID', body: body);
`}});let q=f[5]&&yt(),D=((ot=f[0])==null?void 0:ot.isAuth)&&kt(),de=(dt=f[0])==null?void 0:dt.schema;const lt=e=>e[12].name;for(let e=0;e<de.length;e+=1){let n=_t(f,de,e),v=lt(n);Je.set(v,F[e]=ht(v,n))}Y=new Tt({props:{content:"?expand=relField1,relField2.subRelField21"}});let re=f[2];const st=e=>e[7].code;for(let e=0;e<re.length;e+=1){let n=mt(f,re,e),v=st(n);Ze.set(v,N[e]=vt(v,n))}let ie=f[2];const nt=e=>e[7].code;for(let e=0;e<ie.length;e+=1){let n=bt(f,ie,e),v=nt(n);tt.set(v,R[e]=wt(v,n))}return{c(){t=r("h3"),l=y("Update ("),b=y(s),u=y(")"),d=m(),p=r("div"),k=r("p"),C=y("Update a single "),w=r("strong"),H=y(O),A=y(" record."),j=m(),M=r("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,E=m(),B=r("p"),B.innerHTML=`File upload is supported only via <code>multipart/form-data</code>.
<br/>
For more info and examples you could check the detailed
<a href="https://pocketbase.io/docs/files-handling/" target="_blank" rel="noopener noreferrer">Files upload and handling docs
</a>.`,c=m(),Ae(_.$$.fragment),K=m(),H=r("h6"),H.textContent="API details",S=m(),h=r("div"),L=r("strong"),L.textContent="PATCH",Ne=m(),ae=r("div"),W=r("p"),je=y("/api/collections/"),ue=r("strong"),be=y(oe),Ee=y("/records/"),me=r("strong"),me.textContent=":id",Ue=m(),R&&R.c(),_e=m(),X=r("div"),X.textContent="Path parameters",ye=m(),Z=r("table"),Z.innerHTML=`<thead><tr><th>Param</th>
</a>.`,c=m(),Ae(_.$$.fragment),K=m(),L=r("h6"),L.textContent="API details",S=m(),h=r("div"),P=r("strong"),P.textContent="PATCH",Ne=m(),ae=r("div"),W=r("p"),je=y("/api/collections/"),ue=r("strong"),be=y(oe),Ee=y("/records/"),me=r("strong"),me.textContent=":id",Ue=m(),q&&q.c(),_e=m(),X=r("div"),X.textContent="Path parameters",ye=m(),Z=r("table"),Z.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,ke=m(),ee=r("div"),ee.textContent="Body Parameters",he=m(),J=r("table"),ve=r("thead"),ve.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,Ie=m(),g=r("tbody"),q&&q.c(),we=m();for(let e=0;e<j.length;e+=1)j[e].c();Te=m(),te=r("div"),te.textContent="Query parameters",Ce=m(),V=r("table"),Se=r("thead"),Se.innerHTML=`<tr><th>Param</th>
<th width="50%">Description</th></tr>`,Ie=m(),g=r("tbody"),D&&D.c(),we=m();for(let e=0;e<F.length;e+=1)F[e].c();Te=m(),te=r("div"),te.textContent="Query parameters",Ce=m(),V=r("table"),Se=r("thead"),Se.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ge=m(),Oe=r("tbody"),x=r("tr"),Me=r("td"),Me.textContent="expand",Ve=m(),$e=r("td"),$e.innerHTML='<span class="label">String</span>',xe=m(),$=r("td"),Qe=y(`Auto expand relations when returning the updated record. Ex.:
`),Ae(Y.$$.fragment),ze=y(`
Supports up to 6-levels depth nested relations expansion. `),Ke=r("br"),We=y(`
The expanded relations will be appended to the record under the
`),Re=r("code"),Re.textContent="expand",Ye=y(" property (eg. "),qe=r("code"),qe.textContent='"expand": {"relField1": {...}, ...}',Ge=y(`). Only
the relations that the user has permissions to `),De=r("strong"),De.textContent="view",Xe=y(" will be expanded."),He=m(),le=r("div"),le.textContent="Responses",Le=m(),Q=r("div"),se=r("div");for(let e=0;e<E.length;e+=1)E[e].c();et=m(),ne=r("div");for(let e=0;e<P.length;e+=1)P[e].c();T(t,"class","m-b-sm"),T(f,"class","content txt-lg m-b-sm"),T(H,"class","m-b-xs"),T(L,"class","label label-primary"),T(ae,"class","content"),T(h,"class","alert alert-warning"),T(X,"class","section-title"),T(Z,"class","table-compact table-border m-b-base"),T(ee,"class","section-title"),T(J,"class","table-compact table-border m-b-base"),T(te,"class","section-title"),T(V,"class","table-compact table-border m-b-lg"),T(le,"class","section-title"),T(se,"class","tabs-header compact left"),T(ne,"class","tabs-content"),T(Q,"class","tabs")},m(e,n){a(e,t,n),i(t,l),i(t,b),i(t,u),a(e,d,n),a(e,f,n),i(f,k),i(k,C),i(k,v),i(v,D),i(k,A),i(f,F),i(f,M),i(f,N),i(f,B),a(e,c,n),Be(_,e,n),a(e,K,n),a(e,H,n),a(e,S,n),a(e,h,n),i(h,L),i(h,Ne),i(h,ae),i(ae,W),i(W,je),i(W,ue),i(ue,be),i(W,Ee),i(W,me),i(h,Ue),R&&R.m(h,null),a(e,_e,n),a(e,X,n),a(e,ye,n),a(e,Z,n),a(e,ke,n),a(e,ee,n),a(e,he,n),a(e,J,n),i(J,ve),i(J,Ie),i(J,g),q&&q.m(g,null),i(g,we);for(let w=0;w<j.length;w+=1)j[w].m(g,null);a(e,Te,n),a(e,te,n),a(e,Ce,n),a(e,V,n),i(V,Se),i(V,ge),i(V,Oe),i(Oe,x),i(x,Me),i(x,Ve),i(x,$e),i(x,xe),i(x,$),i($,Qe),Be(Y,$,null),i($,ze),i($,Ke),i($,We),i($,Re),i($,Ye),i($,qe),i($,Ge),i($,De),i($,Xe),a(e,He,n),a(e,le,n),a(e,Le,n),a(e,Q,n),i(Q,se);for(let w=0;w<E.length;w+=1)E[w].m(se,null);i(Q,et),i(Q,ne);for(let w=0;w<P.length;w+=1)P[w].m(ne,null);z=!0},p(e,[n]){var rt,pt,ft,ct;(!z||n&1)&&s!==(s=e[0].name+"")&&I(b,s),(!z||n&1)&&O!==(O=e[0].name+"")&&I(D,O);const w={};n&25&&(w.js=`
the relations that the user has permissions to `),De=r("strong"),De.textContent="view",Xe=y(" will be expanded."),He=m(),le=r("div"),le.textContent="Responses",Le=m(),Q=r("div"),se=r("div");for(let e=0;e<N.length;e+=1)N[e].c();et=m(),ne=r("div");for(let e=0;e<R.length;e+=1)R[e].c();T(t,"class","m-b-sm"),T(p,"class","content txt-lg m-b-sm"),T(L,"class","m-b-xs"),T(P,"class","label label-primary"),T(ae,"class","content"),T(h,"class","alert alert-warning"),T(X,"class","section-title"),T(Z,"class","table-compact table-border m-b-base"),T(ee,"class","section-title"),T(J,"class","table-compact table-border m-b-base"),T(te,"class","section-title"),T(V,"class","table-compact table-border m-b-lg"),T(le,"class","section-title"),T(se,"class","tabs-header compact left"),T(ne,"class","tabs-content"),T(Q,"class","tabs")},m(e,n){a(e,t,n),i(t,l),i(t,b),i(t,u),a(e,d,n),a(e,p,n),i(p,k),i(k,C),i(k,w),i(w,H),i(k,A),i(p,j),i(p,M),i(p,E),i(p,B),a(e,c,n),Be(_,e,n),a(e,K,n),a(e,L,n),a(e,S,n),a(e,h,n),i(h,P),i(h,Ne),i(h,ae),i(ae,W),i(W,je),i(W,ue),i(ue,be),i(W,Ee),i(W,me),i(h,Ue),q&&q.m(h,null),a(e,_e,n),a(e,X,n),a(e,ye,n),a(e,Z,n),a(e,ke,n),a(e,ee,n),a(e,he,n),a(e,J,n),i(J,ve),i(J,Ie),i(J,g),D&&D.m(g,null),i(g,we);for(let v=0;v<F.length;v+=1)F[v]&&F[v].m(g,null);a(e,Te,n),a(e,te,n),a(e,Ce,n),a(e,V,n),i(V,Se),i(V,ge),i(V,Oe),i(Oe,x),i(x,Me),i(x,Ve),i(x,$e),i(x,xe),i(x,$),i($,Qe),Be(Y,$,null),i($,ze),i($,Ke),i($,We),i($,Re),i($,Ye),i($,qe),i($,Ge),i($,De),i($,Xe),a(e,He,n),a(e,le,n),a(e,Le,n),a(e,Q,n),i(Q,se);for(let v=0;v<N.length;v+=1)N[v]&&N[v].m(se,null);i(Q,et),i(Q,ne);for(let v=0;v<R.length;v+=1)R[v]&&R[v].m(ne,null);z=!0},p(e,[n]){var rt,ft,pt,ct;(!z||n&1)&&s!==(s=e[0].name+"")&&I(b,s),(!z||n&1)&&O!==(O=e[0].name+"")&&I(H,O);const v={};n&25&&(v.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[4]}');
@@ -81,7 +81,7 @@ const pb = new PocketBase('${e[4]}');
const data = ${JSON.stringify(Object.assign({},e[3],U.dummyCollectionSchemaData(e[0])),null,4)};
const record = await pb.collection('${(rt=e[0])==null?void 0:rt.name}').update('RECORD_ID', data);
`),n&25&&(w.dart=`
`),n&25&&(v.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[4]}');
@@ -91,13 +91,13 @@ final pb = PocketBase('${e[4]}');
// example update body
final body = <String, dynamic>${JSON.stringify(Object.assign({},e[3],U.dummyCollectionSchemaData(e[0])),null,2)};
final record = await pb.collection('${(pt=e[0])==null?void 0:pt.name}').update('RECORD_ID', body: body);
`),_.$set(w),(!z||n&1)&&oe!==(oe=e[0].name+"")&&I(be,oe),e[5]?R||(R=yt(),R.c(),R.m(h,null)):R&&(R.d(1),R=null),(ft=e[0])!=null&&ft.isAuth?q||(q=kt(),q.c(),q.m(g,we)):q&&(q.d(1),q=null),n&1&&(de=(ct=e[0])==null?void 0:ct.schema,j=Pe(j,n,lt,1,e,de,Je,g,ut,ht,null,_t)),n&6&&(re=e[2],E=Pe(E,n,st,1,e,re,Ze,se,ut,vt,null,mt)),n&6&&(ie=e[2],Mt(),P=Pe(P,n,nt,1,e,ie,tt,ne,$t,wt,null,bt),Rt())},i(e){if(!z){pe(_.$$.fragment,e),pe(Y.$$.fragment,e);for(let n=0;n<ie.length;n+=1)pe(P[n]);z=!0}},o(e){fe(_.$$.fragment,e),fe(Y.$$.fragment,e);for(let n=0;n<P.length;n+=1)fe(P[n]);z=!1},d(e){e&&o(t),e&&o(d),e&&o(f),e&&o(c),Fe(_,e),e&&o(K),e&&o(H),e&&o(S),e&&o(h),R&&R.d(),e&&o(_e),e&&o(X),e&&o(ye),e&&o(Z),e&&o(ke),e&&o(ee),e&&o(he),e&&o(J),q&&q.d();for(let n=0;n<j.length;n+=1)j[n].d();e&&o(Te),e&&o(te),e&&o(Ce),e&&o(V),Fe(Y),e&&o(He),e&&o(le),e&&o(Le),e&&o(Q);for(let n=0;n<E.length;n+=1)E[n].d();for(let n=0;n<P.length;n+=1)P[n].d()}}}function Vt(p,t,l){let s,b,{collection:u=new qt}=t,d=200,f=[],k={};const C=v=>l(1,d=v.code);return p.$$set=v=>{"collection"in v&&l(0,u=v.collection)},p.$$.update=()=>{var v,O;p.$$.dirty&1&&l(5,s=(u==null?void 0:u.updateRule)===null),p.$$.dirty&1&&l(2,f=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(u),null,2)},{code:400,body:`
final record = await pb.collection('${(ft=e[0])==null?void 0:ft.name}').update('RECORD_ID', body: body);
`),_.$set(v),(!z||n&1)&&oe!==(oe=e[0].name+"")&&I(be,oe),e[5]?q||(q=yt(),q.c(),q.m(h,null)):q&&(q.d(1),q=null),(pt=e[0])!=null&&pt.isAuth?D||(D=kt(),D.c(),D.m(g,we)):D&&(D.d(1),D=null),n&1&&(de=(ct=e[0])==null?void 0:ct.schema,F=Pe(F,n,lt,1,e,de,Je,g,ut,ht,null,_t)),n&6&&(re=e[2],N=Pe(N,n,st,1,e,re,Ze,se,ut,vt,null,mt)),n&6&&(ie=e[2],Mt(),R=Pe(R,n,nt,1,e,ie,tt,ne,$t,wt,null,bt),Rt())},i(e){if(!z){fe(_.$$.fragment,e),fe(Y.$$.fragment,e);for(let n=0;n<ie.length;n+=1)fe(R[n]);z=!0}},o(e){pe(_.$$.fragment,e),pe(Y.$$.fragment,e);for(let n=0;n<R.length;n+=1)pe(R[n]);z=!1},d(e){e&&o(t),e&&o(d),e&&o(p),e&&o(c),Fe(_,e),e&&o(K),e&&o(L),e&&o(S),e&&o(h),q&&q.d(),e&&o(_e),e&&o(X),e&&o(ye),e&&o(Z),e&&o(ke),e&&o(ee),e&&o(he),e&&o(J),D&&D.d();for(let n=0;n<F.length;n+=1)F[n].d();e&&o(Te),e&&o(te),e&&o(Ce),e&&o(V),Fe(Y),e&&o(He),e&&o(le),e&&o(Le),e&&o(Q);for(let n=0;n<N.length;n+=1)N[n].d();for(let n=0;n<R.length;n+=1)R[n].d()}}}function Vt(f,t,l){let s,b,{collection:u=new qt}=t,d=200,p=[],k={};const C=w=>l(1,d=w.code);return f.$$set=w=>{"collection"in w&&l(0,u=w.collection)},f.$$.update=()=>{var w,O;f.$$.dirty&1&&l(5,s=(u==null?void 0:u.updateRule)===null),f.$$.dirty&1&&l(2,p=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(u),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(O=(v=u==null?void 0:u.schema)==null?void 0:v[0])==null?void 0:O.name}": {
"${(O=(w=u==null?void 0:u.schema)==null?void 0:w[0])==null?void 0:O.name}": {
"code": "validation_required",
"message": "Missing required value."
}
@@ -115,4 +115,4 @@ final record = await pb.collection('${(pt=e[0])==null?void 0:pt.name}').update('
"message": "The requested resource wasn't found.",
"data": {}
}
`}]),p.$$.dirty&1&&(u.isAuth?l(3,k={username:"test_username_update",emailVisibility:!1,password:"87654321",passwordConfirm:"87654321",oldPassword:"12345678"}):l(3,k={}))},l(4,b=U.getApiExampleUrl(Dt.baseUrl)),[u,d,f,k,b,s,C]}class zt extends Ct{constructor(t){super(),St(this,t,Vt,gt,Ot,{collection:0})}}export{zt as default};
`}]),f.$$.dirty&1&&(u.isAuth?l(3,k={username:"test_username_update",emailVisibility:!1,password:"87654321",passwordConfirm:"87654321",oldPassword:"12345678"}):l(3,k={}))},l(4,b=U.getApiExampleUrl(Dt.baseUrl)),[u,d,p,k,b,s,C]}class zt extends Ct{constructor(t){super(),St(this,t,Vt,gt,Ot,{collection:0})}}export{zt as default};
@@ -1,4 +1,4 @@
import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as r,h as l,m as ke,x as me,O as Ve,P as lt,k as st,Q as nt,n as ot,t as z,a as G,o as d,d as he,R as it,C as ze,p as at,r as J,u as rt}from"./index-7cc53b3b.js";import{S as dt}from"./SdkTabs-855be3ab.js";function Ge(i,s,n){const a=i.slice();return a[6]=s[n],a}function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function We(i,s){let n,a=s[6].code+"",w,c,p,u;function C(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=m(a),c=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,w),l(n,c),p||(u=rt(n,"click",C),p=!0)},p(h,F){s=h,F&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),p=!1,u()}}}function Xe(i,s){let n,a,w,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),w=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(p,u){r(p,n,u),ke(a,n,null),l(n,w),c=!0},p(p,u){s=p,(!c||u&20)&&J(n,"active",s[2]===s[6].code)},i(p){c||(z(a.$$.fragment,p),c=!0)},o(p){G(a.$$.fragment,p),c=!1},d(p){p&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",w,c,p,u,C,h,F,N=i[0].name+"",K,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,Q=i[0].name+"",ee,$e,te,Ce,le,x,se,A,ne,I,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,pe,Se,Be,xe,fe,Ae,ue,M,be,P,H,R=[],Ie=new Map,Me,q,y=[],He=new Map,T;g=new dt({props:{js:`
import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as u,c as _e,f as _,g as r,h as l,m as ke,x as me,O as Ve,P as lt,k as st,Q as nt,n as ot,t as z,a as G,o as d,d as he,R as it,C as ze,p as at,r as J,u as rt}from"./index-3d43ee7c.js";import{S as dt}from"./SdkTabs-720afe62.js";function Ge(i,s,n){const a=i.slice();return a[6]=s[n],a}function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin <code>Authorization:TOKEN</code> header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function We(i,s){let n,a=s[6].code+"",y,c,f,b;function R(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),y=m(a),c=u(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,y),l(n,c),f||(b=rt(n,"click",R),f=!0)},p(h,F){s=h,F&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),f=!1,b()}}}function Xe(i,s){let n,a,y,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),y=u(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(f,b){r(f,n,b),ke(a,n,null),l(n,y),c=!0},p(f,b){s=f,(!c||b&20)&&J(n,"active",s[2]===s[6].code)},i(f){c||(z(a.$$.fragment,f),c=!0)},o(f){G(a.$$.fragment,f),c=!1},d(f){f&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",y,c,f,b,R,h,F,N=i[0].name+"",K,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,Q=i[0].name+"",ee,$e,te,Ce,le,x,se,A,ne,I,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,fe,Se,Be,xe,pe,Ae,ue,M,be,P,H,C=[],Ie=new Map,Me,q,v=[],He=new Map,T;g=new dt({props:{js:`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${i[3]}');
@@ -18,20 +18,20 @@ import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as
final record = await pb.collection('${(Ue=i[0])==null?void 0:Ue.name}').getOne('RECORD_ID',
'expand': 'relField1,relField2.subRelField',
);
`}});let v=i[1]&&Ke();S=new Ye({props:{content:"?expand=relField1,relField2.subRelField"}});let V=i[4];const qe=e=>e[6].code;for(let e=0;e<V.length;e+=1){let t=Je(i,V,e),b=qe(t);Ie.set(b,R[e]=We(b,t))}let L=i[4];const Le=e=>e[6].code;for(let e=0;e<L.length;e+=1){let t=Ge(i,L,e),b=Le(t);He.set(b,y[e]=Xe(b,t))}return{c(){s=o("h3"),n=m("View ("),w=m(a),c=m(")"),p=f(),u=o("div"),C=o("p"),h=m("Fetch a single "),F=o("strong"),K=m(N),ve=m(" record."),W=f(),_e(g.$$.fragment),X=f(),B=o("h6"),B.textContent="API details",Y=f(),$=o("div"),U=o("strong"),U.textContent="GET",we=f(),j=o("div"),E=o("p"),ye=m("/api/collections/"),Z=o("strong"),ee=m(Q),$e=m("/records/"),te=o("strong"),te.textContent=":id",Ce=f(),v&&v.c(),le=f(),x=o("div"),x.textContent="Path Parameters",se=f(),A=o("table"),A.innerHTML=`<thead><tr><th>Param</th>
`}});let w=i[1]&&Ke();S=new Ye({props:{content:"?expand=relField1,relField2.subRelField"}});let V=i[4];const qe=e=>e[6].code;for(let e=0;e<V.length;e+=1){let t=Je(i,V,e),p=qe(t);Ie.set(p,C[e]=We(p,t))}let L=i[4];const Le=e=>e[6].code;for(let e=0;e<L.length;e+=1){let t=Ge(i,L,e),p=Le(t);He.set(p,v[e]=Xe(p,t))}return{c(){s=o("h3"),n=m("View ("),y=m(a),c=m(")"),f=u(),b=o("div"),R=o("p"),h=m("Fetch a single "),F=o("strong"),K=m(N),ve=m(" record."),W=u(),_e(g.$$.fragment),X=u(),B=o("h6"),B.textContent="API details",Y=u(),$=o("div"),U=o("strong"),U.textContent="GET",we=u(),j=o("div"),E=o("p"),ye=m("/api/collections/"),Z=o("strong"),ee=m(Q),$e=m("/records/"),te=o("strong"),te.textContent=":id",Ce=u(),w&&w.c(),le=u(),x=o("div"),x.textContent="Path Parameters",se=u(),A=o("table"),A.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,ne=f(),I=o("div"),I.textContent="Query parameters",oe=f(),O=o("table"),ie=o("thead"),ie.innerHTML=`<tr><th>Param</th>
<td>ID of the record to view.</td></tr></tbody>`,ne=u(),I=o("div"),I.textContent="Query parameters",oe=u(),O=o("table"),ie=o("thead"),ie.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Re=f(),ae=o("tbody"),D=o("tr"),re=o("td"),re.textContent="expand",Fe=f(),de=o("td"),de.innerHTML='<span class="label">String</span>',ge=f(),k=o("td"),Oe=m(`Auto expand record relations. Ex.:
<th width="60%">Description</th></tr>`,Re=u(),ae=o("tbody"),D=o("tr"),re=o("td"),re.textContent="expand",Fe=u(),de=o("td"),de.innerHTML='<span class="label">String</span>',ge=u(),k=o("td"),Oe=m(`Auto expand record relations. Ex.:
`),_e(S.$$.fragment),De=m(`
Supports up to 6-levels depth nested relations expansion. `),Pe=o("br"),Te=m(`
The expanded relations will be appended to the record under the
`),ce=o("code"),ce.textContent="expand",Ee=m(" property (eg. "),pe=o("code"),pe.textContent='"expand": {"relField1": {...}, ...}',Se=m(`).
`),ce=o("code"),ce.textContent="expand",Ee=m(" property (eg. "),fe=o("code"),fe.textContent='"expand": {"relField1": {...}, ...}',Se=m(`).
`),Be=o("br"),xe=m(`
Only the relations to which the request user has permissions to `),fe=o("strong"),fe.textContent="view",Ae=m(" will be expanded."),ue=f(),M=o("div"),M.textContent="Responses",be=f(),P=o("div"),H=o("div");for(let e=0;e<R.length;e+=1)R[e].c();Me=f(),q=o("div");for(let e=0;e<y.length;e+=1)y[e].c();_(s,"class","m-b-sm"),_(u,"class","content txt-lg m-b-sm"),_(B,"class","m-b-xs"),_(U,"class","label label-primary"),_(j,"class","content"),_($,"class","alert alert-info"),_(x,"class","section-title"),_(A,"class","table-compact table-border m-b-base"),_(I,"class","section-title"),_(O,"class","table-compact table-border m-b-base"),_(M,"class","section-title"),_(H,"class","tabs-header compact left"),_(q,"class","tabs-content"),_(P,"class","tabs")},m(e,t){r(e,s,t),l(s,n),l(s,w),l(s,c),r(e,p,t),r(e,u,t),l(u,C),l(C,h),l(C,F),l(F,K),l(C,ve),r(e,W,t),ke(g,e,t),r(e,X,t),r(e,B,t),r(e,Y,t),r(e,$,t),l($,U),l($,we),l($,j),l(j,E),l(E,ye),l(E,Z),l(Z,ee),l(E,$e),l(E,te),l($,Ce),v&&v.m($,null),r(e,le,t),r(e,x,t),r(e,se,t),r(e,A,t),r(e,ne,t),r(e,I,t),r(e,oe,t),r(e,O,t),l(O,ie),l(O,Re),l(O,ae),l(ae,D),l(D,re),l(D,Fe),l(D,de),l(D,ge),l(D,k),l(k,Oe),ke(S,k,null),l(k,De),l(k,Pe),l(k,Te),l(k,ce),l(k,Ee),l(k,pe),l(k,Se),l(k,Be),l(k,xe),l(k,fe),l(k,Ae),r(e,ue,t),r(e,M,t),r(e,be,t),r(e,P,t),l(P,H);for(let b=0;b<R.length;b+=1)R[b].m(H,null);l(P,Me),l(P,q);for(let b=0;b<y.length;b+=1)y[b].m(q,null);T=!0},p(e,[t]){var je,Qe;(!T||t&1)&&a!==(a=e[0].name+"")&&me(w,a),(!T||t&1)&&N!==(N=e[0].name+"")&&me(K,N);const b={};t&9&&(b.js=`
Only the relations to which the request user has permissions to `),pe=o("strong"),pe.textContent="view",Ae=m(" will be expanded."),ue=u(),M=o("div"),M.textContent="Responses",be=u(),P=o("div"),H=o("div");for(let e=0;e<C.length;e+=1)C[e].c();Me=u(),q=o("div");for(let e=0;e<v.length;e+=1)v[e].c();_(s,"class","m-b-sm"),_(b,"class","content txt-lg m-b-sm"),_(B,"class","m-b-xs"),_(U,"class","label label-primary"),_(j,"class","content"),_($,"class","alert alert-info"),_(x,"class","section-title"),_(A,"class","table-compact table-border m-b-base"),_(I,"class","section-title"),_(O,"class","table-compact table-border m-b-base"),_(M,"class","section-title"),_(H,"class","tabs-header compact left"),_(q,"class","tabs-content"),_(P,"class","tabs")},m(e,t){r(e,s,t),l(s,n),l(s,y),l(s,c),r(e,f,t),r(e,b,t),l(b,R),l(R,h),l(R,F),l(F,K),l(R,ve),r(e,W,t),ke(g,e,t),r(e,X,t),r(e,B,t),r(e,Y,t),r(e,$,t),l($,U),l($,we),l($,j),l(j,E),l(E,ye),l(E,Z),l(Z,ee),l(E,$e),l(E,te),l($,Ce),w&&w.m($,null),r(e,le,t),r(e,x,t),r(e,se,t),r(e,A,t),r(e,ne,t),r(e,I,t),r(e,oe,t),r(e,O,t),l(O,ie),l(O,Re),l(O,ae),l(ae,D),l(D,re),l(D,Fe),l(D,de),l(D,ge),l(D,k),l(k,Oe),ke(S,k,null),l(k,De),l(k,Pe),l(k,Te),l(k,ce),l(k,Ee),l(k,fe),l(k,Se),l(k,Be),l(k,xe),l(k,pe),l(k,Ae),r(e,ue,t),r(e,M,t),r(e,be,t),r(e,P,t),l(P,H);for(let p=0;p<C.length;p+=1)C[p]&&C[p].m(H,null);l(P,Me),l(P,q);for(let p=0;p<v.length;p+=1)v[p]&&v[p].m(q,null);T=!0},p(e,[t]){var je,Qe;(!T||t&1)&&a!==(a=e[0].name+"")&&me(y,a),(!T||t&1)&&N!==(N=e[0].name+"")&&me(K,N);const p={};t&9&&(p.js=`
import PocketBase from 'pocketbase';
const pb = new PocketBase('${e[3]}');
@@ -41,7 +41,7 @@ import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as
const record = await pb.collection('${(je=e[0])==null?void 0:je.name}').getOne('RECORD_ID', {
expand: 'relField1,relField2.subRelField',
});
`),t&9&&(b.dart=`
`),t&9&&(p.dart=`
import 'package:pocketbase/pocketbase.dart';
final pb = PocketBase('${e[3]}');
@@ -51,16 +51,16 @@ import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as
final record = await pb.collection('${(Qe=e[0])==null?void 0:Qe.name}').getOne('RECORD_ID',
'expand': 'relField1,relField2.subRelField',
);
`),g.$set(b),(!T||t&1)&&Q!==(Q=e[0].name+"")&&me(ee,Q),e[1]?v||(v=Ke(),v.c(),v.m($,null)):v&&(v.d(1),v=null),t&20&&(V=e[4],R=Ve(R,t,qe,1,e,V,Ie,H,lt,We,null,Je)),t&20&&(L=e[4],st(),y=Ve(y,t,Le,1,e,L,He,q,nt,Xe,null,Ge),ot())},i(e){if(!T){z(g.$$.fragment,e),z(S.$$.fragment,e);for(let t=0;t<L.length;t+=1)z(y[t]);T=!0}},o(e){G(g.$$.fragment,e),G(S.$$.fragment,e);for(let t=0;t<y.length;t+=1)G(y[t]);T=!1},d(e){e&&d(s),e&&d(p),e&&d(u),e&&d(W),he(g,e),e&&d(X),e&&d(B),e&&d(Y),e&&d($),v&&v.d(),e&&d(le),e&&d(x),e&&d(se),e&&d(A),e&&d(ne),e&&d(I),e&&d(oe),e&&d(O),he(S),e&&d(ue),e&&d(M),e&&d(be),e&&d(P);for(let t=0;t<R.length;t+=1)R[t].d();for(let t=0;t<y.length;t+=1)y[t].d()}}}function pt(i,s,n){let a,w,{collection:c=new it}=s,p=200,u=[];const C=h=>n(2,p=h.code);return i.$$set=h=>{"collection"in h&&n(0,c=h.collection)},i.$$.update=()=>{i.$$.dirty&1&&n(1,a=(c==null?void 0:c.viewRule)===null),i.$$.dirty&3&&c!=null&&c.id&&(u.push({code:200,body:JSON.stringify(ze.dummyCollectionRecord(c),null,2)}),a&&u.push({code:403,body:`
`),g.$set(p),(!T||t&1)&&Q!==(Q=e[0].name+"")&&me(ee,Q),e[1]?w||(w=Ke(),w.c(),w.m($,null)):w&&(w.d(1),w=null),t&20&&(V=e[4],C=Ve(C,t,qe,1,e,V,Ie,H,lt,We,null,Je)),t&20&&(L=e[4],st(),v=Ve(v,t,Le,1,e,L,He,q,nt,Xe,null,Ge),ot())},i(e){if(!T){z(g.$$.fragment,e),z(S.$$.fragment,e);for(let t=0;t<L.length;t+=1)z(v[t]);T=!0}},o(e){G(g.$$.fragment,e),G(S.$$.fragment,e);for(let t=0;t<v.length;t+=1)G(v[t]);T=!1},d(e){e&&d(s),e&&d(f),e&&d(b),e&&d(W),he(g,e),e&&d(X),e&&d(B),e&&d(Y),e&&d($),w&&w.d(),e&&d(le),e&&d(x),e&&d(se),e&&d(A),e&&d(ne),e&&d(I),e&&d(oe),e&&d(O),he(S),e&&d(ue),e&&d(M),e&&d(be),e&&d(P);for(let t=0;t<C.length;t+=1)C[t].d();for(let t=0;t<v.length;t+=1)v[t].d()}}}function ft(i,s,n){let a,y,{collection:c=new it}=s,f=200,b=[];const R=h=>n(2,f=h.code);return i.$$set=h=>{"collection"in h&&n(0,c=h.collection)},i.$$.update=()=>{i.$$.dirty&1&&n(1,a=(c==null?void 0:c.viewRule)===null),i.$$.dirty&3&&c!=null&&c.id&&(b.push({code:200,body:JSON.stringify(ze.dummyCollectionRecord(c),null,2)}),a&&b.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),u.push({code:404,body:`
`}),b.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},n(3,w=ze.getApiExampleUrl(at.baseUrl)),[c,a,p,w,u,C]}class bt extends Ze{constructor(s){super(),et(this,s,pt,ct,tt,{collection:0})}}export{bt as default};
`}))},n(3,y=ze.getApiExampleUrl(at.baseUrl)),[c,a,f,y,b,R]}class bt extends Ze{constructor(s){super(),et(this,s,ft,ct,tt,{collection:0})}}export{bt as default};
+13
View File
@@ -0,0 +1,13 @@
class I{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),qe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),qe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ii(this),r=new ii(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ii(this,e)}iterRange(e,t=this.length){return new rl(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ol(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new G(e):qe.from(G.split(e,[]))}}class G extends I{constructor(e,t=Gh(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Jh(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(kr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=$i(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=$i(this.text,$i(i.text,kr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):qe.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=`
`){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class qe extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new qe(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qe))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof qe)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:qe.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new qe(l,t)}}I.empty=new G([""],0);function Gh(n){let e=-1;for(let t of n)e+=t.length+1;return e}function $i(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function kr(n,e,t){return $i(n,[""],e,t)}class ii{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ii(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ol{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ii.prototype[Symbol.iterator]=rl.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=function(){return this});class Jh{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Rt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<Rt.length;n++)Rt[n]+=Rt[n-1];function _h(n){for(let e=1;e<Rt.length;e+=2)if(Rt[e]>n)return Rt[e-1]<=n;return!1}function Cr(n){return n>=127462&&n<=127487}const Ar=8205;function ue(n,e,t=!0,i=!0){return(t?ll:Xh)(n,e,i)}function ll(n,e,t){if(e==n.length)return e;e&&al(n.charCodeAt(e))&&hl(n.charCodeAt(e-1))&&e--;let i=ne(n,e);for(e+=De(i);e<n.length;){let s=ne(n,e);if(i==Ar||s==Ar||t&&_h(s))e+=De(s),i=s;else if(Cr(s)){let r=0,o=e-2;for(;o>=0&&Cr(ne(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Xh(n,e,t){for(;e>0;){let i=ll(n,e-2,t);if(i<e)return i;e--}return 0}function al(n){return n>=56320&&n<57344}function hl(n){return n>=55296&&n<56320}function ne(n,e){let t=n.charCodeAt(e);if(!hl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return al(i)?(t-55296<<10)+(i-56320)+65536:t}function Ks(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function De(n){return n<65536?1:2}const Zn=/\r\n?|\n/;var he=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(he||(he={}));class Ue{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){es(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s Line truncated
`}get readOnly(){return this.facet(wl)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(dl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return lc(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ue(t,o,!1);if(r(t.slice(a,o))!=$.Word)break;o=a}for(;l<s;){let a=ue(t,l);if(r(t.slice(l,a))!=$.Word)break;l=a}return o==l?null:b.range(o+i,l+i)}}N.allowMultipleSelections=pl;N.tabSize=D.define({combine:n=>n.length?n[0]:4});N.lineSeparator=gl;N.readOnly=wl;N.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=dl;N.changeFilter=ml;N.transactionFilter=yl;N.transactionExtender=bl;vn.reconfigure=E.define();function At(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class wt{eq(e){return this==e}range(e,t=e){return os.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=he.TrackDel;let os=class Sl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Sl(e,t,i)}};function ls(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Gs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let h=this.value[a],c=this.from[a]+e,f=this.to[a]+e,u,d;if(c==f){let p=t.mapPos(c,h.startSide,h.mapMode);if(p==null||(u=d=p,h.startSide!=h.endSide&&(d=t.mapPos(c,h.endSide),d<u)))continue}else if(u=t.mapPos(c,h.startSide),d=t.mapPos(f,h.endSide),u>d||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Gs(s,r,i,l):null,pos:o}}}class j{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new j(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ls)),this.isEmpty)return t.length?j.of(t):this;let l=new kl(this,null,-1).goto(0),a=0,h=[],c=new xt;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(os.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?j.empty:this.nextLayer.update({add:h,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],h=e.touchesRange(l,l+a.length);if(h===!1)s=Math.max(s,a.maxPoint),t.push(a),i.push(e.mapPos(l));else if(h===!0){let{mapped:c,pos:f}=a.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new j(i,t,r||j.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return oi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return oi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Or(o,l,i),h=new Jt(o,a,r),c=ne Line truncated
`)}static newName(){let e=Rr[Pr]||1;return Rr[Pr]=e+1,cs+e.toString(36)}static mount(e,t){(e[fs]||new hc(e)).mount(Array.isArray(t)?t:[t])}}let Ai=null;class hc{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Ai)return e.adoptedStyleSheets=[Ai.sheet,...e.adoptedStyleSheets],e[fs]=Ai;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Ai=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[fs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a<o.rules.length;a++)t.insertRule(o.rules[a],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
`;this.styleTag.textContent=r}}}var at={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},li={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lr=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),cc=typeof navigator<"u"&&/Mac/.test(navigator.platform),fc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),uc=cc||Lr&&+Lr[1]<57;for(var se=0;se<10;se++)at[48+se]=at[96+se]=String(se);for(var se=1;se<=24;se++)at[se+111]="F"+se;for(var se=65;se<=90;se++)at[se]=String.fromCharCode(se+32),li[se]=String.fromCharCode(se);for(var In in at)li.hasOwnProperty(In)||(li[In]=at[In]);function dc(n){var e=uc&&(n.ctrlKey||n.altKey||n.metaKey)||fc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?li:at)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Qi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Ft(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function pc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ji(n,e){if(!e.anchorNode)return!1;try{return Ft(n,e.anchorNode)}catch{return!1}}function ai(n){return n.nodeType==3?Vt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Zi(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function en(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Er(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:hi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=en(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?hi(n):0}else return!1}}function hi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const Cl={left:0,right:0,top:0,bottom:0};function Js(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function gc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function mc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n;c;)if(c.nodeType==1){let f,u=c==a.body;if(u)f=gc(h);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let m=c.getBoundingClientRect();f={left:m.left,right:m.left+c.clientWidth,top:m.top,bottom:m.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let m=e.bottom-e.top,g=f.bottom-f.top;p=(s=="center"&&m<=g?e.top+m/2-g/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-g+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)h.scrollBy(d,p);else{let m=0,g=0;if(p){let y=c.scrollTop;c.scrollTop+=p,g=c.scrollTop-y}if(d){let y=c.scrollLeft;c.scrollLeft+=d,m=c.scrollLeft-y}e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g},m&&Math.abs(m-d)<1&&(i="nearest"),g&&Math.abs(g-p)<1&&(s="nearest")}if(u)break;c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function yc(n){let e=n.ownerDocument;for(let t=n.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class bc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Ot=null;function Al(n){if(n.setActive)return n.setActive();if(Ot)return n.focus(Ot);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerLine truncated
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=b.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Uc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==$.Space&&(s=o),s==o}}function Gc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=ta(n,{x:f,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?m<s:m>s))return b.cursor(m,e.assoc,void 0,o)}}function Wn(n,e,t){let i=n.state.facet(Gl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,a)=>{t.from>o&&t.from<l&&(t=e.head>t.from?b.cursor(o,1):b.cursor(l,-1),s=!0)});if(!s)return t}}class Jc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null;let t=(i,s)=>{this.ignoreDuringComposition(s)||s.type=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(s.type,e,s)?s.preventDefault():i(e,s))};for(let i in Z){let s=Z[i];e.contentDOM.addEventListener(i,r=>{Yr(e,r)&&t(s,r)},Cs[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(Z.mousedown,i)}),M.chrome&&M.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{Yr(e,l)&&this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Ee(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Ee(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(M.android&&M.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return M.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((i=ia.find(s=>s.keyCode==t.keyCode))&&!t.ctrlKey||_c.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Et(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const ia=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],_c="dthko",na=[16,17,18,20,91,92,224,225];function Di(n){return n*.7+8}class Xc{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=yc(e.contentDOM);let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Yc(e,t),this.dragMove= Line truncated
`&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}),t){let r=n.state;if(M.ios&&n.inputState.flushIOSKey(n)||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Et(n.contentDOM,"Enter",13)||t.from==s.from-1&&t.to==s.to&&t.insert.length==0&&Et(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Et(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();if(n.state.facet(ql).some(h=>h(n,t.from,t.to,o)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let l;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let h=s.from<t.from?r.sliceDoc(s.from,t.from):"",c=s.to>t.to?r.sliceDoc(t.to,s.to):"";l=r.replaceSelection(n.state.toText(h+t.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let h=r.changes(t),c=i&&!r.selection.main.eq(i.main)&&i.main.to<=h.newLength?i.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let f=n.state.sliceDoc(t.from,t.to),u=Zl(n)||n.state.doc.lineAt(s.head),d=s.to-t.to,p=s.to-s.from;l=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:h,range:c||m.map(h)};let g=m.to-d,y=g-f.length;if(m.to-m.from!=p||n.state.sliceDoc(y,g)!=f||u&&m.to>=u.from&&m.from<=u.to)return{range:m};let S=r.changes({from:y,to:g,insert:t.insert}),A=m.to-s.to;return{changes:S,range:c?b.range(Math.max(0,c.anchor+A),Math.max(0,c.head+A)):m.map(S)}})}else l={changes:h,selection:c&&r.selection.replaceRange(c)}}let a="input.type";return n.composing&&(a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(l,{scrollIntoView:!0,userEvent:a}),!0}else if(i&&!i.main.eq(s)){let r=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(r=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:r,userEvent:o}),!0}else return!1}function Sf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function kf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new $r(t,i)),(s!=t||r!=i)&&e.push(new $r(s,r))),e}function Cf(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const Af={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},zn=M.ie&&M.ie_version<=11;class Mf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new bc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(M.ie&&M.ie_version<=11||M.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),zn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM),this.resizeContent=new ResizeObserver(()=>this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.r Line truncated
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Ts),jf={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let qn=null;function Uf(){var n;if(qn==null&&typeof document<"u"&&document.body){let e=document.body.style;qn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return qn||!1}const Ji=D.define({combine(n){let e=At(n,{render:null,specialChars:Kf,addSpecialChars:null});return(e.replaceTabs=!Uf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ts)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ts)),e}});function Bg(n={}){return[Ji.of(n),Gf()]}let bo=null;function Gf(){return bo||(bo=ge.fromClass(class{constructor(n){this.view=n,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ji)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new $f({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ne(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=yi(o.text,l,i-o.from);return B.replace({widget:new Yf((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new Xf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ji);n.startState.facet(Ji)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Jf="•";function _f(n){return n>=32?Jf:n==10?"␤":String.fromCharCode(9216+n)}class Xf extends ct{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=_f(this.code),i=e.state.phrase("Control character")+" "+(jf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Yf extends ct{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Qf extends ct{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function Pg(n){return ge.fromClass(class{constructor(e){this.view=e,this.placeholder=B.set([B.widget({widget:new Qf(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Bs=2e3;function Zf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Bs||t.off>Bs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(b.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=hs(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=hs(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function eu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function wo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Bs?-1:s==i.length?eu(n,e.clientX):yi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function tu(n,e){let t=wo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=wo(n,s);if(!l)return i;let a=Zf(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Rg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?tu(t,i):null)}const Li="-10000px";class iu{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i== Line truncated
`&&(t="");else{let i=t.indexOf(`
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new qa(t,e?e.state.tabSize:4,e?kt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=ja(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=V.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:nd,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new V(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new V(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function ja(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const lr=Object.create(null),di=[me.none],nd=new tr(di),No=[],Ua=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Ua[n]=Ja(lr,e);class Ga{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Ua)}resolve(e){return e?this.table[e]||(this.table[e]=Ja(this.extra,e)):0}}const sd=new Ga(lr);function Jn(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function Ja(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||C[r];o?typeof o=="function"?t?t=o(t):Jn(r,`Modifier ${r} used at start of tag`):t?Jn(r,`Tag ${r} used as modifier`):t=o:Jn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=me.define({id:di.length,name:i,props:[Du({[i]:t})]});return di.push(s),s.id}function rd(n){let e=me.define({id:di.length,name:"Document",props:[mt.add(()=>n)]});return di.push(e),e}const od=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=hr(n.state,t.from);return i.line?ld(n):i.block?hd(n):!1};function ar(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const ld=ar(ud,0),ad=ar(_a,0),hd=ar((n,e)=>_a(n,e,fd(e)),0);function hr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Yt=50;function cd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Yt,i),o=n.sliceDoc(s,s+Yt),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*Yt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Yt),f=n.sliceDoc(s-Yt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function fd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function _a(n,e,t=e.selection.ranges){let i=t.map(r=>hr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>cd(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let a=i[o],{open:h,close:c}=l;r.push({from:h.pos-a.open.length,to:h.pos+h.margin},{from:c.pos-c.margin,to:c.pos+a.close.length})}return{changes:r}}return null}function ud(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,a=1e9,h=hr(e,r).line;if(h){for(let c=r;c<=o;){let f=e.doc.lineAt(c);if(f.from>s&&(r==o||o>f.from)){s=f.from;let u=/^\s*/. Line truncated
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Tp(this):new Dp(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Bt(this,s,t,i):Tt(this,s,t,i)}}class Rh{constructor(e){this.spec=e}}function Tt(n,e,t,i){return new Kt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Mp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Mp(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(gn(s,t-r))!=$.Word||e(mn(s,t-r))!=$.Word)&&(e(mn(s,i-r))!=$.Word||e(gn(s,i-r))!=$.Word))}class Dp extends Rh{constructor(e){super(e)}nextMatch(e,t,i){let s=Tt(this.spec,e,i,e.doc.length).nextOverlapping();return s.done&&(s=Tt(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Tt(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=Tt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Tt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Bt(n,e,t,i){return new Oh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Op(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function gn(n,e){return n.slice(ue(n,e,!1),e)}function mn(n,e){return n.slice(e,ue(n,e))}function Op(n){return(e,t,i)=>!i[0].length||(n(gn(i.input,i.index))!=$.Word||n(mn(i.input,i.index))!=$.Word)&&(n(mn(i.input,i.index+i[0].length))!=$.Word||n(gn(i.input,i.index+i[0].length))!=$.Word)}class Tp extends Rh{nextMatch(e,t,i){let s=Bt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Bt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Bt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t))}matchAll(e,t){let i=Bt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Bt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const pi=E.define(),dr=E.define(),rt=be.define({create(n){return new Yn(qs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(pi)?n=new Yn(t.value.create(),n.panel):t.is(dr)&&(n=new Yn(n.query,t.value?pr:null));return n},provide:n=>on.from(n,e=>e.panel)});class Yn{constructor(e,t){this.query=e,this.panel=t}}const Bp=B.mark({class:"cm-searchMatch"}),Pp=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Rp=ge.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(rt))}update(n){let e=n.state.field(rt);(e!=n.startState.field(rt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return B.none;let{view:t}=this,i=new xt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Pp:Bp)})}return i.finish()}},{decorations:n=>n.decorations});function xi(n){return e=>{let t=e.state.field(rt,!1);return t&&t.query.spec.valid?n(e,t):Lh(e)}}const yn=xi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:gr(n,i),userEvent:"select.search"}),!0):!1}),bn=xi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:gr(n,s),userEvent:"select.search"}),!0):!1}),Lp=xi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ep=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Kt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o), Line truncated
+1
View File
@@ -0,0 +1 @@
@charset "UTF-8";@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #a0a6ac;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #e4e9ec;--baseAlt2Color: #d7dde4;--baseAlt3Color: #c6cdd7;--baseAlt4Color: #a5b0c0;--infoColor: #5499e8;--infoAltColor: #cee2f8;--successColor: #32ad84;--successAltColor: #c4eedc;--dangerColor: #e34562;--dangerAltColor: #f7cad2;--warningColor: #ff944d;--warningAltColor: #ffd4b8;--overlayColor: rgba(53, 71, 104, .25);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .06);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 22px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--entranceAnimationSpeed: .25s;--baseRadius: 6px;--lgRadius: 12px;--btnRadius: 6px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03Line truncated
+200
View File
@@ -0,0 +1,200 @@
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function X(){}const wl=n=>n;function Le(n,e){for(const t in e)n[t]=e[t];return n}function rb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function T_(n){return n()}function ru(){return Object.create(null)}function Ae(n){n.forEach(T_)}function Bt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function Un(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function ab(n){return Object.keys(n).length===0}function $_(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function We(n,e,t){n.$$.on_destroy.push($_(e,t))}function Et(n,e,t,i){if(n){const s=C_(n,e,t,i);return n[0](s)}}function C_(n,e,t,i){return n[1]&&i?Le(t.ctx.slice(),n[1](i(e))):t.ctx}function At(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function It(n,e,t,i,s,l){if(s){const o=C_(e,t,i,l);n.p(o,s)}}function Pt(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 jt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Je(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 $i(n){return n??""}function Gt(n,e,t){return n.set(t),e}function De(n){return n&&Bt(n.destroy)?n.destroy:X}function au(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const M_=typeof window<"u";let Fo=M_?()=>window.performance.now():()=>Date.now(),pa=M_?n=>requestAnimationFrame(n):X;const bs=new Set;function O_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&pa(O_)}function Ro(n){let e;return bs.size===0&&pa(O_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function b(n,e){n.appendChild(e)}function D_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function ub(n){const e=v("style");return fb(D_(n),e),e.sheet}function fb(n,e){return b(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function at(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function B(n){return document.createTextNode(n)}function D(){return B(" ")}function we(){return B("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function $n(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function m(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:m(n,i,e[i])}function cb(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function ht(n){return n===""?null:+n}function db(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function ue(n,e){n.value=e??""}function Nr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function E_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function $t(n,e){return new n(e)}const mo=new Map;let ho=0;function pb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function mb(n,e){const t={stylesheet:ub(e),rules:{}};return mo.set(n,t),t}function ul(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${pb(f)}_${r}`,d=D_(n),{stylesheet:p,rules:h}=mo.get(d)||mb(d,n);h[c]||(h[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function fl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||hb())}function hb(){pa(()=>{ho||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),mo.clear())})}function _b(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=wl,start:a=Fo()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,h;function g(){c&&(h=ul(n,0,1,o,l,r,c)),l||(p=!0)}function _(){c&&fl(n,h),d=!1}return Ro(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),_()),!d)return!1;if(p){const k=y-a,T=0+1*r(k/o);f(T,1-T)}return!0}),g(),f(0,1),_}function gb(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,A_(n,s)}}function A_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let cl;function ai(n){cl=n}function Sl(){if(!cl)throw new Error("Function called outside component initialization");return cl}function Qt(n){Sl().$$.on_mount.push(n)}function bb(n){Sl().$$.after_update.push(n)}function I_(n){Sl().$$.on_destroy.push(n)}function vt(){const n=Sl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=E_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function de(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gs=[],se=[];let vs=[];const Fr=[],P_=Promise.resolve();let Rr=!1;function L_(){Rr||(Rr=!0,P_.then(ma))}function rn(){return L_(),P_}function et(n){vs.push(n)}function ke(n){Fr.push(n)}const tr=new Set;let cs=0;function ma(){if(cs!==0)return;const n=cl;do{try{for(;cs<gs.length;){const e=gs[cs];cs++,ai(e),vb(e.$$)}}catch(e){throw gs.length=0,cs=0,e}for(ai(null),gs.length=0,cs=0;se.length;)se.pop()();for(let e=0;e<vs.length;e+=1){const t=vs[e];tr.has(t)||(tr.add(t),t())}vs.length=0}while(gs.length);for(;Fr.length;)Fr.pop()();Rr=!1,tr.clear(),ai(n)}function vb(n){if(n.fragment!==null){n.update(),Ae(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(et)}}function yb(n){const e=[],t=[];vs.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vs=e}let qs;function ha(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function Gi(n,e,t){n.dispatchEvent(E_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Gn;function re(){Gn={r:0,c:[],p:Gn}}function ae(){Gn.r||Ae(Gn.c),Gn=Gn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Gn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const _a={duration:0};function kb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&fl(n,o)}function f(){const{delay:d=0,duration:p=300,easing:h=wl,tick:g=X,css:_}=s||_a;_&&(o=ul(n,0,1,p,d,h,_,a++)),g(0,1);const y=Fo()+d,k=y+p;r&&r.abort(),l=!0,et(()=>Gi(n,!0,"start")),r=Ro(T=>{if(l){if(T>=k)return g(1,0),Gi(n,!0,"end"),u(),l=!1;if(T>=y){const $=h((T-y)/p);g($,1-$)}}return l})}let c=!1;return{start(){c||(c=!0,fl(n),Bt(s)?(s=s(i),ha().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function wb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Gn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=wl,tick:d=X,css:p}=s||_a;p&&(o=ul(n,1,0,f,u,c,p));const h=Fo()+u,g=h+f;et(()=>Gi(n,!1,"start")),Ro(_=>{if(l){if(_>=g)return d(0,1),Gi(n,!1,"end"),--r.r||Ae(r.c),!1;if(_>=h){const y=c((_-h)/f);d(1-y,y)}}return l})}return Bt(s)?ha().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&fl(n,o),l=!1)}}}function qe(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&fl(n,u)}function c(p,h){const g=p.b-o;return h*=Math.abs(g),{a:o,b:p.b,d:g,duration:h,start:p.start,end:p.start+h,group:p.group}}function d(p){const{delay:h=0,duration:g=300,easing:_=wl,tick:y=X,css:k}=l||_a,T={start:Fo()+h,b:p};p||(T.group=Gn,Gn.r+=1),r||a?a=T:(k&&(f(),u=ul(n,o,p,g,h,_,k)),p&&y(0,1),r=c(T,g),et(()=>Gi(n,p,"start")),Ro($=>{if(a&&$>a.start&&(r=c(a,g),a=null,Gi(n,r.b,"start"),k&&(f(),u=ul(n,o,r.b,r.duration,0,_,l.css))),r){if($>=r.end)y(o=r.b,1-o),Gi(n,r.b,"end"),a||(r.b?f():--r.group.r||Ae(r.group.c)),r=null;else if($>=r.start){const M=$-r.start;o=r.a+r.d*_(M/r.duration),y(o,1-o)}}return!!(r||a)}))}return{run(p){Bt(l)?ha().then(()=>{l=l Line truncated
`,t+=e.columns.filter(i=>!!(i!=null&&i.column)).map(i=>{let s="";return i.column.includes("(")||i.column.includes(" ")?s+=i.column:s+=`"${i.column}"`,i.collate&&(s+=" COLLATE "+i.collate),i.sort&&(s+=" "+i.sort.toUpperCase()),s}).join(`,
`),t+=`
)`,e.expression&&(t+=` WHERE ${e.expression}`),t}static replaceIndexTableName(e,t){const i=H.parseIndex(e);return i.tableName=t,H.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=H.parseIndex(e);let l=!1;for(let o of s.columns)o.column===t&&(o.column=i,l=!0);return l?H.buildIndex(s):e}}const zo=Rn([]);function Vg(n,e=4e3){return Bo(n,"info",e)}function Ut(n,e=3e3){return Bo(n,"success",e)}function pl(n,e=4500){return Bo(n,"error",e)}function Zv(n,e=4500){return Bo(n,"warning",e)}function Bo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Hg(i)},t)};zo.update(s=>(Da(s,i.message),H.pushOrReplaceByKey(s,i,"message"),s))}function Hg(n){zo.update(e=>(Da(e,n),e))}function Oa(){zo.update(n=>{for(let e of n)Da(n,e);return[]})}function Da(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const ti=Rn({});function _n(n){ti.set(n||{})}function ci(n){ti.update(e=>(H.deleteByPath(e,n),e))}const Ea=Rn({});function Jr(n){Ea.set(n||{})}va.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ei("/login")};va.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&pl(l)}if(H.isEmpty(s.data)||_n(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ei("/")};class Gv extends H_{save(e,t){super.save(e,t),t instanceof es&&Jr(t)}clear(){super.clear(),Jr(null)}}const me=new va("../",new Gv("pb_admin_auth"));me.authStore.model instanceof es&&Jr(me.authStore.model);function Xv(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=n[3].default,h=Et(p,n,n[2],null);return{c(){e=v("div"),t=v("main"),h&&h.c(),i=D(),s=v("footer"),l=v("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=D(),r=v("span"),r.textContent="|",a=D(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.14.0",m(t,"class","page-content"),m(l,"href","https://pocketbase.io/docs/"),m(l,"target","_blank"),m(l,"rel","noopener noreferrer"),m(r,"class","delimiter"),m(f,"class","txt"),m(u,"href","https://github.com/pocketbase/pocketbase/releases"),m(u,"target","_blank"),m(u,"rel","noopener noreferrer"),m(u,"title","Releases"),m(s,"class","page-footer"),m(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(g,_){S(g,e,_),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(u,f),d=!0},p(g,[_]){h&&h.p&&(!d||_&4)&&It(h,p,g,g[2],d?At(p,g[2],_,null):Pt(g[2]),null),(!d||_&2&&c!==(c="page-wrapper "+g[1]))&&m(e,"class",c),(!d||_&3)&&Q(e,"center-content",g[0])},i(g){d||(A(h,g),d=!0)},o(g){I(h,g),d=!1},d(g){g&&w(e),h&&h.d(g)}}}function Qv(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Cn extends ve{constructor(e){super(),be(this,e,Qv,Xv,_e,{center:0,class:1})}}function zu(n){let e,t,i;return{c(){e=v("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=v("div"),m(e,"class","block txt-center m-b-lg"),m(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function xv(n){let e,t,i,s=!n[0]&&zu();const l=n[1].default,o=Et(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=D(),o&&o.c(),m(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=zu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&It(o,l,r,r[2],i?At(l,r[2],a,null):Pt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function ey(n){let e,t;return e=new Cn({props:{class:"full-page",center:!0,$$slots:{default:[xv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ty(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class zg extends ve{constructor(e){super(),be(this,e,ty,ey,_e,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=wl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ei(n,{delay:e=0,duration:t=400,easing:i=Uo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=au(s),[p,h]=au(l);return{delay:e,duration:t,easing:i,css:(g,_)=>`
transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*p}${h});
opacity: ${a-f*_}`}}function Mt(n,{delay:e=0,duration:t=400,easing:i=Uo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),p=parseFloat(l[`margin${f[0]}`]),h=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*p}px;margin-${u[1]}: ${y*h}px;border-${u[0]}-width: ${y*g}px;border-${u[1]}-width: ${y*_}px;`}}function qt(n,{delay:e=0,duration:t=400,easing:i=Uo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}let Zr,Hi;const Gr="app-tooltip";function Bu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Si(){return Hi=Hi||document.querySelector("."+Gr),Hi||(Hi=document.createElement("div"),Hi.classList.add(Gr),document.body.appendChild(Hi)),Hi}function Bg(n,e){let t=Si();if(!t.classList.contains("active")||!(e!=null&&e.text)){Xr();return}t.textContent=e.text,t.className=Gr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Xr(){clearTimeout(Zr),Si().classList.remove("active"),Si().activeNode=void 0}function ny(n,e){Si().activeNode=n,clearTimeout(Zr),Zr=setTimeout(()=>{Si().classList.add("active"),Bg(n,e)},isNaN(e.delay)?0:e.delay)}function ze(n,e){let t=Bu(e);function i(){ny(n,t)}function s(){Xr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&H.isFocusable(n))&&n.addEventListener("click",s),Si(),{update(l){var o,r;t=Bu(l),(r=(o=Si())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Bg(n,t)},destroy(){var l,o;(o=(l=Si())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Xr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Uu(n,e,t){const i=n.slice();return i[12]=e[t],i}const iy=n=>({}),Wu=n=>({uniqueId:n[4]});function sy(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=Yu(Uu(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=we()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=Uu(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Yu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){at(s,o),o&&w(e)}}}function ly(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("i"),m(t,"class","ri-error-warning-fill txt-danger"),m(e,"class","form-field-addon")},m(a,u){S(a,e,u),b(e,t),l=!0,o||(r=De(i=ze.call(null,t,{position:"left",text:n[3].map(yo).join(`
`)})),o=!0)},p(a,u){i&&Bt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(yo).join(`
`)})},i(a){l||(a&&et(()=>{l&&(s||(s=qe(t,qt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,qt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function Yu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=B(i),l=D(),m(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=yo(a[12])+"")&&le(s,i)},i(a){r||(a&&et(()=>{r&&(o||(o=qe(e,Mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,Mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function oy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Et(a,n,n[8],Wu),f=[ly,sy],c=[];function d(p,h){return p[0]&&p[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=D(),s.c(),m(e,"class",n[1]),Q(e,"error",n[3].length)},m(p,h){S(p,e,h),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=K(e,"click",n[10]),o=!0)},p(p,[h]){u&&u.p&&(!l||h&256)&&It(u,a,p,p[8],l?At(a,p[8],h,iy):Pt(p[8]),Wu);let g=i;i=d(p),i===g?c[i].p(p,h):(re(),I(c[g],1,1,()=>{c[g]=null}),ae(),s=c[i],s?s.p(p,h):(s=c[i]=f[i](p),s.c()),A(s,1),s.m(e,null)),(!l||h&2)&&m(e,"class",p[1]),(!l||h&10)&&Q(e,"error",p[3].length)},i(p){l||(A(u,p),A(s),l=!0)},o(p){I(u,p),I(s),l=!1},d(p){p&&w(e),u&&u.d(p),c[i].d(),n[11](null),o=!1,r()}}}const Ku="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Ku:n||Ku}function ry(n,e,t){let i;We(n,ti,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ci(r)}Qt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function p(g){de.call(this,n,g)}function h(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=H.toArray(H.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,p,h]}class pe extends ve{constructor(e){super(),be(this,e,ry,oy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function ay(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("input"),m(e,"for",i=n[9]),m(l,"type","email"),m(l,"autocomplete","off"),m(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function uy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Minimum 10 characters.",m(e,"for",i=n[9]),m(l,"type","password"),m(l,"autocomplete","new-password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0,m(a,"class","help-block")},m(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[1]),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&m(e,"for",i),d&512&&o!==(o=c[9])&&m(l,"id",o),d&2&&l.value!==c[1]&&ue(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function fy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Password confirm"),s=D(),l=v("input"),m(e,"for",i=n[9]),m(l,"type","password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=K(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function cy(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[ay,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[uy,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[fy,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),f=v("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(f,"type","submit"),m(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),m(e,"class","block"),m(e,"autocomplete","off")},m(h,g){S(h,e,g),b(e,t),b(e,i),q(s,e,null),b(e,l),q(o,e,null),b(e,r),q(a,e,null),b(e,u),b(e,f),c=!0,d||(p=K(e,"submit",ft(n[4])),d=!0)},p(h,[g]){const _={};g&1537&&(_.$$scope={dirty:g,ctx:h}),s.$set(_);const y={};g&1538&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const k={};g&1540&&(k.$$scope={dirty:g,ctx:h}),a.$set(k),(!c||g&8)&&Q(f,"btn-disabled",h[3]),(!c||g&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){I(s.$$.fragment,h),I(o.$$.fragment,h),I(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,p()}}}function dy(n,e,t){const i=vt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(d){me.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class py extends ve{constructor(e){super(),be(this,e,dy,cy,_e,{})}}function Ju(n){let e,t;return e=new zg({props:{$$slots:{default:[my]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function my(n){let e,t;return e=new py({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hy(n){let e,t,i=n[0]&&Ju(n);return{c(){i&&i.c(),e=we()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Ju(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function _y(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Ei("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await rn(),window.location.search=""}]}class gy extends ve{constructor(e){super(),be(this,e,_y,hy,_e,{})}}const Ot=Rn(""),ko=Rn(""),Cs=Rn(!1);function by(n){let e,t,i,s;return{c(){e=v("input"),m(e,"type","text"),m(e,"id",n[8]),m(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),ue(e,n[7]),i||(s=K(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&m(e,"placeholder",t),o&128&&e.value!==l[7]&&ue(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function vy(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=$t(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Zu(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Search</span>',m(e,"type","submit"),m(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=qe(e,ei,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,ei,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Gu(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){S(o,e,r),i=!0,s||(l=K(e,"click",n[15]),s=!0)},p:X,i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,ei,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,ei,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function yy(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[vy,by],p=[];function h(y,k){return y[4]&&!y[5]?0:1}l=h(n),o=p[l]=d[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&Zu(),_=(n[0].length||n[7].length)&&Gu(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=D(),o.c(),r=D(),g&&g.c(),a=D(),_&&_.c(),m(i,"class","ri-search-line"),m(t,"for",n[8]),m(t,"class","m-l-10 txt-xl"),m(e,"class","searchbar")},m(y,k){S(y,e,k),b(e,t),b(t,i),b(e,s),p[l].m(e,null),b(e,r),g&&g.m(e,null),b(e,a),_&&_.m(e,null),u=!0,f||(c=[K(e,"click",$n(n[11])),K(e,"submit",ft(n[10]))],f=!0)},p(y,[k]){let T=l;l=h(y),l===TLine truncated
<span class="txt">Method</span>`,m(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Ny(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="URL",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Fy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Referer",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Ry(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="User IP",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function qy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Status",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function jy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function ef(n){let e;function t(l,o){return l[6]?Hy:Vy}let i=t(n),s=i(n);return{c(){s.c(),e=we()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function Vy(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&tf(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=tf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Hy(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function tf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function nf(n){let e;return{c(){e=v("i"),m(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),m(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function sf(n,e){var $e,Ye,dt;let t,i,s,l=(($e=e[23].method)==null?void 0:$e.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,p,h,g,_,y,k=(e[23].referer||"N/A")+"",T,$,M,C,O,E=(e[23].userIp||"N/A")+"",P,L,F,N,R,z=e[23].status+"",W,J,x,ne,G,fe,Z,ce,he,Ce,Re=(((Ye=e[23].meta)==null?void 0:Ye.errorMessage)||((dt=e[23].meta)==null?void 0:dt.errorData))&&nf();ne=new di({props:{date:e[23].created}});function je(){return e[17](e[23])}function ye(...Ke){return e[18](e[23],...Ke)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=B(l),a=D(),u=v("td"),f=v("span"),d=B(c),h=D(),Re&&Re.c(),g=D(),_=v("td"),y=v("span"),T=B(k),M=D(),C=v("td"),O=v("span"),P=B(E),F=D(),N=v("td"),R=v("span"),W=B(z),J=D(),x=v("td"),V(ne.$$.fragment),G=D(),fe=v("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',Z=D(),m(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),m(i,"class","col-type-text col-field-method min-width"),m(f,"class","txt txt-ellipsis"),m(f,"title",p=e[23].url),m(u,"class","col-type-text col-field-url"),m(y,"class","txt txt-ellipsis"),m(y,"title",$=e[23].referer),Q(y,"txt-hint",!e[23].referer),m(_,"class","col-type-text col-field-referer"),m(O,"class","txt txt-ellipsis"),m(O,"title",L=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),m(C,"class","col-type-number col-field-userIp"),m(R,"class","label"),Q(R,"label-danger",e[23].status>=400),m(N,"class","col-type-number col-field-status"),m(x,"class","col-type-date col-field-created"),m(fe,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Ke,Be){S(Ke,t,Be),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,h),Re&&Re.m(u,null),b(t,g),b(t,_),b(_,y),b(y,T),b(t,M),b(t,C),b(C,O),b(O,P),b(t,F),b(t,N),b(N,R),b(R,W),b(t,J),b(t,x),q(ne,x,null),b(t,G),b(t,fe),b(t,Z),ce=!0,he||(Ce=[K(t,"click",je),K(t,"keydown",ye)],he=!0)},p(Ke,Be){var Fe,tt,Wt;e=Ke,(!ce||Be&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!ce||Be&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&m(s,"class",r),(!ce||Be&8)&&c!==(c=e[23].url+"")&&le(d,c),(!ce||Be&8&&p!==(p=e[23].url))&&m(f,"title",p),(tt=e[23].meta)!=null&&tt.errorMessage||(Wt=e[23].meta)!=null&&Wt.errorData?Re||(Re=nf(),Re.c(),Re.m(u,null)):Re&&(Re.d(1),Re=null),(!ce||Be&8)&&k!==(k=(e[23].referer||"N/A")+"")&&le(T,k),(!ce||Be&8&&$!==($=e[23].referer))&&m(y,"title",$),(!ce||Be&8)&&Q(y,"txt-hint",!e[23].referer),(!ce||Be&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(P,E),(!ce||Be&8&&L!==(L=e[23].userIp))&&m(O,"title",L),(!ce||Be&8)&&Q(O,"txt-hint",!e[23].userIp),(!ce||Be&8)&&z!==(z=e[23].status+"")&&le(W,z),(!ce||Be&8)&&Q(R,"label-danger",e[23].status>=400);const ee={};Be&8&&(ee.date=e[23].created),ne.$set(ee)},i(Ke){ce||(A(ne.$$.fragment,Ke),ce=!0)},o(Ke){I(ne.$$.fragment,Ke),ce=!1},d(Ke){Ke&&w(t),Re&&Re.d(),j(ne),he=!1,Ae(Ce)}}}function zy(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P=[],L=new Map,F;function N(ye){n[11](ye)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ly]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Jt({props:R}),se.push(()=>ge(s,"sort",N));function z(ye){n[12](ye)}let W={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Ny]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),r=new Jt({props:W}),se.push(()=>ge(r,"sort",z));function J(ye){n[13](ye)}let x={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Fy]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),f=new Jt({props:x}),se.push(()=>ge(f,"sort",J));function ne(ye){n[14](ye)}let G={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Ry]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),p=new Jt({props:G}),se.push(()=>ge(p,"sort",ne));function fe(ye){n[15](ye)}let Z={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[qy]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),_=new Jt({props:Z}),se.push(()=>ge(_,"sort",fe));function ce(ye){n[16](ye)}let he={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[jy]},$$scope:{ctx:n}};n[1]!==void 0&&(he.sort=n[1]),T=new Jt({props:he}),se.push(()=>ge(T,"sort",ce));let Ce=n[3];const Re=ye=>ye[23].id;for(let ye=0;ye<Ce.length;ye+=1){let $e=xu(n,Ce,ye),Ye=Re($e);L.set(Ye,P[ye]=sf(Ye,$e))}let je=null;return Ce.length||(je=ef(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),V(s.$$.fragment),o=D(),V(r.$$.fragment),u=D(),V(f.$$.fragment),d=D(),V(p.$$.fragment),g=D(),V(_.$$.fragment),k=D(),V(T.$$.fragm Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function si(){}const Yy=function(){let n=0;return function(){return n++}}();function ut(n){return n===null||typeof n>"u"}function gt(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 Ze(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Lt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Dn(n,e){return Lt(n)?n:e}function Qe(n,e){return typeof n>"u"?e:n}const Ky=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Ug=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function St(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ct(n,e,t,i){let s,l,o;if(gt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ze(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(gt(n))return n.map(So);if(Ze(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function Wg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Jy(n,e,t,i){if(!Wg(n))return;const s=e[n],l=t[n];Ze(s)&&Ze(l)?ml(s,l,i):e[n]=So(l)}function ml(n,e,t){const i=gt(e)?e:[e],s=i.length;if(!Ze(n))return n;t=t||{};const l=t.merger||Jy;for(let o=0;o<s;++o){if(e=i[o],!Ze(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function nl(n,e){return ml(n,e,{merger:Zy})}function Zy(n,e,t){if(!Wg(n))return;const i=e[n],s=t[n];Ze(i)&&Ze(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const rf={"":n=>n,x:n=>n.x,y:n=>n.y};function Mi(n,e){return(rf[e]||(rf[e]=Gy(e)))(n)}function Gy(n){const e=Xy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Xy(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Pa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Nn=n=>typeof n<"u",Oi=n=>typeof n=="function",af=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Qy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Dt=Math.PI,mt=2*Dt,xy=mt+Dt,To=Number.POSITIVE_INFINITY,e2=Dt/180,Tt=Dt/2,Bs=Dt/4,uf=Dt*2/3,Pn=Math.log10,Qn=Math.sign;function ff(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Pn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function t2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function n2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Yg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Bn(n){return n*(Dt/180)}function La(n){return n*(180/Dt)}function cf(n){if(!Lt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Kg(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Dt&&(l+=mt),{angle:l,distance:s}}function Qr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function i2(n,e){return(n-e+xy)%mt-Dt}function wn(n){return(n%mt+mt)%mt}function hl(n,e,t,i){const s=wn(n),l=wn(e),o=wn(t),r=wn(l-s),a=wn(o-s),u=wn(s-l),f=wn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Zt(n,e,t){return Math.max(e,Math.min(t,n))}function s2(n){return Zt(n,-32768,32767)}function _l(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Na(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Zi=(n,e,t,i)=>Na(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),l2=(n,e,t)=>Na(n,t,i=>n[i][e]>=t);function o2(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const Jg=["push","pop","shift","splice","unshift"];function r2(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Jg.forEach(t=>{const i="_onData"+Pa(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function df(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Jg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Zg(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const Gg=function(){return typeof window>"u"?function(n){return n()}:window.requestLine truncated
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function El(n){return n+.5|0}const yi=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return yi(El(n*2.55),0,255)}function Ti(n){return yi(El(n*255),0,255)}function ri(n){return yi(El(n/2.55)/100,0,1)}function _f(n){return yi(El(n*100),0,100)}const On={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},xr=[..."0123456789ABCDEF"],f2=n=>xr[n&15],c2=n=>xr[(n&240)>>4]+xr[n&15],Yl=n=>(n&240)>>4===(n&15),d2=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function p2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&On[n[1]]*17,g:255&On[n[2]]*17,b:255&On[n[3]]*17,a:e===5?On[n[4]]*17:255}:(e===7||e===9)&&(t={r:On[n[1]]<<4|On[n[2]],g:On[n[3]]<<4|On[n[4]],b:On[n[5]]<<4|On[n[6]],a:e===9?On[n[7]]<<4|On[n[8]]:255})),t}const m2=(n,e)=>n<255?e(n):"";function h2(n){var e=d2(n)?f2:c2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+m2(n.a,e):void 0}const _2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function e1(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function g2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function b2(n,e,t){const i=e1(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function v2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Fa(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=v2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ra(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ti)}function qa(n,e,t){return Ra(e1,n,e,t)}function y2(n,e,t){return Ra(b2,n,e,t)}function k2(n,e,t){return Ra(g2,n,e,t)}function t1(n){return(n%360+360)%360}function w2(n){const e=_2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):Ti(+e[5]));const s=t1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=y2(s,l,o):e[1]==="hsv"?i=k2(s,l,o):i=qa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function S2(n,e){var t=Fa(n);t[0]=t1(t[0]+e),t=qa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function T2(n){if(!n)return;const e=Fa(n),t=e[0],i=_f(e[1]),s=_f(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ri(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const gf={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"},bf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function $2(){const n={},e=Object.keys(bf),t=Object.keys(gf);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s]Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class Mk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Gg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var li=new Mk;const Ef="transparent",Ok={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=yf(n||Ef),s=i.valid&&yf(e||Ef);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Dk{constructor(e,t,i,s){const l=t[i];s=Zl([e.to,s,l,e.from]);const o=Zl([e.from,l,s]);this._active=!0,this._fn=e.fn||Ok[e.type||typeof o],this._easing=sl[e.easing]||sl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Zl([e.to,t,s,e.from]),this._from=Zl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const Ek=["x","y","borderWidth","radius","tension"],Ak=["color","borderColor","backgroundColor"];xe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Ik=Object.keys(xe.animation);xe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});xe.set("animations",{colors:{type:"color",properties:Ak},numbers:{type:"number",properties:Ek}});xe.describe("animations",{_fallback:"animation"});xe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class _1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ze(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ze(s))return;const l={};for(const o of Ik)l[o]=s[o];(gt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Lk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Pk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new Dk(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return li.add(this._chart,i),!0}}function Pk(n,e){const t=[],Line truncated
`)>-1?n.split(`
`):n}function J3(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function rc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Sn(e.bodyFont),u=Sn(e.titleFont),f=Sn(e.footerFont),c=l.length,d=s.length,p=i.length,h=Fn(e.padding);let g=h.height,_=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=p*$+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let k=0;const T=function($){_=Math.max(_,t.measureText($).width+k)};return t.save(),t.font=u.string,ct(n.title,T),t.font=a.string,ct(n.beforeBody.concat(n.afterBody),T),k=e.displayColors?o+2+e.boxPadding:0,ct(i,$=>{ct($.before,T),ct($.lines,T),ct($.after,T)}),k=0,t.font=f.string,ct(n.footer,T),t.restore(),_+=h.width,{width:_,height:g}}function Z3(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function G3(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function X3(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),G3(u,n,e,t)&&(u="center"),u}function ac(n,e,t){const i=t.yAlign||e.yAlign||Z3(n,t);return{xAlign:t.xAlign||e.xAlign||X3(n,e,t,i),yAlign:i}}function Q3(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function x3(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function uc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:p}=ks(o);let h=Q3(e,r);const g=x3(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,p)+s),{x:Zt(h,0,i.width-e.width),y:Zt(g,0,i.height-e.height)}}function no(n,e,t){const i=Fn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function fc(n){return Zn([],oi(n))}function eS(n,e,t){return Ai(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function cc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class aa extends pi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new _1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=eS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Zn(r,oi(s)),r=Zn(r,oi(l)),r=Zn(r,oi(o)),r}getBeforeBody(e,t){return fc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ct(e,l=>{const o={before:[],lines:[],after:[]},r=cc(i,l);Zn(o.before,oi(r.beforeLabel.call(this,l))),Zn(o.lines,r.label.call(this,l)),Zn(o.after,oi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return fc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Zn(r,oi(s)),r=Zn(r,oi(l)),r=Zn(r,oi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(J3(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ct(r,f=>{const c=cc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;l Line truncated
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const kS={datetime:Ve.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ve.TIME_WITH_SECONDS,minute:Ve.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};k1._date.override({_id:"luxon",_create:function(n){return Ve.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return kS},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=Ve.fromFormat(n,e,t):n=Ve.fromISO(n,t):n instanceof Date?n=Ve.fromJSDate(n,t):i==="object"&&!(n instanceof Ve)&&(n=Ve.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 vc(n){let e,t,i;return{c(){e=v("div"),m(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,qt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function wS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=D(),s=B(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function SS(n){let e;return{c(){e=B("Loading...")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function TS(n){let e,t,i,s,l,o=n[2]&&vc();function r(f,c){return f[2]?SS:wS}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=D(),i=v("canvas"),s=D(),l=v("div"),u.c(),m(i,"class","chart-canvas svelte-vh4sl8"),Nr(i,"height","250px"),Nr(i,"width","100%"),m(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),m(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=vc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){I(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function $S(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let h of p)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),me.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Qt(()=>(Io.register(Ii,Zo,Ko,eu,Ll,K3,tS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){se[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class CS extends ve{constructor(e){super(),be(this,e,$S,TS,_e,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ca={},MS={get exports(){return ca},set exports(n){ca=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function k(T){return T instanceof a?new a(T.type,k(T.content),T.alias):Array.isArray(T)?T.map(k):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k(T,$){$=$||{};var M,C;switch(r.util.type(T)){case"Object":if(C=r.util.objId(T),$[C])return $[C];M={},$[C]=M;for(var O in T)T.hasOwnProperty(O)&&(M[O]=k(T[O],$));return M;case"Array":return C=r.util.objId(T),$[C]?$[C]:(M=[],$[C]=M,T.forEach(function(E,P){M[P]=k(E,$)}),M);default:return T}},getLanguage:function(k){for(;k;){var T=s.exec(k.className);if(T)return T[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,T){k.className=k.className.replace(RegExp(s,"gi"),""),k.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(k){var T=document.getElementsByTagName("script");for(var $ in T)if(T[$].src==k)return T[$]}return null}},isActive:function(k,T,$){for(var M="no-"+T;k;){var C=k.classList;if(C.contains(T))return!0;if(C.contains(M))return!1;k=k.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(k,T){var $=r.util.clone(r.languages[k]);for(var M in T)$[M]=T[M];return $},insertBefore:function(k,T,$,M){M=M||r.languages;var C=M[k],O={};for(var E in C)if(C.hasOwnProperty(E)){if(E==T)for(var P in $)$.hasOwnProperty(P)&&(O[P]=$[P]);$.hasOwnProperty(E)||(O[E]=C[E])}var L=M[k];return M[k]=O,r.languages.DFS(r.languages,function(F,N){N===L&&F!=k&&(this[F]=O)}),O},DFS:function k(T,$,M,C){C=C||{};var O=r.util.objId;for(var E in T)if(T.hasOwnProperty(E)){$.call(T,E,T[E],M||E);var P=T[E],L=r.util.type(P);L==="Object"&&!C[O(P)]?(C[O(P)]=!0,k(P,$,null,C)):L==="Array"&&!C[O(P)]&&(C[O(P)]=!0,k(P,$,E,C))}}},plugins:{},highlightAll:function(k,T){r.highlightAllUnder(document,k,T)},highlightAllUnder:function(k,T,$){var M={callback:$,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var C=0,O;O=M.elements[C++];)r.highlightElement(O,T===!0,M.callback)},highlightElement:function(k,T,$){var M=r.util.getLanguage(k),C=r.languages[M];r.util.setLanguage(k,M);var O=k.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var E=k.textContent,P={element:k,language:M,grammar:C,code:E};function L(N){P.highlightedCode=N,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),$&&$.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),$&&$.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){L(r.util.encode(P.code));return}if(T&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(N){L(N.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else L(r.highlight(P.code,P.grammar,P.language))},highlight:function(k,T,$){var M={code:k,grammar:T,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(k,T){var $=T.rest;if($){for(var M in $)T[M]=$[M];delete T.rest}var C=new c;return d(C,C.head,k),f(k,C,T,C.head,0),h(C)},hooks:{all:{},add:function(k,T){var $=r.hooks.all;$[k]=$[k]||[],$[k].push(T)},run:function(k,T){var $=r.hooks.all[k];if(!(!$||!$.length))for(var M=0,C;C=$[M++];)C(T)}},Token:a};i.Prism=r;function a(k,T,$,M){this.type=k,this.content=T,this.alias=$,this.length=(M||"").length|0}a.stringify=function k(T,$){if(typeof T=="string")return T;if(Array.isArray(T)){var M="";return T.forEach(function(L){M+=k(L,$)}),M}var C={type:T.type,content:k(T.content,$),tag:"span",classes:["token",T.type],attributes:{},language:$},O=T.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(C.classes,O):C.classes.push(O)),r.hooks.run("wrap",C);var E="";for(var P in C.attributes)E+=" "+P+'="'+(C.attributes[P]||"").replace(/"/g,"&quot;")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+E+">"+C.content+"</"+C.tag+">"};function u(k,T,$,M){k.lastIndex=T;var C=k.exec($);if(C&&M&&C[1]){var O=C[1].length;C.index+=O,C[0]=C[0].slice(O)}return C}funLine truncated
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(P+1))}y.textContent=C,t.highlightElement(y)},function(C){_.setAttribute(r,f),y.textContent=C})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),k=0,T;T=y[k++];)t.highlightElement(T)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(MS);const Zs=ca;var kc={},OS={get exports(){return kc},set exports(n){kc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var p=s(f[d]);c+=p,c>r&&(f[d]=`
`+f[d],c=p)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,p="",h="",g=!1,_=0;_<d.length;++_){var y=d[_];y==o.element?g=!0:y.nodeName==="#text"&&(g?h+=y.nodeValue:p+=y.nodeValue,a.removeChild(y),--_)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=p+o.code+h,o.code=r.normalize(o.code,o.settings);else{var k=p+o.element.innerHTML+h;o.element.innerHTML=r.normalize(k,o.settings),o.code=o.element.textContent}}}})})()})(OS);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function DS(n){let e,t,i;return{c(){e=v("div"),t=v("code"),m(t,"class","svelte-10s5tkd"),m(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&m(e,"class",i)},i:X,o:X,d(s){s&&w(e)}}}function ES(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class H1 extends ve{constructor(e){super(),be(this,e,ES,DS,_e,{class:0,content:2,language:3})}}const AS=n=>({}),wc=n=>({}),IS=n=>({}),Sc=n=>({});function Tc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T=n[4]&&!n[2]&&$c(n);const $=n[19].header,M=Et($,n,n[18],Sc);let C=n[4]&&n[2]&&Cc(n);const O=n[19].default,E=Et(O,n,n[18],null),P=n[19].footer,L=Et(P,n,n[18],wc);return{c(){e=v("div"),t=v("div"),s=D(),l=v("div"),o=v("div"),T&&T.c(),r=D(),M&&M.c(),a=D(),C&&C.c(),u=D(),f=v("div"),E&&E.c(),c=D(),d=v("div"),L&&L.c(),m(t,"class","overlay"),m(o,"class","overlay-panel-section panel-header"),m(f,"class","overlay-panel-section panel-content"),m(d,"class","overlay-panel-section panel-footer"),m(l,"class",p="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),m(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(F,N){S(F,e,N),b(e,t),b(e,s),b(e,l),b(l,o),T&&T.m(o,null),b(o,r),M&&M.m(o,null),b(o,a),C&&C.m(o,null),b(l,u),b(l,f),E&&E.m(f,null),n[21](f),b(l,c),b(l,d),L&&L.m(d,null),_=!0,y||(k=[K(t,"click",ft(n[20])),K(f,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?T.p(n,N):(T=$c(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),M&&M.p&&(!_||N[0]&262144)&&It(M,$,n,n[18],_?At($,n[18],N,IS):Pt(n[18]),Sc),n[4]&&n[2]?C?C.p(n,N):(C=Cc(n),C.c(),C.m(o,null)):C&&(C.d(1),C=null),E&&E.p&&(!_||N[0]&262144)&&It(E,O,n,n[18],_?At(O,n[18],N,null):Pt(n[18]),null),L&&L.p&&(!_||N[0]&262144)&&It(L,P,n,n[18],_?At(P,n[18],N,A Line truncated
<span class="txt">New index</span>`,f=D(),V(c.$$.fragment),m(e,"class","section-title"),m(u,"type","button"),m(u,"class","label label-primary link-fade svelte-167lbwu"),m(r,"class","indexes-list svelte-167lbwu")},m(O,E){S(O,e,E),b(e,t),b(e,s),b(e,l),S(O,o,E),S(O,r,E);for(let P=0;P<y.length;P+=1)y[P]&&y[P].m(r,null);b(r,a),b(r,u),S(O,f,E),q(c,O,E),p=!0,h||(g=K(u,"click",n[5]),h=!0)},p(O,[E]){var L,F,N;if((!p||E&1)&&i!==(i=(((F=(L=O[0])==null?void 0:L.indexes)==null?void 0:F.length)||0)+"")&&le(s,i),E&7){_=((N=O[0])==null?void 0:N.indexes)||[];let R;for(R=0;R<_.length;R+=1){const z=Fc(O,_,R);y[R]?y[R].p(z,E):(y[R]=qc(z),y[R].c(),y[R].m(r,a))}for(;R<y.length;R+=1)y[R].d(1);y.length=_.length}const P={};!d&&E&1&&(d=!0,P.collection=O[0],ke(()=>d=!1)),c.$set(P)},i(O){p||(A(c.$$.fragment,O),p=!0)},o(O){I(c.$$.fragment,O),p=!1},d(O){O&&w(e),O&&w(o),O&&w(r),at(y,O),O&&w(f),n[6](null),j(c,O),h=!1,g()}}}const jc=n=>n.column;function cT(n,e,t){let i;We(n,ti,p=>t(2,i=p));let{collection:s}=e,l;function o(p,h){for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==p){t(0,s.indexes[g]=h,s),ci("indexes."+g);return}s.indexes.push(h),t(0,s)}const r=(p,h)=>l==null?void 0:l.show(p,h),a=()=>l==null?void 0:l.show();function u(p){se[p?"unshift":"push"](()=>{l=p,t(1,l)})}function f(p){s=p,t(0,s)}const c=p=>{for(let h=0;h<s.indexes.length;h++)if(s.indexes[h]==p.detail){s.indexes.splice(h,1),ci("indexes."+h);break}t(0,s)},d=p=>{o(p.detail.old,p.detail.new)};return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},[s,l,i,o,r,a,u,f,c,d]}class dT extends ve{constructor(e){super(),be(this,e,cT,fT,_e,{collection:0})}}function Vc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function c(...d){return n[5](n[6],...d)}return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),o=B(l),r=D(),m(t,"class","icon "+n[6].icon+" svelte-1p626x7"),m(s,"class","txt"),m(e,"tabindex","0"),m(e,"class","dropdown-item closable svelte-1p626x7")},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),b(s,o),b(e,r),a||(u=[K(e,"click",$n(f)),K(e,"keydown",$n(c))],a=!0)},p(d,p){n=d},d(d){d&&w(e),a=!1,Ae(u)}}}function pT(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Hc(Vc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Vc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Hc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){at(i,s),s&&w(e)}}}function mT(n){let e,t,i,s,l,o,r,a,u,f;return o=new qn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[pT]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("i"),i=D(),s=v("div"),s.textContent="New field",l=D(),V(o.$$.fragment),m(t,"class","ri-add-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class",r=$i(n[0])+" svelte-1p626x7")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(e,l),q(o,e,null),a=!0,u||(f=K(e,"click",n[1]),u=!0)},p(c,[d]){const p={};d&512&&(p.$$scope={dirty:d,ctx:c}),o.$set(p),(!a||d&1&&r!==(r=$i(c[0])+" svelte-1p626x7"))&&m(e,"class",r)},i(c){a||(A(o.$$.fragment,c),a=!0)},o(c){I(o.$$.fragment,c),a=!1},d(c){c&&w(e),j(o),u=!1,f()}}}function hT(n,e,t){let{class:i=""}=e;const s=vt(),l=[{label:"Plain text",value:"text",icon:H.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:H.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:H.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:H.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:H.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:H.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:H.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:H.getFieldTypeIcon("select")},{label:"File",value:"file",icon:H.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:H.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:H.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class _T extends ve{constructor(e){super(),be(this,e,hT,mT,_e,{class:0})}}const gT=n=>({interactive:n&32,hasErrors:n&16}),zc=n=>({interactive:n[5],hasErrors:n[4]}),bT=n=>({interactive:n&32,hasErrors:n&16}),Bc=n=>({interactive:n[5],hasErrors:n[4]});function Uc(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="drag-handle"></span>',m(e,"class","drag-handle-wrapper"),m(e,"draggable","true"),m(e,"aria-label","Sort")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function vT(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("div"),t=v("i"),s=D(),l=v("input"),m(t,"class",i=H.getFieldTypeIcon(n[0].type)),m(e,"class","form-field-addon prefix no-pointer-events"),Q(e,"txt-disabled",!n[5]),m(l,"type","text"),l.required=!0,l.disabled=o=!n[5],l.readOnly=r=n[0].id&&n[0].system,m(l,"spellcheck","false"),l.autofocus=a=!n[0].id,m(l,"placeholder","Field name"),l.value=u=n[Line truncated
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.exceptDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function YT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[4](_)}let g={id:n[12]+".options.onlyDomains",disabled:!H.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]+".options.onlyDomains"),m(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]+".options.onlyDomains"))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]+".options.onlyDomains"),y&1&&(k.disabled=!H.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.onlyDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function KT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[WT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[YT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(a,u){S(a,e,u),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function JT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[KT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function ZT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(_){n.$$.not_equal(l.options.exceptDomains,_)&&(l.options.exceptDomains=_,t(0,l))}function a(_){n.$$.not_equal(l.options.onlyDomains,_)&&(l.options.onlyDomains=_,t(0,l))}function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(2,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,c,d,p,h,g]}class W1 extends ve{constructor(e){super(),be(this,e,ZT,JT,_e,{field:0,key:1})}}function GT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new W1({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function XT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(h){l=h,t(0,l)}function a(h){de.call(this,n,h)}function u(h){de.call(this,n,h)}function f(h){de.call(this,n,h)}function c(h){de.call(this,n,h)}function d(h){de.call(this,n,h)}function p(h){de.call(this,n,h)}return n.$$set=h=>{e=Le(Le({},e),jt(h)),t(2,s=Je(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,p]}class QT extends ve{constructor(e){super(),be(this,e,XT,GT,_e,{field:0,key:1})}}function xT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function e$(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(h){l=h,t(0,l)}function a(h){de.call(this,n,h)}function u(h){de.call(this,n,h)}function f(h){de.call(this,n,h)}function c(h){de.call(this,n,h)}function d(h){de.call(this,n,h)}function p(h){de.call(this,n,h)}return n.$$set=h=>{e=Le(Le({},e),jt(h)),t(2,s=Je(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,p]}class t$ extends ve{constructor(e){super(),be(this,e,e$,xT,_e,{field:0,key:1})}}var $r=["onChange","onClose","onDayCreate","onDest Line truncated
<span class='flatpickr-weekday'>
`+Y.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var U=ot("div","flatpickr-weekwrapper");U.appendChild(ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Y=ot("div","flatpickr-weeks");return U.appendChild(Y),{weekWrapper:U,weekNumbers:Y}}function Z(U,Y){Y===void 0&&(Y=!0);var te=Y?U:U-t.currentMonth;te<0&&t._hidePrevMonthArrow===!0||te>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=te,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ge("onYearChange"),R()),N(),Ge("onMonthChange"),Ri())}function ce(U,Y){if(U===void 0&&(U=!0),Y===void 0&&(Y=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Y===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var te=Dr(t.config),oe=te.hours,Te=te.minutes,Ee=te.seconds;p(oe,Te,Ee)}t.redraw(),U&&Ge("onChange")}function he(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ge("onClose")}function Ce(){t.config!==void 0&&Ge("onDestroy");for(var U=t._handlers.length;U--;)t._handlers[U].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 Y=t.calendarContainer.parentNode;if(Y.lastChild&&Y.removeChild(Y.lastChild),Y.parentNode){for(;Y.firstChild;)Y.parentNode.insertBefore(Y.firstChild,Y);Y.parentNode.removeChild(Y)}}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(te){try{delete t[te]}catch{}})}function Re(U){return t.calendarContainer.contains(U)}function je(U){if(t.isOpen&&!t.config.inline){var Y=yn(U),te=Re(Y),oe=Y===t.input||Y===t.altInput||t.element.contains(Y)||U.path&&U.path.indexOf&&(~U.path.indexOf(t.input)||~U.path.indexOf(t.altInput)),Te=!oe&&!te&&!Re(U.relatedTarget),Ee=!t.config.ignoredFocusElements.some(function(Ie){return Ie.contains(Y)});Te&&Ee&&(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 ye(U){if(!(!U||t.config.minDate&&U<t.config.minDate.getFullYear()||t.config.maxDate&&U>t.config.maxDate.getFullYear())){var Y=U,te=t.currentYear!==Y;t.currentYear=Y||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)),te&&(t.redraw(),Ge("onYearChange"),R())}}function $e(U,Y){var te;Y===void 0&&(Y=!0);var oe=t.parseDate(U,void 0,Y);if(t.config.minDate&&oe&&kn(oe,t.config.minDate,Y!==void 0?Y:!t.minDateHasTime)<0||t.config.maxDate&&oe&&kn(oe,t.config.maxDate,Y!==void 0?Y:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Te=!!t.config.enable,Ee=(te=t.config.enable)!==null&&te!==void 0?te:t.config.disable,Ie=0,Me=void 0;Ie<Ee.length;Ie++){if(Me=Ee[Ie],typeof Me=="function"&&Me(oe))return Te;if(Me instanceof Date&&oe!==void 0&&Me.getTime()===oe.getTime())return Te;if(typeof Me=="string"){var Ue=t.parseDate(Me,void 0,!0);return Ue&&Ue.getTime()===oe.getTime()?Te:!Te}else if(typeof Me=="object"&&oe!==void 0&&Me.from&&Me.to&&oe.getTime()>=Me.from.getTime()&&oe.getTime()<=Me.to.getTime())return Te}return!Te}function Ye(U){return t.daysContainer!==void 0?U.className.indexOf("hidden")===-1&&U.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(U):!1}function dt(U){var Y=U.target===t._input,te=t._input.value.trimEnd()!==qi();Y&&te&&!(U.relatedTarget&&Re(U.relatedTarget))&&t.setDate(t._input.value,!0,U.target===t.altInput?t.config.altFormat:t.config.dateFormat)}f Line truncated
`),r=v("code"),r.textContent="multipart/form-data",a=B(`
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=B(` field
is a
`),c=v("strong"),c.textContent="plain string",d=B(`:
`),p=v("ul"),h=v("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=D(),_=v("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=D(),k=v("li"),k.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=D(),$=v("li"),$.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=D(),C=v("li"),E=B(O),P=B(" is converted to the json "),L=v("code"),L.textContent='{"a":1,"b":2}',F=D(),N=v("li"),N.textContent="numeric strings are converted to json number",R=D(),z=v("li"),z.textContent="double quoted strings are left as they are (aka. without normalizations)",W=D(),J=v("li"),J.textContent="any other string (empty string too) is double quoted",x=B(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),ne=v("code"),ne.textContent='{"data": anything}',m(i,"class","content"),m(t,"class","alert alert-warning m-b-0 m-t-10"),m(e,"class","block")},m(Z,ce){S(Z,e,ce),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,p),b(p,h),b(p,g),b(p,_),b(p,y),b(p,k),b(p,T),b(p,$),b(p,M),b(p,C),b(C,E),b(C,P),b(C,L),b(p,F),b(p,N),b(p,R),b(p,z),b(p,W),b(p,J),b(i,x),b(i,ne),fe=!0},i(Z){fe||(Z&&et(()=>{fe&&(G||(G=qe(e,Mt,{duration:150},!0)),G.run(1))}),fe=!0)},o(Z){Z&&(G||(G=qe(e,Mt,{duration:150},!1)),G.run(0)),fe=!1},d(Z){Z&&w(e),Z&&G&&G.end()}}}function U$(n){let e,t,i,s,l,o,r;function a(d,p){return d[2]?B$:z$}let u=a(n),f=u(n),c=n[2]&&hd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),c&&c.c(),l=we(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,p){S(d,e,p),b(e,t),b(e,i),f.m(e,null),S(d,s,p),c&&c.m(d,p),S(d,l,p),o||(r=K(e,"click",n[4]),o=!0)},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?p&4&&A(c,1):(c=hd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function W$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[U$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?bt(s,[a&2&&{key:r[1]},a&8&&Vt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function Y$(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(3,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,r,s,a,u,f,c,d,p,h,g]}class K$ extends ve{constructor(e){super(),be(this,e,Y$,W$,_e,{field:0,key:1})}}function J$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=B(t),s=D(),l=v("small"),r=B(o),m(e,"class","txt"),m(l,"class","txt-hint")},m(a,u){S(a,e,u),b(e,i),S(a,s,u),S(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:X,o:X,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function Z$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class _d extends ve{constructor(e){super(),be(this,e,Z$,J$,_e,{item:0})}}const G$=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"ima Line truncated
Leave empty for no restriction.`,position:"top"})),k=!0)},p(C,O){(!y||O&33554432&&l!==(l=C[25]))&&m(e,"for",l);const E={};O&33554432&&(E.id=C[25]),O&8&&(E.items=C[3]),!a&&O&1&&(a=!0,E.keyOfSelected=C[0].options.mimeTypes,ke(()=>a=!1)),r.$set(E);const P={};O&134217729&&(P.$$scope={dirty:O,ctx:C}),_.$set(P)},i(C){y||(A(r.$$.fragment,C),A(_.$$.fragment,C),y=!0)},o(C){I(r.$$.fragment,C),I(_.$$.fragment,C),y=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(_),k=!1,T()}}}function tC(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,m(e,"class","m-0")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function nC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M;function C(E){n[12](E)}let O={id:n[25],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Fs({props:O}),se.push(()=>ge(r,"value",C)),k=new qn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[tC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=D(),p=v("button"),h=v("span"),h.textContent="Supported formats",g=D(),_=v("i"),y=D(),V(k.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[25]),m(c,"class","txt"),m(h,"class","txt link-primary"),m(_,"class","ri-arrow-drop-down-fill"),m(p,"type","button"),m(p,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(E,P){S(E,e,P),b(e,t),b(e,i),b(e,s),S(E,o,P),q(r,E,P),S(E,u,P),S(E,f,P),b(f,c),b(f,d),b(f,p),b(p,h),b(p,g),b(p,_),b(p,y),q(k,p,null),T=!0,$||(M=De(ze.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(E,P){(!T||P&33554432&&l!==(l=E[25]))&&m(e,"for",l);const L={};P&33554432&&(L.id=E[25]),!a&&P&1&&(a=!0,L.value=E[0].options.thumbs,ke(()=>a=!1)),r.$set(L);const F={};P&134217728&&(F.$$scope={dirty:P,ctx:E}),k.$set(F)},i(E){T||(A(r.$$.fragment,E),A(k.$$.fragment,E),T=!0)},o(E){I(r.$$.fragment,E),I(k.$$.fragment,E),T=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(k),$=!1,M()}}}function iC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Max file size"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Must be in bytes.",m(e,"for",i=n[25]),m(l,"type","number"),m(l,"id",o=n[25]),m(l,"step","1"),m(l,"min","0"),m(a,"class","help-block")},m(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[0].options.maxSize),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[13]),u=!0)},p(c,d){d&33554432&&i!==(i=c[25])&&m(e,"for",i),d&33554432&&o!==(o=c[25])&&m(l,"id",o),d&1&&ht(l.value)!==c[0].options.maxSize&&ue(l,c[0].options.maxSize)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function gd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[sC,({uniqueId:s})=>({25:s}),({uniqueId:s})=>s?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","col-sm-3")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&167772161&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function sC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Max select"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"id",o=n[25]),m(l,"type","number"),m(l,"step","1"),m(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&1&&ht(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function lC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[eC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[nC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[iC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}});let h=!n[2]&&gd(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),a=D(),u=v("div"),V(f.$$.fragment),d=D(),h&&h.c(),m(t,"class","col-sm-12"),m(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),m(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),m(e,"class","grid grid-sm")},m(g,_){S(g,e,_),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,a),b(e,u),q(f,u,null),b(e,d),h&&h.m(e,null),p=!0},p(g,_){const y={};_&2&&(y.name="schema."+g[1]+".options.mimeTypes"),_&167772169&&(y.$$scope={dirty:_,ctx:g}),i.$set(y);const k={};_&2&&(k.name="schema."+g[1]+".options.thumbs"),_&167772161&&(k.$$scope={dirty:_,ctx:g}),o.$set(k),(!p||_&4&&r!==(r=g[2]?"col-sm-8":"col-sm-6"))&&m(l,"class",r);const T={};_&2&&(T.name="schema."+g[1]+".options.maxSize"),_&167772161&&(T.$$scope={dirty:_,ctx:g}),f.$set(T),(!p||_&4&&c!==(c=g[2]?"col-sm-4":"col-sm-3"))&&m(u,"class",c),g[2]?h&&(re(),I(h,1,1,()=>{h=null}),ae()):h?(h.p(g,_),_&4&&A(h,1)):(h=gd(g),h.c(),A(h,1),h.m(e,null))},i(g){p||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(f.$$.fragmentLine truncated
<span class="txt">New collection</span>`,m(i,"type","button"),m(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[15]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function fC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33],$$slots:{afterOptions:[uC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[1]&4&&(a.disabled=!o[33]),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function cC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function dC(n){let e,t,i,s;return e=new pe({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[fC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[cC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function bd(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[pC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[mC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),i=D(),s=v("div"),V(l.$$.fragment),m(e,"class","col-sm-6"),m(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Min select"),s=D(),l=v("input"),m(e,"for",i=n[32]),m(l,"type","number"),m(l,"id",o=n[32]),m(l,"step","1"),m(l,"min","1"),m(l,"placeholder","No min limit")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minSelect),r||(a=K(l,"input",n[11]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&m(e,"for",i),f[1]&2&&o!==(o=u[32])&&m(l,"id",o),f[0]&1&&ht(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Max select"),s=D(),l=v("input"),m(e,"for",i=n[32]),m(l,"type","number"),m(l,"id",o=n[32]),m(l,"step","1"),m(l,"placeholder","No max limit"),m(l,"min",r=n[0].options.minSelect||2)},m(f,c){S(f,e,c),b(e,t),S(f,s,c),S(f,l,c),ue(l,n[0].options.maxSelect),a||(u=K(l,"input",n[12]),a=!0)},p(f,c){c[1]&2&&i!==(i=f[32])&&m(e,"for",i),c[1]&2&&o!==(o=f[32])&&m(l,"id",o),c[0]&1&&r!==(r=f[0].options.minSelect||2)&&m(l,"min",r),c[0]&1&&ht(l.value)!==f[0].options.maxSelect&&ue(l,f[0].options.maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function hC(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[13](h)}let p={multiple:!0,searchable:!0,id:n[32],selectPlaceholder:"Auto",items:n[5]};return n[0].options.displayFields!==void 0&&(p.selected=n[0].options.displayFields),r=new iu({props:p}),se.push(()=>ge(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=D(),s=v("i"),o=D(),V(r.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),Line truncated
`),t=v("code"),t.textContent="username",i=B(` ,
`),s=v("code"),s.textContent="email",l=B(` ,
`),o=v("code"),o.textContent="emailVisibility",r=B(` ,
`),a=v("code"),a.textContent="verified",m(t,"class","txt-sm"),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function kd(n,e){let t,i,s,l,o;function r(p){e[7](p,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...p){return e[10](e[19],...p)}function f(...p){return e[11](e[19],...p)}var c=e[1][e[17].type];function d(p){let h={key:p[4](p[17])};return p[17]!==void 0&&(h.field=p[17]),{props:h}}return c&&(i=$t(c,d(e)),se.push(()=>ge(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=we(),i&&V(i.$$.fragment),l=we(),this.first=t},m(p,h){S(p,t,h),i&&q(i,p,h),S(p,l,h),o=!0},p(p,h){e=p;const g={};if(h&1&&(g.key=e[4](e[17])),!s&&h&1&&(s=!0,g.field=e[17],ke(()=>s=!1)),h&1&&c!==(c=e[1][e[17].type])){if(i){re();const _=i;I(_.$$.fragment,1,0,()=>{j(_,1)}),ae()}c?(i=$t(c,d(e)),se.push(()=>ge(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),V(i.$$.fragment),A(i.$$.fragment,1),q(i,l.parentNode,l)):i=null}else c&&i.$set(g)},i(p){o||(i&&A(i.$$.fragment,p),o=!0)},o(p){i&&I(i.$$.fragment,p),o=!1},d(p){p&&w(t),p&&w(l),i&&j(i,p)}}}function kC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=[],h=new Map,g,_,y,k,T,$,M,C,O=n[0].isAuth&&yd(),E=n[0].schema;const P=N=>N[17];for(let N=0;N<E.length;N+=1){let R=vd(n,E,N),z=P(R);h.set(z,p[N]=kd(z,R))}_=new _T({props:{class:"btn btn-block btn-outline"}}),_.$on("select",n[12]);function L(N){n[13](N)}let F={};return n[0]!==void 0&&(F.collection=n[0]),$=new dT({props:F}),se.push(()=>ge($,"collection",L)),{c(){e=v("div"),t=v("p"),i=B(`System fields:
`),s=v("code"),s.textContent="id",l=B(` ,
`),o=v("code"),o.textContent="created",r=B(` ,
`),a=v("code"),a.textContent="updated",u=D(),O&&O.c(),f=B(`
.`),c=D(),d=v("div");for(let N=0;N<p.length;N+=1)p[N].c();g=D(),V(_.$$.fragment),y=D(),k=v("div"),T=D(),V($.$$.fragment),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm"),m(t,"class","txt-sm"),m(e,"class","block m-b-25"),m(d,"class","accordions schema-fields"),m(k,"class","clearfix m-b-base")},m(N,R){S(N,e,R),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),O&&O.m(t,null),b(t,f),S(N,c,R),S(N,d,R);for(let z=0;z<p.length;z+=1)p[z]&&p[z].m(d,null);S(N,g,R),q(_,N,R),S(N,y,R),S(N,k,R),S(N,T,R),q($,N,R),C=!0},p(N,[R]){N[0].isAuth?O||(O=yd(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),R&119&&(E=N[0].schema,re(),p=Ct(p,R,P,1,N,E,h,d,an,kd,null,vd),ae());const z={};!M&&R&1&&(M=!0,z.collection=N[0],ke(()=>M=!1)),$.$set(z)},i(N){if(!C){for(let R=0;R<E.length;R+=1)A(p[R]);A(_.$$.fragment,N),A($.$$.fragment,N),C=!0}},o(N){for(let R=0;R<p.length;R+=1)I(p[R]);I(_.$$.fragment,N),I($.$$.fragment,N),C=!1},d(N){N&&w(e),O&&O.d(),N&&w(c),N&&w(d);for(let R=0;R<p.length;R+=1)p[R].d();N&&w(g),j(_,N),N&&w(y),N&&w(k),N&&w(T),j($,N)}}}function wC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function SC(n,e,t){let i,{collection:s=new hn}=e;const l={text:PT,number:jT,bool:zT,email:W1,url:QT,editor:t$,date:g$,select:H$,json:K$,file:aC,relation:yC};function o($){s.schema[$]&&(s.schema.splice($,1),t(0,s))}function r($="text"){const M=new gn({name:a(),type:$});M.onMountExpand=!0,s.schema.push(M),t(0,s)}function a($="field"){let M="";for(;u($+M);)++M;return $+M}function u($){return!!s.schema.find(M=>M.name===$)}function f($){return i.findIndex(M=>M===$)}function c($,M){var C;!((C=s==null?void 0:s.schema)!=null&&C.length)||$===M||!M||t(0,s.indexes=s.indexes.map(O=>H.replaceIndexColumn(O,$,M)),s)}function d($,M){if(!$)return;$.dataTransfer.dropEffect="move";const C=parseInt($.dataTransfer.getData("text/plain")),O=s.schema;C<M?(O.splice(M+1,0,O[C]),O.splice(C,1)):(O.splice(M,0,O[C]),O.splice(C+1,1)),t(0,s.schema=O,s),_n({})}function p($,M,C,O){C[O]=$,t(0,s)}const h=$=>o($),g=$=>c($.detail.oldName,$.detail.newName),_=($,M)=>wC(M.detail,$),y=($,M)=>d(M.detail,$),k=$=>r($.detail);function T($){s=$,t(0,s)}return n.$$set=$=>{"collection"in $&&t(0,s=$.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new hn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter($=>!$.toDelete)||[])},[s,l,o,r,f,c,d,p,h,g,_,y,k,T]}class TC extends ve{constructor(e){super(),be(this,e,SC,kC,_e,{collection:0})}}const $C=n=>({isAdminOnly:n&256}),wd=n=>({isAdminOnly:n[8]});function CC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[EC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function MC(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","txt-center")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function OC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function DC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function EC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,p,h,g;function _(E,P){return E[8]?DC:OC}let y=_(n),k=y(n);function T(E){n[13](E)}var $=n[6];function M(E){let P={id:E[17],baseCollection:E[1],disabled:E[8],placeholder:E[8]?"":"Leave empty to grant everyone access..."};return E[0]!==void 0&&(P.value=E[0]),{props:P}}$&&(c=$t($,M(n)),n[12](c),se.push(()=>ge(c,"value",T)));const C=n[11].default,O=Et(C,n,n[14],wd);return{c(){e=v("label"),t=v("span"),i=B(n[2]),s=D(),l=v("span"),r=B(o),a=D(),k.c(),f=D(),c&&V(c.$$.fragment),p=D(),h=v("div"),O&&O.c(),m(t,"class","txt"),Q(t,"txt-hint",n[8]),m(l,"class","label label-sm svelte-5uq9tk"),m(e,"for",u=n[17]),m(e,"class","svelte-5uq9tk"),m(h,"class","help-block")},m(E,P){S(E,e,P),b(e,t),b(t,i),b(e,s),b(e,l),b(l,r),b(e,a),k.m(e,null),S(E,f,P),c&&q(c,E,P),S(E,p,P),S(E,h,P),O&&O.m(h,null),g=!0},p(E,P){(!g||P&4)&&le(i,E[2]),(!g||P&256)&&Q(t,"txt-hint",E[8]),(!g||P&256)&&o!==(o=E[8]?"Admins only":"Custom rule")&&le(r,o),y===(y=_(E))&&k?k.p(E,P):(k.d(1),k=y(E),k&&(k.c(),k.m(e,null))),(!g||P&131072&&u!==(u=E[17]))&&m(e,"for",u);const L={};if(P&131072&&(L.id=E[17]),P&2&&(L.baseCollection=E[1]),P&256&&(L.disabled=E[8]),P&256&&(L.placeholder=E[8]?"":"Leave empty to grant everyone access..."),!d&&P&1&&(d=!0,L.value=E[0],ke(()=>d=!1)),P&64&&$!==($=E[6])){if(c){re();const F=c;I(F.$$.fragment,1,0,()=>{j(F,1)}),ae()}$?(c=$t($,M(E)),E[12](c),se.push(()=>ge(c,"value",T)),V(c.$$.fragment),A(c.$$.fragment,1),q(c,p.parentNode,p)):c=null}else $&&c.$set(L);O&&O.p&&(!g||P&16640)&&It(O,C,E,E[14],g?At(C,E[14],P,$C):Pt(E[14]),wd)},i(E){g||(c&&A(c.$$.fragment,E),A(O,E),g=!0)},o(E){c&&I(c.$$.fragment,E),I(O,E),g=!1},d(E){E&&w(e),k.d(),E&&w(f),n[12](null),c&&j(c,E),E&&w(p),E&&w(h),O&&O.d(E)}}}function AC(n){let e,t,i,s;const l=[MC,CC],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=we()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Sd;function IC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,p=Sd,h=!1;g();async function g(){p||h||(t(7,h=!0),t(6,p=(await rt(()=>import("./FilterAutocompleteInput-2b0e39bf.js"),["./FilterAutocompleteInput-2b0e39bf.js","./index-20adcf24.js"],import.meta.url)).default),Sd=p,t(7,h=!1))}async function _(){t(0,r=d||""),await rn(),c==null||c.focus()}async function y(){d=r,t(0,r=null)}function k($){se[$?"unshift":"push"](()=>{c=$,t(5,c)})}function T($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,u=$.formKey),"required"in $&&t(4,f=$.required),"$$scope"in $&&t(14,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,p,h,i,_,y,s,k,T,l]}class Ts extends ve{constructor(e){super(),be(this,e,IC,AC,_e,{collection:1,rule:0,label:2,formKey:3,required:4})}}function Td(n,e,t){const i=n.slice();return i[10]=e[t],i}function $d(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P=n[2],L=[];for(let F=0;F<P.length;F+=1)L[F]=Cd(Td(n,P,F));return{c(){e=v("div"),t=v("div"),i=v("div"),s=v("p"),s.textContent="The following record fields are available:",l=D(),o=v("div");for(let F=0;F<L.length;F+=1)L[F].c();r=D(),a=v("hr"),u=D(),f=v("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=D(),d=v("div"),d.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,p=D(),h=v("hr"),g=D(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",y=D(),k=v("div"),k.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=D(),$=v("hr"),M=D(),C=v("p"),C.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,m(s,"class","m-b-0"),m(o,"class","inline-flex flex-gap-5"),m(a,"class","m-t-10 m-b-5"),m(f,"class","m-b-0"),m(d,"class","inline-flex flex-gap-5"),m(h,"class","m-t-10 m-b-5"),m(_,"class","m-b-0"),m(k,"class","inline-flex flex-gap-5"),m($,"class","m-t-10 m-b-5"),m(i,"class","content"),m(t,"class","alert alert-warning m-0")},m(F,N){S(F,e,N),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R<L.length;R+=1)L[R]&&L[R].m(o,null);b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,p),b(i,h),b(i,g),b(i,_),b(i,y),b(i,k),b(i,T),b(i,$),b(i,M),b(i,C),E=!0},p(F,N){if(N&4){P=F[2];let R;for(R=0;R<P.length;R+=1){const z=Td(F,P,R);L[R]?L[R].p(z,N):(L[R]=Cd(z),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=P.length}},i(F){E||(F&&et(()=>{E&&(O||(O=qe(e,Mt,{duration:150},!0)),O.run(1))}),E=!0)},o(F){F&&(O||(O=qe(e,Mt,{duration:150},!1)),O.run(0)),E=!1},d(F){F&&w(e),at(L,F),F&&O&&O.end()}}}function Cd(n){let e,t=n[10]+"",i;return{c(){e=v("code"),i=B(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function Md(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ts({props:c}),se.push(()=>ge(e,"rule",f));function d(_){n[7](_)}let p={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(p.rule=n[0].updateRule),s=new Ts({props:p}),se.push(()=>ge(s,"rule",d));function h(_){n[8](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Ts({props:g}),se.push(()=>ge(r,"rule",h)),{c(){V(e.$$.fragment),i=D(),V(s.$$.fragment),o=D(),V(r.$$.fragment)},m(_,y){q(e,_,y),S(_,i,y),q(s,_,y),S(_,o,y),q(r,_,y),u=!0},p(_,y){const k={};y&1&&(k.collection=_[0]),!t&&y&1&&(t=!0,k.rule=_[0].createRule,ke(()=>t=!1)),e.$set(k);const T={};y&1&&(T.collection=_[0]),!l&&y&1&&(l=!0,T.rule=_[0].updateRule,ke(()=>l=!1)),s.$set(T);const $={};y&1&&($.collection=_[0]),!a&&y&1&&(a=!0,$.rule=_[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(s.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){j(e,_),_&&w(i),j(s,_),_&&w(o),j(r,_)}}}function Od(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[PC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ts({props:l}),se.push(()=>ge(e,"rule",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PC(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=D(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function LC(n){var N,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,p,h,g,_,y,k,T,$,M=n[1]&&$d(n);function C(z){n[4](z)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Ts({props:O}),se.push(()=>ge(f,"rule",C));function E(z){n[5](z)}let P={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(P.rule=n[0].viewRule),p=new Ts({props:P}),se.push(()=>ge(p,"rule",E));let L=!((N=n[0])!=null&&N.isView)&&Md(n),F=((R=n[0])==null?void 0:R.isAuth)&&Od(n);return{c(){e=v("div"),t=v("div"),i=v("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>.`,s=D(),l=v("button"),r=B(o),a=D(),M&&M.c(),u=D(),V(f.$$.fragment),d=D(),V(p.$$.fragment),g=D(),L&&L.c(),_=D(),F&&F.c(),y=we(),m(l,"type","button"),m(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),m(t,"class","flex txt-sm txt-hint m-b-5"),m(e,"class","block m-b-sm handle"),Q(e,"fade",!n[1])},m(z,W){S(z,e,W),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),M&&M.m(e,null),S(z,u,W),q(f,z,W),S(z,d,W),q(p,z,W),S(z,g,W),L&&L.m(z,W),S(z,_,W),F&&F.m(z,W),S(z,y,W),k=!0,T||($=K(l,"click",n[3]),T=!0)},p(z,[W]){var ne,G;(!k||W&2)&&o!==(o=z[1]?"Hide available fields":"Show available fields")&&le(r,o),z[1]?M?(M.p(z,W),W&2&&A(M,1)):(M=$d(z),M.c(),A(M,1),M.m(e,null)):M&&(re(),I(M,1,1,()=>{M=null}),ae()),(!k||W&2)&&Q(e,"fade",!z[1]);const J={};W&1&&(J.collection=z[0]),!c&&W&1&&(c=!0,J.rule=z[0].listRule,ke(()=>c=!1)),f.$set(J);const x={};W&1&&(x.collection=z[0]),!h&&W&1&&(h=!0,x.rule=z[0].viewRule,ke(()=>h=!1)),p.$set(x),(ne=z[0])!=null&&ne.isView?L&&(re(),I(L,1,1,()=>{L=null}),ae()):L?(L.p(z,W),W&1&&A(L,1)):(L=Md(z),L.c(),A(L,1),L.m(_.parentNode,_)),(G=z[0])!=null&&G.isAuth?F?(F.p(z,W),W&1&&A(F,1)):(F=Od(z),F.c(),A(F,1),F.m(y.parentNode,y)):F&&(re(),I(F,1,1,()=>{F=null}),ae())},i(z){k||(A(M),A(f.$$.fragment,z),A(p.$$.fragment,z),A(L),A(F),k=!0)},o(z){I(M),I(f.$$.fragment,z),I(p.$$.fragment,z),I(L),I(F),k=!1},d(z){z&&w(e),M&&M.d(),z&&w(u),j(f,z),z&&w(d),j(p,z),z&&w(g),L&&L.d(z),z&&w(_),F&&F.d(z),z&&w(y),T=!1,$()}}}function NC(n,e,t){let i,{collection:s=new hn}=e,l=!1;const o=()=>t(1,l=!l);function r(p){n.$$.not_equal(s.listRule,p)&&(s.listRule=p,t(0,s))}function a(p){n.$$.not_equal(s.viewRule,p)&&(s.viewRule=p,t(0,s))}function u(p){n.$$.not_equal(s.createRule,p)&&(s.createRule=p,t(0,s))}function f(p){n.$$.not_equal(s.updateRule,p)&&(s.updateRule=p,t(0,s))}function c(p){n.$$.not_equal(s.deleteRule,p)&&(s.deleteRule=p,t(0,s))}function d(p){n.$$.not_equal(s.options.manageRule,p)&&(s.options.manageRule=p,t(0,s))}return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class FC extends ve{constructor(e){super(),be(this,e,NC,LC,_e,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[9]=e[t],i}function RC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=$t(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function qC(n){let e;return{c(){e=v("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Ed(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Ad(Dd(n,i,l));return{c(){e=v("div"),t=v("div");for(let l=0;l<s.length;l+=1)s[l].c();m(t,"class","content"),m(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),b(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=Dd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Ad(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),at(s,l)}}}function Ad(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=B(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function jC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[qC,RC],p=[];function h(_,y){return _[2]?0:1}l=h(n),o=p[l]=d[l](n);let g=n[3].length&&Ed(n);return{c(){e=v("label"),t=v("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=v("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=D(),g&&g.c(),f=we(),m(t,"class","txt"),m(e,"for",i=n[8]),m(a,"class","help-block")},m(_,y){S(_,e,y),b(e,t),S(_,s,y),p[l].m(_,y),S(_,r,y),S(_,a,y),S(_,u,y),g&&g.m(_,y),S(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&m(e,"for",i);let k=l;l=h(_),l===k?p[l].p(_,y):(re(),I(p[k],1,1,()=>{p[k]=null}),ae(),o=p[l],o?o.p(_,y):(o=p[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=Ed(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&w(e),_&&w(s),p[l].d(_),_&&w(r),_&&w(a),_&&w(u),g&&g.d(_),_&&w(f)}}}function VC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[jC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function HC(n,e,t){let i;We(n,ti,c=>t(4,i=c));let{collection:s=new hn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=H.getNestedVal(c,"schema",null);if(H.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const p=H.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);H.removeByValue(p,"id"),H.removeByValue(p,"created"),H.removeByValue(p,"updated");for(let g in d)for(let _ in d[g]){const y=d[g][_].message,k=p[g]||g;r.push(H.sentenize(k+": "+y))}}Qt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-b80c0f73.js"),["./CodeEditor-b80c0f73.js","./index-20adcf24.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&ci("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class zC extends ve{constructor(e){super(),be(this,e,HC,VC,_e,{collection:0})}}const BC=n=>({active:n&1}),Id=n=>({active:n[0]});function Pd(n){let e,t,i;const s=n[15].default,l=Et(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),m(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&It(l,s,o,o[14],i?At(s,o[14],r,null):Pt(o[14]),null)},i(o){i||(A(l,o),o&&et(()=>{i&&(t||(t=qe(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=qe(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function UC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Et(a,n,n[14],Id);let f=n[0]&&Pd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=D(),f&&f.c(),m(t,"type","button"),m(t,"class","accordion-header"),m(t,"draggable",n[2]),Q(t,"interactive",n[3]),m(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){S(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[K(t,"click",ft(n[17])),K(t,"drop",ft(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",ft(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&It(u,a,c,c[14],l?At(a,c[14],d,BC):Pt(c[14]),Id),(!l||d&4)&&m(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Pd(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&m(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){I(u,c),I(f),l=!1},d(c){c&&w(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ae(r)}}}function WC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=vt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,p=!1;function h(){return!!f}function g(){k(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():g()}function k(){if(d&&o.closest(".accordions")){const L=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of L)F.click()}}Qt(()=>()=>clearTimeout(r));function T(L){de.call(this,n,L)}const $=()=>c&&y(),M=L=>{u&&(t(7,p=!1),k(),l("drop",L))},C=L=>u&&l("dragstart",L),O=L=>{u&&(t(7,p=!0),l("dragenter",L))},E=L=>{u&&(t(7,p=!1),l("dragleave",L))};function P(L){se[L?"unshift":"push"](()=>{o=L,t(6,o)})}return n.$$set=L=>{"class"in L&&t(1,a=L.class),"draggable"in L&&t(2,u=L.draggable),"active"in L&&t(0,f=L.active),"interactive"in L&&t(3,c=L.interactive),"single"in L&&t(9,d=L.single),"$$scope"in L&&t(14,s=L.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,y,k,o,p,l,d,h,g,_,r,s,i,T,$,M,C,O,E,P]}class al extends ve{constructor(e){super(),be(this,e,WC,UC,_e,{class:1,draggable:2,active:0,interactive:3,single:9,isELine truncated
<span class="txt">Username/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?p&8&&A(c,1):(c=Ld(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function XC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Nd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[QC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[xC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(H.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(H.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&et(()=>{a&&(r||(r=qe(e,Mt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=qe(e,Mt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[7](_)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function xC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[8](_)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function e4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[XC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Nd(n);return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Nd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function t4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function n4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Fd(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function i4(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowEmailAuth?n4:t4}let u=a(n),f=u(n),c=n[2]&&Fd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?p&4&&A(c,1):(c=Fd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function s4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Rd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',m(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=qe(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function l4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[s4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Rd();return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Rd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function o4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function r4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qd(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function a4(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowOAuth2Auth?r4:o4}let u=a(n),f=u(n),c=n[1]&&qd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?p&2&&A(c,1):(c=qd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function u4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Minimum password length"),s=D(),l=v("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12]),l.required=!0,m(l,"min","6"),m(l,"max","72")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=K(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&m(e,"for",i),f&4096&&o!==(o=u[12])&&m(l,"id",o),f&1&&ht(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function f4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Always require email",o=D(),r=v("i"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(l,"class","txt"),m(r,"class","ri-information-line txt-sm link-hint"),m(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),De(ze.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&m(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&m(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Ae(f)}}}function c4(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;return s=new al({props:{single:!0,$$slots:{header:[GC],default:[KC]},$$scope:{ctx:n}}}),o=new al({props:{single:!0,$$slots:{header:[i4],default:[e4]},$$scope:{ctx:n}}}),a=new al({props:{single:!0,$$slots:{header:[a4],default:[l4]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[u4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[f4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=D(),i=v("div"),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),f=v("hr"),c=D(),d=v("h4"),d.textContent="General",p=D(),V(h.$$.fragment),g=D(),V(_.$$.fragment),m(e,"class","section-title"),m(i,"class","accordions"),m(d,"class","section-title")},m(k,T){S(k,e,T),S(k,t,T),S(k,i,T),q(s,i,null),b(i,l),q(o,i,null),b(i,r),q(a,i,null),S(k,u,T),S(k,f,T),S(k,c,T),S(k,d,T),S(k,p,T),q(h,k,T),S(k,g,T),q(_,k,T),y=!0},p(k,[T]){const $={};T&8201&&($.$$scope={dirty:T,ctx:k}),s.$set($);const M={};T&8197&&(M.$$scope={dirty:T,ctx:k}),o.$set(M);const C={};T&8195&&(C.$$scope={dirty:T,ctx:k}),a.$set(C);const O={};T&12289&&(O.$$scope={dirty:T,ctx:k}),h.$set(O);const E={};T&12289&&(E.$$scope={dirty:T,ctx:k}),_.$set(E)},i(k){y||(A(s.$$.fragment,k),A(o.$$.fragment,k),A(a.$$.fragment,k),A(h.$$.fragment,k),A(_.$$.fragment,k),y=!0)},o(k){I(s.$$.fragment,k),I(o.$$.fragment,k),I(a.$$.fragment,k),I(h.$$.fragment,k),I(_.$$.fragment,k),y=!1},d(k){k&&w(e),k&&w(t),k&&w(i),j(s),j(o),j(a),k&&w(u),k&&w(f),k&&w(c),k&&w(d),k&&w(p),j(h,k),k&&w(g),j(_,k)}}}function d4(n,e,t){let i,s,l,o;We(n,ti,g=>t(4,o=g));let{collection:r=new hn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function p(){r.options.minPasswordLength=ht(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,_,y,k;n.$$.dirty&1&&r.isAuth&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!H.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!H.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,p,h]}class p4 extends ve{constructor(e){super(),be(this,e,d4,c4,_e,{collection:0})}}function jd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Hd(n,e,t){const i=n.slice();return i[17]=e[t],i}function zd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Bd(n){var r;let e,t,i,s,l=n[3]&&Ud(n),o=!((r=n[2])!=null&&r.isView)&&Wd(n);return{c(){e=v("h6"),e.textContent="Changes:",t=D(),i=v("ul"),l&&l.c(),s=D(),o&&o.c(),m(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Ud(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Wd(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Ud(n){var p,h;let e,t,i,s,l=((p=n[1])==null?void 0:p.name)+"",o,r,a,u,f,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed collection
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(g,_){S(g,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(g,_){var y,k;_&2&&l!==(l=((y=g[1])==null?void 0:y.name)+"")&&le(o,l),_&4&&c!==(c=((k=g[2])==null?void 0:k.name)+"")&&le(d,c)},d(g){g&&w(e)}}}function Wd(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=Yd(Hd(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=Kd(Vd(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=Jd(jd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=D();for(let f=0;f<r.length;f+=1)r[f].c();t=D();for(let f=0;f<u.length;f+=1)u[f].c();i=we()},m(f,c){for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(f,c);S(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);S(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);S(f,i,c)},p(f,c){if(c&32){s=f[5];let d;for(d=0;d<s.length;d+=1){const p=Hd(f,s,d);l[d]?l[d].p(p,c):(l[d]=Yd(p),l[d].c(),l[d].m(e.parentNode,e))}for(;d<l.length;d+=1)l[d].d(1);l.length=s.length}if(c&128){o=f[7];let d;for(d=0;d<o.length;d+=1){const p=Vd(f,o,d);r[d]?r[d].p(p,c):(r[d]=Kd(p),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&64){a=f[6];let d;for(d=0;d<a.length;d+=1){const p=jd(f,a,d);u[d]?u[d].p(p,c):(u[d]=Jd(p),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){at(l,f),f&&w(e),at(r,f),f&&w(t),at(u,f),f&&w(i)}}}function Yd(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=v("li"),t=B(`Multiple to single value conversion of field
`),i=v("strong"),l=B(s),o=D(),r=v("em"),r.textContent="(will keep only the last array item)",m(r,"class","txt-sm"),m(e,"class","svelte-xqpcsf")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o),b(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function Kd(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,c=n[17].name+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed field
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(p,h){S(p,e,h),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(p,h){h&128&&l!==(l=p[17].originalName+"")&&le(o,l),h&128&&c!==(c=p[17].name+"")&&le(d,c)},d(p){p&&w(e)}}}function Jd(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=v("li"),t=B("Removed field "),i=v("span"),l=B(s),o=D(),m(i,"class","txt-bold"),m(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function m4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&zd(),f=n[8]&&Bd(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=D(),u&&u.c(),r=D(),f&&f.c(),a=we(),m(t,"class","icon"),m(s,"class","content txt-bold"),m(e,"class","alert alert-warning")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[6].length?u||(u=zd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[8]?f?f.p(c,d):(f=Bd(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function h4(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function _4(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[K(e,"click",n[11]),K(i,"click",n[12])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function g4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[_4],header:[h4],default:[m4]},$$scope:{ctx:n}};return e=new bn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[13](null),j(e,s)}}}function b4(n,e,t){let i,s,l,o,r;const a=vt();let u,f,c;async function d($,M){t(1,f=$),t(2,c=M),await rn(),i||s.length||l.length||o.length?u==null||u.show():h()}function p(){u==null||u.hide()}function h(){p(),a("confirm")}const g=()=>p(),_=()=>h();function y($){se[$?"unshift":"push"](()=>{u=$,t(4,u)})}function k($){de.call(this,n,$)}function T($){de.call(this,n,$)}return n.$$.update=()=>{var $,M,C;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(c==null?void 0:c.name)),n.$$.dirty&4&&t(7,s=(($=c==null?void 0:c.schema)==null?void 0:$.filter(O=>O.id&&!O.toDelete&&O.originalName!=O.name))||[]),n.$$.dirty&4&&t(6,l=((M=c==null?void 0:c.schema)==null?void 0:M.filter(O=>O.id&&O.toDelete))||[]),n.$$.dirty&6&&t(5,o=((C=c==null?void 0:c.schema)==null?void 0:C.filter(O=>{var P,L,F;const E=(P=f==null?void 0:f.schema)==null?void 0:P.find(N=>N.id==O.id);return E?((L=E.options)==null?void 0:L.maxSelect)!=1&&((F=O.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(c!=null&&c.isView)||i)},[p,f,c,i,u,o,l,s,r,h,d,g,_,y,k,T]}class v4 extends ve{constructor(e){super(),be(this,e,b4,g4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function Zd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function y4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new TC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function k4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new zC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Gd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new FC({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Xd(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new p4({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function w4(n){let e,t,i,s,l,o,r;const a=[k4,y4],u=[];function f(p,h){return p[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===yl&&Gd(n),d=n[2].isAuth&&Xd(n);return{c(){e=v("div"),t=v("div"),s.c(),l=D(),c&&c.c(),o=D(),d&&d.c(),m(t,"class","tab-item"),Q(t,"active",n[3]===wi),m(e,"class","tabs-content svelte-12y0yzb")},m(p,h){S(p,e,h),b(e,t),u[i].m(t,null),b(e,l),c&&c.m(e,null),b(e,o),d&&d.m(e,null),r=!0},p(p,h){let g=i;i=f(p),i===g?u[i].p(p,h):(re(),I(u[g],1,1,()=>{u[g]=null}),ae(),s=u[i],s?s.p(p,h):(s=u[i]=a[i](p),s.c()),A(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",p[3]===wi),p[3]===yl?c?(c.p(p,h),h[0]&8&&A(c,1)):(c=Gd(p),c.c(),A(c,1),c.m(e,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),p[2].isAutLine truncated
<span class="txt">Duplicate</span>`,t=D(),i=v("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable"),m(i,"type","button"),m(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[24]),K(i,"click",$n(ft(n[25])))],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function xd(n){let e,t,i,s;return i=new qn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[T4]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=D(),V(i.$$.fragment),m(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function ep(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[27](n[47])}return{c(){e=v("button"),t=v("i"),s=D(),l=v("span"),r=B(o),a=B(" collection"),u=D(),m(t,"class",i=$i(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),m(l,"class","txt"),m(e,"type","button"),m(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(p,h){S(p,e,h),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=K(e,"click",d),f=!0)},p(p,h){n=p,h[0]&64&&i!==(i=$i(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&m(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(p){p&&w(e),f=!1,c()}}}function T4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=ep(Zd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=Zd(s,t,o);i[o]?i[o].p(r,l):(i[o]=ep(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){at(i,s),s&&w(e)}}}function tp(n){let e;return{c(){e=v("div"),e.textContent="System collection",m(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $4(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y=(n[6][n[2].type]||"N/A")+"",k,T,$,M,C,O,E,P,L,F=n[2].isNew&&xd(n),N=n[2].system&&tp();return{c(){e=v("label"),t=B("Name"),s=D(),l=v("input"),f=D(),c=v("div"),d=v("button"),p=v("span"),h=D(),g=v("span"),_=B("Type: "),k=B(y),T=D(),F&&F.c(),C=D(),N&&N.c(),O=we(),m(e,"for",i=n[46]),m(l,"type","text"),m(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],m(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,m(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,m(g,"class","txt"),m(d,"type","button"),m(d,"class",$="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,m(c,"class","form-field-addon")},m(R,z){S(R,e,z),b(e,t),S(R,s,z),S(R,l,z),S(R,f,z),S(R,c,z),b(c,d),b(d,p),b(d,h),b(d,g),b(g,_),b(g,k),b(d,T),F&&F.m(d,null),S(R,C,z),N&&N.m(R,z),S(R,O,z),E=!0,n[2].isNew&&l.focus(),P||(L=K(l,"input",n[26]),P=!0)},p(R,z){(!E||z[1]&32768&&i!==(i=R[46]))&&m(e,"for",i),(!E||z[1]&32768&&o!==(o=R[46]))&&m(l,"id",o),(!E||z[0]&8192)&&(l.disabled=R[13]),(!E||z[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||z[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&m(l,"placeholder",a),(!E||z[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||z[0]&68)&&y!==(y=(R[6][R[2].type]||"N/A")+"")&&le(k,y),R[2].isNew?F?(F.p(R,z),z[0]&4&&A(F,1)):(F=xd(R),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!E||z[0]&4&&$!==($="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&m(d,"class",$),(!E||z[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?N||(N=tp(),N.c(),N.m(O.parentNode,O)):N&&(N.d(1),N=null)},i(R){E||(A(F),E=!0)},o(R){I(F),E=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),F&&F.d(),R&&w(C),N&&N.d(R),R&&w(O),P=!1,L()}}}function np(n){let e,t,i,s,l,o;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=De(t=ze.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&et(()=>{s&&(i||(i=qe(e,qt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,qt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function ip(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function sp(n){var a,u,f;let e,t,i,s=!H.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&lp();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=D(),r&&r.c(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(c,d){S(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=K(e,"click",n[31]),l=!0)},p(c,d){var p,h,g;d[0]&32&&(s=!H.isEmpty((p=c[5])==null?void 0:p.opLine truncated
<span class="txt">New collection</span>`,m(t,"type","button"),m(t,"class","btn btn-block btn-outline"),m(e,"class","sidebar-footer")},m(l,o){S(l,e,o),b(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function A4(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],p=new Map,h,g,_,y,k,T,$=n[3];const M=P=>P[15].id;for(let P=0;P<$.length;P+=1){let L=ap(n,$,P),F=M(L);p.set(F,d[P]=cp(F,L))}let C=null;$.length||(C=up(n));let O=!n[7]&&dp(n),E={};return _=new su({props:E}),n[13](_),_.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=v("input"),a=D(),u=v("hr"),f=D(),c=v("div");for(let P=0;P<d.length;P+=1)d[P].c();C&&C.c(),h=D(),O&&O.c(),g=D(),V(_.$$.fragment),m(l,"type","button"),m(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),m(s,"class","form-field-addon"),m(r,"type","text"),m(r,"placeholder","Search collections..."),m(i,"class","form-field search"),Q(i,"active",n[4]),m(t,"class","sidebar-header"),m(u,"class","m-t-5 m-b-xs"),m(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),m(e,"class","page-sidebar collection-sidebar")},m(P,L){S(P,e,L),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),ue(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let F=0;F<d.length;F+=1)d[F]&&d[F].m(c,null);C&&C.m(c,null),b(e,h),O&&O.m(e,null),S(P,g,L),q(_,P,L),y=!0,k||(T=[K(l,"click",n[10]),K(r,"input",n[11])],k=!0)},p(P,[L]){(!y||L&16)&&Q(l,"hidden",!P[4]),L&1&&r.value!==P[0]&&ue(r,P[0]),(!y||L&16)&&Q(i,"active",P[4]),L&42&&($=P[3],d=Ct(d,L,M,1,P,$,p,c,ns,cp,null,ap),!$.length&&C?C.p(P,L):$.length?C&&(C.d(1),C=null):(C=up(P),C.c(),C.m(c,null))),(!y||L&64)&&Q(c,"fade",P[6]),(!y||L&8)&&Q(c,"sidebar-content-compact",P[3].length>20),P[7]?O&&(O.d(1),O=null):O?O.p(P,L):(O=dp(P),O.c(),O.m(e,null));const F={};_.$set(F)},i(P){y||(A(_.$$.fragment,P),y=!0)},o(P){I(_.$$.fragment,P),y=!1},d(P){P&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),O&&O.d(),P&&w(g),n[13](null),j(_,P),k=!1,Ae(T)}}}function I4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function P4(n,e,t){let i,s,l,o,r,a,u;We(n,Di,k=>t(5,o=k)),We(n,Pi,k=>t(9,r=k)),We(n,Lo,k=>t(6,a=k)),We(n,Cs,k=>t(7,u=k));let f,c="";function d(k){Gt(Di,o=k,o)}const p=()=>t(0,c="");function h(){c=this.value,t(0,c)}const g=()=>f==null?void 0:f.show();function _(k){se[k?"unshift":"push"](()=>{f=k,t(2,f)})}const y=k=>{var T;(T=k.detail)!=null&&T.isNew&&k.detail.collection&&d(k.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&I4(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(k=>k.id==c||k.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,p,h,g,_,y]}class L4 extends ve{constructor(e){super(),be(this,e,P4,A4,_e,{})}}function pp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function mp(n){n[18]=n[19].default}function hp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function _p(n){let e;return{c(){e=v("hr"),m(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function gp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&_p();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=we(),c&&c.c(),s=D(),l=v("button"),r=B(o),a=D(),m(l,"type","button"),m(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(p,h){S(p,t,h),c&&c.m(p,h),S(p,s,h),S(p,l,h),b(l,r),b(l,a),u||(f=K(l,"click",d),u=!0)},p(p,h){e=p,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=_p(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(p){p&&w(t),c&&c.d(p),p&&w(s),p&&w(l),u=!1,f()}}}function bp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:R4,then:F4,catch:N4,value:19,blocks:[,,,]};return uu(t=n[15].component,s),{c(){e=we(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&uu(t,s)||Sb(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];I(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function N4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function F4(n){mp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=D()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){mp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function R4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function vp(n,e){let t,i,s,l=e[5]===e[14]&&bp(e);return{key:n,first:null,c(){t=we(),l&&l.c(),i=we(),this.first=t},m(o,r){S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=bp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(Line truncated
`),O&&O.c(),d=D(),h.c(),g=we(),m(e,"class","flex m-b-base flex-gap-10"),m(l,"class","list picker-list m-b-base svelte-1u8jhky"),m(f,"class","section-title")},m(N,R){S(N,e,R),q(t,e,null),b(e,i),T&&T.m(e,null),S(N,s,R),S(N,l,R);for(let z=0;z<o.length;z+=1)o[z]&&o[z].m(l,null);C&&C.m(l,null),S(N,u,R),S(N,f,R),b(f,c),O&&O.m(f,null),S(N,d,R),P[p].m(N,R),S(N,g,R),_=!0,y||(k=De(a=iM.call(null,l,n[36])),y=!0)},p(N,R){var J;const z={};R[0]&4&&(z.value=N[2]),R[0]&1024&&(z.autocompleteCollection=N[10]),t.$set(z),(J=N[10])!=null&&J.isView?T&&(T.d(1),T=null):T?T.p(N,R):(T=qp(N),T.c(),T.m(e,null)),R[0]&145324&&($=N[3],re(),o=Ct(o,R,M,1,N,$,r,l,an,zp,null,Rp),ae(),!$.length&&C?C.p(N,R):$.length?C&&(C.d(1),C=null):(C=jp(N),C.c(),C.m(l,null))),a&&Bt(a.update)&&R[0]&2064&&a.update.call(null,N[36]),N[5]>1?O?O.p(N,R):(O=Bp(N),O.c(),O.m(f,null)):O&&(O.d(1),O=null);let W=p;p=L(N),p===W?P[p].p(N,R):(re(),I(P[W],1,1,()=>{P[W]=null}),ae(),h=P[p],h?h.p(N,R):(h=P[p]=E[p](N),h.c()),A(h,1),h.m(g.parentNode,g))},i(N){if(!_){A(t.$$.fragment,N);for(let R=0;R<$.length;R+=1)A(o[R]);A(h),_=!0}},o(N){I(t.$$.fragment,N);for(let R=0;R<o.length;R+=1)I(o[R]);I(h),_=!1},d(N){N&&w(e),j(t),T&&T.d(),N&&w(s),N&&w(l);for(let R=0;R<o.length;R+=1)o[R].d();C&&C.d(),N&&w(u),N&&w(f),O&&O.d(),N&&w(d),P[p].d(N),N&&w(g),y=!1,k()}}}function bM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=B("Select "),i=v("strong"),l=B(s),o=B(" records")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function vM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Save selection</span>',m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function yM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[vM],header:[bM],default:[gM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Le(o,l[a]);e=new bn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new G1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?bt(l,[l[0],l[1],Vt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&1024&&(c.collection=a[10]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Ar=100;function kM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=Je(e,c),p;We(n,Pi,Pe=>t(26,p=Pe));const h=vt(),g="picker_"+H.randomString(5);let{value:_}=e,{field:y}=e,k,T,$="",M=[],C=[],O=1,E=0,P=!1,L=!1;function F(){return t(2,$=""),t(3,M=[]),t(6,C=[]),R(),z(!0),k==null?void 0:k.show()}function N(){return k==null?void 0:k.hide()}async function R(){const Pe=H.toArray(_);if(!s||!Pe.length)return;t(24,L=!0);let ie=[];const Se=Pe.slice(),st=[];for(;Se.length>0;){const nt=[];for(const kt of Se.splice(0,Ar))nt.push(`id="${kt}"`);st.push(me.collection(s).getFullList(Ar,{filter:nt.join("||"),$autoCancel:!1}))}try{await Promise.all(st).then(nt=>{ie=ie.concat(...nt)}),t(6,C=[]);for(const nt of Pe){const kt=H.findByKey(ie,"id",nt);kt&&C.push(kt)}$.trim()||t(3,M=H.filterDuplicatesByKey(C.concat(M)))}catch(nt){me.errorResponseHandler(nt)}t(24,L=!1)}async function z(Pe=!1){if(s){t(4,P=!0),Pe&&($.trim()?t(3,M=[]):t(3,M=H.toArray(C).slice()));try{const ie=Pe?1:O+1,Se=await me.collection(s).getList(ie,Ar,{filter:$,sort:o!=null&&o.isView?"":"-created",$cancelKey:g+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(Se.items))),O=Se.page,t(23,E=Se.totalItems)}catch(ie){me.errorResponseHandler(ie)}t(4,P=!1)}}function W(Pe){i==1?t(6,C=[Pe]):u&&(H.pushOrReplaceByKey(C,Pe),t(6,C))}function J(Pe){H.removeByKey(C,"id",Pe.id),t(6,C)}function x(Pe){f(Pe)?J(Pe):W(Pe)}function ne(){var Pe;i!=1?t(20,_=C.map(ie=>ie.id)):t(20,_=((Pe=C==null?void 0:C[0])==null?void 0:Pe.id)||""),h("save",C),N()}function G(Pe){de.call(this,n,Pe)}const fe=()=>N(),Z=()=>ne(),ce=Pe=>t(2,$=Pe.detail),he=()=>T==null?void 0:T.show(),Ce=Pe=>T==null?void 0:T.show(Pe),Re=Pe=>x(Pe),je=(Pe,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),x(Pe))},ye=()=>t(2,$=""),$e=()=>{a&&!P&&z()},Ye=Pe=>J(Pe);function dt(Pe){C=Pe,t(6,C)}function Ke(Pe){se[Pe?"unshift":"push"](()=>{k=Pe,t(1,k)})}function Be(Pe){de.call(this,n,Pe)}function ee(Pe){de.call(this,n,Pe)}function Fe(Pe){se[Pe?"unshift":"push"](()=>{T=Pe,t(7,T)})}const tt=Pe=>{H.removeByKey(M,"id",Pe.detail.id),M.unshift(Pe.detail),t(3,M),W(Pe.detail)},Wt=Pe=>{H.removeByKey(M,"id",Pe.detail.id),t(3,M),J(Pe.detail)}; Line truncated
`,m(e,"class","list-item")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Gp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Qo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),m(t,"class","content"),m(o,"type","button"),m(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),m(l,"class","actions"),m(e,"class","list-item")},m(p,h){S(p,e,h),b(e,t),q(i,t,null),b(e,s),b(e,l),b(l,o),b(e,r),a=!0,u||(f=[De(ze.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(p,h){var _;n=p;const g={};h&16&&(g.record=n[15]),h&4&&(g.displayFields=(_=n[2].options)==null?void 0:_.displayFields),i.$set(g)},i(p){a||(A(i.$$.fragment,p),a=!0)},o(p){I(i.$$.fragment,p),a=!1},d(p){p&&w(e),j(i),u=!1,Ae(f)}}}function SM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,_,y,k=n[4],T=[];for(let C=0;C<k.length;C+=1)T[C]=Gp(Wp(n,k,C));const $=C=>I(T[C],1,1,()=>{T[C]=null});let M=null;return k.length||(M=Kp(n)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("div"),c=v("div");for(let C=0;C<T.length;C+=1)T[C].c();M&&M.c(),d=D(),p=v("div"),h=v("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,m(t,"class",i=$i(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),m(l,"class","txt"),m(e,"for",a=n[14]),m(c,"class","relations-list svelte-1ynw0pc"),m(h,"type","button"),m(h,"class","btn btn-transparent btn-sm btn-block"),m(p,"class","list-item list-item-btn"),m(f,"class","list")},m(C,O){S(C,e,O),b(e,t),b(e,s),b(e,l),b(l,r),S(C,u,O),S(C,f,O),b(f,c);for(let E=0;E<T.length;E+=1)T[E]&&T[E].m(c,null);M&&M.m(c,null),b(f,d),b(f,p),b(p,h),g=!0,_||(y=K(h,"click",n[9]),_=!0)},p(C,O){if((!g||O&4&&i!==(i=$i(H.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&m(t,"class",i),(!g||O&4)&&o!==(o=C[2].name+"")&&le(r,o),(!g||O&16384&&a!==(a=C[14]))&&m(e,"for",a),O&181){k=C[4];let E;for(E=0;E<k.length;E+=1){const P=Wp(C,k,E);T[E]?(T[E].p(P,O),A(T[E],1)):(T[E]=Gp(P),T[E].c(),A(T[E],1),T[E].m(c,null))}for(re(),E=k.length;E<T.length;E+=1)$(E);ae(),!k.length&&M?M.p(C,O):k.length?M&&(M.d(1),M=null):(M=Kp(C),M.c(),M.m(c,null))}},i(C){if(!g){for(let O=0;O<k.length;O+=1)A(T[O]);g=!0}},o(C){T=T.filter(Boolean);for(let O=0;O<T.length;O+=1)I(T[O]);g=!1},d(C){C&&w(e),C&&w(u),C&&w(f),at(T,C),M&&M.d(),_=!1,y()}}}function TM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[SM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new wM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const Xp=100;function $M(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new gn}=e,r,a=[],u=!1;f();async function f(){var $,M;const y=H.toArray(s);if(!(($=o==null?void 0:o.options)!=null&&$.collectionId)||!y.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const k=y.slice(),T=[];for(;k.length>0;){const C=[];for(const O of k.splice(0,Xp))C.push(`id="${O}"`);T.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(Xp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all(T).then(O=>{C=C.concat(...O)});for(const O of y){const E=H.findByKey(C,"id",O);E&&a.push(E)}t(4,a)}catch(C){me.errorResponseHandler(C)}t(5,u=!1)}function c(y){var k;H.removeByKey(a,"id",y.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((k=a[0])==null?void 0:k.id)||"")}const d=y=>c(y),p=()=>l==null?void 0:l.show();function h(y){se[y?"unshift":"push"](()=>{r=y,t(3,r)})}function g(y){se[y?"unshift":"push"](()=>{l=y,t(1,l)})}const _=y=>{var k;t(4,a=y.detail||[]),t(0,s=i?a.map(T=>T.id):((k=a[0])==null?void 0:k.id)||"")};return n.$$set=y=>{"value"in y&&t(0,s=y.value),"picker"in y&&t(1,l=y.picker),"field"in y&&t(2,o=y.field)},n.$$.update=()=>{var y;n.$$.dirty&4&&t(6,i=((y=o.options)==null?void 0:y.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,p,h,g,_]}class CM extends ve{constructor(e){super(),be(this,e,$M,TM,_e,{value:0,picker:1,field:2})}}const MM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],OM=(n,e)=>{MM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function DM(n){let e;return{c(){e=v("textarea"),m(e,"id",n[0]),Nr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&m(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function EM(n){let e;return{c(){e=v("div"),m(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&m(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function AM(n){let e;function t(l,o){return l[1]?EM:DM}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),m(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&m(e,"class",l[2])},i:X,o:X,d(l){l&&w(e),s.d(),n[19](null)}}}const J1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),IM=()=>{let n={listeners:[],scriptId:J1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement(Line truncated
...
-----END PRIVATE KEY-----`),m(a,"class","help-block")},m(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[5]),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&m(e,"for",i),d&8388608&&o!==(o=c[23])&&m(l,"id",o),d&32&&ue(l,c[5])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function lO(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[eO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[tO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[nO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),p=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[iO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[sO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(r.$$.fragment),a=D(),u=v("div"),V(f.$$.fragment),c=D(),d=v("div"),V(p.$$.fragment),h=D(),V(g.$$.fragment),m(i,"class","col-lg-6"),m(o,"class","col-lg-6"),m(u,"class","col-lg-6"),m(d,"class","col-lg-6"),m(t,"class","grid"),m(e,"id",n[9]),m(e,"autocomplete","off")},m(T,$){S(T,e,$),b(e,t),b(t,i),q(s,i,null),b(t,l),b(t,o),q(r,o,null),b(t,a),b(t,u),q(f,u,null),b(t,c),b(t,d),q(p,d,null),b(t,h),q(g,t,null),_=!0,y||(k=K(e,"submit",ft(n[17])),y=!0)},p(T,$){const M={};$&25165828&&(M.$$scope={dirty:$,ctx:T}),s.$set(M);const C={};$&25165832&&(C.$$scope={dirty:$,ctx:T}),r.$set(C);const O={};$&25165840&&(O.$$scope={dirty:$,ctx:T}),f.$set(O);const E={};$&25165888&&(E.$$scope={dirty:$,ctx:T}),p.$set(E);const P={};$&25165856&&(P.$$scope={dirty:$,ctx:T}),g.$set(P)},i(T){_||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(p.$$.fragment,T),A(g.$$.fragment,T),_=!0)},o(T){I(s.$$.fragment,T),I(r.$$.fragment,T),I(f.$$.fragment,T),I(p.$$.fragment,T),I(g.$$.fragment,T),_=!1},d(T){T&&w(e),j(s),j(r),j(f),j(p),j(g),y=!1,k()}}}function oO(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function rO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("i"),o=D(),r=v("span"),r.textContent="Generate and set secret",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[7],m(l,"class","ri-key-line"),m(r,"class","txt"),m(s,"type","submit"),m(s,"form",n[9]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function aO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[rO],header:[oO],default:[lO]},$$scope:{ctx:n}};return e=new bn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const po=15777e3;function uO(n,e,t){let i;const s=vt(),l="apple_secret_"+H.randomString(5);let o,r,a,u,f,c,d=!1;function p(L={}){t(2,r=L.clientId||""),t(3,a=L.teamId||""),t(4,u=L.keyId||""),t(5,f=L.privateKey||""),t(6,c=L.duration||po),_n({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const L=await me.send("/api/settings/apple/generate-client-secret",{method:"POST",body:{teamId:a,clientId:r,keyId:u,privateKey:f.trim(),duration:c}});t(7,d=!1),Ut("Successfully generated client secret."),s("submit",L),o==null||o.hide()}catch(L){me.errorResponseHandler(L)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function k(){u=this.value,t(4,u)}function T(){c=this.value,t(6,c)}function $(){f=this.value,t(5,f)}const M=()=>g(),C=()=>!d;function O(L){se[L?"unshift":"push"](()=>{o=L,t(1,o)})}function E(L){de.call(this,n,L)}function P(L){de.call(this,n,L)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,l,g,p,_,y,k,T,$,M,C,O,E,P]}class fO extends ve{constructor(e){super(),be(this,e,uO,aO,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function cO(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new fO({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=D(),s=v("span"),s.textContent="Generate secret",o=D(),V(r.$$.fragment),m(t,"class","ri-key-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class",l="btn btn- Line truncated
Updated: ${n[2].updated}`,position:"left"})),_=!0)},p(k,T){T[1]&8388608&&r!==(r=k[54])&&m(e,"for",r),c&&Bt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${k[2].created}
Updated: ${k[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=k[54])&&m(p,"id",h),T[0]&4&&g!==(g=k[2].id)&&p.value!==g&&(p.value=g)},d(k){k&&w(e),k&&w(a),k&&w(u),k&&w(d),k&&w(p),_=!1,y()}}}function im(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new X4({props:r}),se.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&sm();return{c(){V(e.$$.fragment),i=D(),a&&a.c(),s=we()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,g;const p={};d[0]&1&&(p.collection=c[0]),!t&&d[0]&4&&(t=!0,p.record=c[2],ke(()=>t=!1)),e.$set(p),(g=(h=c[0])==null?void 0:h.schema)!=null&&g.length?a||(a=sm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){I(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function sm(n){let e;return{c(){e=v("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function kO(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new CM({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function wO(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new nM({props:u}),se.push(()=>ge(e,"value",o)),se.push(()=>ge(e,"uploadedFiles",r)),se.push(()=>ge(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function SO(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new I5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TO(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new O5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $O(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new T5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function CO(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new qM({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function MO(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new y5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function OO(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new _5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function DO(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new d5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={}; Line truncated
<span class="txt">Send verification email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[23]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function um(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[24]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function PO(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&am(n),u=n[0].isAuth&&n[7].email&&um(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=v("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=v("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(i,"type","button"),m(i,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[K(i,"click",n[25]),K(l,"click",$n(ft(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=am(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=um(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Ae(r)}}}function fm(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=D(),s=v("button"),s.textContent="Authorized providers",m(t,"type","button"),m(t,"class","tab-item"),Q(t,"active",n[10]===xi),m(s,"type","button"),m(s,"class","tab-item"),Q(s,"active",n[10]===kl),m(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[K(t,"click",n[27]),K(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===xi),a[0]&1024&&Q(s,"active",r[10]===kl)},d(r){r&&w(e),l=!1,Ae(o)}}}function LO(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,p=!n[2].isNew&&rm(n),h=n[0].isAuth&&!n[2].isNew&&fm(n);return{c(){e=v("h4"),i=B(t),s=D(),l=v("strong"),r=B(o),a=B(" record"),u=D(),p&&p.c(),f=D(),h&&h.c(),c=we()},m(_,y){S(_,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),S(_,u,y),p&&p.m(_,y),S(_,f,y),h&&h.m(_,y),S(_,c,y),d=!0},p(_,y){var k;(!d||y[0]&4)&&t!==(t=_[2].isNew?"New":"Edit")&&le(i,t),(!d||y[0]&1)&&o!==(o=((k=_[0])==null?void 0:k.name)+"")&&le(r,o),_[2].isNew?p&&(re(),I(p,1,1,()=>{p=null}),ae()):p?(p.p(_,y),y[0]&4&&A(p,1)):(p=rm(_),p.c(),A(p,1),p.m(f.parentNode,f)),_[0].isAuth&&!_[2].isNew?h?h.p(_,y):(h=fm(_),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(_){d||(A(p),d=!0)},o(_){I(p),d=!1},d(_){_&&w(e),_&&w(u),p&&p.d(_),_&&w(f),h&&h.d(_),_&&w(c)}}}function NO(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=B(o),m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[8],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[13]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(l,r),u||(f=K(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function FO(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[NO],header:[LO],default:[IO]},$$scope:{ctx:n}};return e=new bn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const xi="form",kl="providers";function cm(n){return JSON.stringify(n)}function RO(n,e,t){let i,s,l,o;const r=vt(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ci,p=!1,h=!1,g={},_={},y="",k=xi;function T(ie){return M(ie),t(9,h=!0),t(10,k=xi),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(ie){_n({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ci),t(3,g={}),t(4,_={}),await rn(),t(20,y=cm(d))}function C(){if(p||!o||!(u!=null&&u.id))return;t(8,p=!0);const ie=E();let Se;d.isNew?Se=me.collection(u.id).create(ie):Se=me.collection(u.id).update(d.id,ie),Se.then(st=>{Ut(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),$(),r("save",st)}).catch(st=>{me.errorResponseHandler(st)}).finally(()=>{t(8,p=!1)})}function O(){c!=null&&c.id&&pn("Do you really want to delete the selected record?",()=>me.collection(c.collectionId).delete(c.id).then(()=>{$(),Ut("Successfully deleted record."),r("delete",c)}).catch(ie=>{me.errorResponseHandler(ie)}))}function E(){const ie=(d==null?void 0:d.export())||{},Se=new FormData,st={};for(const nt of(u==null?void 0:u.schema)||[])st[nt.name]=!0;u!=null&&u.isAuth&&(st.username=!0,st.email=!0,st.emailVisibility=!0,st.password=!0,st.passwordConfirm=!0,st.verified=!0);for(const nt in ie)st[nt]&&(typeof ie[nt]>"u"&&(ie[nt]=null),H.addValueToFormData(Se,nt,ie[nt]));for(const nt in g){const kt=H.toArray(g[nt]);for(const xt of kt)Se.append(nt,xt)}for(const nt in _){const kt=H.toArray(_[nt]);for(const xt of kt)Se.append(nt+"."+xt,"")}return Se}function P(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent verification email to ${c.email}?`,()=>me.collection(u.id).requestVerification(c.email).then(()=>{Ut(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent password reset email to ${c.email}?`,()=>me.collection(u.id).requestPasswordReset(c.email).then(()=>{Ut(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function F(){l?pn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const Se=(u==null?void 0:u.schema)||[];for(const st of Se)st.type==="file"&&delete ie[st.name]}T(ie),await rn(),t(20,y="")}const R=()=>$(),z=()=>P(),W=()=>L(),J=()=>F(),x=()=>O(),ne=()=>t(10,k=xi),G=()=>t(10,k=kl);function fe(ie){d=ie,t(2,d)}function Z(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function ce(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function he(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ce(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Re(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function je(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function ye(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function $e(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ye(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function dt(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ke(ie,Se){n.$$.not_equal(g[Se.name],ie)&&(g[Se.name]=ie,t(3,g))}function Be(ie,Se){n.$$.not_equal(_[Se.name],ie)&&(_[Se.name]=ie,t(4,_))}function ee(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}const Fe=()=>l&&h?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),$()}),!1):(_n({}),!0);function tt(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Wt(ie){de.call(this,n,ie)}function Pe(ie){de.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(Se=>Se.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=H.hasNonEmptyProps(g)||H.hasNonEmptyProps(_)),n.$$.dirty[0]&3145732&&t(5,l=s||y!=cm(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,$,d,g,_,l,f,c,p,h,k,o,i,a,C,O,P,L,F,T,y,s,R,z,W,J,x,ne,G,fe,Z,ce,he,Ce,Re,je,ye,$e,Ye,dt,Ke,Be,ee,Fe,tt,Wt,Pe]}class G1 extends ve{constructor(e){super(),be(this,e,RO,FO,_e,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function qO(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[De(i=ze.call(null,e,n[2]?"":"Copy")),K(e,"click",$n(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&m(e,"class",t),i&&Bt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:X,o:X,d(o){o&&w(e),s=!1,Ae(l)}}}function jO(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm lin Line truncated
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function TD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[40]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $D(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[39]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Vm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=D(),r=v("label"),m(i,"type","checkbox"),m(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],m(r,"for",a="checkbox_"+n[55].id),m(t,"class","form-field"),m(e,"class","bulk-select-col min-width")},m(d,p){S(d,e,p),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[K(i,"change",c),K(t,"click",$n(n[26]))],u=!0)},p(d,p){n=d,p[0]&16&&s!==(s="checkbox_"+n[55].id)&&m(i,"id",s),p[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),p[0]&16&&a!==(a="checkbox_"+n[55].id)&&m(r,"for",a)},d(d){d&&w(e),u=!1,Ae(f)}}}function Hm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new xo({props:{value:n[55].id}});let c=n[2].isAuth&&zm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),a=B(r),u=D(),c&&c.c(),m(o,"class","txt"),m(i,"class","label"),m(t,"class","flex flex-gap-5"),m(e,"class","col-type-text col-field-id")},m(d,p){S(d,e,p),b(e,t),b(t,i),q(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,p){const h={};p[0]&16&&(h.value=d[55].id),s.$set(h),(!f||p[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,p):(c=zm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){I(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function zm(n){let e;function t(l,o){return l[55].verified?MD:CD}let i=t(n),s=i(n);return{c(){s.c(),e=we()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function CD(n){let e,t,i;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=De(ze.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function MD(n){let e,t,i;return{c(){e=v("i"),m(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=De(ze.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Bm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Um(n),o=i&&Wm(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=we()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Um(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Wm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Um(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?DD:OD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),m(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function OD(n){let e,t=n[55].username+"",i,s;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].username)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&m(e,"title",s)},d(l){l&&w(e)}}}function DD(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Wm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?AD:ED}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),m(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function ED(n){let e,t=n[55].email+"",i,s;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].email)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&m(e,"title",s)},d(l){l&&w(e)}}}function AD(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Ym(n,e){let t,i,s,l;return i=new X1({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=v("td"),V(i.$$.fragment),m(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&m(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){I(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Km(n){let e,t,i;return t=new di({props:{date:n[55].created}}),{c(){e=v("td"),V(t.$$.fragment),m(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){coLine truncated
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[18]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P,L,F=!n[10]&&th(n);c=new Aa({}),c.$on("refresh",n[16]);let N=!n[2].isView&&nh(n);y=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[19]);function R(J){n[21](J)}function z(J){n[22](J)}let W={collection:n[2]};return n[0]!==void 0&&(W.filter=n[0]),n[1]!==void 0&&(W.sort=n[1]),M=new jD({props:W}),n[20](M),se.push(()=>ge(M,"filter",R)),se.push(()=>ge(M,"sort",z)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=D(),l=v("div"),r=B(o),a=D(),u=v("div"),F&&F.c(),f=D(),V(c.$$.fragment),d=D(),p=v("div"),h=v("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=D(),N&&N.c(),_=D(),V(y.$$.fragment),k=D(),T=v("div"),$=D(),V(M.$$.fragment),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(u,"class","inline-flex gap-5"),m(h,"type","button"),m(h,"class","btn btn-outline"),m(p,"class","btns-group"),m(e,"class","page-header"),m(T,"class","clearfix m-b-base")},m(J,x){S(J,e,x),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),F&&F.m(u,null),b(u,f),q(c,u,null),b(e,d),b(e,p),b(p,h),b(p,g),N&&N.m(p,null),S(J,_,x),q(y,J,x),S(J,k,x),S(J,T,x),S(J,$,x),q(M,J,x),E=!0,P||(L=K(h,"click",n[17]),P=!0)},p(J,x){(!E||x[0]&4)&&o!==(o=J[2].name+"")&&le(r,o),J[10]?F&&(F.d(1),F=null):F?F.p(J,x):(F=th(J),F.c(),F.m(u,f)),J[2].isView?N&&(N.d(1),N=null):N?N.p(J,x):(N=nh(J),N.c(),N.m(p,null));const ne={};x[0]&1&&(ne.value=J[0]),x[0]&4&&(ne.autocompleteCollection=J[2]),y.$set(ne);const G={};x[0]&4&&(G.collection=J[2]),!C&&x[0]&1&&(C=!0,G.filter=J[0],ke(()=>C=!1)),!O&&x[0]&2&&(O=!0,G.sort=J[1],ke(()=>O=!1)),M.$set(G)},i(J){E||(A(c.$$.fragment,J),A(y.$$.fragment,J),A(M.$$.fragment,J),E=!0)},o(J){I(c.$$.fragment,J),I(y.$$.fragment,J),I(M.$$.fragment,J),E=!1},d(J){J&&w(e),F&&F.d(),j(c),N&&N.d(),J&&w(_),j(y,J),J&&w(k),J&&w(T),J&&w($),n[20](null),j(M,J),P=!1,L()}}}function UD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=D(),i=v("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,m(e,"class","m-b-10"),m(i,"type","button"),m(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[14]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function WD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",m(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function YD(n){let e,t,i;function s(r,a){return r[10]?WD:UD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),m(t,"class","icon"),m(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function KD(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,m(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function JD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[zD,HD,VD],p=[];function h(T,$){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=p[e]=d[e](n);let g={};s=new su({props:g}),n[25](s);let _={};o=new z4({props:_}),n[26](o);let y={collection:n[2]};a=new G1({props:y}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let k={collection:n[2]};return f=new pD({props:k}),n[30](f),{c(){t.c(),i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment)},m(T,$){p[e].m(T,$),S(T,i,$),q(s,T,$),S(T,l,$),q(o,T,$),S(T,r,$),q(a,T,$),S(T,u,$),q(f,T,$),c=!0},p(T,$){let M=e;e=h(T),e===M?p[e].p(T,$):(re(),I(p[M],1,1,()=>{p[M]=null}),ae(),t=p[e],t?t.p(T,$):(t=p[e]=d[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const O={};o.$set(O);const E={};$[0]&4&&(E.collection=T[2]),a.$set(E);const P={};$[0]&4&&(P.collection=T[2]),f.$set(P)},i(T){c||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),c=!0)},o(T){I(t),I(s.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(f.$$.fragment,T),c=!1},d(T){p[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function ZD(n,e,t){let i,s,l,o,r,a,u;We(n,Di,Z=>t(2,s=Z)),We(n,Ot,Z=>t(31,l=Z)),We(n,Lo,Z=>t(3,o=Z)),We(n,ga,Z=>t(13,r=Z)),We(n,Pi,Z=>t(9,a=Z)),We(n,Cs,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,p,h,g,_=f.get("filter")||"",y=f.get("sort")||"",k=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,k=s==null?void 0:s.id),t(0,_=""),t(1,y="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,y="")}B1(k);const $=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>g==null?void 0:g.load(),O=()=>d==null?void 0:d.show(s),E=()=>p==null?void 0:p.show(),P=Z=>t(0,_=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{g=Z,t(8,g)})}function F(Z){_=Z,t(0,_)}function N(Z){y=Z,t(1,y)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):p==null||p.show(Z==null?void 0:Z.detail)},z=()=>p==null?void 0:p.show();function W(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function J(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function x(Z){se[Z?"unshift":"push"](()=>{p=Z,t(6,p)})}const ne=()=>g==null?void 0:g.reloadLoadedPages(),G=()=>g==null?void 0:g.reloadLoadedPages();function fe(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=k&&GS(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&k!=s.id&&T(),n.$$.dirty[0]&7&&(y||_||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:_,sort:y}).toString();Ei("/collections?"+Z)}n.$$.dirty[0]&4&&Gt(Ot,l=(s==null?void 0:s.name)||"Collections",l)},[_,y,s,o,c,d,p,h,g,a,u,k,i,r,$,M,C,O,E,P,L,F,N,R,z,W,J,x,ne,G,fe]}class GD extends ve{constructor(e){super(),be(this,e,ZD,JD,_e,{},null,[-1,-1])}}function XD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=D(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=v("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),p=v("a"),p.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=D(),g=v("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,_=D(),y=v("div"),y.textContent="Authentication",k=D(),T=v("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,$=D(),M=v("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=D(),O=v("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,m(i,"class","sidebar-title"),m(l,"href","/settings"),m(l,"class","sidebar-list-item"),m(r,"href","/settings/mail"),m(r,"class","sidebar-list-item"),m(u,"href","/settings/storage"),m(u,"class","sidebar-list-item"),m(c,"class","sidebar-title"),m(p,"href","/settings/export-collections"),m(p,"class","sidebar-list-item"),m(g,"href","/settings/import-collections"),m(g,"class","sidebar-list-item"),m(y,"class","sidebar-title"),m(T,"href","/settings/auth-providers"),m(T,"class","sidebar-list-item"),m(M,"href","/settings/tokens"),m(M,"class","sidebar-list-item"),m(O,"href","/settings/admins"),m(O,"class","sidebar-list-item"),m(t,"class","sidebar-content"),m(e,"class","page-sidebar settings-sidebar")},m(L,F){S(L,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,c),b(t,d),b(t,p),b(t,h),b(t,g),b(t,_),b(t,y),b(t,k),b(t,T),b(t,$),b(t,M),b(t,C),b(t,O),E||(P=[De(Hn.call(null,l,{path:"/settings"})),De(nn.call(null,l)),De(Hn.call(null,r,{path:"/settings/mail/?.*"})),De(nn.call(null,r)),De(Hn.call(null,u,{path:"/settings/storage/?.*"})),De(nn.call(null,u)),De(Hn.call(null,p,{path:"/settings/export-collections/?.*"})),De(nn.call(null,p)),De(Hn.call(null,g,{path:"/settings/import-collections/?.*"})),De(nn.call(null,g)),De(Hn.call(null,T,{path:"/settings/auth-providers/?.*"})),De(nn.call(null,T)),De(Hn.call(null,M,{path:"/settings/tokens/?.*"})),De(nn.call(null,M)),De(Hn.call(null,O,{path:"/settings/admins/?.*"})),De(nn.call(null,O))],E=!0)},p:X,i:X,o:X,d(L){L&&w(e),E=!1,Ae(P)}}}class Ni extends ve{constructor(e){super(),be(this,e,null,XD,_e,{})}}function ih(n,e,t){const i=n.slice();return i[30]=e[t],i}function sh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[QD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function QD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="id",o=D(),r=v("div"),a=v("i"),f=D(),c=v("input"),m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"for",l=n[29]),m(a,"class","ri-calendar-event-line txt-disabled"),m(r,"class","form-field-addon"),m(c,"type","text"),m(c,"id",d=n[29]),c.value=p=n[1].id,c.readOnly=!0},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),S(_,r,y),b(r,a),S(_,f,y),S(_,c,y),h||(g=De(u=ze.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(_,y){y[0]&536870912&&l!==(l=_[29])&&m(e,"for",l),u&&Bt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${_[1].created}
Updated: ${_[1].updated}`,position:"left"}),y[0]&536870912&&d!==(d=_[29])&&m(c,"id",d),y[0]&2&&p!==(p=_[1].id)&&c.value!==p&&(c.value=p)},d(_){_&&w(e),_&&w(o),_&&w(r),_&&w(f),_&&w(c),h=!1,g()}}}function lh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=D(),Un(t.src,i="./images/avatars/avatar"+n[30]+".svg")||m(t,"src",i),m(t,"alt","Avatar "+n[30]),m(e,"type","button"),m(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),b(e,t),b(e,s),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&m(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function xD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("input"),m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","email"),m(r,"autocomplete","off"),m(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[3]),u||(f=K(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&8&&r.value!==c[3]&&ue(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function oh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[eE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Change password"),m(e,"type","checkbox"),m(e,"id",t=n[29]),m(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&m(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function rh(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[tE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[nE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(t,"class","grid"),m(e,"class","col-12")},m(f,c){S(f,e,c),b(e,t),b(t,i),q(s,i,null),b(t,l),b(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&536871424|c[1]&4&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=qe(t,Mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=qe(t,Mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function tE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[8]),u||(f=K(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&256&&r.value!==c[8]&&ue(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function nE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[9]),u||(f=K(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&512&&r.value!==c[9]&&ue(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function iE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h=!n[1].isNew&&sh(n),g=[0,1,2,3,4,5,6,7,8,9],_=[];for(let T=0;T<10;T+=1)_[T]=lh(ih(n,g,T));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[xD,({uniqueId:T})=>({29:T}),({uniqueId:T})=>[T?536870912:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&oh(n),k=(n[1].isNew||n[4])&&rh(n);return{c(){e=v("form"),h&&h.c(),t=D(),i=v("div"),s=v("p"),s.textContent="Avatar",l=D(),o=v("div");for(let T=0;T<10;T+=1)_[T].c();r=D(),V(a.$$.fragment),u=D(),y&&y.c(),f=D(),k&&k.c(),m(s,"class","section-title"),m(o,"class","flex flex-gap-xs flex-wrap"),m(i,"class","content"),m(e,"id",n[11]),m(e,"class","grid"),m(e,"autocomplete","off")},m(T,$){S(T,e,$),h&&h.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let M=0;M<10;M+=1)_[M]&&_[M]. Line truncated
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function oE(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&ah(n);return{c(){p&&p.c(),e=D(),t=v("button"),i=v("span"),i.textContent="Cancel",s=D(),l=v("button"),o=v("span"),a=B(r),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-transparent"),t.disabled=n[6],m(o,"class","txt"),m(l,"type","submit"),m(l,"form",n[11]),m(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,g){p&&p.m(h,g),S(h,e,g),S(h,t,g),b(t,i),S(h,s,g),S(h,l,g),b(l,o),b(o,a),f=!0,c||(d=K(t,"click",n[16]),c=!0)},p(h,g){h[1].isNew?p&&(re(),I(p,1,1,()=>{p=null}),ae()):p?(p.p(h,g),g[0]&2&&A(p,1)):(p=ah(h),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=h[6]),(!f||g[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||g[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(p),f=!0)},o(h){I(p),f=!1},d(h){p&&p.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function rE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[oE],header:[sE],default:[iE]},$$scope:{ctx:n}};return e=new bn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function aE(n,e,t){let i;const s=vt(),l="admin_"+H.randomString(5);let o,r=new es,a=!1,u=!1,f=0,c="",d="",p="",h=!1;function g(J){return y(J),t(7,u=!0),o==null?void 0:o.show()}function _(){return o==null?void 0:o.hide()}function y(J){t(1,r=J!=null&&J.clone?J.clone():new es),k()}function k(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,p=""),_n({})}function T(){if(a||!i)return;t(6,a=!0);const J={email:c,avatar:f};(r.isNew||h)&&(J.password=d,J.passwordConfirm=p);let x;r.isNew?x=me.admins.create(J):x=me.admins.update(r.id,J),x.then(async ne=>{var G;t(7,u=!1),_(),Ut(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((G=me.authStore.model)==null?void 0:G.id)===ne.id&&me.authStore.save(me.authStore.token,ne)}).catch(ne=>{me.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function $(){r!=null&&r.id&&pn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),_(),Ut("Successfully deleted admin."),s("delete",r)}).catch(J=>{me.errorResponseHandler(J)}))}const M=()=>$(),C=()=>_(),O=J=>t(2,f=J);function E(){c=this.value,t(3,c)}function P(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function F(){p=this.value,t(9,p)}const N=()=>i&&u?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),_()}),!1):!0;function R(J){se[J?"unshift":"push"](()=>{o=J,t(5,o)})}function z(J){de.call(this,n,J)}function W(J){de.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[_,r,f,c,h,o,a,u,d,p,i,l,T,$,g,M,C,O,E,P,L,F,N,R,z,W]}class uE extends ve{constructor(e){super(),be(this,e,aE,rE,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function uh(n,e,t){const i=n.slice();return i[24]=e[t],i}function fE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function cE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function dE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function pE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="updated",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function fh(n){let e;function t(l,o){return l[5]?hE:mE}let i=t(n),s=i(n);return{c(){s.c(),e=we()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function mE(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&ch(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(Line truncated
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ch(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function dh(n){let e;return{c(){e=v("span"),e.textContent="You",m(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ph(n,e){let t,i,s,l,o,r,a,u,f,c,d,p=e[24].id+"",h,g,_,y,k,T=e[24].email+"",$,M,C,O,E,P,L,F,N,R,z,W,J,x;f=new xo({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&dh();E=new di({props:{date:e[24].created}}),F=new di({props:{date:e[24].updated}});function G(){return e[15](e[24])}function fe(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=D(),a=v("td"),u=v("div"),V(f.$$.fragment),c=D(),d=v("span"),h=B(p),g=D(),ne&&ne.c(),_=D(),y=v("td"),k=v("span"),$=B(T),C=D(),O=v("td"),V(E.$$.fragment),P=D(),L=v("td"),V(F.$$.fragment),N=D(),R=v("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',z=D(),Un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||m(l,"src",o),m(l,"alt","Admin avatar"),m(s,"class","thumb thumb-sm thumb-circle"),m(i,"class","min-width"),m(d,"class","txt"),m(u,"class","label"),m(a,"class","col-type-text col-field-id"),m(k,"class","txt txt-ellipsis"),m(k,"title",M=e[24].email),m(y,"class","col-type-email col-field-email"),m(O,"class","col-type-date col-field-created"),m(L,"class","col-type-date col-field-updated"),m(R,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Z,ce){S(Z,t,ce),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),q(f,u,null),b(u,c),b(u,d),b(d,h),b(a,g),ne&&ne.m(a,null),b(t,_),b(t,y),b(y,k),b(k,$),b(t,C),b(t,O),q(E,O,null),b(t,P),b(t,L),q(F,L,null),b(t,N),b(t,R),b(t,z),W=!0,J||(x=[K(t,"click",G),K(t,"keydown",fe)],J=!0)},p(Z,ce){e=Z,(!W||ce&16&&!Un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&m(l,"src",o);const he={};ce&16&&(he.value=e[24].id),f.$set(he),(!W||ce&16)&&p!==(p=e[24].id+"")&&le(h,p),e[24].id===e[7].id?ne||(ne=dh(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!W||ce&16)&&T!==(T=e[24].email+"")&&le($,T),(!W||ce&16&&M!==(M=e[24].email))&&m(k,"title",M);const Ce={};ce&16&&(Ce.date=e[24].created),E.$set(Ce);const Re={};ce&16&&(Re.date=e[24].updated),F.$set(Re)},i(Z){W||(A(f.$$.fragment,Z),A(E.$$.fragment,Z),A(F.$$.fragment,Z),W=!0)},o(Z){I(f.$$.fragment,Z),I(E.$$.fragment,Z),I(F.$$.fragment,Z),W=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(E),j(F),J=!1,Ae(x)}}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M=[],C=new Map,O;function E(G){n[11](G)}let P={class:"col-type-text",name:"id",$$slots:{default:[fE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),o=new Jt({props:P}),se.push(()=>ge(o,"sort",E));function L(G){n[12](G)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[cE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new Jt({props:F}),se.push(()=>ge(u,"sort",L));function N(G){n[13](G)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Jt({props:R}),se.push(()=>ge(d,"sort",N));function z(G){n[14](G)}let W={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[pE]},$$scope:{ctx:n}};n[2]!==void 0&&(W.sort=n[2]),g=new Jt({props:W}),se.push(()=>ge(g,"sort",z));let J=n[4];const x=G=>G[24].id;for(let G=0;G<J.length;G+=1){let fe=uh(n,J,G),Z=x(fe);C.set(Z,M[G]=ph(Z,fe))}let ne=null;return J.length||(ne=fh(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=D(),V(o.$$.fragment),a=D(),V(u.$$.fragment),c=D(),V(d.$$.fragment),h=D(),V(g.$$.fragment),y=D(),k=v("th"),T=D(),$=v("tbody");for(let G=0;G<M.length;G+=1)M[G].c();ne&&ne.c(),m(s,"class","min-width"),m(k,"class","col-type-action min-width"),m(e,"class","table"),Q(e,"table-loading",n[5])},m(G,fe){S(G,e,fe),b(e,t),b(t,i),b(i,s),b(i,l),q(o,i,null),b(i,a),q(u,i,null),b(i,c),q(d,i,null),b(i,h),q(g,i,null),b(i,y),b(i,k),b(e,T),b(e,$);for(let Z=0;Z<M.length;Z+=1)M[Z]&&M[Z].m($,null);ne&&ne.m($,null),O=!0},p(G,fe){const Z={};fe&134217728&&(Z.$$scope={dirty:fe,ctx:G}),!r&&fe&4&&(r=!0,Z.sort=G[2],ke(()=>r=!1)),o.$set(Z);const ce={};fe&134217728&&(ce.$$scope={dirty:fe,ctx:G}),!f&&fe&4&&(f=!0,ce.sort=G[2],ke(()=>f=!1)),u.$set(ce);const he={};fe&134217728&&(he.$$scope={dirty:fe,ctx:G}),!p&&fe&4&&(p=!0,he.sort=G[2],ke(()=>p=!1)),d.$set(he);const Ce={};fe&134217728&&(Ce.$$scope={dirty:fe,ctx:G}),!_&&fe&4&&(_=!0,Ce.sort=G[2],ke(()=>_=!1)),g.$set(Ce),fe&186&&(J=G[4],re(),M=Ct(M,fe,x,1,G,J,C,$,an,ph,null,uh),ae(),!J.length&&ne?ne.p(G,fe):J.length?ne&&(ne.d(1),ne=null):(ne=fh(G),ne.c(),ne.m($,null))),(!O||fe&32)&&Q(e,"table-loading",G[5])},i(G){if(!O){A(o.$$.fragment,G),A(u.$$.fragment,G),A(d.$$.fragment,G),A(g.$$.fragment,G);for(let fe=0;fe<J.length;fe+=1)A(M[fe]);O=!0}},o(G){I(o.$$.fragment,G),I(u.$$.fragment,G),I(d.$$.fragment,G),I Line truncated
<span class="txt">New admin</span>`,p=D(),V(h.$$.fragment),g=D(),_=v("div"),y=D(),V(k.$$.fragment),T=D(),E&&E.c(),$=we(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(f,"class","flex-fill"),m(d,"type","button"),m(d,"class","btn btn-expanded"),m(e,"class","page-header"),m(_,"class","clearfix m-b-base")},m(P,L){S(P,e,L),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),q(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),S(P,p,L),q(h,P,L),S(P,g,L),S(P,_,L),S(P,y,L),q(k,P,L),S(P,T,L),E&&E.m(P,L),S(P,$,L),M=!0,C||(O=K(d,"click",n[9]),C=!0)},p(P,L){(!M||L&64)&&le(o,P[6]);const F={};L&2&&(F.value=P[1]),h.$set(F);const N={};L&134217918&&(N.$$scope={dirty:L,ctx:P}),k.$set(N),P[4].length?E?E.p(P,L):(E=mh(P),E.c(),E.m($.parentNode,$)):E&&(E.d(1),E=null)},i(P){M||(A(a.$$.fragment,P),A(h.$$.fragment,P),A(k.$$.fragment,P),M=!0)},o(P){I(a.$$.fragment,P),I(h.$$.fragment,P),I(k.$$.fragment,P),M=!1},d(P){P&&w(e),j(a),P&&w(p),j(h,P),P&&w(g),P&&w(_),P&&w(y),j(k,P),P&&w(T),E&&E.d(P),P&&w($),C=!1,O()}}}function bE(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[gE]},$$scope:{ctx:n}}});let r={};return l=new uE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function vE(n,e,t){let i,s,l;We(n,ga,F=>t(21,i=F)),We(n,Ot,F=>t(6,s=F)),We(n,Ea,F=>t(7,l=F)),Gt(Ot,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),p(),me.errorResponseHandler(F,!1))})}function p(){t(4,a=[])}const h=()=>d(),g=()=>r==null?void 0:r.show(),_=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function k(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const M=F=>r==null?void 0:r.show(F),C=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function E(F){se[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Ei("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,h,g,_,y,k,T,$,M,C,O,E,P,L]}class yE extends ve{constructor(e){super(),be(this,e,vE,bE,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function kE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("input"),m(e,"for",i=n[8]),m(l,"type","email"),m(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&m(e,"for",i),f&256&&o!==(o=u[8])&&m(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wE(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",m(e,"for",i=n[8]),m(l,"type","password"),m(l,"id",o=n[8]),l.required=!0,m(u,"href","/request-password-reset"),m(u,"class","link-hint"),m(a,"class","help-block")},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[1]),S(d,r,p),S(d,a,p),b(a,u),f||(c=[K(l,"input",n[5]),De(nn.call(null,u))],f=!0)},p(d,p){p&256&&i!==(i=d[8])&&m(e,"for",i),p&256&&o!==(o=d[8])&&m(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Ae(c)}}}function SE(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[kE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[wE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Admin sign in</h4>",i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),a=v("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(a,"type","submit"),m(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),m(e,"class","block")},m(d,p){S(d,e,p),b(e,t),b(e,i),q(s,e,null),b(e,l),q(o,e,null),b(e,r),b(e,a),u=!0,f||(c=K(e,"submit",ft(n[3])),f=!0)},p(d,p){const h={};p&769&&(h.$$scope={dirty:p,ctx:d}),s.$set(h);const g={};p&770&&(g.$$scope={dirty:p,ctx:d}),o.$set(g),(!u||p&4)&&Q(a,"btn-disabled",d[2]),(!u||p&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(s.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function TE(n){let e,t;return e=new zg({props:{$$slots:{default:[SE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function $E(n,e,t){let i;We(n,ga,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Oa(),Ei("/")}).catch(()=>{pl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class CE extends ve{constructor(e){super(),be(this,e,$E,TE,_e,{})}}function ME(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[DE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[EE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[AE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[IE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&hh(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),c=D(),d=v("div"),p=v("div"),h=D(),C&&C.c(),g=D(),_=v("button"),y=v("span"),y.textContent="Save changes",m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(p,"class","flex-fill"),m(y,"class","txt"),m(_,"type","submit"),m(_,"class","btn btn-expanded"),_.disabled=k=!n[3]||n[2],Q(_,"btn-loading",n[2]),m(d,"class","col-lg-12 flex"),m(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),q(a,e,null),b(e,u),q(f,e,null),b(e,c),b(e,d),b(d,p),b(d,h),C&&C.m(d,null),b(d,g),b(d,_),b(_,y),T=!0,$||(M=K(_,"click",n[13]),$=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),a.$set(F);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:O}),f.$set(N),O[3]?C?C.p(O,E):(C=hh(O),C.c(),C.m(d,g)):C&&(C.d(1),C=null),(!T||E&12&&k!==(k=!O[3]||O[2]))&&(_.disabled=k),(!T||E&4)&&Q(_,"btn-loading",O[2])},i(O){T||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),T=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(a.$$.fragment,O),I(f.$$.fragment,O),T=!1},d(O){O&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),$=!1,M()}}}function OE(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application name"),s=D(),l=v("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appName),r||(a=K(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function EE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application url"),s=D(),l=v("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appUrl),r||(a=K(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&ue(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function AE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Logs max days retention"),s=D(),l=v("input"),m(e,"for",i=n[19]),m(l,"type","number"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].logs.maxDays),r||(a=K(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&ht(l.value)!==u[0].logs.maxDays&&ue(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function IE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("spanLine truncated
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=v("div"),s=v("form"),o.c(),m(e,"class","page-header"),m(s,"class","panel"),m(s,"autocomplete","off"),m(i,"class","wrapper")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),b(i,s),c[l].m(s,null),r=!0,a||(u=K(s,"submit",ft(n[4])),a=!0)},p(p,h){let g=l;l=d(p),l===g?c[l].p(p,h):(re(),I(c[g],1,1,()=>{c[g]=null}),ae(),o=c[l],o?o.p(p,h):(o=c[l]=f[l](p),o.c()),A(o,1),o.m(s,null))},i(p){r||(A(o),r=!0)},o(p){I(o),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),c[l].d(),a=!1,u()}}}function LE(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[PE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function NE(n,e,t){let i,s,l,o;We(n,Cs,C=>t(14,s=C)),We(n,ko,C=>t(15,l=C)),We(n,Ot,C=>t(16,o=C)),Gt(Ot,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await me.settings.getAll()||{};h(C)}catch(C){me.errorResponseHandler(C)}t(1,u=!1)}async function p(){if(!(f||!i)){t(2,f=!0);try{const C=await me.settings.update(H.filterRedactedProps(a));h(C),Ut("Successfully saved application settings.")}catch(C){me.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var O,E;Gt(ko,l=(O=C==null?void 0:C.meta)==null?void 0:O.appName,l),Gt(Cs,s=!!((E=C==null?void 0:C.meta)!=null&&E.hideControls),s),t(0,a={meta:(C==null?void 0:C.meta)||{},logs:(C==null?void 0:C.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function k(){a.logs.maxDays=ht(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>g(),M=()=>p();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,p,g,r,c,_,y,k,T,$,M]}class FE extends ve{constructor(e){super(),be(this,e,NE,LE,_e,{})}}function RE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Le(l,s[o]);return{c(){e=v("input"),xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ue(e,n[0]),t||(i=K(e,"input",n[8]),t=!0)},p(o,r){xn(e,l=bt(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ue(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function qE(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Le(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=v("input"),m(t,"type","button"),m(t,"class","btn btn-transparent btn-circle"),m(e,"class","form-field-addon"),xn(s,a)},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[De(ze.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){xn(s,a=bt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Ae(o)}}}function jE(n){let e;function t(l,o){return l[3]?qE:RE}let i=t(n),s=i(n);return{c(){s.c(),e=we()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:X,o:X,d(l){s.d(l),l&&w(e)}}}function VE(n,e,t){const i=["value","mask"];let s=Je(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await rn(),r==null||r.focus()}const f=()=>u();function c(p){se[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=Le(Le({},e),jt(p)),t(5,s=Je(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class ou extends ve{constructor(e){super(),be(this,e,VE,jE,_e,{value:0,mask:1})}}function HE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=v("label"),t=B("Subject"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(a,"class","help-block")},m(_,y){S(_,e,y),b(e,t),S(_,s,y),S(_,l,y),ue(l,n[0].subject),S(_,r,y),S(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),h||(g=[K(l,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],h=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&m(e,"for",i),y[1]&1&&o!==(o=_[31])&&m(l,"id",o),y[0]&1&&l.value!==_[0].subject&&ue(l,_[0].subject)},d(_){_&&w(e),_&&w(s),_&&w(l),_&&w(r),_&&w(a),h=!1,Ae(g)}}}function zE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;return{c(){e=v("label"),t=B("Action URL"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(h,"title","Required parameter"),m(a,"class","help-block")},m(k,T){S(k,e,T),b(e,t),S(k,s,T),S(k,l,T),ue(l,n[0].actionUrl),S(k,r,T),S(k,a,T),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),b(a,h),b(a,g),_||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],_=!0)},p(k,T){T[1]&1&&i!==(i=k[31])&&m(e,"for",i),T[1]&1&&o!==(o=k[31])&&m(l,"id",o),T[0]&1&&l.value!==k[0].actionUrl&&ue(l,k[0].actionUrl)},d(k){k&&w(e),k&&w(s),k&&w(l),k&&w(r),k&&w(a),_=!1,Ae(y)}}}function BE(n){let e,t,i,s;return{c(){e=v("textarea"),m(e,"id",t=n[31]),m(e,"class","txt-mono"),m(e,"spellcheck","false"),m(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),ue(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&m(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function UE(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=$t(o,r(n)),se.push(()=>ge(e,"value",l))),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$;const M=[UE,BE],C=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=C[l]=M[l](n),{c(){e=v("label"),t=B("Body (HTML)"),s=D(),o.c(),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B(`,
`),_=v("button"),_.textContent=`{ACTION_URL}
`,y=B("."),m(e,"for",i=n[31]),m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(_,"type","button"),m(_,"class","label label-sm link-primary txt-mono"),m(_,"title","Required parameter"),m(a,"class","help-block")},m(E,P){S(E,e,P),b(e,t),S(E,s,P),C[l].m(E,P),S(E,r,P),S(E,a,P),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),b(a,h),b(a,g),b(a,_),b(a,y),k=!0,T||($=[K(f,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(_,"click",n[25])],T=!0)},p(E,P){(!k||P[1]&1&&i!==(i=E[31]))&&m(e,"for",i);let L=l;l=O(E),l===L?C[l].p(E,P):(re(),I(C[L],1,1,()=>{C[L]=null}),ae(),o=C[l],o?o.p(E,P):(o=C[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){k||(A(o),k=!0)},o(E){I(o),k=!1},d(E){E&&w(e),E&&w(s),C[l].d(E),E&&w(r),E&&w(a),T=!1,Ae($)}}}function YE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[HE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[zE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[WE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function _h(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function KE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&_h();return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),l=B(n[2]),o=D(),r=v("div"),a=D(),f&&f.c(),u=we(),m(t,"class","ri-draft-line"),m(s,"class","txt"),m(e,"class","inline-flex"),m(r,"class","flex-fill")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=_h(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function JE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[KE],default:[YE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Le(s,i[l]);return e=new al({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?bt(i,[Vt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let gh;function ZE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Je(e,s),o;We(n,ti,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=gh,d=!1;function p(){f==null||f.expand()}function h(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-b80c0f73.js"),["./CodeEditor-b80c0f73.js","./index-20adcf24.js"],import.meta.url)).default),gh=c,t(5,d=!1))}function y(G){H.copyToClipboard(G),Vg(`Copied ${G} to clipboard`,2e3)}_();function k(){u.subject=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),O=()=>y("{APP_URL}"),E=()=>y("{TOKEN}");function P(G){n.$$.not_equal(u.body,G)&&(u.body=G,t(0,u))}function L(){u.body=this.value,t(0,u)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),R=()=>y("{TOKEN}"),z=()=>y("{ACTION_URL}");function W(G){se[G?"unshift":"push"](()=>{f=G,t(3,f)})}function J(G){de.call(this,n,G)}function x(G){de.call(this,n,G)}function ne(G){de.call(this,n,G)}return n.$$set=G=>{e=Le(Le({},e),jt(G)),t(8,l=Je(e,s)),"key"in G&&t(1,r=G.key),"title"in G&&t(2,a=G.title),"config"in G&&t(0,u=G.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||ci(r))},[u,r,a,f,c,d,i,y,l,p,h,g,o,k,T,$,M,C,O,E,P,L,F,N,R,z,W,J,x,ne]}class Pr extends ve{constructor(e){super(),be(this,e,ZE,JE,_e,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){retur Line truncated
<span class="txt">Send test email</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function _A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),l.textContent="Save changes",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],m(l,"class","txt"),m(s,"type","submit"),m(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),b(s,l),r||(a=[K(e,"click",n[24]),K(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Ae(a)}}}function gA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[lA,sA],k=[];function T($,M){return $[2]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[5]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),p.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[27])),g=!0)},p($,M){(!h||M[0]&32)&&le(o,$[5]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function bA(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[gA]},$$scope:{ctx:n}}});let r={};return l=new iA({props:r}),n[28](l),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function vA(n,e,t){let i,s,l;We(n,Ot,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Gt(Ot,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;p();async function p(){t(2,c=!0);try{const ne=await me.settings.getAll()||{};g(ne)}catch(ne){me.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await me.settings.update(H.filterRedactedProps(f));g(ne),_n({}),Ut("Successfully saved mail settings.")}catch(ne){me.errorResponseHandler(ne)}t(3,d=!1)}}function g(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function k(){f.meta.senderAddress=this.value,t(0,f)}function T(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function $(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=ht(this.value),t(0,f)}function P(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function N(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>_(),z=()=>h(),W=()=>a==null?void 0:a.show(),J=()=>h();function x(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,_,u,i,y,k,T,$,M,C,O,E,P,L,F,N,R,z,W,J,x]}class yA extends ve{constructor(e){super(),be(this,e,vA,bA,_e,{},null,[-1,-1])}}function kA(n){var $,M;let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[SA,({uniqueId:C})=>({25:C}),({uniqueId:C})=>C?33554432:0]},$$scope:{ctx:n}}});let _=(($=n[0].s3)==null?void 0:$.enabled)!=n[1].s3.enabled&&wh(n),y=n[1].s3.enabled&&Sh(n),k=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&Th(n),T=n[6]&&$h(n);return{c(){V(e.$$.fragment),t=D(),_&&_.c(),i=D(),y&&y.c(),s=D(),l=v("div"),o=v("div"),r=D(),k&&k.c(),a=D(),T&&T.c(),u=D(),f=v("button"),c=v("span"),c.textContent="Save changes",m(o,"class",Line truncated
the
`),r=v("strong"),u=B(a),f=B(`
to the
`),c=v("strong"),p=B(d),h=B(`.
`),g=v("br"),_=B(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,k=B(`,
`),T=v("a"),T.textContent=`s5cmd
`,$=B(", etc."),M=D(),C=v("div"),m(i,"class","icon"),m(y,"href","https://github.com/rclone/rclone"),m(y,"target","_blank"),m(y,"rel","noopener noreferrer"),m(y,"class","txt-bold"),m(T,"href","https://github.com/peak/s5cmd"),m(T,"target","_blank"),m(T,"rel","noopener noreferrer"),m(T,"class","txt-bold"),m(l,"class","content"),m(t,"class","alert alert-warning m-0"),m(C,"class","clearfix m-t-base")},m(L,F){S(L,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,p),b(l,h),b(l,g),b(l,_),b(l,y),b(l,k),b(l,T),b(l,$),b(e,M),b(e,C),E=!0},p(L,F){var N;(!E||F&1)&&a!==(a=(N=L[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!E||F&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(p,d)},i(L){E||(L&&et(()=>{E&&(O||(O=qe(e,Mt,{duration:150},!0)),O.run(1))}),E=!0)},o(L){L&&(O||(O=qe(e,Mt,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&w(e),L&&O&&O.end()}}}function Sh(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[TA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[$A,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[CA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[MA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[OA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),k=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[DA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),a=v("div"),V(u.$$.fragment),f=D(),c=v("div"),V(d.$$.fragment),p=D(),h=v("div"),V(g.$$.fragment),_=D(),y=v("div"),V(k.$$.fragment),T=D(),$=v("div"),m(t,"class","col-lg-6"),m(l,"class","col-lg-3"),m(a,"class","col-lg-3"),m(c,"class","col-lg-6"),m(h,"class","col-lg-6"),m(y,"class","col-lg-12"),m($,"class","col-lg-12"),m(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),b(e,a),q(u,a,null),b(e,f),b(e,c),q(d,c,null),b(e,p),b(e,h),q(g,h,null),b(e,_),b(e,y),q(k,y,null),b(e,T),b(e,$),C=!0},p(O,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:O}),d.$set(N);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:O}),g.$set(R);const z={};E&100663298&&(z.$$scope={dirty:E,ctx:O}),k.$set(z)},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(g.$$.fragment,O),A(k.$$.fragment,O),O&&et(()=>{C&&(M||(M=qe(e,Mt,{duration:150},!0)),M.run(1))}),C=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(u.$$.fragment,O),I(d.$$.fragment,O),I(g.$$.fragment,O),I(k.$$.fragment,O),O&&(M||(M=qe(e,Mt,{duration:150},!1)),M.run(0)),C=!1},d(O){O&&w(e),j(i),j(o),j(u),j(d),j(g),j(k),O&&M&&M.end()}}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Endpoint"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.endpoint),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Bucket"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.bucket),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&ue(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function CA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Region"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.region),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.region&&ue(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function MA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Access key"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.accessKey),r||(a=K(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554 Line truncated
<span class="txt">S3 connected successfully</span>`,m(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function AA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=De(t=ze.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function IA(n){let e;return{c(){e=v("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function $h(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),b(e,t),i||(s=K(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function PA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[wA,kA],k=[];function T($,M){return $[2]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[7]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),p.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[20])),g=!0)},p($,M){(!h||M&128)&&le(o,$[7]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function LA(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const oo="s3_test_request";function NA(n,e,t){let i,s,l;We(n,Ot,N=>t(7,l=N)),Gt(Ot,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;p();async function p(){t(2,a=!0);try{const N=await me.settings.getAll()||{};g(N)}catch(N){me.errorResponseHandler(N)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(oo);const N=await me.settings.update(H.filterRedactedProps(r));_n({}),await g(N),Oa(),c?Zv("Successfully saved but failed to establish S3 connection."):Ut("Successfully saved files storage settings.")}catch(N){me.errorResponseHandler(N)}t(3,u=!1)}}async function g(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await y()}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await y()}async function y(){if(t(5,c=null),!!r.s3.enabled){me.cancelRequest(oo),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(oo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:oo})}catch(N){t(5,c=N)}t(4,f=!1),clearTimeout(d)}}Qt(()=>()=>{clearTimeout(d)});function k(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function $(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function O(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>_(),L=()=>h(),F=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,_,i,k,T,$,M,C,O,E,P,L,F]}class FA extends ve{constructor(e){super(),be(this,e,NA,LA,_e,{})}}function RA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[21]),m(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&m(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function qA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Client ID"),s=D(),l=v("input"),m(e,"for",i=n[21]),m(l,"type","text"),m(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),b(e,t),S(f,s,c),S(f,l,c),ue(l,n[0].clientId),a||(u=K(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&m(e,"for",i),c&2097152&&o!==(o=f[21])&&m(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&ue(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function jA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new ou({props:u}),se.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Client secret"),s=D(),V(l.$$.fragment),m(e,"for",i=n[21])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&m(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function Ch(n){let e,t,i,s;function l(a){n[16](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=$t(o,r(n)),se.push(()=>ge(t,"config",l))),{c(){e=v("div"),t&&V(t.$$.fragment),m(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&q(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],ke(()=>i=!1)),u&16&&o!==(o=a[4])){if(t){re();const c=t;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(t=$t(o,r(a)),se.push(()=>ge(t,"config",l)),V(t.$$.fragment),A(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&I(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}fuLine truncated
another PocketBase environment.</p>`,t=D(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),V(o.$$.fragment),r=D(),a=v("div"),u=v("div"),f=D(),c=v("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,m(e,"class","content txt-xl m-b-base"),m(s,"type","button"),m(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),m(i,"tabindex","0"),m(i,"class","export-preview svelte-jm5c4z"),m(u,"class","flex-fill"),m(c,"type","button"),m(c,"class","btn btn-expanded"),m(a,"class","flex m-t-base")},m(g,_){S(g,e,_),S(g,t,_),S(g,i,_),b(i,s),b(i,l),q(o,i,null),n[8](i),S(g,r,_),S(g,a,_),b(a,u),b(a,f),b(a,c),d=!0,p||(h=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],p=!0)},p(g,_){const y={};_&4&&(y.content=g[2]),o.$set(y)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){I(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),j(o),n[8](null),g&&w(r),g&&w(a),p=!1,Ae(h)}}}function r6(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function a6(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[r6,o6],h=[];function g(_,y){return _[1]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[3]),r=D(),a=v("div"),u=v("div"),c.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&le(o,_[3]);let k=f;f=g(_),f===k?h[f].p(_,y):(re(),I(h[k],1,1,()=>{h[k]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=p[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function u6(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[a6]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function f6(n,e,t){let i,s;We(n,Ot,_=>t(3,s=_)),Gt(Ot,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){me.errorResponseHandler(_)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function c(){H.copyToClipboard(i),Vg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function p(_){se[_?"unshift":"push"](()=>{o=_,t(0,o)})}const h=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),k=document.createRange();k.selectNodeContents(o),y.removeAllRanges(),y.addRange(k)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,p,h,g]}class c6 extends ve{constructor(e){super(),be(this,e,f6,u6,_e,{})}}function Rh(n,e,t){const i=n.slice();return i[14]=e[t],i}function qh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Vh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Hh(n,e,t){const i=n.slice();return i[14]=e[t],i}function zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Bh(n,e,t){const i=n.slice();return i[30]=e[t],i}function d6(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Uh(),a=n[0].name!==n[1].name&&Wh(n);return{c(){e=v("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=v("strong"),o=B(l),m(s,"class","txt"),m(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=Uh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Wh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function p6(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=D(),i=v("strong"),l=B(s),m(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function m6(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=D(),i=v("strong"),l=B(s),m(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),b(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function Uh(n){let e;return{c(){e=v("span"),e.textContent="Changed",m(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wh(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=D(),l=v("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),b(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Yh(n){var _,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((_=n[0])==null?void Line truncated
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=v("tbody");for(let $=0;$<h.length;$+=1)h[$].c();r=D(),g&&g.c(),a=D();for(let $=0;$<y.length;$+=1)y[$].c();u=D();for(let $=0;$<T.length;$+=1)T[$].c();m(e,"class","section-title"),m(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){S($,e,M),d.m(e,null),S($,t,M),S($,i,M),b(i,s),b(i,l),b(i,o);for(let C=0;C<h.length;C+=1)h[C]&&h[C].m(o,null);b(o,r),g&&g.m(o,null),b(o,a);for(let C=0;C<y.length;C+=1)y[C]&&y[C].m(o,null);b(o,u);for(let C=0;C<T.length;C+=1)T[C]&&T[C].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){p=$[11];let C;for(C=0;C<p.length;C+=1){const O=Bh($,p,C);h[C]?h[C].p(O,M):(h[C]=Yh(O),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=p.length}if($[2]||$[5]?g?g.p($,M):(g=Kh($),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){_=$[7];let C;for(C=0;C<_.length;C+=1){const O=jh($,_,C);y[C]?y[C].p(O,M):(y[C]=Qh(O),y[C].c(),y[C].m(o,u))}for(;C<y.length;C+=1)y[C].d(1);y.length=_.length}if(M[0]&4352){k=$[8];let C;for(C=0;C<k.length;C+=1){const O=Rh($,k,C);T[C]?T[C].p(O,M):(T[C]=e_(O),T[C].c(),T[C].m(o,null))}for(;C<T.length;C+=1)T[C].d(1);T.length=k.length}},i:X,o:X,d($){$&&w(e),d.d(),$&&w(t),$&&w(i),at(h,$),g&&g.d(),at(y,$),at(T,$)}}}function An(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function cn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function _6(n,e,t){let i,s,l,{collectionA:o=new hn}=e,{collectionB:r=new hn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],p=[];const h=Object.keys(new hn().export()).filter(y=>!["schema","created","updated"].includes(y));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(k=>y.id==k.id))))}function _(y){return typeof y>"u"?"":H.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(k=>y.id==k.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(k=>k.id==y.id))),n.$$.dirty[0]&24&&t(8,p=f.filter(y=>!u.find(k=>k.id==y.id))),n.$$.dirty[0]&7&&t(9,l=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,p,l,s,h,_]}class g6 extends ve{constructor(e){super(),be(this,e,_6,h6,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function t_(n,e,t){const i=n.slice();return i[17]=e[t],i}function n_(n){let e,t;return e=new g6({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function b6(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=n_(t_(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=we()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=t_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=n_(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){at(s,o),o&&w(e)}}}function v6(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function y6(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("span"),l.textContent="Confirm and import",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[4],m(l,"class","txt"),m(s,"type","button"),m(s,"class","btn btn-expanded"),s.disabled=n[4],Q(s,"btn-loading",n[4])},m(a,u){S(a,e,u),b(e,t),S(a,i,u),S(a,s,u),b(s,l),o||(r=[K(e,"click",n[0]),K(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&Q(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Ae(r)}}}function k6(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[y6],header:[v6],default:[b6]},$$scope:{ctx:n}};return e=new bn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function w6(n,e,tLine truncated
- ${$.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),Ut("Successfully imported collections configuration."),i("submit")}catch($){me.errorResponseHandler($)}t(4,u=!1),c()}}const g=()=>p(),_=()=>!u;function y($){se[$?"unshift":"push"](()=>{s=$,t(1,s)})}function k($){de.call(this,n,$)}function T($){de.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,p,f,l,o,g,_,y,k,T]}class S6 extends ve{constructor(e){super(),be(this,e,w6,k6,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function i_(n,e,t){const i=n.slice();return i[32]=e[t],i}function s_(n,e,t){const i=n.slice();return i[35]=e[t],i}function l_(n,e,t){const i=n.slice();return i[32]=e[t],i}function T6(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[C6,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&r_(),L=n[6]&&n[1].length&&n[7]&&a_(n),F=n[13].length&&v_(n),N=!!n[0]&&y_(n);return{c(){e=v("input"),t=D(),i=v("div"),s=v("p"),l=B(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),V(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),L&&L.c(),d=D(),F&&F.c(),p=D(),h=v("div"),N&&N.c(),g=D(),_=v("div"),y=D(),k=v("button"),T=v("span"),T.textContent="Review",m(e,"type","file"),m(e,"class","hidden"),m(e,"accept",".json"),m(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),m(i,"class","content txt-xl m-b-base"),m(_,"class","flex-fill"),m(T,"class","txt"),m(k,"type","button"),m(k,"class","btn btn-expanded btn-warning m-l-auto"),k.disabled=$=!n[14],m(h,"class","flex m-t-base")},m(R,z){S(R,e,z),n[19](e),S(R,t,z),S(R,i,z),b(i,s),b(s,l),b(s,o),S(R,r,z),q(a,R,z),S(R,u,z),S(R,f,z),P&&P.m(R,z),S(R,c,z),L&&L.m(R,z),S(R,d,z),F&&F.m(R,z),S(R,p,z),S(R,h,z),N&&N.m(h,null),b(h,g),b(h,_),b(h,y),b(h,k),b(k,T),M=!0,C||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(k,"click",n[26])],C=!0)},p(R,z){(!M||z[0]&4096)&&Q(o,"btn-loading",R[12]);const W={};z[0]&64&&(W.class="form-field "+(R[6]?"":"field-error")),z[0]&65|z[1]&1536&&(W.$$scope={dirty:z,ctx:R}),a.$set(W),R[6]&&R[1].length&&!R[7]?P||(P=r_(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),R[6]&&R[1].length&&R[7]?L?L.p(R,z):(L=a_(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?F?F.p(R,z):(F=v_(R),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),R[0]?N?N.p(R,z):(N=y_(R),N.c(),N.m(h,g)):N&&(N.d(1),N=null),(!M||z[0]&16384&&$!==($=!R[14]))&&(k.disabled=$)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){I(a.$$.fragment,R),I(E),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),P&&P.d(R),R&&w(c),L&&L.d(R),R&&w(d),F&&F.d(R),R&&w(p),R&&w(h),N&&N.d(),C=!1,Ae(O)}}}function $6(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function o_(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",m(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function C6(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&o_();return{c(){e=v("label"),t=B("Collections"),s=D(),l=v("textarea"),r=D(),c&&c.c(),a=we(),m(e,"for",i=n[40]),m(e,"class","p-b-10"),m(l,"id",o=n[40]),m(l,"class","code"),m(l,"spellcheck","false"),m(l,"rows","15"),l.required=!0},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0]),S(d,r,p),c&&c.m(d,p),S(d,a,p),u||(f=K(l,"input",n[22]),u=!0)},p(d,p){p[1]&512&&i!==(i=d[40])&&m(e,"for",i),p[1]&512&&o!==(o=d[40])&&m(l,"id",o),p[0]&1&&ue(l,d[0]),d[0]&&!d[6]?c||(c=o_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function r_(n){let e;return{c(){e=v("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>`,m(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function a_(n){let e,t,i,s,l,o=n[9].length&&u_(n),r=n[4].length&&d_(n),a=n[8].length&&__(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=D(),i=v("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),m(e,"class","section-title"),m(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=u_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=d_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=__(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function u_(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=l_(n,s,o),a=l(r);t.set(a,e[o]=c_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=Ct(e,r,l,1,o,s,t,i.parentNode,ns,c_,i,l_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function f_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function c_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&f_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=D(),l=v("strong"),r=B(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-danger list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),b(t,i),b(t,s),b(t,l),b(l,r),b(t,a),f&&f.m(t,null),b(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=f_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function d_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=s_(n,s,o),a=l(r);t.set(a,e[o]=h_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=Ct(e,r,l,1,o,s,t,i.parentNode,ns,h_,i,s_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function p_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=D(),l=v("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),b(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function m_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function h_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&p_(e),p=e[35].new.id&&m_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=D(),l=v("div"),d&&d.c(),o=D(),r=v("strong"),u=B(a),f=D(),p&&p.c(),c=D(),m(i,"class","label label-warning list-label svelte-1jx20fl"),m(l,"class","inline-flex flex-gap-5"),m(t,"class","list-item"),this.first=t},m(h,g){S(h,t,g),b(t,i),b(t,s),b(t,l),d&&d.m(l,null),b(l,o),b(l,r),b(r,u),b(l,f),p&&p.m(l,null),b(t,c)},p(h,g){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=p_(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?p?p.p(e,g):(p=m_(e),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},d(h){h&&w(t),d&&d.d(),p&&p.d()}}}function __(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=i_(n,s,o),a=l(r);t.set(a,e[o]=b_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=Ct(e,r,l,1,o,s,t,i.parentNode,ns,b_,i,i_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function g_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function b_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&g_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Added",s=D(),l=v("strong"),r=B(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-success list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),b(t,i),b(t,s),b(t,l),b(l,r),b(t,a),f&&f.m(t,null),b(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=g_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function v_(n){let e,t,i,s,l,o,r,a;return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),s.innerHTML=`<string>Some of the imported collections share the same name and/or fields but are
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',m(t,"class","icon"),m(s,"class","content"),m(o,"type","button"),m(o,"class","btn btn-warning btn-sm btn-outline"),m(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function y_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function M6(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[$6,T6],h=[];function g(_,y){return _[5]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[15]),r=D(),a=v("div"),u=v("div"),c.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&le(o,_[15]);let k=f;f=g(_),f===k?h[f].p(_,y):(re(),I(h[k],1,1,()=>{h[k]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=p[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function O6(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[M6]},$$scope:{ctx:n}}});let r={};return l=new S6({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function D6(n,e,t){let i,s,l,o,r,a,u;We(n,Ot,G=>t(15,u=G)),Gt(Ot,u="Import collections",u);let f,c,d="",p=!1,h=[],g=[],_=!0,y=[],k=!1;T();async function T(){t(5,k=!0);try{t(2,g=await me.collections.getFullList(200));for(let G of g)delete G.created,delete G.updated}catch(G){me.errorResponseHandler(G)}t(5,k=!1)}function $(){if(t(4,y=[]),!!i)for(let G of h){const fe=H.findByKey(g,"id",G.id);!(fe!=null&&fe.id)||!H.hasCollectionChanges(fe,G,_)||y.push({new:G,old:fe})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let G of h)delete G.created,delete G.updated,G.schema=H.filterDuplicatesByKey(G.schema)}function C(){var G,fe;for(let Z of h){const ce=H.findByKey(g,"name",Z.name)||H.findByKey(g,"id",Z.id);if(!ce)continue;const he=Z.id,Ce=ce.id;Z.id=Ce;const Re=Array.isArray(ce.schema)?ce.schema:[],je=Array.isArray(Z.schema)?Z.schema:[];for(const ye of je){const $e=H.findByKey(Re,"name",ye.name);$e&&$e.id&&(ye.id=$e.id)}for(let ye of h)if(Array.isArray(ye.schema))for(let $e of ye.schema)(G=$e.options)!=null&&G.collectionId&&((fe=$e.options)==null?void 0:fe.collectionId)===he&&($e.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function O(G){t(12,p=!0);const fe=new FileReader;fe.onload=async Z=>{t(12,p=!1),t(10,f.value="",f),t(0,d=Z.target.result),await rn(),h.length||(pl("Invalid collections configuration."),E())},fe.onerror=Z=>{console.warn(Z),pl("Failed to load the imported JSON."),t(12,p=!1),t(10,f.value="",f)},fe.readAsText(G)}function E(){t(0,d=""),t(10,f.value="",f),_n({})}function P(G){se[G?"unshift":"push"](()=>{f=G,t(10,f)})}const L=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const z=()=>C(),W=()=>E(),J=()=>c==null?void 0:c.show(g,h,_);function x(G){se[G?"unshift":"push"](()=>{c=G,t(11,c)})}const ne=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(G=>i&&_&&!H.findByKey(h,"id",G.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(G=>i&&!H.findByKey(g,"id",G.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof _<"u")&&$(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!k&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(G=>{let fe=H.findByKey(g,"name",G.name)||H.findByKey(g,"id",G.id);if(!fe)return!1;if(fe.id!=G.id)return!0;const Z=Array.isArray(fe.schema)?fe.schema:[],ce=Array.isArray(G.schema)?G.schema:[];for(const he of ce){if(H.findByKey(Z,"id",he.id))continue;const Re=H.findByKey(Z,"name",he.name);if(Re&&he.id!=Re.id)return!0}return!1}))},[d,h,g,_,y,k,i,o,l,s,f,c,p,a,r,u,C,O,E,P,L,F,N,R,z,W,J,x,ne]}class E6 extends ve{constructor(e){super(),be(this,e,D6,O6,_e,{},null,[-1,-1])}}const Ht=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ei("/"):!0}],A6={"/login":Nt({component:CE,conditions:Ht.coLine truncated
<span class="txt">Manage admins</span>`,t=D(),i=v("hr"),s=D(),l=v("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,m(e,"href","/settings/admins"),m(e,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[De(nn.call(null,e)),K(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Ae(r)}}}function Y6(n){var p;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((p=n[0])==null?void 0:p.id)&&n[1]&&S_(n);return o=new Ib({props:{routes:A6}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new j6({}),f=new U6({}),{c(){t=D(),i=v("div"),d&&d.c(),s=D(),l=v("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),m(l,"class","app-body"),m(i,"class","app-layout")},m(h,g){S(h,t,g),S(h,i,g),d&&d.m(i,null),b(i,s),b(i,l),q(o,l,null),b(l,r),q(a,l,null),S(h,u,g),q(f,h,g),c=!0},p(h,[g]){var _;(!c||g&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(_=h[0])!=null&&_.id&&h[1]?d?(d.p(h,g),g&3&&A(d,1)):(d=S_(h),d.c(),A(d,1),d.m(i,s)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){I(d),I(o.$$.fragment,h),I(a.$$.fragment,h),I(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function K6(n,e,t){let i,s,l,o;We(n,Cs,p=>t(8,i=p)),We(n,ko,p=>t(2,s=p)),We(n,Ea,p=>t(0,l=p)),We(n,Ot,p=>t(3,o=p));let r,a=!1;function u(p){var h,g,_,y;((h=p==null?void 0:p.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((_=(g=p==null?void 0:p.detail)==null?void 0:g.userData)!=null&&_.showAppSidebar)),r=(y=p==null?void 0:p.detail)==null?void 0:y.location,Gt(Ot,o="",o),_n({}),U1())}function f(){Ei("/")}async function c(){var p,h;if(l!=null&&l.id)try{const g=await me.settings.getAll({$cancelKey:"initialAppSettings"});Gt(ko,s=((p=g==null?void 0:g.meta)==null?void 0:p.appName)||"",s),Gt(Cs,i=!!((h=g==null?void 0:g.meta)!=null&&h.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){me.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class J6 extends ve{constructor(e){super(),be(this,e,K6,Y6,_e,{})}}new J6({target:document.getElementById("app")});export{Ae as A,Ut as B,H as C,Ei as D,we as E,zg as F,va as G,gu as H,We as I,Pi as J,vt as K,Qt as L,se as M,H1 as N,Ct as O,ns as P,an as Q,hn as R,ve as S,Nr as T,I as a,D as b,V as c,j as d,v as e,m as f,S as g,b as h,be as i,De as j,re as k,nn as l,q as m,ae as n,w as o,me as p,pe as q,Q as r,_e as s,A as t,K as u,ft as v,B as w,le as x,X as y,ue as z};
-204
View File
@@ -1,204 +0,0 @@
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function G(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function eb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function h_(n){return n()}function ru(){return Object.create(null)}function Pe(n){n.forEach(h_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function zn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function tb(n){return Object.keys(n).length===0}function __(n,...e){if(n==null)return G;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(__(e,t))}function Nt(n,e,t,i){if(n){const s=g_(n,e,t,i);return n[0](s)}}function g_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Rt(n,e,t,i,s,l){if(s){const o=g_(e,t,i,l);n.p(o,s)}}function qt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Qn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function At(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Si(n){return n??""}function Kt(n,e,t){return n.set(t),e}function Ie(n){return n&&Bt(n.destroy)?n.destroy:G}const b_=typeof window<"u";let Fo=b_?()=>window.performance.now():()=>Date.now(),pa=b_?n=>requestAnimationFrame(n):G;const bs=new Set;function v_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&pa(v_)}function Ro(n){let e;return bs.size===0&&pa(v_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function y_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function nb(n){const e=b("style");return ib(y_(n),e),e.sheet}function ib(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function pt(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 H(n){return document.createTextNode(n)}function O(){return H(" ")}function Ce(){return H("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function mt(n){return n===""?null:+n}function sb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function re(n,e){n.value=e??""}function Nr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function k_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Vt(n,e){return new n(e)}const mo=new Map;let ho=0;function lb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function ob(n,e){const t={stylesheet:nb(e),rules:{}};return mo.set(n,t),t}function al(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${lb(f)}_${r}`,d=y_(n),{stylesheet:m,rules:h}=mo.get(d)||ob(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function ul(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||rb())}function rb(){pa(()=>{ho||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),mo.clear())})}function ab(n,e,t,i){if(!e)return G;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return G;const{delay:l=0,duration:o=300,easing:r=kl,start:a=Fo()+l,end:u=a+o,tick:f=G,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function _(){c&&(h=al(n,0,1,o,l,r,c)),l||(m=!0)}function v(){c&&ul(n,h),d=!1}return Ro(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),v()),!d)return!1;if(m){const y=k-a,$=0+1*r(y/o);f($,1-$)}return!0}),_(),f(0,1),v}function ub(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,w_(n,s)}}function w_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let fl;function oi(n){fl=n}function wl(){if(!fl)throw new Error("Function called outside component initialization");return fl}function Zt(n){wl().$$.on_mount.push(n)}function fb(n){wl().$$.after_update.push(n)}function S_(n){wl().$$.on_destroy.push(n)}function Ct(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=k_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function He(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],se=[],oo=[],Fr=[],$_=Promise.resolve();let Rr=!1;function T_(){Rr||(Rr=!0,$_.then(ma))}function sn(){return T_(),$_}function Ge(n){oo.push(n)}function ke(n){Fr.push(n)}const tr=new Set;let fs=0;function ma(){if(fs!==0)return;const n=fl;do{try{for(;fs<_s.length;){const e=_s[fs];fs++,oi(e),cb(e.$$)}}catch(e){throw _s.length=0,fs=0,e}for(oi(null),_s.length=0,fs=0;se.length;)se.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];tr.has(t)||(tr.add(t),t())}oo.length=0}while(_s.length);for(;Fr.length;)Fr.pop()();Rr=!1,tr.clear(),oi(n)}function cb(n){if(n.fragment!==null){n.update(),Pe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ge)}}let qs;function ha(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function Ki(n,e,t){n.dispatchEvent(k_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function ae(){Jn={r:0,c:[],p:Jn}}function ue(){Jn.r||Pe(Jn.c),Jn=Jn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const _a={duration:0};function C_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ul(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:_=G,css:v}=s||_a;v&&(o=al(n,0,1,m,d,h,v,a++)),_(0,1);const k=Fo()+d,y=k+m;r&&r.abort(),l=!0,Ge(()=>Ki(n,!0,"start")),r=Ro($=>{if(l){if($>=y)return _(1,0),Ki(n,!0,"end"),u(),l=!1;if($>=k){const T=h(($-k)/m);_(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,ul(n),Bt(s)?(s=s(i),ha().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function M_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=G,css:m}=s||_a;m&&(o=al(n,1,0,f,u,c,m));const h=Fo()+u,_=h+f;Ge(()=>Ki(n,!1,"start")),Ro(v=>{if(l){if(v>=_)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?ha().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&ul(n,o),l=!1)}}}function qe(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&ul(n,u)}function c(m,h){const _=m.b-o;return h*=Math.abs(_),{a:o,b:m.b,d:_,duration:h,start:m.start,end:m.start+h,group:m.group}}function d(m){const{delay:h=0,duration:_=300,easing:v=kl,tick:k=G,css:y}=l||_a,$={start:Fo()+h,b:m};m||($.group=Jn,Jn.r+=1),r||a?a=$:(y&&(f(),u=al(n,o,m,_,h,v,y)),m&&k(0,1),r=c($,_),Ge(()=>Ki(n,m,"start")),Ro(T=>{if(a&&T>a.start&&(r=c(a,_),a=null,Ki(n,r.b,"start"),y&&(f(),u=al(n,o,r.b,r.duration,0,v,l.css))),r){if(T>=r.end)k(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?f():--r.group.r||Pe(r.group.c)),r=null;else if(T>=r.start){const M=T-r.start;o=r.a+r.d*v(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Bt(l)?ha().then(()=>{l=l(s),d(m)}):d(m)},end(){f(),r=a=null}}}function au(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e Line truncated
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=O(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function zv(n){let e,t,i,s=!n[0]&&Hu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=O(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Hu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):qt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Bv(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[zv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Uv(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Ng extends be{constructor(e){super(),ge(this,e,Uv,Bv,he,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Pn(n,{delay:e=0,duration:t=400,easing:i=Uo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function St(n,{delay:e=0,duration:t=400,easing:i=Uo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Uo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function zu(n,e,t){const i=n.slice();return i[11]=e[t],i}const Wv=n=>({}),Bu=n=>({uniqueId:n[3]});function Yv(n){let e=(n[11]||yo)+"",t;return{c(){t=H(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||yo)+"")&&le(t,e)},d(i){i&&w(t)}}}function Kv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||yo)+"",i;return{c(){e=b("pre"),i=H(t)},m(o,r){S(o,e,r),g(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||yo)+"")&&le(i,t)},d(o){o&&w(e)}}}function Uu(n){let e,t,i,s;function l(a,u){return typeof a[11]=="object"?Kv:Yv}let o=l(n),r=o(n);return{c(){e=b("div"),r.c(),t=O(),p(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),r.m(e,null),g(e,t),s=!0},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(e,t)))},i(a){s||(a&&Ge(()=>{i||(i=qe(e,St,{duration:150},!0)),i.run(1)}),s=!0)},o(a){a&&(i||(i=qe(e,St,{duration:150},!1)),i.run(0)),s=!1},d(a){a&&w(e),r.d(),a&&i&&i.end()}}}function Jv(n){let e,t,i,s,l;const o=n[8].default,r=Nt(o,n,n[7],Bu);let a=n[2],u=[];for(let c=0;c<a.length;c+=1)u[c]=Uu(zu(n,a,c));const f=c=>P(u[c],1,1,()=>{u[c]=null});return{c(){e=b("div"),r&&r.c(),t=O();for(let c=0;c<u.length;c+=1)u[c].c();p(e,"class",n[0]),Q(e,"error",n[2].length)},m(c,d){S(c,e,d),r&&r.m(e,null),g(e,t);for(let m=0;m<u.length;m+=1)u[m].m(e,null);n[10](e),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p(c,[d]){if(r&&r.p&&(!i||d&128)&&Rt(r,o,c,c[7],i?Ft(o,c[7],d,Wv):qt(c[7]),Bu),d&4){a=c[2];let m;for(m=0;m<a.length;m+=1){const h=zu(c,a,m);u[m]?(u[m].p(h,d),A(u[m],1)):(u[m]=Uu(h),u[m].c(),A(u[m],1),u[m].m(e,null))}for(ae(),m=a.length;m<u.length;m+=1)f(m);ue()}(!i||d&1)&&p(e,"class",c[0]),(!i||d&5)&&Q(e,"error",c[2].length)},i(c){if(!i){A(r,c);for(let d=0;d<a.length;d+=1)A(u[d]);i=!0}},o(c){P(r,c),u=u.filter(Boolean);for(let d=0;d<u.length;d+=1)P(u[d]);i=!1},d(c){c&&w(e),r&&r.d(c),pt(u,c),n[10](null),s=!1,l()}}}const yo="Invalid value";function Zv(n,e,t){let i;Ye(n,fi,h=>t(6,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Qi(r)}Zt(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){He.call(this,n,h)}function m(h){se[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(7,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&80&&t(2,f=z.toArray(z.getNestedVal(i,r)))},[a,u,f,o,r,c,i,l,s,d,m]}class pe extends be{constructor(e){super(),ge(this,e,Zv,Jv,he,{name:4,class:0,changed:5})}get changed(){return this.$$.ctx[5]}}function Gv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Email"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Xv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=H("Password"),s=O(),l=b("input"),r=O(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[1]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&re(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function Qv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Password confirm"),s=O(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function xv(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Gv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[Xv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Qv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),f=b("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){S(h,e,_),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),q(a,e,null),g(e,u),g(e,f),c=!0,d||(m=Y(e,"submit",ft(n[4])),d=!0)},p(h,[_]){const v={};_&1537&&(v.$$scope={dirty:_,ctx:h}),s.$set(v);const k={};_&1538&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&1540&&(y.$$scope={dirty:_,ctx:h}),a.$set(y),(!c||_&8)&&Q(f,"btn-disabled",h[3]),(!c||_&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,m()}}}function ey(n,e,t){const i=Ct();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(d){me.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class ty extends be{constructor(e){super(),ge(this,e,ey,xv,he,{})}}function Wu(n){let e,t;return e=new Ng({props:{$$slots:{default:[ny]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ny(n){let e,t;return e=new ty({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:G,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function iy(n){let e,t,i=n[0]&&Wu(n);return{c(){i&&i.c(),e=Ce()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Wu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function sy(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Di("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class ly extends be{constructor(e){super(),ge(this,e,sy,iy,he,{})}}const $t=Fn(""),ko=Fn(""),Cs=Fn(!1);function oy(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),re(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&re(e,l[7])},i:G,o:G,d(l){l&&w(e),n[13](null),i=!1,s()}}}function ry(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Vt(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Vt(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Yu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Ku();return{c(){r&&r.c(),e=O(),t=b("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Ku(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(ae(),P(r,1,1,()=>{r=null}),ue())},i(a){s||(A(r),a&&Ge(()=>{i||(i=qe(t,Pn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=qe(t,Pn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Ku(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,Pn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function ay(n){let e,t,i,s,l,o,r,a,u,f;const c=[ry,oy],d=[];function m(_,v){return _[4]&&!_[5]?0:1}l=m(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&Yu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=O(),o.c(),r=O(),h&&h.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(_,v){S(_,e,v),g(e,t),g(t,i),g(e,s),d[l].m(e,null),g(e,r),h&&h.m(e,null),aLine truncated
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function $y(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="url",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Ty(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="referer",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Cy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="User IP",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function My(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="status",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Dy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Qu(n){let e;function t(l,o){return l[6]?Ey:Oy}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function Oy(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&xu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=xu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Ey(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function xu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function ef(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function tf(n,e){var Se,We,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,h,_,v,k,y=(e[23].referer||"N/A")+"",$,T,M,C,D,E=(e[23].userIp||"N/A")+"",I,L,F,N,R,K=e[23].status+"",x,U,X,ne,J,fe,Z,de,ve,Te,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&ef();ne=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function ye(...ce){return e[18](e[23],...ce)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("span"),o=H(l),a=O(),u=b("td"),f=b("span"),d=H(c),h=O(),Ne&&Ne.c(),_=O(),v=b("td"),k=b("span"),$=H(y),M=O(),C=b("td"),D=b("span"),I=H(E),F=O(),N=b("td"),R=b("span"),x=H(K),U=O(),X=b("td"),V(ne.$$.fragment),J=O(),fe=b("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',Z=O(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(k,"class","txt txt-ellipsis"),p(k,"title",T=e[23].referer),Q(k,"txt-hint",!e[23].referer),p(v,"class","col-type-text col-field-referer"),p(D,"class","txt txt-ellipsis"),p(D,"title",L=e[23].userIp),Q(D,"txt-hint",!e[23].userIp),p(C,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(N,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(fe,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ce,ze){S(ce,t,ze),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,h),Ne&&Ne.m(u,null),g(t,_),g(t,v),g(v,k),g(k,$),g(t,M),g(t,C),g(C,D),g(D,I),g(t,F),g(t,N),g(N,R),g(R,x),g(t,U),g(t,X),q(ne,X,null),g(t,J),g(t,fe),g(t,Z),de=!0,ve||(Te=[Y(t,"click",Re),Y(t,"keydown",ye)],ve=!0)},p(ce,ze){var Fe,ot,Ht;e=ce,(!de||ze&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||ze&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!de||ze&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||ze&8&&m!==(m=e[23].url))&&p(f,"title",m),(ot=e[23].meta)!=null&&ot.errorMessage||(Ht=e[23].meta)!=null&&Ht.errorData?Ne||(Ne=ef(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||ze&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le($,y),(!de||ze&8&&T!==(T=e[23].referer))&&p(k,"title",T),(!de||ze&8)&&Q(k,"txt-hint",!e[23].referer),(!de||ze&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(I,E),(!de||ze&8&&L!==(L=e[23].userIp))&&p(D,"title",L),(!de||ze&8)&&Q(D,"txt-hint",!e[23].userIp),(!de||ze&8)&&K!==(K=e[23].status+"")&&le(x,K),(!de||ze&8)&&Q(R,"label-danger",e[23].status>=400);const te={};ze&8&&(te.date=e[23].created),ne.$set(te)},i(ce){de||(A(ne.$$.fragment,ce),de=!0)},o(ce){P(ne.$$.fragment,ce),de=!1},d(ce){ce&&w(t),Ne&&Ne.d(),j(ne),ve=!1,Pe(Te)}}}function Ay(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I=[],L=new Map,F;function N(ye){n[11](ye)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Sy]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),se.push(()=>_e(s,"sort",N));function K(ye){n[12](ye)}let x={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[$y]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),r=new Wt({props:x}),se.push(()=>_e(r,"sort",K));function U(ye){n[13](ye)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Ty]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new Wt({props:X}),se.push(()=>_e(f,"sort",U));function ne(ye){n[14](ye)}let J={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Cy]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),m=new Wt({props:J}),se.push(()=>_e(m,"sort",ne));function fe(ye){n[15](ye)}let Z={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[My]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),v=new Wt({props:Z}),se.push(()=>_e(v,"sort",fe));function de(ye){n[16](ye)}let ve={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Dy]},$$scope:{ctx:n}};n[1]!==void 0&&(ve.sort=n[1]),$=new Wt({props:ve}),se.push(()=>_e($,"sort",de));let Te=n[3];const Ne=ye=>ye[23].id;for(let ye=0;ye<Te.length;ye+=1){let Se=Xu(n,Te,ye),We=Ne(Se);L.set(We,I[ye]=tf(We,Se))}let Re=null;return Te.length||(Re=Qu(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),V(s.$$.fragment),o=O(),V(r.$$.fragment),u=O(),V(f.$$.fragment),d=O(),V(m.$$.fragment),_=O(),V(v.$$.fragment),y=O(),V($.$$.fragm Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function ni(){}const Ny=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function _t(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ke(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Mt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Cn(n,e){return Mt(n)?n:e}function Qe(n,e){return typeof n>"u"?e:n}const Fy=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Rg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ut(n,e,t,i){let s,l,o;if(_t(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ke(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(_t(n))return n.map(So);if(Ke(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function qg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ry(n,e,t,i){if(!qg(n))return;const s=e[n],l=t[n];Ke(s)&&Ke(l)?pl(s,l,i):e[n]=So(l)}function pl(n,e,t){const i=_t(e)?e:[e],s=i.length;if(!Ke(n))return n;t=t||{};const l=t.merger||Ry;for(let o=0;o<s;++o){if(e=i[o],!Ke(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function nl(n,e){return pl(n,e,{merger:qy})}function qy(n,e,t){if(!qg(n))return;const i=e[n],s=t[n];Ke(i)&&Ke(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const lf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ti(n,e){return(lf[e]||(lf[e]=jy(e)))(n)}function jy(n){const e=Vy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Vy(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Pa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ln=n=>typeof n<"u",Ci=n=>typeof n=="function",of=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Hy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,dt=2*Tt,zy=dt+Tt,$o=Number.POSITIVE_INFINITY,By=Tt/180,kt=Tt/2,Bs=Tt/4,rf=Tt*2/3,En=Math.log10,Gn=Math.sign;function af(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(En(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Uy(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function Wy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function jg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Hn(n){return n*(Tt/180)}function La(n){return n*(180/Tt)}function uf(n){if(!Mt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Vg(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Tt&&(l+=dt),{angle:l,distance:s}}function Qr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Yy(n,e){return(n-e+zy)%dt-Tt}function bn(n){return(n%dt+dt)%dt}function ml(n,e,t,i){const s=bn(n),l=bn(e),o=bn(t),r=bn(l-s),a=bn(o-s),u=bn(s-l),f=bn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Yt(n,e,t){return Math.max(e,Math.min(t,n))}function Ky(n){return Yt(n,-32768,32767)}function hl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Na(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Yi=(n,e,t,i)=>Na(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Jy=(n,e,t)=>Na(n,t,i=>n[i][e]>=t);function Zy(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const Hg=["push","pop","shift","splice","unshift"];function Gy(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Hg.forEach(t=>{const i="_onData"+Pa(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function ff(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Hg.forEach(l=>{delete n[l]}),delete n._chartjs)}function zg(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const Bg=function(){return typeof window>"u"?function(n){return n()}:window.requestLine truncated
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Ol(n){return n+.5|0}const bi=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return bi(Ol(n*2.55),0,255)}function wi(n){return bi(Ol(n*255),0,255)}function li(n){return bi(Ol(n/2.55)/100,0,1)}function mf(n){return bi(Ol(n*100),0,100)}const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},xr=[..."0123456789ABCDEF"],xy=n=>xr[n&15],e2=n=>xr[(n&240)>>4]+xr[n&15],Wl=n=>(n&240)>>4===(n&15),t2=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function n2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Tn[n[1]]*17,g:255&Tn[n[2]]*17,b:255&Tn[n[3]]*17,a:e===5?Tn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Tn[n[1]]<<4|Tn[n[2]],g:Tn[n[3]]<<4|Tn[n[4]],b:Tn[n[5]]<<4|Tn[n[6]],a:e===9?Tn[n[7]]<<4|Tn[n[8]]:255})),t}const i2=(n,e)=>n<255?e(n):"";function s2(n){var e=t2(n)?xy:e2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+i2(n.a,e):void 0}const l2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Kg(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function o2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function r2(n,e,t){const i=Kg(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function a2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Fa(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=a2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ra(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(wi)}function qa(n,e,t){return Ra(Kg,n,e,t)}function u2(n,e,t){return Ra(r2,n,e,t)}function f2(n,e,t){return Ra(o2,n,e,t)}function Jg(n){return(n%360+360)%360}function c2(n){const e=l2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):wi(+e[5]));const s=Jg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=u2(s,l,o):e[1]==="hsv"?i=f2(s,l,o):i=qa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function d2(n,e){var t=Fa(n);t[0]=Jg(t[0]+e),t=qa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function p2(n){if(!n)return;const e=Fa(n),t=e[0],i=mf(e[1]),s=mf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const hf={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"},_f={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function m2(){const n={},e=Object.keys(_f),t=Object.keys(hf);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s]Line truncated
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class _k{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Bg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ii=new _k;const Df="transparent",gk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=bf(n||Df),s=i.valid&&bf(e||Df);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class bk{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||gk[e.type||typeof o],this._easing=sl[e.easing]||sl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const vk=["x","y","borderWidth","radius","tension"],yk=["color","borderColor","backgroundColor"];xe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const kk=Object.keys(xe.animation);xe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});xe.set("animations",{colors:{type:"color",properties:yk},numbers:{type:"number",properties:vk}});xe.describe("animations",{_fallback:"animation"});xe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class u1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ke(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ke(s))return;const l={};for(const o of kk)l[o]=s[o];(_t(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Sk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&wk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new bk(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ii.add(this._chart,i),!0}}function wk(n,e){const t=[],Line truncated
`)>-1?n.split(`
`):n}function R3(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function lc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=vn(e.bodyFont),u=vn(e.titleFont),f=vn(e.footerFont),c=l.length,d=s.length,m=i.length,h=Nn(e.padding);let _=h.height,v=0,k=i.reduce((T,M)=>T+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const $=function(T){v=Math.max(v,t.measureText(T).width+y)};return t.save(),t.font=u.string,ut(n.title,$),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),$),y=e.displayColors?o+2+e.boxPadding:0,ut(i,T=>{ut(T.before,$),ut(T.lines,$),ut(T.after,$)}),y=0,t.font=f.string,ut(n.footer,$),t.restore(),v+=h.width,{width:v,height:_}}function q3(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function j3(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function V3(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),j3(u,n,e,t)&&(u="center"),u}function oc(n,e,t){const i=t.yAlign||e.yAlign||q3(n,t);return{xAlign:t.xAlign||e.xAlign||V3(n,e,t,i),yAlign:i}}function H3(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function z3(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function rc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=ys(o);let h=H3(e,r);const _=z3(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:Yt(h,0,i.width-e.width),y:Yt(_,0,i.height-e.height)}}function to(n,e,t){const i=Nn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function ac(n){return Kn([],si(n))}function B3(n,e,t){return Oi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function uc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class aa extends ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new u1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=B3(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}getBeforeBody(e,t){return ac(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=uc(i,l);Kn(o.before,si(r.beforeLabel.call(this,l))),Kn(o.lines,r.label.call(this,l)),Kn(o.after,si(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return ac(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(R3(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ut(r,f=>{const c=uc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;l Line truncated
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const fS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};m1._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return fS},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=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.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 gc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function cS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=H(n[1]),t=O(),s=H(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function dS(n){let e;return{c(){e=H("Loading...")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function pS(n){let e,t,i,s,l,o=n[2]&&gc();function r(f,c){return f[2]?dS:cS}let a=r(n),u=a(n);return{c(){e=b("div"),o&&o.c(),t=O(),i=b("canvas"),s=O(),l=b("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Nr(i,"height","250px"),Nr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=gc(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),P(o,1,1,()=>{o=null}),ue()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function mS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let h of m)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Io.register(Ei,Zo,Ko,eu,Pl,F3,U3),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class hS extends be{constructor(e){super(),ge(this,e,mS,pS,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var bc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ca={},_S={get exports(){return ca},set exports(n){ca=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function y($){return $ instanceof a?new a($.type,y($.content),$.alias):Array.isArray($)?$.map(y):$.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++l}),y.__id},clone:function y($,T){T=T||{};var M,C;switch(r.util.type($)){case"Object":if(C=r.util.objId($),T[C])return T[C];M={},T[C]=M;for(var D in $)$.hasOwnProperty(D)&&(M[D]=y($[D],T));return M;case"Array":return C=r.util.objId($),T[C]?T[C]:(M=[],T[C]=M,$.forEach(function(E,I){M[I]=y(E,T)}),M);default:return $}},getLanguage:function(y){for(;y;){var $=s.exec(y.className);if($)return $[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,$){y.className=y.className.replace(RegExp(s,"gi"),""),y.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(y){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==y)return $[T]}return null}},isActive:function(y,$,T){for(var M="no-"+$;y;){var C=y.classList;if(C.contains($))return!0;if(C.contains(M))return!1;y=y.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,$){var T=r.util.clone(r.languages[y]);for(var M in $)T[M]=$[M];return T},insertBefore:function(y,$,T,M){M=M||r.languages;var C=M[y],D={};for(var E in C)if(C.hasOwnProperty(E)){if(E==$)for(var I in T)T.hasOwnProperty(I)&&(D[I]=T[I]);T.hasOwnProperty(E)||(D[E]=C[E])}var L=M[y];return M[y]=D,r.languages.DFS(r.languages,function(F,N){N===L&&F!=y&&(this[F]=D)}),D},DFS:function y($,T,M,C){C=C||{};var D=r.util.objId;for(var E in $)if($.hasOwnProperty(E)){T.call($,E,$[E],M||E);var I=$[E],L=r.util.type(I);L==="Object"&&!C[D(I)]?(C[D(I)]=!0,y(I,T,null,C)):L==="Array"&&!C[D(I)]&&(C[D(I)]=!0,y(I,T,E,C))}}},plugins:{},highlightAll:function(y,$){r.highlightAllUnder(document,y,$)},highlightAllUnder:function(y,$,T){var M={callback:T,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var C=0,D;D=M.elements[C++];)r.highlightElement(D,$===!0,M.callback)},highlightElement:function(y,$,T){var M=r.util.getLanguage(y),C=r.languages[M];r.util.setLanguage(y,M);var D=y.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var E=y.textContent,I={element:y,language:M,grammar:C,code:E};function L(N){I.highlightedCode=N,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),T&&T.call(I.element)}if(r.hooks.run("before-sanity-check",I),D=I.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),T&&T.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if($&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(N){L(N.data)},F.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(y,$,T){var M={code:y,grammar:$,language:T};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(y,$){var T=$.rest;if(T){for(var M in T)$[M]=T[M];delete $.rest}var C=new c;return d(C,C.head,y),f(y,C,$,C.head,0),h(C)},hooks:{all:{},add:function(y,$){var T=r.hooks.all;T[y]=T[y]||[],T[y].push($)},run:function(y,$){var T=r.hooks.all[y];if(!(!T||!T.length))for(var M=0,C;C=T[M++];)C($)}},Token:a};i.Prism=r;function a(y,$,T,M){this.type=y,this.content=$,this.alias=T,this.length=(M||"").length|0}a.stringify=function y($,T){if(typeof $=="string")return $;if(Array.isArray($)){var M="";return $.forEach(function(L){M+=y(L,T)}),M}var C={type:$.type,content:y($.content,T),tag:"span",classes:["token",$.type],attributes:{},language:T},D=$.alias;D&&(Array.isArray(D)?Array.prototype.push.apply(C.classes,D):C.classes.push(D)),r.hooks.run("wrap",C);var E="";for(var I in C.attributes)E+=" "+I+'="'+(C.attributes[I]||"").replace(/"/g,"&quot;")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+E+">"+C.content+"</"+C.tag+">"};function u(y,$,T,M){y.lastIndex=$;var C=y.exec(T);if(C&&M&&C[1]){var D=C[1].length;C.index+=D,C[0]=C[0].slice(D)}return C}funLine truncated
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(I+1))}k.textContent=C,t.highlightElement(k)},function(C){v.setAttribute(r,f),k.textContent=C})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(c),y=0,$;$=k[y++];)t.highlightElement($)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(_S);const Zs=ca;var vc={},gS={get exports(){return vc},set exports(n){vc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var m=s(f[d]);c+=m,c>r&&(f[d]=`
`+f[d],c=m)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",h="",_=!1,v=0;v<d.length;++v){var k=d[v];k==o.element?_=!0:k.nodeName==="#text"&&(_?h+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--v)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+h,o.code=r.normalize(o.code,o.settings);else{var y=m+o.element.innerHTML+h;o.element.innerHTML=r.normalize(y,o.settings),o.code=o.element.textContent}}}})})()})(gS);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function bS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),g(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:G,o:G,d(s){s&&w(e)}}}function vS(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class L1 extends be{constructor(e){super(),ge(this,e,vS,bS,he,{class:0,content:2,language:3})}}const yS=n=>({}),yc=n=>({}),kS=n=>({}),kc=n=>({});function wc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$=n[4]&&!n[2]&&Sc(n);const T=n[19].header,M=Nt(T,n,n[18],kc);let C=n[4]&&n[2]&&$c(n);const D=n[19].default,E=Nt(D,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],yc);return{c(){e=b("div"),t=b("div"),s=O(),l=b("div"),o=b("div"),$&&$.c(),r=O(),M&&M.c(),a=O(),C&&C.c(),u=O(),f=b("div"),E&&E.c(),c=O(),d=b("div"),L&&L.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(F,N){S(F,e,N),g(e,t),g(e,s),g(e,l),g(l,o),$&&$.m(o,null),g(o,r),M&&M.m(o,null),g(o,a),C&&C.m(o,null),g(l,u),g(l,f),E&&E.m(f,null),n[21](f),g(l,c),g(l,d),L&&L.m(d,null),v=!0,k||(y=[Y(t,"click",ft(n[20])),Y(f,"scroll",n[22])],k=!0)},p(F,N){n=F,n[4]&&!n[2]?$?$.p(n,N):($=Sc(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!v||N[0]&262144)&&Rt(M,T,n,n[18],v?Ft(T,n[18],N,kS):qt(n[18]),kc),n[4]&&n[2]?C?C.p(n,N):(C=$c(n),C.c(),C.m(o,null)):C&&(C.d(1),C=null),E&&E.p&&(!v||N[0]&262144)&&Rt(E,D,n,n[18],v?Ft(D,n[18],N,null):qt(n[18]),null),L&&L.p&&(!v||N[0]&262144)&&Rt(L,I,n,n[18],v?Ft(I,n[18],N,y Line truncated
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]),k&1&&(y.disabled=!z.isEmpty(v[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=v[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function M$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[3](v)}let _={id:n[4]+".options.onlyDomains",disabled:!z.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&16&&l!==(l=v[4]+".options.onlyDomains"))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]+".options.onlyDomains"),k&1&&(y.disabled=!z.isEmpty(v[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=v[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function D$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[C$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[M$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function O$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class q1 extends be{constructor(e){super(),ge(this,e,O$,D$,he,{key:1,options:0})}}function E$(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new q1({props:r}),se.push(()=>_e(e,"key",l)),se.push(()=>_e(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],ke(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],ke(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function A$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class I$ extends be{constructor(e){super(),ge(this,e,A$,E$,he,{key:0,options:1})}}function P$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class L$ extends be{constructor(e){super(),ge(this,e,P$,null,he,{key:0,options:1})}}var Tr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},bl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%10 Line truncated
<span class='flatpickr-weekday'>
`+W.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var B=st("div","flatpickr-weekwrapper");B.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=st("div","flatpickr-weeks");return B.appendChild(W),{weekWrapper:B,weekNumbers:W}}function Z(B,W){W===void 0&&(W=!0);var ee=W?B:B-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),R()),N(),Ze("onMonthChange"),Li())}function de(B,W){if(B===void 0&&(B=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Or(t.config),oe=ee.hours,$e=ee.minutes,Oe=ee.seconds;m(oe,$e,Oe)}t.redraw(),B&&Ze("onChange")}function ve(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Te(){t.config!==void 0&&Ze("onDestroy");for(var B=t._handlers.length;B--;)t._handlers[B].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ee){try{delete t[ee]}catch{}})}function Ne(B){return t.calendarContainer.contains(B)}function Re(B){if(t.isOpen&&!t.config.inline){var W=_n(B),ee=Ne(W),oe=W===t.input||W===t.altInput||t.element.contains(W)||B.path&&B.path.indexOf&&(~B.path.indexOf(t.input)||~B.path.indexOf(t.altInput)),$e=!oe&&!ee&&!Ne(B.relatedTarget),Oe=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(W)});$e&&Oe&&(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 ye(B){if(!(!B||t.config.minDate&&B<t.config.minDate.getFullYear()||t.config.maxDate&&B>t.config.maxDate.getFullYear())){var W=B,ee=t.currentYear!==W;t.currentYear=W||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ee&&(t.redraw(),Ze("onYearChange"),R())}}function Se(B,W){var ee;W===void 0&&(W=!0);var oe=t.parseDate(B,void 0,W);if(t.config.minDate&&oe&&gn(oe,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&oe&&gn(oe,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var $e=!!t.config.enable,Oe=(ee=t.config.enable)!==null&&ee!==void 0?ee:t.config.disable,Ee=0,Me=void 0;Ee<Oe.length;Ee++){if(Me=Oe[Ee],typeof Me=="function"&&Me(oe))return $e;if(Me instanceof Date&&oe!==void 0&&Me.getTime()===oe.getTime())return $e;if(typeof Me=="string"){var Ue=t.parseDate(Me,void 0,!0);return Ue&&Ue.getTime()===oe.getTime()?$e:!$e}else if(typeof Me=="object"&&oe!==void 0&&Me.from&&Me.to&&oe.getTime()>=Me.from.getTime()&&oe.getTime()<=Me.to.getTime())return $e}return!$e}function We(B){return t.daysContainer!==void 0?B.className.indexOf("hidden")===-1&&B.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(B):!1}function lt(B){var W=B.target===t._input,ee=t._input.value.trimEnd()!==Ni();W&&ee&&!(B.relatedTarget&&Ne(B.relatedTarget))&&t.setDate(t._input.value,!0,B.target===t.altInput?t.config.altFormat:t.config.dateFormat)}f Line truncated
`),r=b("code"),r.textContent="multipart/form-data",a=H(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=H(` field is a
`),c=b("strong"),c.textContent="plain string",d=H(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=O(),v=b("li"),v.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=O(),y=b("li"),y.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",$=O(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=O(),C=b("li"),E=H(D),I=H(" is converted to the json "),L=b("code"),L.textContent='{"a":1,"b":2}',F=O(),N=b("li"),N.textContent="numeric strings are converted to json number",R=O(),K=b("li"),K.textContent="double quoted strings are left as they are (aka. without normalizations)",x=O(),U=b("li"),U.textContent="any other string (empty string too) is double quoted",X=H(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
an object, eg.`),ne=b("code"),ne.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Z,de){S(Z,e,de),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(m,h),g(m,_),g(m,v),g(m,k),g(m,y),g(m,$),g(m,T),g(m,M),g(m,C),g(C,E),g(C,I),g(C,L),g(m,F),g(m,N),g(m,R),g(m,K),g(m,x),g(m,U),g(i,X),g(i,ne),fe=!0},i(Z){fe||(Z&&Ge(()=>{J||(J=qe(e,St,{duration:150},!0)),J.run(1)}),fe=!0)},o(Z){Z&&(J||(J=qe(e,St,{duration:150},!1)),J.run(0)),fe=!1},d(Z){Z&&w(e),Z&&J&&J.end()}}}function iT(n){let e,t,i,s,l,o,r;function a(d,m){return d[0]?nT:tT}let u=a(n),f=u(n),c=n[0]&&Qc();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=O(),f.c(),s=O(),c&&c.c(),l=Ce(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){S(d,e,m),g(e,t),g(e,i),f.m(e,null),S(d,s,m),c&&c.m(d,m),S(d,l,m),o||(r=Y(e,"click",n[3]),o=!0)},p(d,[m]){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[0]?c?m&1&&A(c,1):(c=Qc(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){A(c)},o(d){P(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function sT(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class lT extends be{constructor(e){super(),ge(this,e,sT,iT,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function oT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=H(t),s=O(),l=b("small"),r=H(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),S(a,l,u),g(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:G,o:G,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function rT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class xc extends be{constructor(e){super(),ge(this,e,rT,oT,he,{item:0})}}const aT=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeT Line truncated
Leave empty for no restriction.`,position:"top"})),y=!0)},p(C,D){(!k||D&4096&&l!==(l=C[12]))&&p(e,"for",l);const E={};D&4096&&(E.id=C[12]),D&4&&(E.items=C[2]),!a&&D&1&&(a=!0,E.keyOfSelected=C[0].mimeTypes,ke(()=>a=!1)),r.$set(E);const I={};D&8193&&(I.$$scope={dirty:D,ctx:C}),v.$set(I)},i(C){k||(A(r.$$.fragment,C),A(v.$$.fragment,C),k=!0)},o(C){P(r.$$.fragment,C),P(v.$$.fragment,C),k=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(v),y=!1,$()}}}function pT(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function mT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;function C(E){n[10](E)}let D={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(D.value=n[0].thumbs),r=new Fs({props:D}),se.push(()=>_e(r,"value",C)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[pT]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=O(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=O(),v=b("i"),k=O(),V(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(v,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,I){S(E,e,I),g(e,t),g(e,i),g(e,s),S(E,o,I),q(r,E,I),S(E,u,I),S(E,f,I),g(f,c),g(f,d),g(f,m),g(m,h),g(m,_),g(m,v),g(m,k),q(y,m,null),$=!0,T||(M=Ie(Be.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(E,I){(!$||I&4096&&l!==(l=E[12]))&&p(e,"for",l);const L={};I&4096&&(L.id=E[12]),!a&&I&1&&(a=!0,L.value=E[0].thumbs,ke(()=>a=!1)),r.$set(L);const F={};I&8192&&(F.$$scope={dirty:I,ctx:E}),y.$set(F)},i(E){$||(A(r.$$.fragment,E),A(y.$$.fragment,E),$=!0)},o(E){P(r.$$.fragment,E),P(y.$$.fragment,E),$=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(y),T=!1,M()}}}function hT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[uT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[fT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[dT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[mT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(h,_){S(h,e,_),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(h,[_]){const v={};_&2&&(v.name="schema."+h[1]+".options.maxSize"),_&12289&&(v.$$scope={dirty:_,ctx:h}),i.$set(v);const k={};_&2&&(k.name="schema."+h[1]+".options.maxSelect"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&2&&(y.name="schema."+h[1]+".options.mimeTypes"),_&12293&&(y.$$scope={dirty:_,ctx:h}),u.$set(y);const $={};_&2&&($.name="schema."+h[1]+".options.thumbs"),_&12289&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),A(d.$$.fragment,h),m=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),m=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function _T(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=aT.slice();function o(){if(z.isEmpty(s.mimeTypes))return;const _=[];for(const v of s.mimeTypes)l.find(k=>k.mimeType===v)||_.push({mimeType:v});_.length&&t(2,l=l.concat(_))}function r(){s.maxSize=mt(this.value),t(0,s)}function a(){s.maxSelect=mt(this.value),t(0,s)}function u(_){n.$$.not_equal(s.mimeTypes,_)&&(s.mimeTypes=_,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},d=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},m=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function h(_){n.$$.not_equal(s.thumbs,_)&&(s.thumbs=_,t(0,s))}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"options"in _&&t(0,s=_.options)},n.$$.update=()=>{n.$$.dirty&1&&(z.isEmpty(s)?t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]}):o())},[s,i,l,r,a,u,f,c,d,m,h]}class gT extends be{constructor(e){super(),ge(this,e,_T,hT,he,{key:1,options:0})}}function bT(n){let e,t,i,s,l;return{c(){e=b("hr"),t=O(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[10]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function vT(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[23],searchable:n[3].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3],$$slots:{afterOptions:[bT]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=H("Collection"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),c&8&&(d.searchable=f[3].length>5),c&8&&(d.items=f[3]),c&16777232&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function yT(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[23],items:n[6]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=H("Relation type"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ed(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[kT,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[wT,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),i=O(),s=b("div"),V(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&25165825&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&25165825&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function kT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Min select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].minSelect),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].minSelect&&re(l,u[0].minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=H("Max select"),s=O(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].minSelect||2)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||2)&&p(l,"min",r),c&1&&mt(l.value)!==f[0].maxSelect&&re(l,f[0].maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function ST(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[15](h)}let m={multiple:!0,searchable:!0,id:n[23],selectPlaceholder:"Auto",items:n[5]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new nu({props:m}),se.push(()=>_e(r,"selected",d)),{c(){e=b("label"),t=b("span"),t.textContent="Display fields",i=O(),s=b("i"),o=O(),V(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23])},m(h,_){S(h,e,_),g(e,t),g(e,i),g(e,s),S(h,o,_),q(r,h,_),u=!0,f||(c=Ie(Be.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(h,_){(!u||_&8388608&&l!==(l=h[23]))&&p(e,"for",l);const v={};_&8388608&&(v.id=h[23]),_&32&&(v.items=h[5]),!a&&_&1&&(a=!0,v.selected=h[0].displayFields,ke(()=>a=!1)),r.$set(v)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),j(r,h),f=!1,c()}}}function $T(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[7]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=H("Delete main record on relation delete"),s=O(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",iLine truncated
(aka. not ${z.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,_){_[1]&4096&&t!==(t=h[43])&&p(e,"id",t),_[0]&1&&(e.checked=h[0].required),_[0]&1&&o!==(o=gs(h[0])+"")&&le(r,o),f&&Bt(f.update)&&_[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])}
(aka. not ${z.zeroDefaultStr(h[0])}).`,position:"right"}),_[1]&4096&&c!==(c=h[43])&&p(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Pe(m)}}}function nd(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[zT,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function zT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=H("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(s,"for",o=n[43])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function id(n){let e,t,i,s,l,o,r,a,u,f;a=new ei({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[BT]},$$scope:{ctx:n}}});let c=n[8]&&sd(n);return{c(){e=b("div"),t=b("div"),i=O(),s=b("div"),l=b("button"),o=b("i"),r=O(),V(a.$$.fragment),u=O(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,m){S(d,e,m),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),q(a,l,null),g(s,u),c&&c.m(s,null),f=!0},p(d,m){const h={};m[1]&8192&&(h.$$scope={dirty:m,ctx:d}),a.$set(h),d[8]?c?c.p(d,m):(c=sd(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function BT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function sd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[3])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function UT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;s=new pe({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[DT,({uniqueId:N})=>({43:N}),({uniqueId:N})=>[0,N?4096:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[OT,({uniqueId:N})=>({43:N}),({uniqueId:N})=>[0,N?4096:0]]},$$scope:{ctx:n}}});const D=[VT,jT,qT,RT,FT,NT,LT,PT,IT,AT,ET],E=[];function I(N,R){return N[0].type==="text"?0:N[0].type==="number"?1:N[0].type==="bool"?2:N[0].type==="email"?3:N[0].type==="url"?4:N[0].type==="editor"?5:N[0].type==="date"?6:N[0].type==="select"?7:N[0].type==="json"?8:N[0].type==="file"?9:N[0].type==="relation"?10:-1}~(f=I(n))&&(c=E[f]=D[f](n)),h=new pe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[HT,({uniqueId:N})=>({43:N}),({uniqueId:N})=>[0,N?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&nd(n),F=!n[0].toDelete&&id(n);return{c(){e=b("form"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),a=O(),u=b("div"),c&&c.c(),d=O(),m=b("div"),V(h.$$.fragment),_=O(),v=b("div"),L&&L.c(),k=O(),F&&F.c(),y=O(),$=b("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(v,"class","col-sm-4 flex"),p(t,"class","grid"),p($,"type","submit"),p($,"class","hidden"),p($,"tabindex","-1"),p(e,"class","field-form")},m(N,R){S(N,e,R),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),~f&&E[f].m(u,null),g(t,d),g(t,m),q(h,m,null),g(t,_),g(t,v),L&&L.m(v,null),g(t,k),F&&F.m(t,null),g(e,y),g(e,$),T=!0,M||(C=[Y(e,"dragstart",KT),Y(e,"submit",ft(n[32]))],M=!0)},p(N,R){const K={};R[0]&1&&(K.class="form-field required "+(N[0].id?"readonly":"")),R[0]&2&&(K.name="schema."+N[1]+".type"),R[0]&1|R[1]&12288&&(K.$$scope={dirty:R,ctx:N}),s.$set(K);const x={};R[0]&33&&(x.class=`
form-field
required
`+(N[5]?"":"invalid")+`
`+(N[0].id&&N[0].system?"disabled":"")+`
`),R[0]&2&&(x.name="schema."+N[1]+".name"),R[0]&33|R[1]&12288&&(x.$$scope={dirty:R,ctx:N}),r.$set(x);let U=f;f=I(N),f===U?~f&&E[f].p(N,R):(c&&(ae(),P(E[U],1,1,()=>{E[U]=null}),ue()),~f?(c=E[f],c?c.p(N,R):(c=E[f]=D[f](N),c.c()),A(c,1),c.m(u,null)):c=null);const X={};R[0]&1|R[1]&12288&&(X.$$scope={dirty:R,ctx:N}),h.$set(X),N[0].type!=="file"?L?(L.p(N,R),R[0]&1&&A(L,1)):(L=nd(N),L.c(),A(L,1),L.m(v,null)):L&&(ae(),P(L,1,1,()=>{L=null}),ue()),N[0].toDelete?F&&(ae(),P(F,1,1,()=>{F=null}),ue()):F?(F.p(N,R),R[0]&1&&A(F,1)):(F=id(N),F.c(),A(F,1),F.m(t,null))},i(N){T||(A(s.$$.fragment,N),A(r.$$.fragment,N),A(c),A(h.$$.fragment,N),A(L),A(F),T=!0)},o(N){P(s.$$.fragment,N),P(r.$$.fragment,N),P(c),P(h.$$.fragment,N),P(L),P(F),T=!1},d(N){N&&w(e),j(s),j(r),~f&&E[f].d(),j(h),L&&L.d(),F&&F.d(),M=!1,Pe(C)}}}function ld(n){let e,t,i,s,l=n[0].system&&od(),o=!n[0].id&&rd(n),r=n[0].required&&ad(n),a=n[0].unique&&ud();return{c(){e=b("div"),l&&l.c(),t=O(),o&&o.c(),i=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=od(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=rd(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ad(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ud(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function od(n){let e;return{c(){e=b("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rd(n){let e;return{c(){e=b("span"),e.textContent="New",p(e,"class","label"),Q(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&Q(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function ad(n){let e,t=gs(n[0])+"",i;return{c(){e=b("span"),i=H(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function ud(n){let e;return{c(){e=b("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[16])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function WT(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,_,v,k=!n[0].toDelete&&ld(n),y=n[7]&&!n[0].system&&fd(),$=n[0].toDelete&&cd(n);return{c(){e=b("div"),t=b("span"),i=b("i"),l=O(),o=b("strong"),a=H(r),f=O(),k&&k.c(),c=O(),d=b("div"),m=O(),y&&y.c(),h=O(),$&&$.c(),_=Ce(),p(i,"class",s=Si(z.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),Q(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),S(T,f,M),k&&k.m(T,M),S(T,c,M),S(T,d,M),S(T,m,M),y&&y.m(T,M),S(T,h,M),$&&$.m(T,M),S(T,_,M),v=!0},p(T,M){(!v||M[0]&1&&s!==(s=Si(z.getFieldTypeIcon(T[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!v||M[0]&1)&&r!==(r=(T[0].name||"-")+"")&&le(a,r),(!v||M[0]&1&&u!==(u=T[0].name))&&p(o,"title",u),(!v||M[0]&1)&&Q(o,"txt-strikethrough",T[0].toDelete),T[0].toDelete?k&&(k.d(1),k=null):k?k.p(T,M):(k=ld(T),k.c(),k.m(c.parentNode,c)),T[7]&&!T[0].system?y?M[0]&129&&A(y,1):(y=fd(),y.c(),A(y,1),y.m(h.parentNode,h)):y&&(ae(),P(y,1,1,()=>{y=null}),ue()),T[0].toDelete?$?$.p(T,M):($=cd(T),$.c(),$.m(_.parentNode,_)):$&&($.d(1),$=null)},i(T){v||(A(y),v=!0)},o(T){P(y),v=!1},d(T){T&&w(e),T&&w(f),k&&k.d(T),T&&w(c),T&&w(d),T&&w(m),y&&y.d(T),T&&w(h),$&&$.d(T),T&&w(_)}}}function YT(n){let e,t;const i=[{draggable:!0},{single:!0},{interactive:n[8]},{class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion"},n[11]];let s={$$slots:{header:[WT],default:[UT]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[33](e),e.$on("expand",n[34]),e.$on("collapse",n[35]),e.$on("toggle",n[36]),e.$on("dragenter",n[37]),e.$on("dragleave",n[38]),e.$on("dragstart",n[39]),e.$on("drop",n[40]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&2309?on(i,[i[0],i[1],o[0]&256&&{interactive:l[8]},o[0]&5&&{class:l[2]||l[0].toDelete||l[0].system?"field-accordion disabled":"field-accordion"},o[0]&2048&&xn(l[11])]):{};o[0]&483|o[1]&8192&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[33](null),j(e,l)}}}function gs(n){switch(n==null?void 0:n.type){case"bool":ret Line truncated
`),t=b("code"),t.textContent="username",i=H(` ,
`),s=b("code"),s.textContent="email",l=H(` ,
`),o=b("code"),o.textContent="emailVisibility",r=H(` ,
`),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function md(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new ZT({props:f}),se.push(()=>_e(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Ce(),V(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),q(i,c,d),l=!0},p(c,d){e=c;const m={};d&1&&(m.key=e[15]),d&3&&(m.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,m.field=e[13],ke(()=>s=!1)),i.$set(m)},i(c){l||(A(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function GT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,_,v,k,y,$,T,M,C,D,E,I,L=n[0].isAuth&&pd(),F=n[0].schema;const N=R=>R[13];for(let R=0;R<F.length;R+=1){let K=dd(n,F,R),x=N(K);h.set(x,m[R]=md(x,K))}return{c(){e=b("div"),t=b("p"),i=H(`System fields:
`),s=b("code"),s.textContent="id",l=H(` ,
`),o=b("code"),o.textContent="created",r=H(` ,
`),a=b("code"),a.textContent="updated",u=O(),L&&L.c(),f=H(`
.`),c=O(),d=b("div");for(let R=0;R<m.length;R+=1)m[R].c();_=O(),v=b("div"),k=O(),y=b("button"),$=b("i"),T=O(),M=b("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(v,"class","clearfix m-t-xs"),p($,"class","ri-add-line"),p(M,"class","txt"),p(y,"type","button"),p(y,"class",C="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(R,K){S(R,e,K),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),L&&L.m(t,null),g(t,f),S(R,c,K),S(R,d,K);for(let x=0;x<m.length;x+=1)m[x].m(d,null);S(R,_,K),S(R,v,K),S(R,k,K),S(R,y,K),g(y,$),g(y,T),g(y,M),D=!0,E||(I=Y(y,"click",n[3]),E=!0)},p(R,[K]){R[0].isAuth?L||(L=pd(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),K&55&&(F=R[0].schema,ae(),m=wt(m,K,N,1,R,F,h,d,ln,md,null,dd),ue()),(!D||K&1&&C!==(C="btn btn-block "+(R[0].schema.length?"btn-transparent":"btn-secondary")))&&p(y,"class",C)},i(R){if(!D){for(let K=0;K<F.length;K+=1)A(m[K]);D=!0}},o(R){for(let K=0;K<m.length;K+=1)P(m[K]);D=!1},d(R){R&&w(e),L&&L.d(),R&&w(c),R&&w(d);for(let K=0;K<m.length;K+=1)m[K].d();R&&w(_),R&&w(v),R&&w(k),R&&w(y),E=!1,I()}}}function XT(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function QT(n,e,t){let{collection:i=new pn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(v){i.schema[v]&&(i.schema.splice(v,1),t(0,i))}function r(){const v=new mn({name:a()});v.onMountExpand=!0,i.schema.push(v),t(0,i)}function a(v="field"){let k="";for(;u(v+k);)++k;return v+k}function u(v){return!!i.schema.find(k=>k.name===v)}function f(v){let k=[];if(v.toDelete)return k;for(let y of i.schema)y===v||y.toDelete||k.push(y.name);return k}function c(v,k){if(!v)return;v.dataTransfer.dropEffect="move";const y=parseInt(v.dataTransfer.getData("text/plain")),$=i.schema;y<k?($.splice(k+1,0,$[y]),$.splice(y,1)):($.splice(k,0,$[y]),$.splice(y+1,1)),t(0,i.schema=$,i)}function d(v,k,y,$){y[$]=v,t(0,i)}const m=v=>o(v),h=(v,k)=>XT(k==null?void 0:k.detail,v),_=(v,k)=>c(k==null?void 0:k.detail,v);return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new pn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,m,h,_]}class xT extends be{constructor(e){super(),ge(this,e,QT,GT,he,{collection:0})}}const eC=n=>({isAdminOnly:n&256}),hd=n=>({isAdminOnly:n[8]});function tC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[lC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function nC(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function iC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function sC(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function lC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,m,h,_;function v(E,I){return E[8]?sC:iC}let k=v(n),y=k(n);function $(E){n[13](E)}var T=n[6];function M(E){let I={id:E[17],baseCollection:E[1],disabled:E[8],placeholder:E[8]?"":"Leave empty to grant everyone access..."};return E[0]!==void 0&&(I.value=E[0]),{props:I}}T&&(c=Vt(T,M(n)),n[12](c),se.push(()=>_e(c,"value",$)));const C=n[11].default,D=Nt(C,n,n[14],hd);return{c(){e=b("label"),t=b("span"),i=H(n[2]),s=O(),l=b("span"),r=H(o),a=O(),y.c(),f=O(),c&&V(c.$$.fragment),m=O(),h=b("div"),D&&D.c(),p(t,"class","txt"),Q(t,"txt-hint",n[8]),p(l,"class","label label-sm svelte-5uq9tk"),p(e,"for",u=n[17]),p(e,"class","svelte-5uq9tk"),p(h,"class","help-block")},m(E,I){S(E,e,I),g(e,t),g(t,i),g(e,s),g(e,l),g(l,r),g(e,a),y.m(e,null),S(E,f,I),c&&q(c,E,I),S(E,m,I),S(E,h,I),D&&D.m(h,null),_=!0},p(E,I){(!_||I&4)&&le(i,E[2]),(!_||I&256)&&Q(t,"txt-hint",E[8]),(!_||I&256)&&o!==(o=E[8]?"Admins only":"Custom rule")&&le(r,o),k===(k=v(E))&&y?y.p(E,I):(y.d(1),y=k(E),y&&(y.c(),y.m(e,null))),(!_||I&131072&&u!==(u=E[17]))&&p(e,"for",u);const L={};if(I&131072&&(L.id=E[17]),I&2&&(L.baseCollection=E[1]),I&256&&(L.disabled=E[8]),I&256&&(L.placeholder=E[8]?"":"Leave empty to grant everyone access..."),!d&&I&1&&(d=!0,L.value=E[0],ke(()=>d=!1)),T!==(T=E[6])){if(c){ae();const F=c;P(F.$$.fragment,1,0,()=>{j(F,1)}),ue()}T?(c=Vt(T,M(E)),E[12](c),se.push(()=>_e(c,"value",$)),V(c.$$.fragment),A(c.$$.fragment,1),q(c,m.parentNode,m)):c=null}else T&&c.$set(L);D&&D.p&&(!_||I&16640)&&Rt(D,C,E,E[14],_?Ft(C,E[14],I,eC):qt(E[14]),hd)},i(E){_||(c&&A(c.$$.fragment,E),A(D,E),_=!0)},o(E){c&&P(c.$$.fragment,E),P(D,E),_=!1},d(E){E&&w(e),y.d(),E&&w(f),n[12](null),c&&j(c,E),E&&w(m),E&&w(h),D&&D.d(E)}}}function oC(n){let e,t,i,s;const l=[nC,tC],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ce()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),P(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let _d;function rC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,m=_d,h=!1;_();async function _(){m||h||(t(7,h=!0),t(6,m=(await rt(()=>import("./FilterAutocompleteInput-c78c0e44.js"),["./FilterAutocompleteInput-c78c0e44.js","./index-a6ccb683.js"],import.meta.url)).default),_d=m,t(7,h=!1))}async function v(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y(T){se[T?"unshift":"push"](()=>{c=T,t(5,c)})}function $(T){r=T,t(0,r)}return n.$$set=T=>{"collection"in T&&t(1,o=T.collection),"rule"in T&&t(0,r=T.rule),"label"in T&&t(2,a=T.label),"formKey"in T&&t(3,u=T.formKey),"required"in T&&t(4,f=T.required),"$$scope"in T&&t(14,l=T.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,v,k,s,y,$,l]}class $s extends be{constructor(e){super(),ge(this,e,rC,oC,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function gd(n,e,t){const i=n.slice();return i[10]=e[t],i}function bd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I=n[2],L=[];for(let F=0;F<I.length;F+=1)L[F]=vd(gd(n,I,F));return{c(){e=b("div"),t=b("div"),i=b("div"),s=b("p"),s.textContent="The following record fields are available:",l=O(),o=b("div");for(let F=0;F<L.length;F+=1)L[F].c();r=O(),a=b("hr"),u=O(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=O(),d=b("div"),d.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=O(),h=b("hr"),_=O(),v=b("p"),v.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=O(),y=b("div"),y.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",$=O(),T=b("hr"),M=O(),C=b("p"),C.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(v,"class","m-b-0"),p(y,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){S(F,e,N),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let R=0;R<L.length;R+=1)L[R].m(o,null);g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(i,h),g(i,_),g(i,v),g(i,k),g(i,y),g(i,$),g(i,T),g(i,M),g(i,C),E=!0},p(F,N){if(N&4){I=F[2];let R;for(R=0;R<I.length;R+=1){const K=gd(F,I,R);L[R]?L[R].p(K,N):(L[R]=vd(K),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=I.length}},i(F){E||(F&&Ge(()=>{D||(D=qe(e,St,{duration:150},!0)),D.run(1)}),E=!0)},o(F){F&&(D||(D=qe(e,St,{duration:150},!1)),D.run(0)),E=!1},d(F){F&&w(e),pt(L,F),F&&D&&D.end()}}}function vd(n){let e,t=n[10]+"",i;return{c(){e=b("code"),i=H(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;function v(C){n[6](C)}let k={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new $s({props:k}),se.push(()=>_e(i,"rule",v));function y(C){n[7](C)}let $={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&($.rule=n[0].updateRule),a=new $s({props:$}),se.push(()=>_e(a,"rule",y));function T(C){n[8](C)}let M={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),m=new $s({props:M}),se.push(()=>_e(m,"rule",T)),{c(){e=b("hr"),t=O(),V(i.$$.fragment),l=O(),o=b("hr"),r=O(),V(a.$$.fragment),f=O(),c=b("hr"),d=O(),V(m.$$.fragment)},m(C,D){S(C,e,D),S(C,t,D),q(i,C,D),S(C,l,D),S(C,o,D),S(C,r,D),q(a,C,D),S(C,f,D),S(C,c,D),S(C,d,D),q(m,C,D),_=!0},p(C,D){const E={};D&1&&(E.collection=C[0]),!s&&D&1&&(s=!0,E.rule=C[0].createRule,ke(()=>s=!1)),i.$set(E);const I={};D&1&&(I.collection=C[0]),!u&&D&1&&(u=!0,I.rule=C[0].updateRule,ke(()=>u=!1)),a.$set(I);const L={};D&1&&(L.collection=C[0]),!h&&D&1&&(h=!0,L.rule=C[0].deleteRule,ke(()=>h=!1)),m.$set(L)},i(C){_||(A(i.$$.fragment,C),A(a.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){P(i.$$.fragment,C),P(a.$$.fragment,C),P(m.$$.fragment,C),_=!1},d(C){C&&w(e),C&&w(t),j(i,C),C&&w(l),C&&w(o),C&&w(r),j(a,C),C&&w(f),C&&w(c),C&&w(d),j(m,C)}}}function kd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[aC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new $s({props:r}),se.push(()=>_e(i,"rule",o)),{c(){e=b("hr"),t=O(),V(i.$$.fragment)},m(a,u){S(a,e,u),S(a,t,u),q(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&8192&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,ke(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function aC(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=O(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:G,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function uC(n){var K,x;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D=n[1]&&bd(n);function E(U){n[4](U)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new $s({props:I}),se.push(()=>_e(f,"rule",E));function L(U){n[5](U)}let F={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(F.rule=n[0].viewRule),_=new $s({props:F}),se.push(()=>_e(_,"rule",L));let N=!((K=n[0])!=null&&K.isView)&&yd(n),R=((x=n[0])==null?void 0:x.isAuth)&&kd(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>.`,s=O(),l=b("button"),r=H(o),a=O(),D&&D.c(),u=O(),V(f.$$.fragment),d=O(),m=b("hr"),h=O(),V(_.$$.fragment),k=O(),N&&N.c(),y=O(),R&&R.c(),$=Ce(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-base handle"),Q(e,"fade",!n[1])},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),D&&D.m(e,null),S(U,u,X),q(f,U,X),S(U,d,X),S(U,m,X),S(U,h,X),q(_,U,X),S(U,k,X),N&&N.m(U,X),S(U,y,X),R&&R.m(U,X),S(U,$,X),T=!0,M||(C=Y(l,"click",n[3]),M=!0)},p(U,[X]){var fe,Z;(!T||X&2)&&o!==(o=U[1]?"Hide available fields":"Show available fields")&&le(r,o),U[1]?D?(D.p(U,X),X&2&&A(D,1)):(D=bd(U),D.c(),A(D,1),D.m(e,null)):D&&(ae(),P(D,1,1,()=>{D=null}),ue()),(!T||X&2)&&Q(e,"fade",!U[1]);const ne={};X&1&&(ne.collection=U[0]),!c&&X&1&&(c=!0,ne.rule=U[0].listRule,ke(()=>c=!1)),f.$set(ne);const J={};X&1&&(J.collection=U[0]),!v&&X&1&&(v=!0,J.rule=U[0].viewRule,ke(()=>v=!1)),_.$set(J),(fe=U[0])!=null&&fe.isView?N&&(ae(),P(N,1,1,()=>{N=null}),ue()):N?(N.p(U,X),X&1&&A(N,1)):(N=yd(U),N.c(),A(N,1),N.m(y.parentNode,y)),(Z=U[0])!=null&&Z.isAuth?R?(R.p(U,X),X&1&&A(R,1)):(R=kd(U),R.c(),A(R,1),R.m($.parentNode,$)):R&&(ae(),P(R,1,1,()=>{R=null}),ue())},i(U){T||(A(D),A(f.$$.fragment,U),A(_.$$.fragment,U),A(N),A(R),T=!0)},o(U){P(D),P(f.$$.fragment,U),P(_.$$.fragment,U),P(N),P(R),T=!1},d(U){U&&w(e),D&&D.d(),U&&w(u),j(f,U),U&&w(d),U&&w(m),U&&w(h),j(_,U),U&&w(k),N&&N.d(U),U&&w(y),R&&R.d(U),U&&w($),M=!1,C()}}}function fC(n,e,t){let i,{collection:s=new pn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=z.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class cC extends be{constructor(e){super(),ge(this,e,fC,uC,he,{collection:0})}}function wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function dC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Vt(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),o!==(o=a[1])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Vt(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function pC(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function Sd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=$d(wd(n,i,l));return{c(){e=b("div"),t=b("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),g(e,t);for(let r=0;r<s.length;r+=1)s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=wd(l,i,r);s[r]?s[r].p(a,o):(s[r]=$d(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),pt(s,l)}}}function $d(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=H(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function mC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[pC,dC],m=[];function h(v,k){return v[2]?0:1}l=h(n),o=m[l]=d[l](n);let _=n[3].length&&Sd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",s=O(),o.c(),r=O(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=O(),_&&_.c(),f=Ce(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),m[l].m(v,k),S(v,r,k),S(v,a,k),S(v,u,k),_&&_.m(v,k),S(v,f,k),c=!0},p(v,k){(!c||k&256&&i!==(i=v[8]))&&p(e,"for",i);let y=l;l=h(v),l===y?m[l].p(v,k):(ae(),P(m[y],1,1,()=>{m[y]=null}),ue(),o=m[l],o?o.p(v,k):(o=m[l]=d[l](v),o.c()),A(o,1),o.m(r.parentNode,r)),v[3].length?_?_.p(v,k):(_=Sd(v),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(v){c||(A(o),c=!0)},o(v){P(o),c=!1},d(v){v&&w(e),v&&w(s),m[l].d(v),v&&w(r),v&&w(a),v&&w(u),_&&_.d(v),v&&w(f)}}}function hC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[mC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function _C(n,e,t){let i;Ye(n,fi,c=>t(4,i=c));let{collection:s=new pn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=z.getNestedVal(c,"schema",null);if(z.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=z.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.removeByValue(m,"updated");for(let _ in d)for(let v in d[_]){const k=d[_][v].message,y=m[_]||_;r.push(z.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-cee841da.js"),["./CodeEditor-cee841da.js","./index-a6ccb683.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&Qi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class gC extends be{constructor(e){super(),ge(this,e,_C,hC,he,{collection:0})}}function bC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function vC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[bC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function yC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function kC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function wC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowUsernameAuth?kC:yC}let u=a(n),f=u(n),c=n[3]&&Td();return{c(){e=b("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?m&8&&A(c,1):(c=Td(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function SC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(z.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[$C,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(z.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[TC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(z.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(z.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&Ge(()=>{r||(r=qe(e,St,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=qe(e,St,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function $C(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[7](v)}let _={id:n[12],disabled:!z.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!z.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function TC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[8](v)}let _={id:n[12],disabled:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=O(),s=b("i"),o=O(),V(r.$$.fragment),u=O(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!z.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(A(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function CC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[SC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Cd(n);return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=Ce()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Cd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function MC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function DC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Md(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function OC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?DC:MC}let u=a(n),f=u(n),c=n[2]&&Md();return{c(){e=b("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?m&4&&A(c,1):(c=Md(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function EC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Dd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{t||(t=qe(e,St,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=qe(e,St,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function AC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[EC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Dd();return{c(){V(e.$$.fragment),t=O(),l&&l.c(),i=Ce()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Dd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function IC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function PC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Od(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function LC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?PC:IC}let u=a(n),f=u(n),c=n[1]&&Od();return{c(){e=b("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=O(),i=b("div"),s=O(),f.c(),l=O(),c&&c.c(),o=Ce(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?m&2&&A(c,1):(c=Od(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function NC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Minimum password length"),s=O(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function FC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.textContent="Always require email",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(Be.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function RC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return s=new ks({props:{single:!0,$$slots:{header:[wC],default:[vC]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[OC],default:[CC]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[LC],default:[AC]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[NC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),v=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[FC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=O(),i=b("div"),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),f=b("hr"),c=O(),d=b("h4"),d.textContent="General",m=O(),V(h.$$.fragment),_=O(),V(v.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(y,$){S(y,e,$),S(y,t,$),S(y,i,$),q(s,i,null),g(i,l),q(o,i,null),g(i,r),q(a,i,null),S(y,u,$),S(y,f,$),S(y,c,$),S(y,d,$),S(y,m,$),q(h,y,$),S(y,_,$),q(v,y,$),k=!0},p(y,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:y}),s.$set(T);const M={};$&8197&&(M.$$scope={dirty:$,ctx:y}),o.$set(M);const C={};$&8195&&(C.$$scope={dirty:$,ctx:y}),a.$set(C);const D={};$&12289&&(D.$$scope={dirty:$,ctx:y}),h.$set(D);const E={};$&12289&&(E.$$scope={dirty:$,ctx:y}),v.$set(E)},i(y){k||(A(s.$$.fragment,y),A(o.$$.fragment,y),A(a.$$.fragment,y),A(h.$$.fragment,y),A(v.$$.fragment,y),k=!0)},o(y){P(s.$$.fragment,y),P(o.$$.fragment,y),P(a.$$.fragment,y),P(h.$$.fragment,y),P(v.$$.fragment,y),k=!1},d(y){y&&w(e),y&&w(t),y&&w(i),j(s),j(o),j(a),y&&w(u),y&&w(f),y&&w(c),y&&w(d),y&&w(m),j(h,y),y&&w(_),j(v,y)}}}function qC(n,e,t){let i,s,l,o;Ye(n,fi,_=>t(4,o=_));let{collection:r=new pn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function c(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=mt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,v,k,y;n.$$.dirty&1&&r.isAuth&&z.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!z.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!z.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!z.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!z.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,h]}class jC extends be{constructor(e){super(),ge(this,e,qC,RC,he,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[17]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[17]=e[t],i}function Id(n,e,t){const i=n.slice();return i[17]=e[t],i}function Pd(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ld(n){var r;let e,t,i,s,l=n[3]&&Nd(n),o=!((r=n[2])!=null&&r.isView)&&Fd(n);return{c(){e=b("h6"),e.textContent="Changes:",t=O(),i=b("ul"),l&&l.c(),s=O(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Nd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Fd(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Nd(n){var m,h;let e,t,i,s,l=((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=H(`Renamed collection
`),s=b("strong"),o=H(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=H(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,v){S(_,e,v),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(_,v){var k,y;v&2&&l!==(l=((k=_[1])==null?void 0:k.name)+"")&&le(o,l),v&4&&c!==(c=((y=_[2])==null?void 0:y.name)+"")&&le(d,c)},d(_){_&&w(e)}}}function Fd(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=Rd(Id(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=qd(Ad(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=jd(Ed(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=O();for(let f=0;f<r.length;f+=1)r[f].c();t=O();for(let f=0;f<u.length;f+=1)u[f].c();i=Ce()},m(f,c){for(let d=0;d<l.length;d+=1)l[d].m(f,c);S(f,e,c);for(let d=0;d<r.length;d+=1)r[d].m(f,c);S(f,t,c);for(let d=0;d<u.length;d+=1)u[d].m(f,c);S(f,i,c)},p(f,c){if(c&32){s=f[5];let d;for(d=0;d<s.length;d+=1){const m=Id(f,s,d);l[d]?l[d].p(m,c):(l[d]=Rd(m),l[d].c(),l[d].m(e.parentNode,e))}for(;d<l.length;d+=1)l[d].d(1);l.length=s.length}if(c&128){o=f[7];let d;for(d=0;d<o.length;d+=1){const m=Ad(f,o,d);r[d]?r[d].p(m,c):(r[d]=qd(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&64){a=f[6];let d;for(d=0;d<a.length;d+=1){const m=Ed(f,a,d);u[d]?u[d].p(m,c):(u[d]=jd(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){pt(l,f),f&&w(e),pt(r,f),f&&w(t),pt(u,f),f&&w(i)}}}function Rd(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=b("li"),t=H(`Multiple to single value conversion of field
`),i=b("strong"),l=H(s),o=O(),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){S(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o),g(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function qd(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,c=n[17].name+"",d;return{c(){e=b("li"),t=b("div"),i=H(`Renamed field
`),s=b("strong"),o=H(l),r=O(),a=b("i"),u=O(),f=b("strong"),d=H(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&128&&l!==(l=m[17].originalName+"")&&le(o,l),h&128&&c!==(c=m[17].name+"")&&le(d,c)},d(m){m&&w(e)}}}function jd(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=b("li"),t=H("Removed field "),i=b("span"),l=H(s),o=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function VC(n){let e,t,i,s,l,o,r,a,u=n[6].length&&Pd(),f=n[8]&&Ld(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=O(),u&&u.c(),r=O(),f&&f.c(),a=Ce(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[6].length?u||(u=Pd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[8]?f?f.p(c,d):(f=Ld(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function HC(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function zC(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[11]),Y(i,"click",n[12])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function BC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[zC],header:[HC],default:[VC]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[13](null),j(e,s)}}}function UC(n,e,t){let i,s,l,o,r;const a=Ct();let u,f,c;async function d(T,M){t(1,f=T),t(2,c=M),await sn(),i||s.length||l.length||o.length?u==null||u.show():h()}function m(){u==null||u.hide()}function h(){m(),a("confirm")}const _=()=>m(),v=()=>h();function k(T){se[T?"unshift":"push"](()=>{u=T,t(4,u)})}function y(T){He.call(this,n,T)}function $(T){He.call(this,n,T)}return n.$$.update=()=>{var T,M,C;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(c==null?void 0:c.name)),n.$$.dirty&4&&t(7,s=((T=c==null?void 0:c.schema)==null?void 0:T.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(6,l=((M=c==null?void 0:c.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(5,o=((C=c==null?void 0:c.schema)==null?void 0:C.filter(D=>{var I,L,F;const E=(I=f==null?void 0:f.schema)==null?void 0:I.find(N=>N.id==D.id);return E?((L=E.options)==null?void 0:L.maxSelect)!=1&&((F=D.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(c!=null&&c.isView)||i)},[m,f,c,i,u,o,l,s,r,h,d,_,v,k,y,$]}class WC extends be{constructor(e){super(),ge(this,e,UC,BC,he,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function Vd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function YC(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new xT({props:l}),se.push(()=>_e(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function KC(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new gC({props:l}),se.push(()=>_e(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Hd(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new cC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function zd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new jC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function JC(n){let e,t,i,s,l,o,r;const a=[KC,YC],u=[];function f(m,h){return m[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===vl&&Hd(n),d=n[2].isAuth&&zd(n);return{c(){e=b("div"),t=b("div"),s.c(),l=O(),c&&c.c(),o=O(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===yi),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){S(m,e,h),g(e,t),u[i].m(t,null),g(e,l),c&&c.m(e,null),g(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=f(m),i===_?u[i].p(m,h):(ae(),P(u[_],1,1,()=>{u[_]=null}),ue(),s=u[i],s?s.p(m,h):(s=u[i]=a[i](m),s.c()),A(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",m[3]===yi),m[3]===vl?c?(c.p(m,h),h[0]&8&&A(c,1)):(c=Hd(m),c.c(),A(c,1),c.m(e,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue()),m[2].isAutLine truncated
<span class="txt">Duplicate</span>`,t=O(),i=b("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(ft(n[24])))],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function Ud(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[GC]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),V(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function Wd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=O(),l=b("span"),r=H(o),a=H(" collection"),u=O(),p(t,"class",i=Si(z.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(m,h){S(m,e,h),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Si(z.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function GC(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Wd(Vd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Ce()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=Vd(s,t,o);i[o]?i[o].p(r,l):(i[o]=Wd(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){pt(i,s),s&&w(e)}}}function Yd(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function XC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k=(n[6][n[2].type]||"N/A")+"",y,$,T,M,C,D,E,I,L,F=n[2].isNew&&Ud(n),N=n[2].system&&Yd();return{c(){e=b("label"),t=H("Name"),s=O(),l=b("input"),f=O(),c=b("div"),d=b("button"),m=b("span"),h=O(),_=b("span"),v=H("Type: "),y=H(k),$=O(),F&&F.c(),C=O(),N&&N.c(),D=Ce(),p(e,"for",i=n[46]),p(l,"type","text"),p(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(_,"class","txt"),p(d,"type","button"),p(d,"class",T="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(R,K){S(R,e,K),g(e,t),S(R,s,K),S(R,l,K),S(R,f,K),S(R,c,K),g(c,d),g(d,m),g(d,h),g(d,_),g(_,v),g(_,y),g(d,$),F&&F.m(d,null),S(R,C,K),N&&N.m(R,K),S(R,D,K),E=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[25]),I=!0)},p(R,K){(!E||K[1]&32768&&i!==(i=R[46]))&&p(e,"for",i),(!E||K[1]&32768&&o!==(o=R[46]))&&p(l,"id",o),(!E||K[0]&8192)&&(l.disabled=R[13]),(!E||K[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||K[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!E||K[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||K[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le(y,k),R[2].isNew?F?(F.p(R,K),K[0]&4&&A(F,1)):(F=Ud(R),F.c(),A(F,1),F.m(d,null)):F&&(ae(),P(F,1,1,()=>{F=null}),ue()),(!E||K[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",T),(!E||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?N||(N=Yd(),N.c(),N.m(D.parentNode,D)):N&&(N.d(1),N=null)},i(R){E||(A(F),E=!0)},o(R){P(F),E=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),F&&F.d(),R&&w(C),N&&N.d(R),R&&w(D),I=!1,L()}}}function Kd(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Ge(()=>{i||(i=qe(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=qe(e,It,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Jd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Zd(n){var a,u,f;let e,t,i,s=!z.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&Gd();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(c,d){S(c,e,d),g(e,t),g(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[30]),l=!0)},p(c,d){var m,h,_;d[0]&32&&(s=!z.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=Line truncated
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function i4(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,_,v,k,y,$,T=n[3];const M=I=>I[15].id;for(let I=0;I<T.length;I+=1){let L=xd(n,T,I),F=M(L);m.set(F,d[I]=np(F,L))}let C=null;T.length||(C=ep(n));let D=!n[7]&&ip(n),E={};return v=new su({props:E}),n[13](v),v.$on("save",n[14]),{c(){e=b("aside"),t=b("header"),i=b("div"),s=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',o=O(),r=b("input"),a=O(),u=b("hr"),f=O(),c=b("div");for(let I=0;I<d.length;I+=1)d[I].c();C&&C.c(),h=O(),D&&D.c(),_=O(),V(v.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),Q(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),re(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let F=0;F<d.length;F+=1)d[F].m(c,null);C&&C.m(c,null),g(e,h),D&&D.m(e,null),S(I,_,L),q(v,I,L),k=!0,y||($=[Y(l,"click",n[10]),Y(r,"input",n[11])],y=!0)},p(I,[L]){(!k||L&16)&&Q(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&re(r,I[0]),(!k||L&16)&&Q(i,"active",I[4]),L&42&&(T=I[3],d=wt(d,L,M,1,I,T,m,c,es,np,null,xd),!T.length&&C?C.p(I,L):T.length?C&&(C.d(1),C=null):(C=ep(I),C.c(),C.m(c,null))),(!k||L&64)&&Q(c,"fade",I[6]),(!k||L&8)&&Q(c,"sidebar-content-compact",I[3].length>20),I[7]?D&&(D.d(1),D=null):D?D.p(I,L):(D=ip(I),D.c(),D.m(e,null));const F={};v.$set(F)},i(I){k||(A(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),D&&D.d(),I&&w(_),n[13](null),j(v,I),y=!1,Pe($)}}}function s4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function l4(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Lo,y=>t(6,a=y)),Ye(n,Cs,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const _=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var $;($=y.detail)!=null&&$.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&s4(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,h,_,v,k]}class o4 extends be{constructor(e){super(),ge(this,e,l4,i4,he,{})}}function sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function lp(n){n[18]=n[19].default}function op(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function rp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ap(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&rp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Ce(),c&&c.c(),s=O(),l=b("button"),r=H(o),a=O(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),g(l,r),g(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=rp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function up(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:u4,then:a4,catch:r4,value:19,blocks:[,,,]};return au(t=n[15].component,s),{c(){e=Ce(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&au(t,s)||db(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function r4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function a4(n){lp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=O()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){lp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function u4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function fp(n,e){let t,i,s,l=e[5]===e[14]&&up(e);return{key:n,first:null,c(){t=Ce(),l&&l.c(),i=Ce(),this.first=t},m(o,r){S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=up(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(A(l),s=!0)},o(o){P(lLine truncated
`),D&&D.c(),d=O(),h.c(),_=Ce(),p(e,"class","flex m-b-base flex-gap-10"),p(l,"class","list picker-list m-b-base svelte-1u8jhky"),p(f,"class","section-title")},m(N,R){S(N,e,R),q(t,e,null),g(e,i),$&&$.m(e,null),S(N,s,R),S(N,l,R);for(let K=0;K<o.length;K+=1)o[K].m(l,null);C&&C.m(l,null),S(N,u,R),S(N,f,R),g(f,c),D&&D.m(f,null),S(N,d,R),I[m].m(N,R),S(N,_,R),v=!0,k||(y=Ie(a=OM.call(null,l,n[36])),k=!0)},p(N,R){var U;const K={};R[0]&4&&(K.value=N[2]),R[0]&1024&&(K.autocompleteCollection=N[10]),t.$set(K),(U=N[10])!=null&&U.isView?$&&($.d(1),$=null):$?$.p(N,R):($=Op(N),$.c(),$.m(e,null)),R[0]&145324&&(T=N[3],ae(),o=wt(o,R,M,1,N,T,r,l,ln,Pp,null,Dp),ue(),!T.length&&C?C.p(N,R):T.length?C&&(C.d(1),C=null):(C=Ep(N),C.c(),C.m(l,null))),a&&Bt(a.update)&&R[0]&2064&&a.update.call(null,N[36]),N[5]>1?D?D.p(N,R):(D=Lp(N),D.c(),D.m(f,null)):D&&(D.d(1),D=null);let x=m;m=L(N),m===x?I[m].p(N,R):(ae(),P(I[x],1,1,()=>{I[x]=null}),ue(),h=I[m],h?h.p(N,R):(h=I[m]=E[m](N),h.c()),A(h,1),h.m(_.parentNode,_))},i(N){if(!v){A(t.$$.fragment,N);for(let R=0;R<T.length;R+=1)A(o[R]);A(h),v=!0}},o(N){P(t.$$.fragment,N);for(let R=0;R<o.length;R+=1)P(o[R]);P(h),v=!1},d(N){N&&w(e),j(t),$&&$.d(),N&&w(s),N&&w(l);for(let R=0;R<o.length;R+=1)o[R].d();C&&C.d(),N&&w(u),N&&w(f),D&&D.d(),N&&w(d),I[m].d(N),N&&w(_),k=!1,y()}}}function UM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=b("h4"),t=H("Select "),i=b("strong"),l=H(s),o=H(" records")},m(a,u){S(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function WM(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=b("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function YM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[WM],header:[UM],default:[BM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Je(o,l[a]);e=new Sn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new B1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?on(l,[l[0],l[1],xn(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&1024&&(c.collection=a[10]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Ar=100;function KM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=At(e,c),m;Ye(n,Ai,Ae=>t(26,m=Ae));const h=Ct(),_="picker_"+z.randomString(5);let{value:v}=e,{field:k}=e,y,$,T="",M=[],C=[],D=1,E=0,I=!1,L=!1;function F(){return t(2,T=""),t(3,M=[]),t(6,C=[]),R(),K(!0),y==null?void 0:y.show()}function N(){return y==null?void 0:y.hide()}async function R(){const Ae=z.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Ar))et.push(`id="${bt}"`);nt.push(me.collection(s).getFullList(Ar,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,C=[]);for(const et of Ae){const bt=z.findByKey(ie,"id",et);bt&&C.push(bt)}T.trim()||t(3,M=z.filterDuplicatesByKey(C.concat(M)))}catch(et){me.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(T.trim()?t(3,M=[]):t(3,M=z.toArray(C).slice()));try{const ie=Ae?1:D+1,we=await me.collection(s).getList(ie,Ar,{filter:T,sort:o!=null&&o.isView?"":"-created",$cancelKey:_+"loadList"});t(3,M=z.filterDuplicatesByKey(M.concat(we.items))),D=we.page,t(23,E=we.totalItems)}catch(ie){me.errorResponseHandler(ie)}t(4,I=!1)}}function x(Ae){i==1?t(6,C=[Ae]):u&&(z.pushOrReplaceByKey(C,Ae),t(6,C))}function U(Ae){z.removeByKey(C,"id",Ae.id),t(6,C)}function X(Ae){f(Ae)?U(Ae):x(Ae)}function ne(){var Ae;i!=1?t(20,v=C.map(ie=>ie.id)):t(20,v=((Ae=C==null?void 0:C[0])==null?void 0:Ae.id)||""),h("save",C),N()}function J(Ae){He.call(this,n,Ae)}const fe=()=>N(),Z=()=>ne(),de=Ae=>t(2,T=Ae.detail),ve=()=>$==null?void 0:$.show(),Te=Ae=>$==null?void 0:$.show(Ae),Ne=Ae=>X(Ae),Re=(Ae,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),X(Ae))},ye=()=>t(2,T=""),Se=()=>{a&&!I&&K()},We=Ae=>U(Ae);function lt(Ae){C=Ae,t(6,C)}function ce(Ae){se[Ae?"unshift":"push"](()=>{y=Ae,t(1,y)})}function ze(Ae){He.call(this,n,Ae)}function te(Ae){He.call(this,n,Ae)}function Fe(Ae){se[Ae?"unshift":"push"](()=>{$=Ae,t(7,$)})}const ot=Ae=>{z.removeByKey(M,"id",Ae.detail.id),M.unshift(Ae.detail),t(3,M),x(Ae.detail)},Ht=Ae=>{z.removeByKey(M,"id",Ae.detail.id),t(3,M),U(Ae.detail)};return Line truncated
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Hp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Qo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(m,h){S(m,e,h),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(e,r),a=!0,u||(f=[Ie(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var v;n=m;const _={};h&16&&(_.record=n[15]),h&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function ZM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y=n[4],$=[];for(let C=0;C<y.length;C+=1)$[C]=Hp(Fp(n,y,C));const T=C=>P($[C],1,1,()=>{$[C]=null});let M=null;return y.length||(M=qp(n)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=H(o),u=O(),f=b("div"),c=b("div");for(let C=0;C<$.length;C+=1)$[C].c();M&&M.c(),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,p(t,"class",i=Si(z.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m(C,D){S(C,e,D),g(e,t),g(e,s),g(e,l),g(l,r),S(C,u,D),S(C,f,D),g(f,c);for(let E=0;E<$.length;E+=1)$[E].m(c,null);M&&M.m(c,null),g(f,d),g(f,m),g(m,h),_=!0,v||(k=Y(h,"click",n[9]),v=!0)},p(C,D){if((!_||D&4&&i!==(i=Si(z.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!_||D&4)&&o!==(o=C[2].name+"")&&le(r,o),(!_||D&16384&&a!==(a=C[14]))&&p(e,"for",a),D&181){y=C[4];let E;for(E=0;E<y.length;E+=1){const I=Fp(C,y,E);$[E]?($[E].p(I,D),A($[E],1)):($[E]=Hp(I),$[E].c(),A($[E],1),$[E].m(c,null))}for(ae(),E=y.length;E<$.length;E+=1)T(E);ue(),!y.length&&M?M.p(C,D):y.length?M&&(M.d(1),M=null):(M=qp(C),M.c(),M.m(c,null))}},i(C){if(!_){for(let D=0;D<y.length;D+=1)A($[D]);_=!0}},o(C){$=$.filter(Boolean);for(let D=0;D<$.length;D+=1)P($[D]);_=!1},d(C){C&&w(e),C&&w(u),C&&w(f),pt($,C),M&&M.d(),v=!1,k()}}}function GM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[ZM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new JM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const zp=100;function XM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var T,M;const k=z.toArray(s);if(!((T=o==null?void 0:o.options)!=null&&T.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),$=[];for(;y.length>0;){const C=[];for(const D of y.splice(0,zp))C.push(`id="${D}"`);$.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(zp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all($).then(D=>{C=C.concat(...D)});for(const D of k){const E=z.findByKey(C,"id",D);E&&a.push(E)}t(4,a)}catch(C){me.errorResponseHandler(C)}t(5,u=!1)}function c(k){var y;z.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map($=>$.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map($=>$.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,m,h,_,v]}class QM extends be{constructor(e){super(),ge(this,e,XM,GM,he,{value:0,picker:1,field:2})}}const xM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],e5=(n,e)=>{xM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function t5(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Nr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function n5(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function i5(n){let e;function t(l,o){return l[1]?n5:t5}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:G,o:G,d(l){l&&w(e),s.d(),n[19](null)}}}const H1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),s5=()=>{let n={listeners:[],scriptId:H1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("scripLine truncated
...
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[5]),S(c,r,d),S(c,a,d),u||(f=Y(l,"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(l,"id",o),d&32&&re(l,c[5])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function A5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[C5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[M5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[D5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[O5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[E5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),a=O(),u=b("div"),V(f.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),V(_.$$.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){S($,e,T),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),q(f,u,null),g(t,c),g(t,d),q(m,d,null),g(t,h),q(_,t,null),v=!0,k||(y=Y(e,"submit",ft(n[17])),k=!0)},p($,T){const M={};T&25165828&&(M.$$scope={dirty:T,ctx:$}),s.$set(M);const C={};T&25165832&&(C.$$scope={dirty:T,ctx:$}),r.$set(C);const D={};T&25165840&&(D.$$scope={dirty:T,ctx:$}),f.$set(D);const E={};T&25165888&&(E.$$scope={dirty:T,ctx:$}),m.$set(E);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:$}),_.$set(I)},i($){v||(A(s.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(_.$$.fragment,$),v=!0)},o($){P(s.$$.fragment,$),P(r.$$.fragment,$),P(f.$$.fragment,$),P(m.$$.fragment,$),P(_.$$.fragment,$),v=!1},d($){$&&w(e),j(s),j(r),j(f),j(m),j(_),k=!1,y()}}}function I5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function P5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=H("Close"),i=O(),s=b("button"),l=b("i"),o=O(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function L5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[P5],header:[I5],default:[A5]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const po=15777e3;function N5(n,e,t){let i;const s=Ct(),l="apple_secret_"+z.randomString(5);let o,r,a,u,f,c,d=!1;function m(L={}){t(2,r=L.clientId||""),t(3,a=L.teamId||""),t(4,u=L.keyId||""),t(5,f=L.privateKey||""),t(6,c=L.duration||po),In({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const L=await me.send("/api/settings/apple/generate-client-secret",{method:"POST",body:{teamId:a,clientId:r,keyId:u,privateKey:f.trim(),duration:c}});t(7,d=!1),jt("Successfully generated client secret."),s("submit",L),o==null||o.hide()}catch(L){me.errorResponseHandler(L)}t(7,d=!1)}function v(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function y(){u=this.value,t(4,u)}function $(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const M=()=>_(),C=()=>!d;function D(L){se[L?"unshift":"push"](()=>{o=L,t(1,o)})}function E(L){He.call(this,n,L)}function I(L){He.call(this,n,L)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,l,_,m,v,k,y,$,T,M,C,D,E,I]}class F5 extends be{constructor(e){super(),ge(this,e,N5,L5,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function R5(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new F5({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=O(),s=b("span"),s.textContent="Generate secret",o=O(),V(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn- Line truncated
Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,$){$[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&$[0]&4&&c.update.call(null,{text:`Created: ${y[2].created}
Updated: ${y[2].updated}`,position:"left"}),$[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),$[0]&4&&_!==(_=y[2].id)&&m.value!==_&&(m.value=_)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),v=!1,k()}}}function Jp(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new S4({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Zp();return{c(){V(e.$$.fragment),i=O(),a&&a.c(),s=Ce()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,_;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Zp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Zp(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function K5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new QM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function J5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new DM({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function Z5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new sM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function G5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new eM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function X5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new G4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Q5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new f5({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function x5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Y4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function eD(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new z4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function tD(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new q4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={}; Line truncated
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function em(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function lD(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&xp(n),u=n[0].isAuth&&n[7].email&&em(n);return{c(){a&&a.c(),e=O(),u&&u.c(),t=O(),i=b("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=O(),l=b("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[Y(i,"click",n[25]),Y(l,"click",kn(ft(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=xp(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=em(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Pe(r)}}}function tm(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=O(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[10]===Gi),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[Y(t,"click",n[27]),Y(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===Gi),a[0]&1024&&Q(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Pe(o)}}}function oD(n){var _;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Qp(n),h=n[0].isAuth&&!n[2].isNew&&tm(n);return{c(){e=b("h4"),i=H(t),s=O(),l=b("strong"),r=H(o),a=H(" record"),u=O(),m&&m.c(),f=O(),h&&h.c(),c=Ce()},m(v,k){S(v,e,k),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),S(v,u,k),m&&m.m(v,k),S(v,f,k),h&&h.m(v,k),S(v,c,k),d=!0},p(v,k){var y;(!d||k[0]&4)&&t!==(t=v[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=v[0])==null?void 0:y.name)+"")&&le(r,o),v[2].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(v,k),k[0]&4&&A(m,1)):(m=Qp(v),m.c(),A(m,1),m.m(f.parentNode,f)),v[0].isAuth&&!v[2].isNew?h?h.p(v,k):(h=tm(v),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(v){d||(A(m),d=!0)},o(v){P(m),d=!1},d(v){v&&w(e),v&&w(u),m&&m.d(v),v&&w(f),h&&h.d(v),v&&w(c)}}}function rD(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),r=H(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[13]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=Y(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function aD(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[rD],header:[oD],default:[sD]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function nm(n){return JSON.stringify(n)}function uD(n,e,t){let i,s,l,o;const r=Ct(),a="record_"+z.randomString(5);let{collection:u}=e,f,c=null,d=new $i,m=!1,h=!1,_={},v={},k="",y=Gi;function $(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function T(){return f==null?void 0:f.hide()}async function M(ie){In({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new $i),t(3,_={}),t(4,v={}),await sn(),t(20,k=nm(d))}function C(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=E();let we;d.isNew?we=me.collection(u.id).create(ie):we=me.collection(u.id).update(d.id,ie),we.then(nt=>{jt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),T(),r("save",nt)}).catch(nt=>{me.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>me.collection(c.collectionId).delete(c.id).then(()=>{T(),jt("Successfully deleted record."),r("delete",c)}).catch(ie=>{me.errorResponseHandler(ie)}))}function E(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),z.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=z.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=z.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>me.collection(u.id).requestVerification(c.email).then(()=>{jt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>me.collection(u.id).requestPasswordReset(c.email).then(()=>{jt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function F(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}$(ie),await sn(),t(20,k="")}const R=()=>T(),K=()=>I(),x=()=>L(),U=()=>F(),X=()=>D(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function fe(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ve(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ye(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function ze(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),T()}),!1):(In({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Ht(ie){He.call(this,n,ie)}function Ae(ie){He.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=z.hasNonEmptyProps(_)||z.hasNonEmptyProps(v)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=nm(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,T,d,_,v,l,f,c,m,h,y,o,i,a,C,D,I,L,F,$,k,s,R,K,x,U,X,ne,J,fe,Z,de,ve,Te,Ne,Re,ye,Se,We,lt,ce,ze,te,Fe,ot,Ht,Ae]}class B1 extends be{constructor(e){super(),ge(this,e,uD,aD,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function fD(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ie(i=Be.call(null,e,n[2]?"":"Copy")),Y(e,"click",kn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Bt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function cD(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm lin Line truncated
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function GD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function XD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Am(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Im(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new xo({props:{value:n[55].id}});let c=n[2].isAuth&&Pm(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),a=H(r),u=O(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Pm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Pm(n){let e;function t(l,o){return l[55].verified?xD:QD}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function QD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function xD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Lm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Nm(n),o=i&&Fm(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=Ce()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Nm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Fm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Nm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].username)),t?tO:eO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function eO(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=H(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function tO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Fm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].email)),t?iO:nO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function nO(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=H(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function iO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Rm(n,e){let t,i,s,l;return i=new U1({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),p(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function qm(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){coLine truncated
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function hO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I,L,F=!n[10]&&Ym(n);c=new Aa({}),c.$on("refresh",n[16]);let N=!n[2].isView&&Km(n);k=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let x={collection:n[2]};return n[0]!==void 0&&(x.filter=n[0]),n[1]!==void 0&&(x.sort=n[1]),M=new cO({props:x}),n[20](M),se.push(()=>_e(M,"filter",R)),se.push(()=>_e(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=O(),l=b("div"),r=H(o),a=O(),u=b("div"),F&&F.c(),f=O(),V(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=O(),N&&N.c(),v=O(),V(k.$$.fragment),y=O(),$=b("div"),T=O(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-base")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),F&&F.m(u,null),g(u,f),q(c,u,null),g(e,d),g(e,m),g(m,h),g(m,_),N&&N.m(m,null),S(U,v,X),q(k,U,X),S(U,y,X),S(U,$,X),S(U,T,X),q(M,U,X),E=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,X){(!E||X[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?F&&(F.d(1),F=null):F?F.p(U,X):(F=Ym(U),F.c(),F.m(u,f)),U[2].isView?N&&(N.d(1),N=null):N?N.p(U,X):(N=Km(U),N.c(),N.m(m,null));const ne={};X[0]&1&&(ne.value=U[0]),X[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};X[0]&4&&(J.collection=U[2]),!C&&X[0]&1&&(C=!0,J.filter=U[0],ke(()=>C=!1)),!D&&X[0]&2&&(D=!0,J.sort=U[1],ke(()=>D=!1)),M.$set(J)},i(U){E||(A(c.$$.fragment,U),A(k.$$.fragment,U),A(M.$$.fragment,U),E=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),E=!1},d(U){U&&w(e),F&&F.d(),j(c),N&&N.d(),U&&w(v),j(k,U),U&&w(y),U&&w($),U&&w(T),n[20](null),j(M,U),I=!1,L()}}}function _O(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function gO(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function bO(n){let e,t,i;function s(r,a){return r[10]?gO:_O}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function vO(n){let e;return{c(){e=b("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function yO(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[mO,pO,dO],m=[];function h($,T){return $[3]&&!$[9].length?0:$[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new su({props:_}),n[25](s);let v={};o=new m4({props:v}),n[26](o);let k={collection:n[2]};a=new B1({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new jD({props:y}),n[30](f),{c(){t.c(),i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment)},m($,T){m[e].m($,T),S($,i,T),q(s,$,T),S($,l,T),q(o,$,T),S($,r,T),q(a,$,T),S($,u,T),q(f,$,T),c=!0},p($,T){let M=e;e=h($),e===M?m[e].p($,T):(ae(),P(m[M],1,1,()=>{m[M]=null}),ue(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const D={};o.$set(D);const E={};T[0]&4&&(E.collection=$[2]),a.$set(E);const I={};T[0]&4&&(I.collection=$[2]),f.$set(I)},i($){c||(A(t),A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){P(t),P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(f.$$.fragment,$),c=!1},d($){m[e].d($),$&&w(i),n[25](null),j(s,$),$&&w(l),n[26](null),j(o,$),$&&w(r),n[27](null),j(a,$),$&&w(u),n[30](null),j(f,$)}}}function kO(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,$t,Z=>t(31,l=Z)),Ye(n,Lo,Z=>t(3,o=Z)),Ye(n,ga,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,Cs,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function $(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!z.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}F1(y);const T=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>_==null?void 0:_.load(),D=()=>d==null?void 0:d.show(s),E=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function F(Z){v=Z,t(0,v)}function N(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function x(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function X(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function fe(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&jS(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&$(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Di("/collections?"+Z)}n.$$.dirty[0]&4&&Kt($t,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,T,M,C,D,E,I,L,F,N,R,K,x,U,X,ne,J,fe]}class wO extends be{constructor(e){super(),ge(this,e,kO,yO,he,{},null,[-1,-1])}}function SO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D,E,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=O(),l=b("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=O(),r=b("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=O(),u=b("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=O(),c=b("div"),c.innerHTML='<span class="txt">Sync</span>',d=O(),m=b("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=O(),_=b("a"),_.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,v=O(),k=b("div"),k.textContent="Authentication",y=O(),$=b("a"),$.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,T=O(),M=b("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=O(),D=b("a"),D.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(k,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(D,"href","/settings/admins"),p(D,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,F){S(L,e,F),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),g(t,f),g(t,c),g(t,d),g(t,m),g(t,h),g(t,_),g(t,v),g(t,k),g(t,y),g(t,$),g(t,T),g(t,M),g(t,C),g(t,D),E||(I=[Ie(jn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(jn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(jn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(jn.call(null,m,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,m)),Ie(jn.call(null,_,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,_)),Ie(jn.call(null,$,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,$)),Ie(jn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(jn.call(null,D,{path:"/settings/admins/?.*"})),Ie(xt.call(null,D))],E=!0)},p:G,i:G,o:G,d(L){L&&w(e),E=!1,Pe(I)}}}class Ii extends be{constructor(e){super(),ge(this,e,null,SO,he,{})}}function Jm(n,e,t){const i=n.slice();return i[30]=e[t],i}function Zm(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[$O,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function $O(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",o=O(),r=b("div"),a=b("i"),f=O(),c=b("input"),p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=m=n[1].id,c.readOnly=!0},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),S(v,r,k),g(r,a),S(v,f,k),S(v,c,k),h||(_=Ie(u=Be.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&p(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created}
Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c,"id",d),k[0]&2&&m!==(m=v[1].id)&&c.value!==m&&(c.value=m)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(c),h=!1,_()}}}function Gm(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=b("button"),t=b("img"),s=O(),zn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),g(e,t),g(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function TO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Email",o=O(),r=b("input"),p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Xm(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[CO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function CO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=H("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Qm(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[MO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[DO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&536871424|c[1]&4&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{a||(a=qe(t,St,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=qe(t,St,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function MO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&re(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function DO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&re(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function OO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[1].isNew&&Zm(n),_=[0,1,2,3,4,5,6,7,8,9],v=[];for(let $=0;$<10;$+=1)v[$]=Gm(Jm(n,_,$));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[TO,({uniqueId:$})=>({29:$}),({uniqueId:$})=>[$?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].isNew&&Xm(n),y=(n[1].isNew||n[4])&&Qm(n);return{c(){e=b("form"),h&&h.c(),t=O(),i=b("div"),s=b("p"),s.textContent="Avatar",l=O(),o=b("div");for(let $=0;$<10;$+=1)v[$].c();r=O(),V(a.$$.fragment),u=O(),k&&k.c(),f=O(),y&&y.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m($,T){S($,e,T),h&&h.m(e,null),g(e,t),g(e,i),g(i,s),g(i,l),g(i,o);for(let M=0;M<10;M+=1)v[M].m(o,null);g Line truncated
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function IO(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&xm(n);return{c(){m&&m.c(),e=O(),t=b("button"),i=b("span"),i.textContent="Cancel",s=O(),l=b("button"),o=b("span"),a=H(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,_){m&&m.m(h,_),S(h,e,_),S(h,t,_),g(t,i),S(h,s,_),S(h,l,_),g(l,o),g(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,_){h[1].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(h,_),_[0]&2&&A(m,1)):(m=xm(h),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=h[6]),(!f||_[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||_[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||_[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(m),f=!0)},o(h){P(m),f=!1},d(h){m&&m.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function PO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[IO],header:[EO],default:[OO]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function LO(n,e,t){let i;const s=Ct(),l="admin_"+z.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function _(U){return k(U),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(U){t(1,r=U!=null&&U.clone?U.clone():new Xi),y()}function y(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,m=""),In({})}function $(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||h)&&(U.password=d,U.passwordConfirm=m);let X;r.isNew?X=me.admins.create(U):X=me.admins.update(r.id,U),X.then(async ne=>{var J;t(7,u=!1),v(),jt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((J=me.authStore.model)==null?void 0:J.id)===ne.id&&me.authStore.save(me.authStore.token,ne)}).catch(ne=>{me.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function T(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),v(),jt("Successfully deleted admin."),s("delete",r)}).catch(U=>{me.errorResponseHandler(U)}))}const M=()=>T(),C=()=>v(),D=U=>t(2,f=U);function E(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function F(){m=this.value,t(9,m)}const N=()=>i&&u?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function R(U){se[U?"unshift":"push"](()=>{o=U,t(5,o)})}function K(U){He.call(this,n,U)}function x(U){He.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[v,r,f,c,h,o,a,u,d,m,i,l,$,T,_,M,C,D,E,I,L,F,N,R,K,x]}class NO extends be{constructor(e){super(),ge(this,e,LO,PO,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function eh(n,e,t){const i=n.slice();return i[24]=e[t],i}function FO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function RO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function qO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function jO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="updated",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function th(n){let e;function t(l,o){return l[5]?HO:VO}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function VO(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&nh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(Line truncated
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function nh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function ih(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function sh(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,_,v,k,y,$=e[24].email+"",T,M,C,D,E,I,L,F,N,R,K,x,U,X;f=new xo({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&ih();E=new ui({props:{date:e[24].created}}),F=new ui({props:{date:e[24].updated}});function J(){return e[15](e[24])}function fe(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("figure"),l=b("img"),r=O(),a=b("td"),u=b("div"),V(f.$$.fragment),c=O(),d=b("span"),h=H(m),_=O(),ne&&ne.c(),v=O(),k=b("td"),y=b("span"),T=H($),C=O(),D=b("td"),V(E.$$.fragment),I=O(),L=b("td"),V(F.$$.fragment),N=O(),R=b("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',K=O(),zn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(y,"class","txt txt-ellipsis"),p(y,"title",M=e[24].email),p(k,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(L,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,de){S(Z,t,de),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,u),q(f,u,null),g(u,c),g(u,d),g(d,h),g(a,_),ne&&ne.m(a,null),g(t,v),g(t,k),g(k,y),g(y,T),g(t,C),g(t,D),q(E,D,null),g(t,I),g(t,L),q(F,L,null),g(t,N),g(t,R),g(t,K),x=!0,U||(X=[Y(t,"click",J),Y(t,"keydown",fe)],U=!0)},p(Z,de){e=Z,(!x||de&16&&!zn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ve={};de&16&&(ve.value=e[24].id),f.$set(ve),(!x||de&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?ne||(ne=ih(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!x||de&16)&&$!==($=e[24].email+"")&&le(T,$),(!x||de&16&&M!==(M=e[24].email))&&p(y,"title",M);const Te={};de&16&&(Te.date=e[24].created),E.$set(Te);const Ne={};de&16&&(Ne.date=e[24].updated),F.$set(Ne)},i(Z){x||(A(f.$$.fragment,Z),A(E.$$.fragment,Z),A(F.$$.fragment,Z),x=!0)},o(Z){P(f.$$.fragment,Z),P(E.$$.fragment,Z),P(F.$$.fragment,Z),x=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(E),j(F),U=!1,Pe(X)}}}function zO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M=[],C=new Map,D;function E(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[FO]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Wt({props:I}),se.push(()=>_e(o,"sort",E));function L(J){n[12](J)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[RO]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new Wt({props:F}),se.push(()=>_e(u,"sort",L));function N(J){n[13](J)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[qO]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),se.push(()=>_e(d,"sort",N));function K(J){n[14](J)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[jO]},$$scope:{ctx:n}};n[2]!==void 0&&(x.sort=n[2]),_=new Wt({props:x}),se.push(()=>_e(_,"sort",K));let U=n[4];const X=J=>J[24].id;for(let J=0;J<U.length;J+=1){let fe=eh(n,U,J),Z=X(fe);C.set(Z,M[J]=sh(Z,fe))}let ne=null;return U.length||(ne=th(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),s=b("th"),l=O(),V(o.$$.fragment),a=O(),V(u.$$.fragment),c=O(),V(d.$$.fragment),h=O(),V(_.$$.fragment),k=O(),y=b("th"),$=O(),T=b("tbody");for(let J=0;J<M.length;J+=1)M[J].c();ne&&ne.c(),p(s,"class","min-width"),p(y,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[5])},m(J,fe){S(J,e,fe),g(e,t),g(t,i),g(i,s),g(i,l),q(o,i,null),g(i,a),q(u,i,null),g(i,c),q(d,i,null),g(i,h),q(_,i,null),g(i,k),g(i,y),g(e,$),g(e,T);for(let Z=0;Z<M.length;Z+=1)M[Z].m(T,null);ne&&ne.m(T,null),D=!0},p(J,fe){const Z={};fe&134217728&&(Z.$$scope={dirty:fe,ctx:J}),!r&&fe&4&&(r=!0,Z.sort=J[2],ke(()=>r=!1)),o.$set(Z);const de={};fe&134217728&&(de.$$scope={dirty:fe,ctx:J}),!f&&fe&4&&(f=!0,de.sort=J[2],ke(()=>f=!1)),u.$set(de);const ve={};fe&134217728&&(ve.$$scope={dirty:fe,ctx:J}),!m&&fe&4&&(m=!0,ve.sort=J[2],ke(()=>m=!1)),d.$set(ve);const Te={};fe&134217728&&(Te.$$scope={dirty:fe,ctx:J}),!v&&fe&4&&(v=!0,Te.sort=J[2],ke(()=>v=!1)),_.$set(Te),fe&186&&(U=J[4],ae(),M=wt(M,fe,X,1,J,U,C,T,ln,sh,null,eh),ue(),!U.length&&ne?ne.p(J,fe):U.length?ne&&(ne.d(1),ne=null):(ne=th(J),ne.c(),ne.m(T,null))),(!D||fe&32)&&Q(e,"table-loading",J[5])},i(J){if(!D){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J),A(_.$$.fragment,J);for(let fe=0;fe<U.length;fe+=1)A(M[fe]);D=!0}},o(J){P(o.$$.fragment,J),P(u.$$.fragment,J),P(d.$$.fragment,J),P(_.$$. Line truncated
<span class="txt">New admin</span>`,m=O(),V(h.$$.fragment),_=O(),v=b("div"),k=O(),V(y.$$.fragment),$=O(),E&&E.c(),T=Ce(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(v,"class","clearfix m-b-base")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),q(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),S(I,m,L),q(h,I,L),S(I,_,L),S(I,v,L),S(I,k,L),q(y,I,L),S(I,$,L),E&&E.m(I,L),S(I,T,L),M=!0,C||(D=Y(d,"click",n[9]),C=!0)},p(I,L){(!M||L&64)&&le(o,I[6]);const F={};L&2&&(F.value=I[1]),h.$set(F);const N={};L&134217918&&(N.$$scope={dirty:L,ctx:I}),y.$set(N),I[4].length?E?E.p(I,L):(E=lh(I),E.c(),E.m(T.parentNode,T)):E&&(E.d(1),E=null)},i(I){M||(A(a.$$.fragment,I),A(h.$$.fragment,I),A(y.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(y.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(m),j(h,I),I&&w(_),I&&w(v),I&&w(k),j(y,I),I&&w($),E&&E.d(I),I&&w(T),C=!1,D()}}}function UO(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[BO]},$$scope:{ctx:n}}});let r={};return l=new NO({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function WO(n,e,t){let i,s,l;Ye(n,ga,F=>t(21,i=F)),Ye(n,$t,F=>t(6,s=F)),Ye(n,Ea,F=>t(7,l=F)),Kt($t,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),m(),me.errorResponseHandler(F,!1))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),v=F=>t(1,f=F.detail);function k(F){c=F,t(2,c)}function y(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}const M=F=>r==null?void 0:r.show(F),C=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,f="");function E(F){se[F?"unshift":"push"](()=>{r=F,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Di("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,h,_,v,k,y,$,T,M,C,D,E,I,L]}class YO extends be{constructor(e){super(),ge(this,e,WO,UO,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Email"),s=O(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=H("Password"),s=O(),l=b("input"),r=O(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[1]),S(d,r,m),S(d,a,m),g(a,u),f||(c=[Y(l,"input",n[5]),Ie(xt.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Pe(c)}}}function ZO(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[KO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[JO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Admin sign in</h4>",i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),a=b("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),g(e,a),u=!0,f||(c=Y(e,"submit",ft(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function GO(n){let e,t;return e=new Ng({props:{$$slots:{default:[ZO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function XO(n,e,t){let i;Ye(n,ga,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Da(),Di("/")}).catch(()=>{dl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class QO extends be{constructor(e){super(),ge(this,e,XO,GO,he,{})}}function xO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[tE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[nE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[iE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[sE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&oh(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),c=O(),d=b("div"),m=b("div"),h=O(),C&&C.c(),_=O(),v=b("button"),k=b("span"),k.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(k,"class","txt"),p(v,"type","submit"),p(v,"class","btn btn-expanded"),v.disabled=y=!n[3]||n[2],Q(v,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(D,E){S(D,e,E),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),q(a,e,null),g(e,u),q(f,e,null),g(e,c),g(e,d),g(d,m),g(d,h),C&&C.m(d,null),g(d,_),g(d,v),g(v,k),$=!0,T||(M=Y(v,"click",n[13]),T=!0)},p(D,E){const I={};E&1572865&&(I.$$scope={dirty:E,ctx:D}),i.$set(I);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:D}),a.$set(F);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:D}),f.$set(N),D[3]?C?C.p(D,E):(C=oh(D),C.c(),C.m(d,_)):C&&(C.d(1),C=null),(!$||E&12&&y!==(y=!D[3]||D[2]))&&(v.disabled=y),(!$||E&4)&&Q(v,"btn-loading",D[2])},i(D){$||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(a.$$.fragment,D),A(f.$$.fragment,D),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),$=!1},d(D){D&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),T=!1,M()}}}function eE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function tE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Application name"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&re(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function nE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Application url"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&re(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Logs max days retention"),s=O(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].logs.maxDays&&re(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function sE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("spanLine truncated
<div class="breadcrumb-item">Application</div></nav>`,t=O(),i=b("div"),s=b("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",ft(n[4])),a=!0)},p(m,h){let _=l;l=d(m),l===_?c[l].p(m,h):(ae(),P(c[_],1,1,()=>{c[_]=null}),ue(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),c[l].d(),a=!1,u()}}}function oE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[lE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function rE(n,e,t){let i,s,l,o;Ye(n,Cs,C=>t(14,s=C)),Ye(n,ko,C=>t(15,l=C)),Ye(n,$t,C=>t(16,o=C)),Kt($t,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await me.settings.getAll()||{};h(C)}catch(C){me.errorResponseHandler(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await me.settings.update(z.filterRedactedProps(a));h(C),jt("Successfully saved application settings.")}catch(C){me.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var D,E;Kt(ko,l=(D=C==null?void 0:C.meta)==null?void 0:D.appName,l),Kt(Cs,s=!!((E=C==null?void 0:C.meta)!=null&&E.hideControls),s),t(0,a={meta:(C==null?void 0:C.meta)||{},logs:(C==null?void 0:C.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=mt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,_,r,c,v,k,y,$,T,M]}class aE extends be{constructor(e){super(),ge(this,e,rE,oE,he,{})}}function uE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Je(l,s[o]);return{c(){e=b("input"),Xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),re(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Xn(e,l=on(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&re(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function fE(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Xn(s,a)},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(Be.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Xn(s,a=on(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Pe(o)}}}function cE(n){let e;function t(l,o){return l[3]?fE:uE}let i=t(n),s=i(n);return{c(){s.c(),e=Ce()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function dE(n,e,t){const i=["value","mask"];let s=At(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(5,s=At(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class ou extends be{constructor(e){super(),ge(this,e,dE,cE,he,{value:0,mask:1})}}function pE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=H("Subject"),s=O(),l=b("input"),r=O(),a=b("div"),u=H(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=H(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=H("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),S(v,l,k),re(l,n[0].subject),S(v,r,k),S(v,a,k),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),h||(_=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&p(e,"for",i),k[1]&1&&o!==(o=v[31])&&p(l,"id",o),k[0]&1&&l.value!==v[0].subject&&re(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),h=!1,Pe(_)}}}function mE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=H("Action URL"),s=O(),l=b("input"),r=O(),a=b("div"),u=H(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=H(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=H(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,_=H("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(y,$){S(y,e,$),g(e,t),S(y,s,$),S(y,l,$),re(l,n[0].actionUrl),S(y,r,$),S(y,a,$),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),v||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],v=!0)},p(y,$){$[1]&1&&i!==(i=y[31])&&p(e,"for",i),$[1]&1&&o!==(o=y[31])&&p(l,"id",o),$[0]&1&&l.value!==y[0].actionUrl&&re(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),v=!1,Pe(k)}}}function hE(n){let e,t,i,s;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),re(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&re(e,l[0].body)},i:G,o:G,d(l){l&&w(e),i=!1,s()}}}function _E(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Vt(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&V(e.$$.fragment),i=Ce()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Vt(o,r(a)),se.push(()=>_e(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function gE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T;const M=[_E,hE],C=[];function D(E,I){return E[4]&&!E[5]?0:1}return l=D(n),o=C[l]=M[l](n),{c(){e=b("label"),t=H("Body (HTML)"),s=O(),o.c(),r=O(),a=b("div"),u=H(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=H(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=H(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,_=H(`,
`),v=b("button"),v.textContent=`{ACTION_URL}
`,k=H("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(E,I){S(E,e,I),g(e,t),S(E,s,I),C[l].m(E,I),S(E,r,I),S(E,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,$||(T=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],$=!0)},p(E,I){(!y||I[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let L=l;l=D(E),l===L?C[l].p(E,I):(ae(),P(C[L],1,1,()=>{C[L]=null}),ue(),o=C[l],o?o.p(E,I):(o=C[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){y||(A(o),y=!0)},o(E){P(o),y=!1},d(E){E&&w(e),E&&w(s),C[l].d(E),E&&w(r),E&&w(a),$=!1,Pe(T)}}}function bE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[pE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[mE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[gE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function rh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{t||(t=qe(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=qe(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function vE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&rh();return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),l=H(n[2]),o=O(),r=b("div"),a=O(),f&&f.c(),u=Ce(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=rh(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),P(f,1,1,()=>{f=null}),ue())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function yE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[vE],default:[bE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?on(i,[xn(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let ah;function kE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=At(e,s),o;Ye(n,fi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=ah,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-cee841da.js"),["./CodeEditor-cee841da.js","./index-a6ccb683.js"],import.meta.url)).default),ah=c,t(5,d=!1))}function k(J){z.copyToClipboard(J),Pg(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const C=()=>k("{APP_NAME}"),D=()=>k("{APP_URL}"),E=()=>k("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function L(){u.body=this.value,t(0,u)}const F=()=>k("{APP_NAME}"),N=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),K=()=>k("{ACTION_URL}");function x(J){se[J?"unshift":"push"](()=>{f=J,t(3,f)})}function U(J){He.call(this,n,J)}function X(J){He.call(this,n,J)}function ne(J){He.call(this,n,J)}return n.$$set=J=>{e=Je(Je({},e),Qn(J)),t(8,l=At(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Qi(r))},[u,r,a,f,c,d,i,k,l,m,h,_,o,y,$,T,M,C,D,E,I,L,F,N,R,K,x,U,X,ne]}class Pr extends be{constructor(e){super(),ge(this,e,kE,yE,he,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return thi Line truncated
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function zE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function BE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[AE,EE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=H(n[5]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[27])),_=!0)},p(T,M){(!h||M[0]&32)&&le(o,T[5]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){h||(A(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function UE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[BE]},$$scope:{ctx:n}}});let r={};return l=new OE({props:r}),n[28](l),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function WE(n,e,t){let i,s,l;Ye(n,$t,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt($t,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ne=await me.settings.getAll()||{};_(ne)}catch(ne){me.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await me.settings.update(z.filterRedactedProps(f));_(ne),In({}),jt("Successfully saved mail settings.")}catch(ne){me.errorResponseHandler(ne)}t(3,d=!1)}}function _(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function $(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function T(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=mt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function N(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),x=()=>a==null?void 0:a.show(),U=()=>h();function X(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,v,u,i,k,y,$,T,M,C,D,E,I,L,F,N,R,K,x,U,X]}class YE extends be{constructor(e){super(),ge(this,e,WE,UE,he,{},null,[-1,-1])}}function KE(n){var T,M;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[ZE,({uniqueId:C})=>({25:C}),({uniqueId:C})=>C?33554432:0]},$$scope:{ctx:n}}});let v=((T=n[0].s3)==null?void 0:T.enabled)!=n[1].s3.enabled&&ph(n),k=n[1].s3.enabled&&mh(n),y=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&hh(n),$=n[6]&&_h(n);return{c(){V(e.$$.fragment),t=O(),v&&v.c(),i=O(),k&&k.c(),s=O(),l=b("div"),o=b("div"),r=O(),y&&y.c(),a=O(),$&&$.c(),u=O(),f=b("button"),c=b("span"),c.textContent="Save changes",p(o,"class",Line truncated
the
`),r=b("strong"),u=H(a),f=H(`
to the
`),c=b("strong"),m=H(d),h=H(`.
`),_=b("br"),v=H(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
`,y=H(`,
`),$=b("a"),$.textContent=`s5cmd
`,T=H(", etc."),M=O(),C=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(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(C,"class","clearfix m-t-base")},m(L,F){S(L,e,F),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(c,m),g(l,h),g(l,_),g(l,v),g(l,k),g(l,y),g(l,$),g(l,T),g(e,M),g(e,C),E=!0},p(L,F){var N;(!E||F&1)&&a!==(a=(N=L[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!E||F&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(L){E||(L&&Ge(()=>{D||(D=qe(e,St,{duration:150},!0)),D.run(1)}),E=!0)},o(L){L&&(D||(D=qe(e,St,{duration:150},!1)),D.run(0)),E=!1},d(L){L&&w(e),L&&D&&D.end()}}}function mh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[GE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[XE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[QE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[xE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[eA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),y=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[tA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),v=O(),k=b("div"),V(y.$$.fragment),$=O(),T=b("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(D,E){S(D,e,E),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,$),g(e,T),C=!0},p(D,E){const I={};E&100663298&&(I.$$scope={dirty:E,ctx:D}),i.$set(I);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:D}),u.$set(F);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:D}),d.$set(N);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:D}),_.$set(R);const K={};E&100663298&&(K.$$scope={dirty:E,ctx:D}),y.$set(K)},i(D){C||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(y.$$.fragment,D),D&&Ge(()=>{M||(M=qe(e,St,{duration:150},!0)),M.run(1)}),C=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=qe(e,St,{duration:150},!1)),M.run(0)),C=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function GE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Endpoint"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&re(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function XE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Bucket"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&re(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Region"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.region),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.region&&re(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function xE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=H("Access key"),s=O(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.accessKey),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==( Line truncated
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function iA(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function sA(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function _h(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function lA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[JE,KE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=H(n[7]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[20])),_=!0)},p(T,M){(!h||M&128)&&le(o,T[7]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){h||(A(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function oA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[lA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function rA(n,e,t){let i,s,l;Ye(n,$t,N=>t(7,l=N)),Kt($t,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const N=await me.settings.getAll()||{};_(N)}catch(N){me.errorResponseHandler(N)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(lo);const N=await me.settings.update(z.filterRedactedProps(r));In({}),await _(N),Da(),c?qv("Successfully saved but failed to establish S3 connection."):jt("Successfully saved files storage settings.")}catch(N){me.errorResponseHandler(N)}t(3,u=!1)}}async function _(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){me.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:lo})}catch(N){t(5,c=N)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){r.s3.enabled=this.checked,t(1,r)}function $(){r.s3.endpoint=this.value,t(1,r)}function T(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function D(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>v(),L=()=>h(),F=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,v,i,y,$,T,M,C,D,E,I,L,F]}class aA extends be{constructor(e){super(),ge(this,e,rA,oA,he,{})}}function uA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function fA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=H("Client ID"),s=O(),l=b("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&p(e,"for",i),c&2097152&&o!==(o=f[21])&&p(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&re(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function cA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new ou({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=H("Client secret"),s=O(),V(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function gh(n){let e,t,i,s;function l(a){n[16](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=Vt(o,r(n)),se.push(()=>_e(t,"config",l))),{c(){e=b("div"),t&&V(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&q(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],ke(()=>i=!1)),o!==(o=a[4])){if(t){ae();const c=t;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(t=Vt(o,r(a)),se.push(()=>_e(t,"config",l)),V(t.$$.fragment),A(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}functionLine truncated
another PocketBase environment.</p>`,t=O(),i=b("div"),s=b("button"),s.innerHTML='<span class="txt">Copy</span>',l=O(),V(o.$$.fragment),r=O(),a=b("div"),u=b("div"),f=O(),c=b("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,v){S(_,e,v),S(_,t,v),S(_,i,v),g(i,s),g(i,l),q(o,i,null),n[8](i),S(_,r,v),S(_,a,v),g(a,u),g(a,f),g(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){d||(A(o.$$.fragment,_),d=!0)},o(_){P(o.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(t),_&&w(i),j(o),n[8](null),_&&w(r),_&&w(a),m=!1,Pe(h)}}}function PA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function LA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[PA,IA],h=[];function _(v,k){return v[1]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=H(n[3]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function NA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[LA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function FA(n,e,t){let i,s;Ye(n,$t,v=>t(3,s=v)),Kt($t,s="Export collections",s);const l="export_"+z.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let v of r)delete v.created,delete v.updated}catch(v){me.errorResponseHandler(v)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function c(){z.copyToClipboard(i),Pg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,_]}class RA extends be{constructor(e){super(),ge(this,e,FA,NA,he,{})}}function Dh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Eh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Ih(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ph(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Lh(n,e,t){const i=n.slice();return i[30]=e[t],i}function qA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Nh(),a=n[0].name!==n[1].name&&Fh(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=b("strong"),o=H(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Nh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Fh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function jA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),l=H(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function VA(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Added",t=O(),i=b("strong"),l=H(s),p(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function Nh(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Fh(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=H(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Rh(n){var v,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((v=n[0])==null?void Line truncated
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=O(),o=b("tbody");for(let T=0;T<h.length;T+=1)h[T].c();r=O(),_&&_.c(),a=O();for(let T=0;T<k.length;T+=1)k[T].c();u=O();for(let T=0;T<$.length;T+=1)$[T].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(T,M){S(T,e,M),d.m(e,null),S(T,t,M),S(T,i,M),g(i,s),g(i,l),g(i,o);for(let C=0;C<h.length;C+=1)h[C].m(o,null);g(o,r),_&&_.m(o,null),g(o,a);for(let C=0;C<k.length;C+=1)k[C].m(o,null);g(o,u);for(let C=0;C<$.length;C+=1)$[C].m(o,null)},p(T,M){if(c===(c=f(T))&&d?d.p(T,M):(d.d(1),d=c(T),d&&(d.c(),d.m(e,null))),M[0]&7203){m=T[11];let C;for(C=0;C<m.length;C+=1){const D=Lh(T,m,C);h[C]?h[C].p(D,M):(h[C]=Rh(D),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=m.length}if(T[2]||T[5]?_?_.p(T,M):(_=qh(T),_.c(),_.m(o,a)):_&&(_.d(1),_=null),M[0]&4248){v=T[7];let C;for(C=0;C<v.length;C+=1){const D=Eh(T,v,C);k[C]?k[C].p(D,M):(k[C]=Bh(D),k[C].c(),k[C].m(o,u))}for(;C<k.length;C+=1)k[C].d(1);k.length=v.length}if(M[0]&4352){y=T[8];let C;for(C=0;C<y.length;C+=1){const D=Dh(T,y,C);$[C]?$[C].p(D,M):($[C]=Wh(D),$[C].c(),$[C].m(o,null))}for(;C<$.length;C+=1)$[C].d(1);$.length=y.length}},i:G,o:G,d(T){T&&w(e),d.d(),T&&w(t),T&&w(i),pt(h,T),_&&_.d(),pt(k,T),pt($,T)}}}function Dn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function un(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function zA(n,e,t){let i,s,l,{collectionA:o=new pn}=e,{collectionB:r=new pn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const h=Object.keys(new pn().export()).filter(k=>!["schema","created","updated"].includes(k));function _(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find(y=>k.id==y.id))))}function v(k){return typeof k>"u"?"":z.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(y=>k.id==y.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(y=>y.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(y=>y.id==k.id))),n.$$.dirty[0]&7&&t(9,l=z.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,h,v]}class BA extends be{constructor(e){super(),ge(this,e,zA,HA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Yh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Kh(n){let e,t;return e=new BA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function UA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Kh(Yh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Ce()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Yh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Kh(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){pt(s,o),o&&w(e)}}}function WA(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function YA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=H("Close"),i=O(),s=b("button"),l=b("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],Q(s,"btn-loading",n[4])},m(a,u){S(a,e,u),g(e,t),S(a,i,u),S(a,s,u),g(s,l),o||(r=[Y(e,"click",n[0]),Y(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&Q(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function KA(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[YA],header:[WA],default:[UA]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function JA(n,e,t){const i=Ct();let s,l=[Line truncated
- ${T.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),jt("Successfully imported collections configuration."),i("submit")}catch(T){me.errorResponseHandler(T)}t(4,u=!1),c()}}const _=()=>m(),v=()=>!u;function k(T){se[T?"unshift":"push"](()=>{s=T,t(1,s)})}function y(T){He.call(this,n,T)}function $(T){He.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,_,v,k,y,$]}class ZA extends be{constructor(e){super(),ge(this,e,JA,KA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Jh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Gh(n,e,t){const i=n.slice();return i[32]=e[t],i}function GA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,D;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[QA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,I=n[6]&&n[1].length&&!n[7]&&Qh(),L=n[6]&&n[1].length&&n[7]&&xh(n),F=n[13].length&&f_(n),N=!!n[0]&&c_(n);return{c(){e=b("input"),t=O(),i=b("div"),s=b("p"),l=H(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=O(),V(a.$$.fragment),u=O(),f=O(),I&&I.c(),c=O(),L&&L.c(),d=O(),F&&F.c(),m=O(),h=b("div"),N&&N.c(),_=O(),v=b("div"),k=O(),y=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(v,"class","flex-fill"),p($,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=T=!n[14],p(h,"class","flex m-t-base")},m(R,K){S(R,e,K),n[19](e),S(R,t,K),S(R,i,K),g(i,s),g(s,l),g(s,o),S(R,r,K),q(a,R,K),S(R,u,K),S(R,f,K),I&&I.m(R,K),S(R,c,K),L&&L.m(R,K),S(R,d,K),F&&F.m(R,K),S(R,m,K),S(R,h,K),N&&N.m(h,null),g(h,_),g(h,v),g(h,k),g(h,y),g(y,$),M=!0,C||(D=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],C=!0)},p(R,K){(!M||K[0]&4096)&&Q(o,"btn-loading",R[12]);const x={};K[0]&64&&(x.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(x.$$scope={dirty:K,ctx:R}),a.$set(x),R[6]&&R[1].length&&!R[7]?I||(I=Qh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=xh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?F?F.p(R,K):(F=f_(R),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),R[0]?N?N.p(R,K):(N=c_(R),N.c(),N.m(h,_)):N&&(N.d(1),N=null),(!M||K[0]&16384&&T!==(T=!R[14]))&&(y.disabled=T)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){P(a.$$.fragment,R),P(E),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),F&&F.d(R),R&&w(m),R&&w(h),N&&N.d(),C=!1,Pe(D)}}}function XA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function Xh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function QA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Xh();return{c(){e=b("label"),t=H("Collections"),s=O(),l=b("textarea"),r=O(),c&&c.c(),a=Ce(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&re(l,d[0]),d[0]&&!d[6]?c||(c=Xh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Qh(n){let e;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xh(n){let e,t,i,s,l,o=n[9].length&&e_(n),r=n[4].length&&i_(n),a=n[8].length&&r_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=e_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=i_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=r_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function e_(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Gh(n,s,o),a=l(r);t.set(a,e[o]=n_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=wt(e,r,l,1,o,s,t,i.parentNode,es,n_,i,Gh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function t_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=H("("),s=H(i),l=H(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function n_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&t_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",s=O(),l=b("strong"),r=H(o),a=O(),f&&f.c(),u=O(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=t_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function i_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=Zh(n,s,o),a=l(r);t.set(a,e[o]=o_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=wt(e,r,l,1,o,s,t,i.parentNode,es,o_,i,Zh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function s_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=b("strong"),i=H(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function l_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=b("small"),t=H("("),s=H(i),l=H(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function o_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&s_(e),m=e[35].new.id&&l_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",s=O(),l=b("div"),d&&d.c(),o=O(),r=b("strong"),u=H(a),f=O(),m&&m.c(),c=O(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(h,_){S(h,t,_),g(t,i),g(t,s),g(t,l),d&&d.m(l,null),g(l,o),g(l,r),g(r,u),g(l,f),m&&m.m(l,null),g(t,c)},p(h,_){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,_):(d=s_(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),_[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,_):(m=l_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(h){h&&w(t),d&&d.d(),m&&m.d()}}}function r_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Jh(n,s,o),a=l(r);t.set(a,e[o]=u_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ce()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,es,u_,i,Jh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function a_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=H("("),s=H(i),l=H(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function u_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&a_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",s=O(),l=b("strong"),r=H(o),a=O(),f&&f.c(),u=O(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=a_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function f_(n){let e,t,i,s,l,o,r,a;return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=b("div"),s.innerHTML=`<string>Some of the imported collections share the same name and/or fields but are
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=O(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:G,d(u){u&&w(e),r=!1,a()}}}function c_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function xA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[XA,GA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=H(n[15]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),A(c,1),c.m(u,null))},i(v){d||(A(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function e6(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[xA]},$$scope:{ctx:n}}});let r={};return l=new ZA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function t6(n,e,t){let i,s,l,o,r,a,u;Ye(n,$t,J=>t(15,u=J)),Kt($t,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;$();async function $(){t(5,y=!0);try{t(2,_=await me.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){me.errorResponseHandler(J)}t(5,y=!1)}function T(){if(t(4,k=[]),!!i)for(let J of h){const fe=z.findByKey(_,"id",J.id);!(fe!=null&&fe.id)||!z.hasCollectionChanges(fe,J,v)||k.push({new:J,old:fe})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=z.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=z.filterDuplicatesByKey(J.schema)}function C(){var J,fe;for(let Z of h){const de=z.findByKey(_,"name",Z.name)||z.findByKey(_,"id",Z.id);if(!de)continue;const ve=Z.id,Te=de.id;Z.id=Te;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const ye of Re){const Se=z.findByKey(Ne,"name",ye.name);Se&&Se.id&&(ye.id=Se.id)}for(let ye of h)if(Array.isArray(ye.schema))for(let Se of ye.schema)(J=Se.options)!=null&&J.collectionId&&((fe=Se.options)==null?void 0:fe.collectionId)===ve&&(Se.options.collectionId=Te)}t(0,d=JSON.stringify(h,null,4))}function D(J){t(12,m=!0);const fe=new FileReader;fe.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(dl("Invalid collections configuration."),E())},fe.onerror=Z=>{console.warn(Z),dl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(J)}function E(){t(0,d=""),t(10,f.value="",f),In({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>C(),x=()=>E(),U=()=>c==null?void 0:c.show(_,h,v);function X(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!z.findByKey(h,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(J=>i&&!z.findByKey(_,"id",J.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof v<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!y&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(J=>{let fe=z.findByKey(_,"name",J.name)||z.findByKey(_,"id",J.id);if(!fe)return!1;if(fe.id!=J.id)return!0;const Z=Array.isArray(fe.schema)?fe.schema:[],de=Array.isArray(J.schema)?J.schema:[];for(const ve of de){if(z.findByKey(Z,"id",ve.id))continue;const Ne=z.findByKey(Z,"name",ve.name);if(Ne&&ve.id!=Ne.id)return!0}return!1}))},[d,h,_,v,k,y,i,o,l,s,f,c,m,a,r,u,C,D,E,I,L,F,N,R,K,x,U,X,ne]}class n6 extends be{constructor(e){super(),ge(this,e,t6,e6,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Di("/"):!0}],i6={"/login":Dt({component:QO,conditions:Pt.coLine truncated
<span class="txt">Manage admins</span>`,t=O(),i=b("hr"),s=O(),l=b("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:G,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function b6(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=z.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&m_(n);return o=new kb({props:{routes:i6}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new c6({}),f=new _6({}),{c(){t=O(),i=b("div"),d&&d.c(),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=z.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&A(d,1)):(d=m_(h),d.c(),A(d,1),d.m(i,s)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function v6(n,e,t){let i,s,l,o;Ye(n,Cs,m=>t(8,i=m)),Ye(n,ko,m=>t(2,s=m)),Ye(n,Ea,m=>t(0,l=m)),Ye(n,$t,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt($t,o="",o),In({}),R1())}function f(){Di("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await me.settings.getAll({$cancelKey:"initialAppSettings"});Kt(ko,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt(Cs,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){me.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class y6 extends be{constructor(e){super(),ge(this,e,v6,b6,he,{})}}new y6({target:document.getElementById("app")});export{Pe as A,jt as B,z as C,Di as D,Ce as E,Ng as F,va as G,_u as H,Ye as I,Ai as J,Ct as K,Zt as L,se as M,L1 as N,wt as O,es as P,ln as Q,pn as R,be as S,Nr as T,P as a,O as b,V as c,j as d,b as e,p as f,S as g,g as h,ge as i,Ie as j,ae as k,xt as l,q as m,ue as n,w as o,me as p,pe as q,Q as r,he as s,A as t,Y as u,ft as v,H as w,le as x,G as y,re as z};
-13
View File
@@ -1,13 +0,0 @@
class I{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),He.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),He.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ii(this),r=new ii(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ii(this,e)}iterRange(e,t=this.length){return new rl(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ol(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new G(e):He.from(G.split(e,[]))}}class G extends I{constructor(e,t=Ka(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new ja(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(vr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=$i(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let h=l.length>>1;i.push(new G(l.slice(0,h)),new G(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=$i(this.text,$i(i.text,vr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):He.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=`
`){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],h=r+l.length;r>e&&o&&(s+=i),e<h&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=h+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class He extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,h=i+o.lines-1;if((t?h:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=h+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],h=o+l.length;if(e<=h&&t>=o){let a=s&((o<=e?1:0)|(h>=t?2:0));o>=e&&h<=t&&!a?i.push(l):l.decompose(e-o,t-o,i,a)}o=h+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let h=o.replace(e-r,t-r,i),a=this.lines-o.lines+h.lines;if(h.lines<a>>5-1&&h.lines>a>>5+1){let c=this.children.slice();return c[s]=h,new He(c,this.length-(t-e)+i.length)}return super.replace(r,l,h)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],h=o+l.length;o>e&&r&&(s+=i),e<h&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=h+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof He))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let h=this.children[s],a=e.children[r];if(h!=a)return i+h.scanIdentical(a,t);i+=h.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],h=0,a=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof He)for(let g of d.children)f(g);else d.lines>o&&(h>o||!h)?(u(),l.push(d)):d instanceof G&&h&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(h+=d.lines,a+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(h+d.lines>s&&u(),h+=d.lines,a+=d.length+1,c.push(d))}function u(){h!=0&&(l.push(c.length==1?c[0]:He.from(c,a)),a=-1,h=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new He(l,t)}}I.empty=new G([""],0);function Ka(n){let e=-1;for(let t of n)e+=t.length+1;return e}function $i(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],h=s+l.length;h>=t&&(h>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=h+1}return e}function vr(n,e,t){return $i(n,[""],e,t)}class ii{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(s instanceof G){let h=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=s.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof G?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ii(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ol{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ii.prototype[Symbol.iterator]=rl.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=function(){return this});class ja{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Rt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<Rt.length;n++)Rt[n]+=Rt[n-1];function Ua(n){for(let e=1;e<Rt.length;e+=2)if(Rt[e]>n)return Rt[e-1]<=n;return!1}function Cr(n){return n>=127462&&n<=127487}const Ar=8205;function de(n,e,t=!0,i=!0){return(t?ll:Ga)(n,e,i)}function ll(n,e,t){if(e==n.length)return e;e&&hl(n.charCodeAt(e))&&al(n.charCodeAt(e-1))&&e--;let i=se(n,e);for(e+=Me(i);e<n.length;){let s=se(n,e);if(i==Ar||s==Ar||t&&Ua(s))e+=Me(s),i=s;else if(Cr(s)){let r=0,o=e-2;for(;o>=0&&Cr(se(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Ga(n,e,t){for(;e>0;){let i=ll(n,e-2,t);if(i<e)return i;e--}return 0}function hl(n){return n>=56320&&n<57344}function al(n){return n>=55296&&n<56320}function se(n,e){let t=n.charCodeAt(e);if(!al(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return hl(i)?(t-55296<<10)+(i-56320)+65536:t}function Ks(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Me(n){return n<65536?1:2}const Zn=/\r\n?|\n/;var he=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(he||(he={}));class Ke{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){es(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s Line truncated
`}get readOnly(){return this.facet(wl)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(dl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return sc(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let h=de(t,o,!1);if(r(t.slice(h,o))!=$.Word)break;o=h}for(;l<s;){let h=de(t,l);if(r(t.slice(l,h))!=$.Word)break;l=h}return o==l?null:b.range(o+i,l+i)}}N.allowMultipleSelections=pl;N.tabSize=M.define({combine:n=>n.length?n[0]:4});N.lineSeparator=gl;N.readOnly=wl;N.phrases=M.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=dl;N.changeFilter=ml;N.transactionFilter=yl;N.transactionExtender=bl;kn.reconfigure=E.define();function At(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class wt{eq(e){return this==e}range(e,t=e){return os.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=he.TrackDel;let os=class Sl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Sl(e,t,i)}};function ls(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Gs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let h=0;h<this.value.length;h++){let a=this.value[h],c=this.from[h]+e,f=this.to[h]+e,u,d;if(c==f){let p=t.mapPos(c,a.startSide,a.mapMode);if(p==null||(u=d=p,a.startSide!=a.endSide&&(d=t.mapPos(c,a.endSide),d<u)))continue}else if(u=t.mapPos(c,a.startSide),d=t.mapPos(f,a.endSide),u>d||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Gs(s,r,i,l):null,pos:o}}}class j{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new j(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ls)),this.isEmpty)return t.length?j.of(t):this;let l=new vl(this,null,-1).goto(0),h=0,a=[],c=new xt;for(;l.value||h<t.length;)if(h<t.length&&(l.from-t[h].from||l.startSide-t[h].value.startSide)>=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(l.chunkIndex)<t[h].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||a.push(os.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!a.length?j.empty:this.nextLayer.update({add:a,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],h=this.chunk[o],a=e.touchesRange(l,l+h.length);if(a===!1)s=Math.max(s,h.maxPoint),t.push(h),i.push(e.mapPos(l));else if(a===!0){let{mapped:c,pos:f}=h.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new j(i,t,r||j.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return oi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return oi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),h=Or(o,l,i),a=new Jt(o,h,r),c=ne Line truncated
`)}static newName(){let e=Rr[Pr]||1;return Rr[Pr]=e+1,cs+e.toString(36)}static mount(e,t){(e[fs]||new oc(e)).mount(Array.isArray(t)?t:[t])}}let Ai=null;class oc{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Ai)return e.adoptedStyleSheets=[Ai.sheet].concat(e.adoptedStyleSheets),e[fs]=Ai;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),Ai=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[fs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let h=0;h<o.rules.length;h++)t.insertRule(o.rules[h],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
`;this.styleTag.textContent=r}}}var lt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},li={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lr=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),lc=typeof navigator<"u"&&/Mac/.test(navigator.platform),hc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ac=lc||Lr&&+Lr[1]<57;for(var re=0;re<10;re++)lt[48+re]=lt[96+re]=String(re);for(var re=1;re<=24;re++)lt[re+111]="F"+re;for(var re=65;re<=90;re++)lt[re]=String.fromCharCode(re+32),li[re]=String.fromCharCode(re);for(var In in lt)li.hasOwnProperty(In)||(li[In]=lt[In]);function cc(n){var e=ac&&(n.ctrlKey||n.altKey||n.metaKey)||hc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?li:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Qi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Ft(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function fc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ji(n,e){if(!e.anchorNode)return!1;try{return Ft(n,e.anchorNode)}catch{return!1}}function hi(n){return n.nodeType==3?Vt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Zi(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function en(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Er(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:ai(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=en(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?ai(n):0}else return!1}}function ai(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const Cl={left:0,right:0,top:0,bottom:0};function Js(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function uc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function dc(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView||window;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=uc(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let g=e.bottom-e.top,m=f.bottom-f.top;p=(s=="center"&&g<=m?e.top+g/2-m/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-m+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)a.scrollBy(d,p);else{let g=0,m=0;if(p){let y=c.scrollTop;c.scrollTop+=p,m=c.scrollTop-y}if(d){let y=c.scrollLeft;c.scrollLeft+=d,g=c.scrollLeft-y}e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m},g&&Math.abs(g-d)<1&&(i="nearest"),m&&Math.abs(m-p)<1&&(s="nearest")}if(u)break;c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function pc(n){let e=n.ownerDocument;for(let t=n.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class gc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Ot=null;function Al(n){if(n.setActive)return n.setActive();if(Ot)return n.focus(Ot);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerLine truncated
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),a=b.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}function $c(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==$.Space&&(s=o),s==o}}function Kc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),a=n.coordsAtPos(s),c=n.documentTop;if(a)o==null&&(o=a.left-h.left),l=r<0?a.top:a.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=h.left+o,u=i??n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=th(n,{x:f,y:p},!1,r);if(p<h.top||p>h.bottom||(r<0?g<s:g>s))return b.cursor(g,e.assoc,void 0,o)}}function Wn(n,e,t){let i=n.state.facet(Gl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,h)=>{t.from>o&&t.from<l&&(t=e.head>t.from?b.cursor(o,1):b.cursor(l,-1),s=!0)});if(!s)return t}}class jc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null;let t=(i,s)=>{this.ignoreDuringComposition(s)||s.type=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(s.type,e,s)?s.preventDefault():i(e,s))};for(let i in ee){let s=ee[i];e.contentDOM.addEventListener(i,r=>{Yr(e,r)&&t(s,r)},Cs[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(ee.mousedown,i)}),A.chrome&&A.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,A.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{Yr(e,l)&&this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Le(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Le(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(A.android&&A.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return A.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((i=ih.find(s=>s.keyCode==t.keyCode))&&!t.ctrlKey||Uc.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Et(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:A.safari&&!A.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const ih=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Uc="dthko",nh=[16,17,18,20,91,92,224,225];function Di(n){return n*.7+8}class Gc{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=pc(e.contentDOM);let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Jc(e,t),this.dragMo Line truncated
`&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}),t){let r=n.state;if(A.ios&&n.inputState.flushIOSKey(n)||A.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Et(n.contentDOM,"Enter",13)||t.from==s.from-1&&t.to==s.to&&t.insert.length==0&&Et(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Et(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();if(n.state.facet(ql).some(a=>a(n,t.from,t.to,o)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let l;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let a=s.from<t.from?r.sliceDoc(s.from,t.from):"",c=s.to>t.to?r.sliceDoc(t.to,s.to):"";l=r.replaceSelection(n.state.toText(a+t.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let a=r.changes(t),c=i&&!r.selection.main.eq(i.main)&&i.main.to<=a.newLength?i.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let f=n.state.sliceDoc(t.from,t.to),u=Zl(n)||n.state.doc.lineAt(s.head),d=s.to-t.to,p=s.to-s.from;l=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:a,range:c||g.map(a)};let m=g.to-d,y=m-f.length;if(g.to-g.from!=p||n.state.sliceDoc(y,m)!=f||u&&g.to>=u.from&&g.from<=u.to)return{range:g};let v=r.changes({from:y,to:m,insert:t.insert}),D=g.to-s.to;return{changes:v,range:c?b.range(Math.max(0,c.anchor+D),Math.max(0,c.head+D)):g.map(v)}})}else l={changes:a,selection:c&&r.selection.replaceRange(c)}}let h="input.type";return n.composing&&(h+=".compose",n.inputState.compositionFirstChange&&(h+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(l,{scrollIntoView:!0,userEvent:h}),!0}else if(i&&!i.main.eq(s)){let r=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(r=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:r,userEvent:o}),!0}else return!1}function wf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let h=Math.max(0,r-Math.min(o,l));t-=o+h-r}if(o<r&&n.length<e.length){let h=t<=r&&t>=o?r-t:0;r-=h,l=r+(l-o),o=r}else if(l<r){let h=t<=r&&t>=l?r-t:0;r-=h,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function xf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new $r(t,i)),(s!=t||r!=i)&&e.push(new $r(s,r))),e}function kf(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const Sf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},zn=A.ie&&A.ie_version<=11;class vf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new gc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(A.ie&&A.ie_version<=11||A.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),zn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM),this.resizeContent=new ResizeObserver(()=>this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.r Line truncated
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Ts),qf={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let qn=null;function $f(){var n;if(qn==null&&typeof document<"u"&&document.body){let e=document.body.style;qn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return qn||!1}const Ji=M.define({combine(n){let e=At(n,{render:null,specialChars:zf,addSpecialChars:null});return(e.replaceTabs=!$f())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ts)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ts)),e}});function Og(n={}){return[Ji.of(n),Kf()]}let bo=null;function Kf(){return bo||(bo=me.fromClass(class{constructor(n){this.view=n,this.decorations=T.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ji)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Hf({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=se(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=yi(o.text,l,i-o.from);return T.replace({widget:new Jf((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=T.replace({widget:new Gf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ji);n.startState.facet(Ji)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const jf="•";function Uf(n){return n>=32?jf:n==10?"␤":String.fromCharCode(9216+n)}class Gf extends ct{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Uf(this.code),i=e.state.phrase("Control character")+" "+(qf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Jf extends ct{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class _f extends ct{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function Tg(n){return me.fromClass(class{constructor(e){this.view=e,this.placeholder=T.set([T.widget({widget:new _f(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?T.none:this.placeholder}},{decorations:e=>e.decorations})}const Bs=2e3;function Xf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Bs||t.off>Bs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(b.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=as(a.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(a.to));else{let f=as(a.text,l,n.tabSize);r.push(b.range(a.from+c,a.from+f))}}}return r}function Yf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function wo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Bs?-1:s==i.length?Yf(n,e.clientX):yi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Qf(n,e){let t=wo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=wo(n,s);if(!l)return i;let h=Xf(n.state,t,l);return h.length?o?b.create(h.concat(i.ranges)):b.create(h):i}}:null}function Bg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?Qf(t,i):null)}const Li="-10000px";class Zf{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i== Line truncated
`&&(t="");else{let i=t.indexOf(`
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Hh(t,e?e.state.tabSize:4,e?vt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=$h(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=W.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:ed,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new W(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new W(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function $h(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const lr=Object.create(null),di=[ye.none],ed=new tr(di),No=[],Kh=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Kh[n]=Uh(lr,e);class jh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Kh)}resolve(e){return e?this.table[e]||(this.table[e]=Uh(this.extra,e)):0}}const td=new jh(lr);function Jn(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function Uh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||k[r];o?typeof o=="function"?t?t=o(t):Jn(r,`Modifier ${r} used at start of tag`):t?Jn(r,`Tag ${r} used as modifier`):t=o:Jn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=ye.define({id:di.length,name:i,props:[Cu({[i]:t})]});return di.push(s),s.id}function id(n){let e=ye.define({id:di.length,name:"Document",props:[mt.add(()=>n)]});return di.push(e),e}const nd=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.head),i=ar(n.state,t.from);return i.line?sd(n):i.block?od(n):!1};function hr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const sd=hr(ad,0),rd=hr(Gh,0),od=hr((n,e)=>Gh(n,e,hd(e)),0);function ar(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Yt=50;function ld(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Yt,i),o=n.sliceDoc(s,s+Yt),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*Yt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Yt),f=n.sliceDoc(s-Yt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function hd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Gh(n,e,t=e.selection.ranges){let i=t.map(r=>ar(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>ld(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let h=i[o],{open:a,close:c}=l;r.push({from:a.pos-h.open.length,to:a.pos+a.margin},{from:c.pos-c.margin,to:c.pos+h.close.length})}return{changes:r}}return null}function ad(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,h=1e9;for(let a=r;a<=o;){let c=e.doc.lineAt(a);if(c.from>s&&(r==o||o>c.from)){s=c.from;let f=ar(e,c.from).line;if(!f)cont Line truncated
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Mp(this):new Cp(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Bt(this,s,t,i):Tt(this,s,t,i)}}class Ba{constructor(e){this.spec=e}}function Tt(n,e,t,i){return new Kt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?vp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function vp(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(gn(s,t-r))!=$.Word||e(mn(s,t-r))!=$.Word)&&(e(mn(s,i-r))!=$.Word||e(gn(s,i-r))!=$.Word))}class Cp extends Ba{constructor(e){super(e)}nextMatch(e,t,i){let s=Tt(this.spec,e,i,e.doc.length).nextOverlapping();return s.done&&(s=Tt(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Tt(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=Tt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Tt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Bt(n,e,t,i){return new Ma(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Ap(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function gn(n,e){return n.slice(de(n,e,!1),e)}function mn(n,e){return n.slice(e,de(n,e))}function Ap(n){return(e,t,i)=>!i[0].length||(n(gn(i.input,i.index))!=$.Word||n(mn(i.input,i.index))!=$.Word)&&(n(mn(i.input,i.index+i[0].length))!=$.Word||n(gn(i.input,i.index+i[0].length))!=$.Word)}class Mp extends Ba{nextMatch(e,t,i){let s=Bt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Bt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Bt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t))}matchAll(e,t){let i=Bt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Bt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const pi=E.define(),dr=E.define(),st=we.define({create(n){return new Yn(qs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(pi)?n=new Yn(t.value.create(),n.panel):t.is(dr)&&(n=new Yn(n.query,t.value?pr:null));return n},provide:n=>on.from(n,e=>e.panel)});class Yn{constructor(e,t){this.query=e,this.panel=t}}const Dp=T.mark({class:"cm-searchMatch"}),Op=T.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Tp=me.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return T.none;let{view:t}=this,i=new xt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:h}=r[s];for(;s<o-1&&h>r[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?Op:Dp)})}return i.finish()}},{decorations:n=>n.decorations});function xi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):Pa(e)}}const yn=xi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:gr(n,i),userEvent:"select.search"}),!0):!1}),bn=xi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:gr(n,s),userEvent:"select.search"}),!0):!1}),Bp=xi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Pp=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Kt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o), Line truncated
-1
View File
@@ -1 +0,0 @@
@charset "UTF-8";@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #a0a6ac;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #e4e9ec;--baseAlt2Color: #d7dde4;--baseAlt3Color: #c6cdd7;--baseAlt4Color: #a5b0c0;--infoColor: #3da9fc;--infoAltColor: #d2ecfe;--successColor: #2aac76;--successAltColor: #d2f4e6;--dangerColor: #e13756;--dangerAltColor: #fcdee4;--warningColor: #ff8e3c;--warningAltColor: #ffeadb;--overlayColor: rgba(53, 71, 104, .25);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .06);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 22px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--entranceAnimationSpeed: .25s;--baseRadius: 3px;--lgRadius: 12px;--btnRadius: 3px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03Line truncated
+2 -2
View File
@@ -44,8 +44,8 @@
window.Prism = window.Prism || {};
window.Prism.manual = true;
</script>
<script type="module" crossorigin src="./assets/index-7cc53b3b.js"></script>
<link rel="stylesheet" href="./assets/index-ef048ca1.css">
<script type="module" crossorigin src="./assets/index-3d43ee7c.js"></script>
<link rel="stylesheet" href="./assets/index-301a59ef.css">
</head>
<body>
<div id="app"></div>
+283 -283
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -28,7 +28,7 @@
"chart.js": "^3.7.1",
"chartjs-adapter-luxon": "^1.2.0",
"luxon": "^2.3.2",
"pocketbase": "^0.10.2",
"pocketbase": "0.13.0-rc",
"prismjs": "^1.28.0",
"sass": "^1.45.0",
"svelte": "^3.44.0",
+21 -8
View File
@@ -94,8 +94,6 @@
readOnlyCompartment.reconfigure(EditorState.readOnly.of(disabled)),
],
});
triggerNativeChange();
}
$: if (editor && value != editor.state.doc.toString()) {
@@ -159,15 +157,30 @@
// Returns the current active editor language.
function getEditorLang() {
let schema = {};
for (let collection of $collections) {
schema[collection.name] = CommonHelper.getAllCollectionIdentifiers(collection);
}
switch (language) {
case "html":
return htmlLang();
case "sql":
let schema = {};
for (let collection of $collections) {
schema[collection.name] = CommonHelper.getAllCollectionIdentifiers(collection);
}
case "sql-create-index":
return sql({
// lightweight sql dialect with mostly SELECT statements keywords
dialect: SQLDialect.define({
keywords:
"create unique index if not exists on collate asc desc where like isnull notnull " +
"date time datetime unixepoch strftime lower upper substr " +
"case when then iif if else json_extract json_each json_tree json_array_length json_valid ",
operatorChars: "*+-%<>!=&|/~",
identifierQuotes: '`"',
specialVar: "@:?$",
}),
schema: schema,
upperCaseKeywords: true,
});
case "sql-select":
return sql({
// lightweight sql dialect with mostly SELECT statements keywords
dialect: SQLDialect.define({
+28 -9
View File
@@ -1,6 +1,7 @@
<script>
import { onMount } from "svelte";
import { slide } from "svelte/transition";
import { slide, scale } from "svelte/transition";
import tooltip from "@/actions/tooltip";
import { errors, removeError } from "@/stores/errors";
import CommonHelper from "@/utils/CommonHelper";
@@ -8,6 +9,7 @@
const defaultError = "Invalid value";
export let name = "";
export let inlineError = false;
let classes = undefined;
export { classes as class }; // export reserved keyword
@@ -32,19 +34,36 @@
container.removeEventListener("change", changed);
};
});
function getErrorMessage(err) {
if (typeof err === "object") {
return err?.message || err?.code || defaultError;
}
return err || defaultError;
}
</script>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div bind:this={container} class={classes} class:error={fieldErrors.length} on:click>
<slot {uniqueId} />
{#each fieldErrors as error}
<div class="help-block help-block-error" transition:slide|local={{ duration: 150 }}>
{#if typeof error === "object"}
<pre>{error?.message || error?.code || defaultError}</pre>
{:else}
{error || defaultError}
{/if}
{#if inlineError && fieldErrors.length}
<div class="form-field-addon">
<i
class="ri-error-warning-fill txt-danger"
transition:scale|local={{ duration: 150, start: 0.7 }}
use:tooltip={{
position: "left",
text: fieldErrors.map(getErrorMessage).join("\n"),
}}
/>
</div>
{/each}
{:else}
{#each fieldErrors as error}
<div class="help-block help-block-error" transition:slide|local={{ duration: 150 }}>
<pre>{getErrorMessage(error)}</pre>
</div>
{/each}
{/if}
</div>
@@ -12,6 +12,7 @@
<footer class="page-footer">
<a href={import.meta.env.PB_DOCS_URL} target="_blank" rel="noopener noreferrer">
<i class="ri-book-open-line txt-sm" />
<span class="txt">Docs</span>
</a>
<span class="delimiter">|</span>
+10 -10
View File
@@ -82,17 +82,17 @@
/>
{/if}
{#if value.length || tempValue.length}
{#if tempValue !== value}
<button
type="submit"
class="btn btn-expanded btn-sm btn-warning"
transition:fly|local={{ duration: 150, x: 5 }}
>
<span class="txt">Search</span>
</button>
{/if}
{#if (value.length || tempValue.length) && tempValue != value}
<button
type="submit"
class="btn btn-expanded btn-sm btn-warning"
transition:fly|local={{ duration: 150, x: 5 }}
>
<span class="txt">Search</span>
</button>
{/if}
{#if value.length || tempValue.length}
<button
type="button"
class="btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10"
+55 -12
View File
@@ -5,12 +5,16 @@
export let trigger = undefined;
export let active = false;
export let escClose = true;
export let autoScroll = true;
export let closableClass = "closable";
let classes = "";
export { classes as class }; // export reserved keyword
let container = undefined;
let activeTrigger = undefined;
let container;
let containerChild;
let activeTrigger;
let scrollTimeoutId;
let isOutsideMouseDown = false;
const dispatch = createEventDispatcher();
@@ -28,10 +32,28 @@
export function hide() {
active = false;
isOutsideMouseDown = false;
clearTimeout(scrollTimeoutId);
}
export function show() {
active = true;
clearTimeout(scrollTimeoutId);
scrollTimeoutId = setTimeout(() => {
if (!autoScroll) {
return;
}
if (containerChild?.scrollIntoViewIfNeeded) {
containerChild?.scrollIntoViewIfNeeded();
} else if (containerChild?.scrollIntoView) {
containerChild?.scrollIntoView({
behavior: "smooth",
block: "nearest",
});
}
}, 180);
}
export function toggle() {
@@ -73,12 +95,6 @@
}
}
function handleOutsideClick(e) {
if (active && !container?.contains(e.target) && !activeTrigger?.contains(e.target)) {
hide();
}
}
function handleEscPress(e) {
if (active && escClose && e.code === "Escape") {
e.preventDefault();
@@ -86,8 +102,28 @@
}
}
function handleOutsideMousedown(e) {
if (active && !container?.contains(e.target)) {
isOutsideMouseDown = true;
} else if (isOutsideMouseDown) {
isOutsideMouseDown = false;
}
}
function handleOutsideClick(e) {
if (
active &&
!container?.contains(e.target) &&
!activeTrigger?.contains(e.target) &&
isOutsideMouseDown
) {
hide();
}
}
function handleFocusChange(e) {
return handleOutsideClick(e);
handleOutsideMousedown(e);
handleOutsideClick(e);
}
function bindTrigger(newTrigger) {
@@ -105,6 +141,8 @@
}
function cleanup() {
clearTimeout(scrollTimeoutId);
if (!activeTrigger) {
return;
}
@@ -121,15 +159,20 @@
});
</script>
<svelte:window on:click={handleOutsideClick} on:keydown={handleEscPress} on:focusin={handleFocusChange} />
<svelte:window
on:mousedown={handleOutsideMousedown}
on:click={handleOutsideClick}
on:keydown={handleEscPress}
on:focusin={handleFocusChange}
/>
<div bind:this={container} class="toggler-container">
{#if active}
<div
bind:this={containerChild}
class={classes}
class:active
in:fly|local={{ duration: 150, y: -5 }}
out:fly|local={{ duration: 150, y: 2 }}
transition:fly|local={{ duration: 150, y: 3 }}
>
<slot />
</div>
@@ -1,46 +1,44 @@
<script>
import { Collection, SchemaField } from "pocketbase";
import FieldAccordion from "@/components/collections/FieldAccordion.svelte";
import { setErrors } from "@/stores/errors";
import CommonHelper from "@/utils/CommonHelper";
import IndexesList from "@/components/collections/IndexesList.svelte";
import NewField from "@/components/collections/schema/NewField.svelte";
import SchemaFieldText from "@/components/collections/schema/SchemaFieldText.svelte";
import SchemaFieldNumber from "@/components/collections/schema/SchemaFieldNumber.svelte";
import SchemaFieldBool from "@/components/collections/schema/SchemaFieldBool.svelte";
import SchemaFieldEmail from "@/components/collections/schema/SchemaFieldEmail.svelte";
import SchemaFieldUrl from "@/components/collections/schema/SchemaFieldUrl.svelte";
import SchemaFieldEditor from "@/components/collections/schema/SchemaFieldEditor.svelte";
import SchemaFieldDate from "@/components/collections/schema/SchemaFieldDate.svelte";
import SchemaFieldSelect from "@/components/collections/schema/SchemaFieldSelect.svelte";
import SchemaFieldJson from "@/components/collections/schema/SchemaFieldJson.svelte";
import SchemaFieldFile from "@/components/collections/schema/SchemaFieldFile.svelte";
import SchemaFieldRelation from "@/components/collections/schema/SchemaFieldRelation.svelte";
export let collection = new Collection();
const baseReservedNames = [
"id",
"created",
"updated",
"collectionId",
"collectionName",
"expand",
"true",
"false",
"null",
];
let reservedNames = [];
$: if (collection.isAuth) {
reservedNames = baseReservedNames.concat([
"username",
"email",
"emailVisibility",
"verified",
"tokenKey",
"passwordHash",
"lastResetSentAt",
"lastVerificationSentAt",
"password",
"passwordConfirm",
"oldPassword",
]);
} else {
reservedNames = baseReservedNames.slice(0);
}
const fieldComponents = {
text: SchemaFieldText,
number: SchemaFieldNumber,
bool: SchemaFieldBool,
email: SchemaFieldEmail,
url: SchemaFieldUrl,
editor: SchemaFieldEditor,
date: SchemaFieldDate,
select: SchemaFieldSelect,
json: SchemaFieldJson,
file: SchemaFieldFile,
relation: SchemaFieldRelation,
};
$: if (typeof collection.schema === "undefined") {
collection = collection || new Collection();
collection.schema = [];
}
$: nonDeletedFields = collection.schema.filter((f) => !f.toDelete) || [];
function removeField(fieldIndex) {
if (collection.schema[fieldIndex]) {
collection.schema.splice(fieldIndex, 1);
@@ -48,9 +46,10 @@
}
}
function newField() {
function newField(fieldType = "text") {
const field = new SchemaField({
name: getUniqueFieldName(),
type: fieldType,
});
field.onMountExpand = true;
@@ -73,22 +72,19 @@
return !!collection.schema.find((field) => field.name === name);
}
function getSiblingsFieldNames(currentField) {
let result = [];
function getSchemaFieldIndex(field) {
return nonDeletedFields.findIndex((f) => f === field);
}
if (currentField.toDelete) {
return result;
function replaceIndexesColumn(oldName, newName) {
if (!collection?.schema?.length || oldName === newName || !newName) {
return;
}
for (let field of collection.schema) {
if (field === currentField || field.toDelete) {
continue; // skip current and deleted fields
}
result.push(field.name);
}
return result;
// update indexes on renamed fields
collection.indexes = collection.indexes.map((idx) =>
CommonHelper.replaceIndexColumn(idx, oldName, newName)
);
}
// ---------------------------------------------------------------
@@ -124,6 +120,9 @@
}
collection.schema = newSchema;
// reset errors since the schema keys index has changed
setErrors({});
}
</script>
@@ -144,26 +143,22 @@
</p>
</div>
<div class="accordions">
<div class="accordions schema-fields">
{#each collection.schema as field, i (field)}
<FieldAccordion
<svelte:component
this={fieldComponents[field.type]}
key={getSchemaFieldIndex(field)}
bind:field
key={i}
excludeNames={reservedNames.concat(getSiblingsFieldNames(field))}
on:remove={() => removeField(i)}
on:dragstart={(e) => onFieldDrag(e?.detail, i)}
on:drop={(e) => onFieldDrop(e?.detail, i)}
on:rename={(e) => replaceIndexesColumn(e.detail.oldName, e.detail.newName)}
on:dragstart={(e) => onFieldDrag(e.detail, i)}
on:drop={(e) => onFieldDrop(e.detail, i)}
/>
{/each}
</div>
<div class="clearfix m-t-xs" />
<NewField class="btn btn-block btn-outline" on:select={(e) => newField(e.detail)} />
<button
type="button"
class="btn btn-block {collection.schema.length ? 'btn-transparent' : 'btn-secondary'}"
on:click={newField}
>
<i class="ri-add-line" />
<span class="txt">New field</span>
</button>
<div class="clearfix m-b-base" />
<IndexesList bind:collection />
@@ -72,7 +72,7 @@
this={codeEditorComponent}
id={uniqueId}
placeholder="eg. SELECT id, name from posts"
language="sql"
language="sql-select"
minHeight="150"
on:change={() => {
if (schemaErrors.length) {
@@ -11,7 +11,7 @@
let showFiltersInfo = false;
</script>
<div class="block m-b-base handle" class:fade={!showFiltersInfo}>
<div class="block m-b-sm handle" class:fade={!showFiltersInfo}>
<div class="flex txt-sm txt-hint m-b-5">
<p>
All rules follow the
@@ -77,22 +77,17 @@
<RuleField label="List/Search rule" formKey="listRule" {collection} bind:rule={collection.listRule} />
<hr />
<RuleField label="View rule" formKey="viewRule" {collection} bind:rule={collection.viewRule} />
{#if !collection?.isView}
<hr />
<RuleField label="Create rule" formKey="createRule" {collection} bind:rule={collection.createRule} />
<hr />
<RuleField label="Update rule" formKey="updateRule" {collection} bind:rule={collection.updateRule} />
<hr />
<RuleField label="Delete rule" formKey="deleteRule" {collection} bind:rule={collection.deleteRule} />
{/if}
{#if collection?.isAuth}
<hr />
<RuleField
label="Manage rule"
formKey="options.manageRule"
@@ -69,6 +69,13 @@
collection.deleteRule = null;
}
// update indexes on collection rename
$: if (collection?.name && original?.name != collection?.name) {
collection.indexes = collection.indexes.map((idx) =>
CommonHelper.replaceIndexTableName(idx, collection.name)
);
}
export function changeTab(newTab) {
activeTab = newTab;
}
@@ -228,6 +235,15 @@
field.id = "";
}
}
// update indexes with the new table name
if (!CommonHelper.isEmpty(clone.indexes)) {
for (let i = 0; i < clone.indexes.length; i++) {
const parsed = CommonHelper.parseIndex(clone.indexes[i]);
parsed.tableName = clone.name;
clone.indexes[i] = CommonHelper.buildIndex(parsed);
}
}
}
show(clone);
@@ -241,6 +257,7 @@
<OverlayPanel
bind:this={collectionPanel}
class="overlay-panel-lg colored-header collection-panel"
escClose={false}
beforeHide={() => {
if (hasChanges && confirmClose) {
confirm("You have unsaved changes. Do you really want to close the panel?", () => {
@@ -1,353 +0,0 @@
<script>
import { createEventDispatcher, onMount } from "svelte";
import { scale, fly } from "svelte/transition";
import { SchemaField } from "pocketbase";
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import { errors } from "@/stores/errors";
import Toggler from "@/components/base/Toggler.svelte";
import Accordion from "@/components/base/Accordion.svelte";
import Field from "@/components/base/Field.svelte";
import FieldTypeSelect from "@/components/collections/schema/FieldTypeSelect.svelte";
import TextOptions from "@/components/collections/schema/TextOptions.svelte";
import NumberOptions from "@/components/collections/schema/NumberOptions.svelte";
import BoolOptions from "@/components/collections/schema/BoolOptions.svelte";
import EmailOptions from "@/components/collections/schema/EmailOptions.svelte";
import UrlOptions from "@/components/collections/schema/UrlOptions.svelte";
import EditorOptions from "@/components/collections/schema/EditorOptions.svelte";
import DateOptions from "@/components/collections/schema/DateOptions.svelte";
import SelectOptions from "@/components/collections/schema/SelectOptions.svelte";
import JsonOptions from "@/components/collections/schema/JsonOptions.svelte";
import FileOptions from "@/components/collections/schema/FileOptions.svelte";
import RelationOptions from "@/components/collections/schema/RelationOptions.svelte";
const dispatch = createEventDispatcher();
export let key = "0";
export let field = new SchemaField();
export let disabled = false;
export let excludeNames = [];
let accordion;
let initialType = field.type;
$: if (initialType != field.type) {
initialType = field.type;
// reset common options
field.options = {};
field.unique = false;
}
$: canBeStored = !CommonHelper.isEmpty(field.name) && field.type;
$: if (!canBeStored) {
accordion && expand();
}
$: if (field.toDelete) {
accordion && collapse();
// reset the name if it was previously deleted
if (field.originalName && field.name !== field.originalName) {
field.name = field.originalName;
}
}
$: if (!field.originalName && field.name) {
field.originalName = field.name;
}
$: if (typeof field.toDelete === "undefined") {
field.toDelete = false; // normalize
}
$: if (field.required) {
field.nullable = false;
}
$: interactive = !disabled && !field.system && !field.toDelete && canBeStored;
$: hasValidName = validateFieldName(field.name);
$: hasErrors =
!hasValidName || !CommonHelper.isEmpty(CommonHelper.getNestedVal($errors, `schema.${key}`));
export function expand() {
accordion?.expand();
}
export function collapse() {
accordion?.collapse();
}
function handleDelete() {
if (!field.id) {
collapse();
dispatch("remove");
} else {
field.toDelete = true;
}
}
function validateFieldName(name) {
name = ("" + name).toLowerCase();
if (!name) {
return false;
}
for (const excluded of excludeNames) {
if (excluded.toLowerCase() === name) {
return false;
}
}
return true;
}
function normalizeFieldName(name) {
return CommonHelper.slugify(name);
}
function requiredLabel(field) {
switch (field?.type) {
case "bool":
return "Nonfalsey";
case "number":
return "Nonzero";
default:
return "Nonempty";
}
}
onMount(() => {
if (field?.onMountExpand) {
field.onMountExpand = false; // auto expand only the first time
expand();
}
});
</script>
<Accordion
bind:this={accordion}
on:expand
on:collapse
on:toggle
on:dragenter
on:dragleave
on:dragstart
on:drop
draggable
single
{interactive}
class={disabled || field.toDelete || field.system ? "field-accordion disabled" : "field-accordion"}
{...$$restProps}
>
<svelte:fragment slot="header">
<div class="inline-flex">
<span class="icon field-type">
<i class={CommonHelper.getFieldTypeIcon(field.type)} />
</span>
<strong class="title field-name" class:txt-strikethrough={field.toDelete} title={field.name}>
{field.name || "-"}
</strong>
</div>
{#if !field.toDelete}
<div class="inline-flex">
{#if field.system}
<span class="label label-danger">System</span>
{/if}
{#if !field.id}
<span class="label" class:label-warning={interactive && !field.toDelete}>New</span>
{/if}
{#if field.required}
<span class="label label-success">{requiredLabel(field)}</span>
{/if}
{#if field.unique}
<span class="label label-success">Unique</span>
{/if}
</div>
{/if}
<div class="flex-fill" />
{#if hasErrors && !field.system}
<i
class="ri-error-warning-fill txt-danger"
transition:scale={{ duration: 150, start: 0.7 }}
use:tooltip={{ text: "Has errors", position: "left" }}
/>
{/if}
{#if field.toDelete}
<button
type="button"
class="btn btn-sm btn-danger btn-transparent"
on:click|stopPropagation={() => {
field.toDelete = false;
}}
>
<span class="txt">Restore</span>
</button>
{/if}
</svelte:fragment>
<form
class="field-form"
on:dragstart={(e) => {
e.stopPropagation();
e.preventDefault();
e.stopImmediatePropagation();
}}
on:submit|preventDefault={() => {
canBeStored && collapse();
}}
>
<div class="grid">
<div class="col-sm-6">
<Field
class="form-field required {field.id ? 'readonly' : ''}"
name="schema.{key}.type"
let:uniqueId
>
<label for={uniqueId}>Type</label>
<FieldTypeSelect id={uniqueId} disabled={field.id} bind:value={field.type} />
</Field>
</div>
<div class="col-sm-6">
<Field
class="
form-field
required
{!hasValidName ? 'invalid' : ''}
{field.id && field.system ? 'disabled' : ''}
"
name="schema.{key}.name"
let:uniqueId
>
<label for={uniqueId}>
<span class="txt">Name</span>
{#if !hasValidName}
<span class="txt invalid-name-note" transition:fly={{ duration: 150, x: 5 }}>
Duplicated or invalid name
</span>
{/if}
</label>
<!-- svelte-ignore a11y-autofocus -->
<input
type="text"
id={uniqueId}
required
disabled={field.id && field.system}
spellcheck="false"
autofocus={!field.id}
value={field.name}
on:input={(e) => {
field.name = normalizeFieldName(e.target.value);
e.target.value = field.name;
}}
/>
</Field>
</div>
<div class="col-sm-12 hidden-empty">
{#if field.type === "text"}
<TextOptions {key} bind:options={field.options} />
{:else if field.type === "number"}
<NumberOptions {key} bind:options={field.options} />
{:else if field.type === "bool"}
<BoolOptions {key} bind:options={field.options} />
{:else if field.type === "email"}
<EmailOptions {key} bind:options={field.options} />
{:else if field.type === "url"}
<UrlOptions {key} bind:options={field.options} />
{:else if field.type === "editor"}
<EditorOptions {key} bind:options={field.options} />
{:else if field.type === "date"}
<DateOptions {key} bind:options={field.options} />
{:else if field.type === "select"}
<SelectOptions {key} bind:options={field.options} />
{:else if field.type === "json"}
<JsonOptions {key} bind:options={field.options} />
{:else if field.type === "file"}
<FileOptions {key} bind:options={field.options} />
{:else if field.type === "relation"}
<RelationOptions {key} bind:options={field.options} />
{/if}
</div>
<div class="col-sm-4 flex">
<Field class="form-field form-field-toggle m-0" name="requried" let:uniqueId>
<input type="checkbox" id={uniqueId} bind:checked={field.required} />
<label for={uniqueId}>
<span class="txt">{requiredLabel(field)}</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: `Requires the field value to be ${requiredLabel(
field
)}\n(aka. not ${CommonHelper.zeroDefaultStr(field)}).`,
position: "right",
}}
/>
</label>
</Field>
</div>
<div class="col-sm-4 flex">
{#if field.type !== "file"}
<Field class="form-field form-field-toggle m-0" name="unique" let:uniqueId>
<input type="checkbox" id={uniqueId} bind:checked={field.unique} />
<label for={uniqueId}>Unique</label>
</Field>
{/if}
</div>
{#if !field.toDelete}
<div class="col-sm-4 txt-right">
<div class="flex-fill" />
<div class="inline-flex flex-gap-sm flex-nowrap">
<button type="button" aria-label="More" class="btn btn-circle btn-sm btn-transparent">
<i class="ri-more-line" />
<Toggler
class="dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width"
>
<button type="button" class="dropdown-item txt-right" on:click={handleDelete}>
<span class="txt">Remove</span>
</button>
</Toggler>
</button>
{#if interactive}
<button
type="button"
class="btn btn-sm btn-outline btn-expanded-sm"
on:click|stopPropagation={collapse}
>
<span class="txt">Done</span>
</button>
{/if}
</div>
</div>
{/if}
</div>
<input type="submit" class="hidden" tabindex="-1" />
</form>
</Accordion>
<style>
.invalid-name-note {
position: absolute;
right: 10px;
top: 10px;
text-transform: none;
}
.title.field-name {
max-width: 130px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
@@ -0,0 +1,162 @@
<script>
import { onMount, createEventDispatcher } from "svelte";
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import OverlayPanel from "@/components/base/OverlayPanel.svelte";
import Field from "@/components/base/Field.svelte";
const dispatch = createEventDispatcher();
export let collection;
let panel;
let original = "";
let index = "";
let key = "";
let codeEditorComponent;
let isCodeEditorComponentLoading = false;
$: presetColumns = collection?.schema?.map((f) => f.name) || [];
$: indexParts = CommonHelper.parseIndex(index);
$: indexColumns = indexParts.columns?.map((c) => c.column) || [];
export function show(showIndex, showKey) {
key = !CommonHelper.isEmpty(showKey) ? showKey : "";
original = showIndex || blankIndex();
index = original;
return panel?.show();
}
export function hide() {
return panel?.hide();
}
function blankIndex() {
const parsed = CommonHelper.parseIndex("");
parsed.tableName = collection?.name || "";
return CommonHelper.buildIndex(parsed);
}
function remove() {
dispatch("remove", original);
hide();
}
function submit() {
if (!indexColumns.length) {
return;
}
dispatch("submit", {
old: original,
new: index,
});
hide();
}
function toggleColumn(column) {
const clone = CommonHelper.clone(indexParts);
const col = clone.columns.find((c) => c.column == column);
if (col) {
CommonHelper.removeByValue(clone.columns, col);
} else {
CommonHelper.pushUnique(clone.columns, { column });
}
index = CommonHelper.buildIndex(clone);
}
onMount(async () => {
isCodeEditorComponentLoading = true;
try {
codeEditorComponent = (await import("@/components/base/CodeEditor.svelte")).default;
} catch (err) {
console.warn(err);
}
isCodeEditorComponentLoading = false;
});
</script>
<OverlayPanel bind:this={panel} popup on:hide on:show {...$$restProps}>
<svelte:fragment slot="header">
<h4>{original ? "Update" : "Create"} index</h4>
</svelte:fragment>
<Field class="form-field form-field-toggle m-b-sm" let:uniqueId>
<input
type="checkbox"
id={uniqueId}
checked={indexParts.unique}
on:change={(e) => {
indexParts.unique = e.target.checked;
indexParts.tableName = indexParts.tableName || collection?.name;
index = CommonHelper.buildIndex(indexParts);
}}
/>
<label for={uniqueId}>Unique</label>
</Field>
<Field class="form-field required m-b-sm" name={`indexes.${key || ""}`} let:uniqueId>
{#if isCodeEditorComponentLoading}
<textarea disabled rows="7" placeholder="Loading..." />
{:else}
<svelte:component
this={codeEditorComponent}
id={uniqueId}
placeholder={`eg. CREATE INDEX idx_test on ${collection?.name} (created)`}
language="sql-create-index"
minHeight="85"
bind:value={index}
/>
{/if}
</Field>
{#if presetColumns.length > 0}
<div class="inline-flex gap-10">
<span class="txt txt-hint">Presets</span>
{#each presetColumns as column}
<button
type="button"
class="label link-primary"
class:label-info={indexColumns.includes(column)}
on:click={() => toggleColumn(column)}
>
{column}
</button>
{/each}
</div>
{/if}
<svelte:fragment slot="footer">
{#if original != ""}
<button
type="button"
class="btn btn-sm btn-circle btn-hint btn-transparent m-r-auto"
use:tooltip={{ text: "Delete", position: "top" }}
on:click={() => remove()}
>
<i class="ri-delete-bin-7-line" />
</button>
{/if}
<button type="button" class="btn btn-transparent" on:click={() => hide()}>
<span class="txt">Cancel</span>
</button>
<button
type="button"
class="btn"
class:btn-disabled={indexColumns.length <= 0}
on:click={() => submit()}
>
<span class="txt">Set index</span>
</button>
</svelte:fragment>
</OverlayPanel>
@@ -0,0 +1,82 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import { errors, removeError } from "@/stores/errors";
import tooltip from "@/actions/tooltip";
import IndexUpsertPanel from "@/components/collections/IndexUpsertPanel.svelte";
export let collection;
let upsertPanel;
function pushOrReplace(oldIndex, newIndex) {
for (let i = 0; i < collection.indexes.length; i++) {
// replace
if (collection.indexes[i] == oldIndex) {
collection.indexes[i] = newIndex;
removeError("indexes." + i);
return;
}
}
// push missing
collection.indexes.push(newIndex);
collection.indexes = collection.indexes;
}
</script>
<div class="section-title">
Unique constraints and indexes ({collection?.indexes?.length || 0})
</div>
<div class="indexes-list">
{#each collection?.indexes || [] as rawIndex, i}
{@const parsed = CommonHelper.parseIndex(rawIndex)}
<button
type="button"
class="label link-primary {$errors.indexes?.[i]?.message ? 'label-danger' : 'label-info'}"
use:tooltip={$errors.indexes?.[i]?.message || ""}
on:click={() => upsertPanel?.show(rawIndex, i)}
>
{#if parsed.unique}
<strong>Unique:</strong>
{/if}
<span class="txt">
{parsed.columns?.map((c) => c.column).join(", ")}
</span>
</button>
{/each}
<button type="button" class="label label-primary link-fade" on:click={() => upsertPanel?.show()}>
<span class="txt">+</span>
<span class="txt">New index</span>
</button>
</div>
<IndexUpsertPanel
bind:this={upsertPanel}
bind:collection
on:remove={(e) => {
for (let i = 0; i < collection.indexes.length; i++) {
if (collection.indexes[i] == e.detail) {
collection.indexes.splice(i, 1);
removeError("indexes." + i);
break;
}
}
collection.indexes = collection.indexes;
}}
on:submit={(e) => {
pushOrReplace(e.detail.old, e.detail.new);
}}
/>
<style lang="scss">
.indexes-list {
display: flex;
flex-wrap: wrap;
width: 100%;
gap: 10px;
}
.label {
overflow: hidden;
min-width: 50px;
}
</style>
@@ -1,6 +0,0 @@
<script>
// svelte-ignore unused-export-let
export let key = "";
// svelte-ignore unused-export-let
export let options = {};
</script>
@@ -1,34 +0,0 @@
<script>
import Flatpickr from "svelte-flatpickr";
import CommonHelper from "@/utils/CommonHelper";
import Field from "@/components/base/Field.svelte";
export let key = "";
export let options = {};
</script>
<div class="grid">
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.min" let:uniqueId>
<label for={uniqueId}>Min date (UTC)</label>
<Flatpickr
id={uniqueId}
options={CommonHelper.defaultFlatpickrOptions()}
value={options.min}
bind:formattedValue={options.min}
/>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.max" let:uniqueId>
<label for={uniqueId}>Max date (UTC)</label>
<Flatpickr
id={uniqueId}
options={CommonHelper.defaultFlatpickrOptions()}
value={options.max}
bind:formattedValue={options.max}
/>
</Field>
</div>
</div>
@@ -1,6 +0,0 @@
<script>
// svelte-ignore unused-export-let
export let key = "";
// svelte-ignore unused-export-let
export let options = {};
</script>
@@ -1,53 +0,0 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import MultipleValueInput from "@/components/base/MultipleValueInput.svelte";
export let key = "";
export let options = {};
</script>
<div class="grid">
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.exceptDomains" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Except domains</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: 'List of domains that are NOT allowed. \n This field is disabled if "Only domains" is set.',
position: "top",
}}
/>
</label>
<MultipleValueInput
id={uniqueId}
disabled={!CommonHelper.isEmpty(options.onlyDomains)}
bind:value={options.exceptDomains}
/>
<div class="help-block">Use comma as separator.</div>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.onlyDomains" let:uniqueId>
<label for="{uniqueId}.options.onlyDomains">
<span class="txt">Only domains</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: 'List of domains that are ONLY allowed. \n This field is disabled if "Except domains" is set.',
position: "top",
}}
/>
</label>
<MultipleValueInput
id="{uniqueId}.options.onlyDomains"
disabled={!CommonHelper.isEmpty(options.exceptDomains)}
bind:value={options.onlyDomains}
/>
<div class="help-block">Use comma as separator.</div>
</Field>
</div>
</div>
@@ -1,208 +0,0 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import Toggler from "@/components/base/Toggler.svelte";
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
import MimeTypeSelectOption from "@/components/base/MimeTypeSelectOption.svelte";
import MultipleValueInput from "@/components/base/MultipleValueInput.svelte";
import baseMimeTypesList from "@/mimes.js";
export let key = "";
export let options = {};
let mimeTypesList = baseMimeTypesList.slice();
$: if (CommonHelper.isEmpty(options)) {
// load defaults
options = {
maxSelect: 1,
maxSize: 5242880,
thumbs: [],
mimeTypes: [],
};
} else {
appendMissingMimeTypes();
}
// append any previously set custom mime types to the predefined
// list for backward compatibility
function appendMissingMimeTypes() {
if (CommonHelper.isEmpty(options.mimeTypes)) {
return;
}
const missing = [];
for (const v of options.mimeTypes) {
if (!!mimeTypesList.find((item) => item.mimeType === v)) {
continue; // exist
}
missing.push({ mimeType: v });
}
if (missing.length) {
mimeTypesList = mimeTypesList.concat(missing);
}
}
</script>
<div class="grid">
<div class="col-sm-6">
<Field class="form-field required" name="schema.{key}.options.maxSize" let:uniqueId>
<label for={uniqueId}>Max file size (bytes)</label>
<input type="number" id={uniqueId} step="1" min="0" bind:value={options.maxSize} />
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field required" name="schema.{key}.options.maxSelect" let:uniqueId>
<label for={uniqueId}>Max files</label>
<input type="number" id={uniqueId} step="1" min="" required bind:value={options.maxSelect} />
</Field>
</div>
<div class="col-sm-12">
<Field class="form-field" name="schema.{key}.options.mimeTypes" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Allowed mime types</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: "Allow files ONLY with the listed mime types. \n Leave empty for no restriction.",
position: "top",
}}
/>
</label>
<ObjectSelect
id={uniqueId}
multiple
searchable
closable={false}
selectionKey="mimeType"
selectPlaceholder="No restriction"
items={mimeTypesList}
labelComponent={MimeTypeSelectOption}
optionComponent={MimeTypeSelectOption}
bind:keyOfSelected={options.mimeTypes}
/>
<div class="help-block">
<button type="button" class="inline-flex flex-gap-0">
<span class="txt link-primary">Choose presets</span>
<i class="ri-arrow-drop-down-fill" />
<Toggler class="dropdown dropdown-sm dropdown-nowrap dropdown-left">
<button
type="button"
class="dropdown-item closable"
on:click={() => {
options.mimeTypes = [
"image/jpeg",
"image/png",
"image/svg+xml",
"image/gif",
"image/webp",
];
}}
>
<span class="txt">Images (jpg, png, svg, gif, webp)</span>
</button>
<button
type="button"
class="dropdown-item closable"
on:click={() => {
options.mimeTypes = [
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
];
}}
>
<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>
</button>
<button
type="button"
class="dropdown-item closable"
on:click={() => {
options.mimeTypes = [
"video/mp4",
"video/x-ms-wmv",
"video/quicktime",
"video/3gpp",
];
}}
>
<span class="txt">Videos (mp4, avi, mov, 3gp)</span>
</button>
<button
type="button"
class="dropdown-item closable"
on:click={() => {
options.mimeTypes = [
"application/zip",
"application/x-7z-compressed",
"application/x-rar-compressed",
];
}}
>
<span class="txt">Archives (zip, 7zip, rar)</span>
</button>
</Toggler>
</button>
</div>
</Field>
</div>
<div class="col-sm-12">
<Field class="form-field" name="schema.{key}.options.thumbs" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Thumb sizes</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
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",
}}
/>
</label>
<MultipleValueInput id={uniqueId} placeholder="eg. 50x50, 480x720" bind:value={options.thumbs} />
<div class="help-block">
<span class="txt">Use comma as separator.</span>
<button type="button" class="inline-flex flex-gap-0">
<span class="txt link-primary">Supported formats</span>
<i class="ri-arrow-drop-down-fill" />
<Toggler class="dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10">
<ul class="m-0">
<li>
<strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)
</li>
<li>
<strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)
</li>
<li>
<strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)
</li>
<li>
<strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)
</li>
<li>
<strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio
</li>
<li>
<strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio
</li>
</ul>
</Toggler>
</button>
</div>
</Field>
</div>
</div>
@@ -1,50 +0,0 @@
<script>
import { slide } from "svelte/transition";
// svelte-ignore unused-export-let
export const key = "";
// svelte-ignore unused-export-let
export const options = {};
let showInfo = false;
</script>
<button
type="button"
class="inline-flex txt-sm flex-gap-5 link-hint"
on:click={() => {
showInfo = !showInfo;
}}
>
<strong class="txt">String value normalizations</strong>
{#if showInfo}
<i class="ri-arrow-up-s-line txt-sm" />
{:else}
<i class="ri-arrow-down-s-line txt-sm" />
{/if}
</button>
{#if showInfo}
<div class="block" transition:slide|local={{ duration: 150 }}>
<div class="alert alert-warning m-b-0 m-t-10">
<div class="content">
In order to support seamlessly both <code>application/json</code> and
<code>multipart/form-data</code>
requests, the following normalization rules are applied if the <code>json</code> field is a
<strong>plain string</strong>:
<ul>
<li>"true" is converted to the json <code>true</code></li>
<li>"false" is converted to the json <code>false</code></li>
<li>"null" is converted to the json <code>null</code></li>
<li>"[1,2,3]" is converted to the json <code>[1,2,3]</code></li>
<li>{'"{"a":1,"b":2}"'} is converted to the json <code>{'{"a":1,"b":2}'}</code></li>
<li>numeric strings are converted to json number</li>
<li>double quoted strings are left as they are (aka. without normalizations)</li>
<li>any other string (empty string too) is double quoted</li>
</ul>
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
an object, eg.<code>{'{"data": anything}'}</code>
</div>
</div>
</div>
{/if}
@@ -1,12 +1,13 @@
<script>
import { createEventDispatcher } from "svelte";
import CommonHelper from "@/utils/CommonHelper";
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
export let value = "text";
import Toggler from "@/components/base/Toggler.svelte";
let classes = "";
export { classes as class }; // export reserved keyword
const dispatch = createEventDispatcher();
const types = [
{
label: "Plain text",
@@ -64,6 +65,50 @@
icon: CommonHelper.getFieldTypeIcon("json"),
},
];
function select(fieldType) {
dispatch("select", fieldType);
}
</script>
<ObjectSelect class="field-type-select {classes}" items={types} bind:keyOfSelected={value} {...$$restProps} />
<button type="button" class={classes} on:click={dispatch}>
<i class="ri-add-line" />
<div class="txt">New field</div>
<Toggler class="dropdown field-types-dropdown">
{#each types as item}
<div
tabindex="0"
class="dropdown-item closable"
on:click|stopPropagation={() => {
select(item.value);
}}
on:keydown|stopPropagation={(e) => {
if (e.code === "Enter" || e.code === "Space") {
select(item.value);
}
}}
>
<i class="icon {item.icon}" />
<span class="txt">{item.label}</span>
</div>
{/each}
</Toggler>
</button>
<style lang="scss">
:global(.field-types-dropdown) {
display: flex;
flex-wrap: wrap;
width: 100%;
max-width: none;
padding: 10px;
margin: 0;
border: 0;
box-shadow: 0px 0px 0px 2px var(--primaryColor);
border-top-left-radius: 0;
border-top-right-radius: 0;
.dropdown-item {
width: 25%;
}
}
</style>
@@ -1,22 +0,0 @@
<script>
import Field from "@/components/base/Field.svelte";
export let key = "";
export let options = {};
</script>
<div class="grid">
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.min" let:uniqueId>
<label for={uniqueId}>Min</label>
<input type="number" id={uniqueId} bind:value={options.min} />
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.max" let:uniqueId>
<label for={uniqueId}>Max</label>
<input type="number" id={uniqueId} min={options.min} bind:value={options.max} />
</Field>
</div>
</div>
@@ -1,187 +0,0 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import Select from "@/components/base/Select.svelte";
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
import CollectionUpsertPanel from "@/components/collections/CollectionUpsertPanel.svelte";
import { collections } from "@/stores/collections";
export let key = "";
export let options = {};
const isSingleOptions = [
{ label: "Single", value: true },
{ label: "Multiple", value: false },
];
const defaultOptions = [
{ label: "False", value: false },
{ label: "True", value: true },
];
const baseFields = ["id", "created", "updated"];
const authFields = ["username", "email", "emailVisibility", "verified"];
let upsertPanel = null;
let displayFieldsList = [];
let oldCollectionId = null;
let isSingle = options?.maxSelect == 1;
let oldIsSingle = isSingle;
// load defaults
$: if (CommonHelper.isEmpty(options)) {
options = {
maxSelect: 1,
collectionId: null,
cascadeDelete: false,
displayFields: [],
};
isSingle = true;
oldIsSingle = isSingle;
}
$: if (oldIsSingle != isSingle) {
oldIsSingle = isSingle;
if (isSingle) {
options.minSelect = null;
options.maxSelect = 1;
} else {
options.maxSelect = null;
}
}
$: selectedColection = $collections.find((c) => c.id == options.collectionId) || null;
$: if (oldCollectionId != options.collectionId) {
oldCollectionId = options.collectionId;
refreshDisplayFieldsList();
}
function refreshDisplayFieldsList() {
displayFieldsList = baseFields.slice(0);
if (!selectedColection) {
return;
}
if (selectedColection.isAuth) {
displayFieldsList = displayFieldsList.concat(authFields);
}
for (const field of selectedColection.schema) {
displayFieldsList.push(field.name);
}
// deselect any missing display field
if (options?.displayFields?.length > 0) {
for (let i = options.displayFields.length - 1; i >= 0; i--) {
if (!displayFieldsList.includes(options.displayFields[i])) {
options.displayFields.splice(i, 1);
}
}
}
}
</script>
<div class="grid">
<div class="col-sm-6">
<Field class="form-field required" name="schema.{key}.options.collectionId" let:uniqueId>
<label for={uniqueId}>Collection</label>
<ObjectSelect
id={uniqueId}
searchable={$collections.length > 5}
selectPlaceholder={"Select collection"}
noOptionsText="No collections found"
selectionKey="id"
items={$collections}
bind:keyOfSelected={options.collectionId}
>
<svelte:fragment slot="afterOptions">
<hr />
<button
type="button"
class="btn btn-transparent btn-block btn-sm"
on:click={() => upsertPanel?.show()}
>
<i class="ri-add-line" />
<span class="txt">New collection</span>
</button>
</svelte:fragment>
</ObjectSelect>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" let:uniqueId>
<label for={uniqueId}>Relation type</label>
<ObjectSelect id={uniqueId} items={isSingleOptions} bind:keyOfSelected={isSingle} />
</Field>
</div>
{#if !isSingle}
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.minSelect" let:uniqueId>
<label for={uniqueId}>Min select</label>
<input
type="number"
id={uniqueId}
step="1"
min="1"
placeholder="No min limit"
bind:value={options.minSelect}
/>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.maxSelect" let:uniqueId>
<label for={uniqueId}>Max select</label>
<input
type="number"
id={uniqueId}
step="1"
placeholder="No max limit"
min={options.minSelect || 2}
bind:value={options.maxSelect}
/>
</Field>
</div>
{/if}
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.displayFields" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Display fields</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: "Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",
position: "top",
}}
/>
</label>
<Select
multiple
searchable
id={uniqueId}
selectPlaceholder="Auto"
items={displayFieldsList}
bind:selected={options.displayFields}
/>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.cascadeDelete" let:uniqueId>
<label for={uniqueId}>Delete main record on relation delete</label>
<ObjectSelect id={uniqueId} items={defaultOptions} bind:keyOfSelected={options.cascadeDelete} />
</Field>
</div>
</div>
<CollectionUpsertPanel
bind:this={upsertPanel}
on:save={(e) => {
if (e?.detail?.collection?.id) {
options.collectionId = e.detail.collection.id;
}
}}
/>
@@ -0,0 +1,217 @@
<script>
import { createEventDispatcher } from "svelte";
import { SchemaField } from "pocketbase";
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import { errors, setErrors } from "@/stores/errors";
import Toggler from "@/components/base/Toggler.svelte";
import Field from "@/components/base/Field.svelte";
const dispatch = createEventDispatcher();
export let key = "";
export let field = new SchemaField();
let optionsTrigger;
let isDragOver = false;
$: if (field.toDelete) {
// reset the name if it was previously deleted
if (field.originalName && field.name !== field.originalName) {
field.name = field.originalName;
}
}
$: if (!field.originalName && field.name) {
field.originalName = field.name;
}
$: if (typeof field.toDelete === "undefined") {
field.toDelete = false; // normalize
}
$: if (field.required) {
field.nullable = false;
}
$: interactive = !field.toDelete && !(field.id && field.system);
$: hasErrors = !CommonHelper.isEmpty(CommonHelper.getNestedVal($errors, `schema.${key}`));
function remove() {
if (!field.id) {
dispatch("remove");
} else {
field.toDelete = true;
}
}
function restore() {
field.toDelete = false;
// reset all errors since the error index key would have been changed
setErrors({});
}
function normalizeFieldName(name) {
return CommonHelper.slugify(name);
}
function requiredLabel(field) {
switch (field?.type) {
case "bool":
return "Nonfalsey";
case "number":
return "Nonzero";
default:
return "Nonempty";
}
}
</script>
<div
draggable={true}
class="schema-field"
class:drag-over={isDragOver}
on:dragstart={(e) => {
if (!e.target.classList.contains("drag-handle-wrapper")) {
e.preventDefault();
return;
}
const blank = document.createElement("div");
e.dataTransfer.setDragImage(blank, 0, 0);
interactive && dispatch("dragstart", e);
}}
on:dragenter={(e) => {
if (interactive) {
isDragOver = true;
dispatch("dragenter", e);
}
}}
on:drop|preventDefault={(e) => {
if (interactive) {
isDragOver = false;
dispatch("drop", e);
}
}}
on:dragleave={(e) => {
if (interactive) {
isDragOver = false;
dispatch("dragleave", e);
}
}}
on:dragover|preventDefault
>
<div class="schema-field-header">
{#if interactive}
<div class="drag-handle-wrapper" draggable="true" aria-label="Sort">
<span class="drag-handle" />
</div>
{/if}
<Field
class="form-field required m-0 {!interactive ? 'disabled' : ''}"
name="schema.{key}.name"
inlineError
>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class="form-field-addon prefix no-pointer-events" class:txt-disabled={!interactive}>
<i class={CommonHelper.getFieldTypeIcon(field.type)} />
</div>
<!-- svelte-ignore a11y-autofocus -->
<input
type="text"
required
disabled={!interactive}
readonly={field.id && field.system}
spellcheck="false"
autofocus={!field.id}
placeholder="Field name"
value={field.name}
on:input={(e) => {
const oldName = field.name;
field.name = normalizeFieldName(e.target.value);
e.target.value = field.name;
dispatch("rename", { oldName: oldName, newName: field.name });
}}
/>
</Field>
<slot {interactive} {hasErrors} />
{#if field.toDelete}
<button
type="button"
class="btn btn-sm btn-circle btn-warning btn-transparent options-trigger"
aria-label="Restore"
use:tooltip={"Restore"}
on:click={restore}
>
<i class="ri-restart-line" />
</button>
{:else if interactive}
<button
bind:this={optionsTrigger}
type="button"
aria-label="Field options"
class="btn btn-sm btn-circle btn-transparent options-trigger {hasErrors
? 'btn-danger'
: 'btn-hint'}"
>
<i class="ri-settings-3-line" />
</button>
{/if}
</div>
{#if interactive}
<Toggler class="dropdown dropdown-block schema-field-dropdown" trigger={optionsTrigger}>
<div class="grid grid-sm">
<div class="col-sm-12 hidden-empty">
<slot name="options" {interactive} {hasErrors} />
</div>
<div class="col-sm-4 flex">
<Field class="form-field form-field-toggle m-0" name="requried" let:uniqueId>
<input type="checkbox" id={uniqueId} bind:checked={field.required} />
<label for={uniqueId}>
<span class="txt">{requiredLabel(field)}</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: `Requires the field value NOT to be ${CommonHelper.zeroDefaultStr(
field
)}.`,
position: "right",
}}
/>
</label>
</Field>
</div>
{#if !field.toDelete}
<div class="col-sm-4 m-l-auto txt-right">
<div class="flex-fill" />
<div class="inline-flex flex-gap-sm flex-nowrap">
<button
type="button"
aria-label="More"
class="btn btn-circle btn-sm btn-transparent"
>
<i class="ri-more-line" />
<Toggler
class="dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width"
>
<button type="button" class="dropdown-item txt-right" on:click={remove}>
<span class="txt">Remove</span>
</button>
</Toggler>
</button>
</div>
</div>
{/if}
</div>
</Toggler>
{/if}
</div>
@@ -0,0 +1,18 @@
<script>
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
export let field;
export let key = "";
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
/>
@@ -0,0 +1,50 @@
<script>
import Flatpickr from "svelte-flatpickr";
import CommonHelper from "@/utils/CommonHelper";
import Field from "@/components/base/Field.svelte";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
export let field;
export let key = "";
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment slot="options">
<div class="grid grid-sm">
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.min" let:uniqueId>
<label for={uniqueId}>Min date (UTC)</label>
<Flatpickr
id={uniqueId}
options={CommonHelper.defaultFlatpickrOptions()}
value={field.options.min}
bind:formattedValue={field.options.min}
/>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.max" let:uniqueId>
<label for={uniqueId}>Max date (UTC)</label>
<Flatpickr
id={uniqueId}
options={CommonHelper.defaultFlatpickrOptions()}
value={field.options.max}
bind:formattedValue={field.options.max}
/>
</Field>
</div>
</div>
</svelte:fragment>
</SchemaField>
@@ -0,0 +1,18 @@
<script>
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
export let field;
export let key = "";
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
/>
@@ -0,0 +1,68 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import MultipleValueInput from "@/components/base/MultipleValueInput.svelte";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
export let field;
export let key = "";
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment slot="options">
<div class="grid grid-sm">
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.exceptDomains" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Except domains</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: 'List of domains that are NOT allowed. \n This field is disabled if "Only domains" is set.',
position: "top",
}}
/>
</label>
<MultipleValueInput
id={uniqueId}
disabled={!CommonHelper.isEmpty(field.options.onlyDomains)}
bind:value={field.options.exceptDomains}
/>
<div class="help-block">Use comma as separator.</div>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.onlyDomains" let:uniqueId>
<label for="{uniqueId}.options.onlyDomains">
<span class="txt">Only domains</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: 'List of domains that are ONLY allowed. \n This field is disabled if "Except domains" is set.',
position: "top",
}}
/>
</label>
<MultipleValueInput
id="{uniqueId}.options.onlyDomains"
disabled={!CommonHelper.isEmpty(field.options.exceptDomains)}
bind:value={field.options.onlyDomains}
/>
<div class="help-block">Use comma as separator.</div>
</Field>
</div>
</div>
</svelte:fragment>
</SchemaField>
@@ -0,0 +1,280 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import Toggler from "@/components/base/Toggler.svelte";
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
import MimeTypeSelectOption from "@/components/base/MimeTypeSelectOption.svelte";
import MultipleValueInput from "@/components/base/MultipleValueInput.svelte";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
import baseMimeTypesList from "@/mimes.js";
export let field;
export let key = "";
const isSingleOptions = [
{ label: "Single", value: true },
{ label: "Multiple", value: false },
];
let mimeTypesList = baseMimeTypesList.slice();
let isSingle = field.options?.maxSelect <= 1;
let oldIsSingle = isSingle;
$: if (CommonHelper.isEmpty(field.options)) {
loadDefaults();
} else {
appendMissingMimeTypes();
}
$: if (oldIsSingle != isSingle) {
oldIsSingle = isSingle;
if (isSingle) {
field.options.maxSelect = 1;
} else {
field.options.maxSelect = field.options?.values?.length || 99;
}
}
function loadDefaults() {
field.options = {
maxSelect: 1,
maxSize: 5242880,
thumbs: [],
mimeTypes: [],
};
isSingle = true;
oldIsSingle = isSingle;
}
// append any previously set custom mime types to the predefined
// list for backward compatibility
function appendMissingMimeTypes() {
if (CommonHelper.isEmpty(field.options.mimeTypes)) {
return;
}
const missing = [];
for (const v of field.options.mimeTypes) {
if (!!mimeTypesList.find((item) => item.mimeType === v)) {
continue; // exist
}
missing.push({ mimeType: v });
}
if (missing.length) {
mimeTypesList = mimeTypesList.concat(missing);
}
}
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment let:interactive>
<Field
class="form-field form-field-single-multiple-select {!interactive ? 'disabled' : ''}"
inlineError
let:uniqueId
>
<ObjectSelect
id={uniqueId}
items={isSingleOptions}
disabled={!interactive}
bind:keyOfSelected={isSingle}
/>
</Field>
</svelte:fragment>
<svelte:fragment slot="options">
<div class="grid grid-sm">
<div class="col-sm-12">
<Field class="form-field" name="schema.{key}.options.mimeTypes" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Allowed mime types</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: "Allow files ONLY with the listed mime types. \n Leave empty for no restriction.",
position: "top",
}}
/>
</label>
<ObjectSelect
id={uniqueId}
multiple
searchable
closable={false}
selectionKey="mimeType"
selectPlaceholder="No restriction"
items={mimeTypesList}
labelComponent={MimeTypeSelectOption}
optionComponent={MimeTypeSelectOption}
bind:keyOfSelected={field.options.mimeTypes}
/>
<div class="help-block">
<button type="button" class="inline-flex flex-gap-0">
<span class="txt link-primary">Choose presets</span>
<i class="ri-arrow-drop-down-fill" />
<Toggler class="dropdown dropdown-sm dropdown-nowrap dropdown-left">
<button
type="button"
class="dropdown-item closable"
on:click={() => {
field.options.mimeTypes = [
"image/jpeg",
"image/png",
"image/svg+xml",
"image/gif",
"image/webp",
];
}}
>
<span class="txt">Images (jpg, png, svg, gif, webp)</span>
</button>
<button
type="button"
class="dropdown-item closable"
on:click={() => {
field.options.mimeTypes = [
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
];
}}
>
<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>
</button>
<button
type="button"
class="dropdown-item closable"
on:click={() => {
field.options.mimeTypes = [
"video/mp4",
"video/x-ms-wmv",
"video/quicktime",
"video/3gpp",
];
}}
>
<span class="txt">Videos (mp4, avi, mov, 3gp)</span>
</button>
<button
type="button"
class="dropdown-item closable"
on:click={() => {
field.options.mimeTypes = [
"application/zip",
"application/x-7z-compressed",
"application/x-rar-compressed",
];
}}
>
<span class="txt">Archives (zip, 7zip, rar)</span>
</button>
</Toggler>
</button>
</div>
</Field>
</div>
<div class={!isSingle ? "col-sm-6" : "col-sm-8"}>
<Field class="form-field" name="schema.{key}.options.thumbs" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Thumb sizes</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
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",
}}
/>
</label>
<MultipleValueInput
id={uniqueId}
placeholder="eg. 50x50, 480x720"
bind:value={field.options.thumbs}
/>
<div class="help-block">
<span class="txt">Use comma as separator.</span>
<button type="button" class="inline-flex flex-gap-0">
<span class="txt link-primary">Supported formats</span>
<i class="ri-arrow-drop-down-fill" />
<Toggler class="dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10">
<ul class="m-0">
<li>
<strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)
</li>
<li>
<strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)
</li>
<li>
<strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)
</li>
<li>
<strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)
</li>
<li>
<strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio
</li>
<li>
<strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio
</li>
</ul>
</Toggler>
</button>
</div>
</Field>
</div>
<div class={!isSingle ? "col-sm-3" : "col-sm-4"}>
<Field class="form-field required" name="schema.{key}.options.maxSize" let:uniqueId>
<label for={uniqueId}>Max file size</label>
<input type="number" id={uniqueId} step="1" min="0" bind:value={field.options.maxSize} />
<div class="help-block">Must be in bytes.</div>
</Field>
</div>
{#if !isSingle}
<div class="col-sm-3">
<Field class="form-field required" name="schema.{key}.options.maxSelect" let:uniqueId>
<label for={uniqueId}>Max select</label>
<input
id={uniqueId}
type="number"
step="1"
min="2"
required
bind:value={field.options.maxSelect}
/>
</Field>
</div>
{/if}
</div>
</svelte:fragment>
</SchemaField>
<style>
:global(.form-field-file-max-select) {
width: 100px;
flex-shrink: 0;
}
</style>
@@ -0,0 +1,66 @@
<script>
import { slide } from "svelte/transition";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
export let field;
export let key = "";
let showInfo = false;
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment slot="options">
<button
type="button"
class="inline-flex txt-sm flex-gap-5 link-hint"
on:click={() => {
showInfo = !showInfo;
}}
>
<strong class="txt">String value normalizations</strong>
{#if showInfo}
<i class="ri-arrow-up-s-line txt-sm" />
{:else}
<i class="ri-arrow-down-s-line txt-sm" />
{/if}
</button>
{#if showInfo}
<div class="block" transition:slide|local={{ duration: 150 }}>
<div class="alert alert-warning m-b-0 m-t-10">
<div class="content">
In order to support seamlessly both <code>application/json</code> and
<code>multipart/form-data</code>
requests, the following normalization rules are applied if the <code>json</code> field
is a
<strong>plain string</strong>:
<ul>
<li>"true" is converted to the json <code>true</code></li>
<li>"false" is converted to the json <code>false</code></li>
<li>"null" is converted to the json <code>null</code></li>
<li>"[1,2,3]" is converted to the json <code>[1,2,3]</code></li>
<li>
{'"{"a":1,"b":2}"'} is converted to the json <code>{'{"a":1,"b":2}'}</code>
</li>
<li>numeric strings are converted to json number</li>
<li>double quoted strings are left as they are (aka. without normalizations)</li>
<li>any other string (empty string too) is double quoted</li>
</ul>
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.<code>{'{"data": anything}'}</code>
</div>
</div>
</div>
{/if}
</svelte:fragment>
</SchemaField>
@@ -0,0 +1,42 @@
<script>
import Field from "@/components/base/Field.svelte";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
export let field;
export let key = "";
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment slot="options">
<div class="grid grid-sm">
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.min" let:uniqueId>
<label for={uniqueId}>Min</label>
<input type="number" id={uniqueId} bind:value={field.options.min} />
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.max" let:uniqueId>
<label for={uniqueId}>Max</label>
<input
type="number"
id={uniqueId}
min={field.options.min}
bind:value={field.options.max}
/>
</Field>
</div>
</div>
</svelte:fragment>
</SchemaField>
@@ -0,0 +1,222 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import Select from "@/components/base/Select.svelte";
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
import CollectionUpsertPanel from "@/components/collections/CollectionUpsertPanel.svelte";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
import { collections } from "@/stores/collections";
export let field;
export let key = "";
const isSingleOptions = [
{ label: "Single", value: true },
{ label: "Multiple", value: false },
];
const defaultOptions = [
{ label: "False", value: false },
{ label: "True", value: true },
];
const baseFields = ["id", "created", "updated"];
const authFields = ["username", "email", "emailVisibility", "verified"];
let upsertPanel = null;
let displayFieldsList = [];
let oldCollectionId = null;
let isSingle = field.options?.maxSelect == 1;
let oldIsSingle = isSingle;
// load defaults
$: if (CommonHelper.isEmpty(field.options)) {
loadDefaults();
}
$: if (oldIsSingle != isSingle) {
oldIsSingle = isSingle;
if (isSingle) {
field.options.minSelect = null;
field.options.maxSelect = 1;
} else {
field.options.maxSelect = null;
}
}
$: selectedColection = $collections.find((c) => c.id == field.options.collectionId) || null;
$: if (oldCollectionId != field.options.collectionId) {
oldCollectionId = field.options.collectionId;
refreshDisplayFieldsList();
}
function loadDefaults() {
field.options = {
maxSelect: 1,
collectionId: null,
cascadeDelete: false,
displayFields: [],
};
isSingle = true;
oldIsSingle = isSingle;
}
function refreshDisplayFieldsList() {
displayFieldsList = baseFields.slice(0);
if (!selectedColection) {
return;
}
if (selectedColection.isAuth) {
displayFieldsList = displayFieldsList.concat(authFields);
}
for (const f of selectedColection.schema) {
displayFieldsList.push(f.name);
}
// deselect any missing display field
if (field.options?.displayFields?.length > 0) {
for (let i = field.options.displayFields.length - 1; i >= 0; i--) {
if (!displayFieldsList.includes(field.options.displayFields[i])) {
field.options.displayFields.splice(i, 1);
}
}
}
}
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment let:interactive>
<Field
class="form-field required {!interactive ? 'disabled' : ''}"
inlineError
name="schema.{key}.options.collectionId"
let:uniqueId
>
<ObjectSelect
id={uniqueId}
searchable={$collections.length > 5}
selectPlaceholder={"Select collection *"}
noOptionsText="No collections found"
selectionKey="id"
items={$collections}
disabled={!interactive}
bind:keyOfSelected={field.options.collectionId}
>
<svelte:fragment slot="afterOptions">
<hr />
<button
type="button"
class="btn btn-transparent btn-block btn-sm"
on:click={() => upsertPanel?.show()}
>
<i class="ri-add-line" />
<span class="txt">New collection</span>
</button>
</svelte:fragment>
</ObjectSelect>
</Field>
<Field
class="form-field form-field-single-multiple-select {!interactive ? 'disabled' : ''}"
inlineError
let:uniqueId
>
<ObjectSelect
id={uniqueId}
items={isSingleOptions}
disabled={!interactive}
bind:keyOfSelected={isSingle}
/>
</Field>
</svelte:fragment>
<svelte:fragment slot="options">
<div class="grid grid-sm">
{#if !isSingle}
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.minSelect" let:uniqueId>
<label for={uniqueId}>Min select</label>
<input
type="number"
id={uniqueId}
step="1"
min="1"
placeholder="No min limit"
bind:value={field.options.minSelect}
/>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.maxSelect" let:uniqueId>
<label for={uniqueId}>Max select</label>
<input
type="number"
id={uniqueId}
step="1"
placeholder="No max limit"
min={field.options.minSelect || 2}
bind:value={field.options.maxSelect}
/>
</Field>
</div>
{/if}
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.displayFields" let:uniqueId>
<label for={uniqueId}>
<span class="txt">Display fields</span>
<i
class="ri-information-line link-hint"
use:tooltip={{
text: "Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",
position: "top",
}}
/>
</label>
<Select
multiple
searchable
id={uniqueId}
selectPlaceholder="Auto"
items={displayFieldsList}
bind:selected={field.options.displayFields}
/>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.cascadeDelete" let:uniqueId>
<label for={uniqueId}>Delete main record on relation delete</label>
<ObjectSelect
id={uniqueId}
items={defaultOptions}
bind:keyOfSelected={field.options.cascadeDelete}
/>
</Field>
</div>
</div>
</svelte:fragment>
</SchemaField>
<CollectionUpsertPanel
bind:this={upsertPanel}
on:save={(e) => {
if (e?.detail?.collection?.id) {
field.options.collectionId = e.detail.collection.id;
}
}}
/>
@@ -0,0 +1,100 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import tooltip from "@/actions/tooltip";
import Field from "@/components/base/Field.svelte";
import ObjectSelect from "@/components/base/ObjectSelect.svelte";
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
import MultipleValueInput from "@/components/base/MultipleValueInput.svelte";
export let field;
export let key = "";
const isSingleOptions = [
{ label: "Single", value: true },
{ label: "Multiple", value: false },
];
let isSingle = field.options?.maxSelect <= 1;
let oldIsSingle = isSingle;
$: if (CommonHelper.isEmpty(field.options)) {
loadDefaults();
}
$: if (oldIsSingle != isSingle) {
oldIsSingle = isSingle;
if (isSingle) {
field.options.maxSelect = 1;
} else {
field.options.maxSelect = field.options?.values?.length || 2;
}
}
function loadDefaults() {
field.options = {
maxSelect: 1,
values: [],
};
isSingle = true;
oldIsSingle = isSingle;
}
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment let:interactive>
<Field
class="form-field required {!interactive ? 'disabled' : ''}"
inlineError
name="schema.{key}.options.values"
let:uniqueId
>
<div use:tooltip={{ text: "Choices (comma separated)", position: "top-left", delay: 700 }}>
<MultipleValueInput
id={uniqueId}
placeholder="Choices: eg. optionA, optionB"
required
disabled={!interactive}
bind:value={field.options.values}
/>
</div>
</Field>
<Field
class="form-field form-field-single-multiple-select {!interactive ? 'disabled' : ''}"
inlineError
let:uniqueId
>
<ObjectSelect
id={uniqueId}
items={isSingleOptions}
disabled={!interactive}
bind:keyOfSelected={isSingle}
/>
</Field>
</svelte:fragment>
<svelte:fragment slot="options">
{#if !isSingle}
<Field class="form-field required" name="schema.{key}.options.maxSelect" let:uniqueId>
<label for={uniqueId}>Max select</label>
<input
id={uniqueId}
type="number"
step="1"
min="2"
required
bind:value={field.options.maxSelect}
/>
</Field>
{/if}
</svelte:fragment>
</SchemaField>
@@ -0,0 +1,55 @@
<script>
import SchemaField from "@/components/collections/schema/SchemaField.svelte";
import Field from "@/components/base/Field.svelte";
export let field;
export let key = "";
</script>
<SchemaField
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
>
<svelte:fragment slot="options">
<div class="grid grid-sm">
<div class="col-sm-3">
<Field class="form-field" name="schema.{key}.options.min" let:uniqueId>
<label for={uniqueId}>Min length</label>
<input type="number" id={uniqueId} step="1" min="0" bind:value={field.options.min} />
</Field>
</div>
<div class="col-sm-3">
<Field class="form-field" name="schema.{key}.options.max" let:uniqueId>
<label for={uniqueId}>Max length</label>
<input
type="number"
id={uniqueId}
step="1"
min={field.options.min || 0}
bind:value={field.options.max}
/>
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.pattern" let:uniqueId>
<label for={uniqueId}>Regex pattern</label>
<input
type="text"
id={uniqueId}
placeholder={"Valid Go regular expression, eg. ^w+$"}
bind:value={field.options.pattern}
/>
</Field>
</div>
</div>
</svelte:fragment>
</SchemaField>
@@ -0,0 +1,19 @@
<script>
import SchemaFieldEmail from "./SchemaFieldEmail.svelte";
export let field;
export let key = "";
</script>
<!-- shares the same options with the email field -->
<SchemaFieldEmail
bind:field
{key}
on:rename
on:remove
on:drop
on:dragstart
on:dragenter
on:dragleave
{...$$restProps}
/>
@@ -1,43 +0,0 @@
<script>
import CommonHelper from "@/utils/CommonHelper";
import Field from "@/components/base/Field.svelte";
import MultipleValueInput from "@/components/base/MultipleValueInput.svelte";
export let key = "";
export let options = {};
$: if (CommonHelper.isEmpty(options)) {
// load defaults
options = {
maxSelect: 1,
values: [],
};
}
// note: leave the validation to the api
// $: if (!CommonHelper.isEmpty(options.values) && options.maxSelect > options.values.length) {
// options.maxSelect = options.values.length;
// }
</script>
<div class="grid">
<div class="col-sm-9">
<Field class="form-field required" name="schema.{key}.options.values" let:uniqueId>
<label for={uniqueId}>Choices</label>
<MultipleValueInput
id={uniqueId}
placeholder="eg. optionA, optionB"
required
bind:value={options.values}
/>
<div class="help-block">Use comma as separator.</div>
</Field>
</div>
<div class="col-sm-3">
<Field class="form-field required" name="schema.{key}.options.maxSelect" let:uniqueId>
<label for={uniqueId}>Max select</label>
<input type="number" id={uniqueId} step="1" min="1" required bind:value={options.maxSelect} />
</Field>
</div>
</div>
@@ -1,30 +0,0 @@
<script>
import Field from "@/components/base/Field.svelte";
export let key = "";
export let options = {};
</script>
<div class="grid">
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.min" let:uniqueId>
<label for={uniqueId}>Min length</label>
<input type="number" id={uniqueId} step="1" min="0" bind:value={options.min} />
</Field>
</div>
<div class="col-sm-6">
<Field class="form-field" name="schema.{key}.options.max" let:uniqueId>
<label for={uniqueId}>Max length</label>
<input type="number" id={uniqueId} step="1" min={options.min || 0} bind:value={options.max} />
</Field>
</div>
<div class="col-sm-12">
<Field class="form-field" name="schema.{key}.options.pattern" let:uniqueId>
<label for={uniqueId}>Regex pattern</label>
<input type="text" id={uniqueId} bind:value={options.pattern} />
<div class="help-block">Valid Go regular expression, eg. <code>^\w+$</code>.</div>
</Field>
</div>
</div>
@@ -1,9 +0,0 @@
<script>
import EmailOptions from "./EmailOptions.svelte";
export let key = "";
export let options = {};
</script>
<!-- shares the same options with the email field -->
<EmailOptions bind:key bind:options />
+5 -5
View File
@@ -89,21 +89,21 @@
<SortHeader disable class="col-field-method" name="method" bind:sort>
<div class="col-header-content">
<i class="ri-global-line" />
<span class="txt">method</span>
<span class="txt">Method</span>
</div>
</SortHeader>
<SortHeader disable class="col-type-text col-field-url" name="url" bind:sort>
<div class="col-header-content">
<i class={CommonHelper.getFieldTypeIcon("url")} />
<span class="txt">url</span>
<span class="txt">URL</span>
</div>
</SortHeader>
<SortHeader disable class="col-type-text col-field-referer" name="referer" bind:sort>
<div class="col-header-content">
<i class={CommonHelper.getFieldTypeIcon("url")} />
<span class="txt">referer</span>
<span class="txt">Referer</span>
</div>
</SortHeader>
@@ -117,14 +117,14 @@
<SortHeader disable class="col-type-number col-field-status" name="status" bind:sort>
<div class="col-header-content">
<i class={CommonHelper.getFieldTypeIcon("number")} />
<span class="txt">status</span>
<span class="txt">Status</span>
</div>
</SortHeader>
<SortHeader disable class="col-type-date col-field-created" name="created" bind:sort>
<div class="col-header-content">
<i class={CommonHelper.getFieldTypeIcon("date")} />
<span class="txt">created</span>
<span class="txt">Created</span>
</div>
</SortHeader>
+8
View File
@@ -121,11 +121,19 @@
.accordion {
border-radius: 0;
margin: -1px 0 0;
&:has(+ .accordion.active) {
border-bottom-left-radius: var(--baseRadius);
border-bottom-right-radius: var(--baseRadius);
}
}
& > .accordion.active,
& > .accordion-wrapper > .accordion.active {
margin: var(--smSpacing) 0;
border-radius: var(--baseRadius);
+ .accordion {
border-top-left-radius: var(--baseRadius);
border-top-right-radius: var(--baseRadius);
}
}
& > .accordion:first-child,
& > .accordion-wrapper:first-child > .accordion {
+44 -28
View File
@@ -323,6 +323,10 @@ a,
}
}
.no-pointer-events {
pointer-events: none;
}
.block {
@extend %block;
}
@@ -354,6 +358,10 @@ a,
border: 1px solid var(--baseAlt1Color);
}
.shadowize {
@include shadowize();
}
.clearfix {
@extend %block;
clear: both;
@@ -451,16 +459,17 @@ a,
.label {
--labelVPadding: 3px;
--labelHPadding: 8px;
--labelHPadding: 9px;
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: top;
gap: 5px;
padding: var(--labelVPadding) var(--labelHPadding);
min-height: 23px;
min-height: 24px;
max-width: 100%;
text-align: center;
line-height: 1;
line-height: var(--smLineHeight);
font-size: var(--smFontSize);
background: var(--baseAlt2Color);
color: var(--txtPrimaryColor);
@@ -562,33 +571,9 @@ a.thumb:not(.thumb-active) {
row-gap: 5px;
margin: 0 0 var(--xsSpacing);
font-weight: 600;
font-size: var(--smFontSize);
font-size: var(--baseFontSize);
line-height: var(--smLineHeight);
color: var(--txtHintColor);
text-transform: uppercase;
}
.drag-handle {
outline: 0;
cursor: pointer;
display: inline-flex;
align-items: left;
color: var(--txtDisabledColor);
transition: color var(--baseAnimationSpeed);
&:before,
&:after {
content: '\ef77';
font-family: var(--iconFontFamily);
font-size: 18px;
line-height: 1;
width: 7px;
text-align: center;
}
&:focus-visible,
&:hover,
&:active {
color: var(--txtPrimaryColor);
}
}
.logo {
@@ -622,6 +607,37 @@ a.thumb:not(.thumb-active) {
}
}
.drag-handle {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
text-align: center;
flex-shrink: 0;
color: var(--txtDisabledColor);
user-select: none;
cursor: pointer;
transition: color var(--baseAnimationSpeed),
transform var(--baseAnimationSpeed),
opacity var(--baseAnimationSpeed),
visibility var(--baseAnimationSpeed);
&:before{
content: "\ef77";
line-height: 1;
font-family: var(--iconFontFamily);
padding-right: 5px;
text-shadow: 5px 0px currentColor;
}
&:hover,
&:focus-visible {
color: var(--txtHintColor);
}
&:active {
transition-duration: var(--activeAnimationSpeed);
color: var(--txtPrimaryColor);
}
}
.loader {
--loaderSize: 32px;
+3 -3
View File
@@ -56,15 +56,15 @@
// states
&.selected {
background: var(--baseAlt1Color);
background: var(--baseAlt2Color);
}
&:focus-visible,
&:hover {
background: var(--baseAlt2Color);
background: var(--baseAlt1Color);
}
&:active {
transition-duration: var(--activeAnimationSpeed);
background: var(--baseAlt3Color);
background: var(--baseAlt2Color);
}
&.disabled {
color: var(--txtDisabledColor);
+9 -2
View File
@@ -509,8 +509,15 @@ select {
.btn {
margin-right: -5px;
}
& ~ %input {
padding-right: 35px;
&:not(.prefix) ~ %input {
padding-right: 45px;
}
&.prefix {
right: auto;
left: var(--hPadding);
& ~ %input {
padding-left: 45px;
}
}
}
label ~ .form-field-addon {
+75
View File
@@ -0,0 +1,75 @@
.schema-field {
@extend %block;
position: relative;
margin: 0 0 var(--xsSpacing);
&.drag-over {
opacity: 0.5;
}
}
.schema-field-header {
position: relative;
display: flex;
width: 100%;
gap: 10px;
align-items: center;
justify-content: stretch;
%input,
.form-field-addon {
min-height: var(--btnHeight);
}
.form-field {
margin: 0;
}
.options-trigger {
i {
transition: transform var(--baseAnimationSpeed);
}
&.active {
i {
transform: rotate(58deg);
}
}
}
.drag-handle-wrapper {
position: absolute;
top: 0;
left: auto;
right: 100%;
height: 100%;
display: flex;
align-items: center;
}
.drag-handle {
padding: 0 5px;
transform: translateX(5px);
@include hide();
}
.form-field-single-multiple-select {
width: 100px;
flex-shrink: 0;
.dropdown {
min-width: 0;
}
}
// states
&:hover,
&:active {
.drag-handle {
transform: translateX(0px);
@include show();
}
}
}
.schema-field-dropdown {
padding: var(--smSpacing);
max-height: none;
overflow: visible;
z-index: 999;
}
.schema-field-options {
margin-top: -10px;
background: var(--bodyColor);
padding: var(--smSpacing);
border-radius: var(--baseRadius);
}
+1 -1
View File
@@ -3,7 +3,7 @@ $tabContentAnimationSpeed: 0.2s;
@keyframes tabChange {
0% {
opacity: 0.5;
opacity: 0.7;
}
100% {
opacity: 1;
+10 -10
View File
@@ -17,14 +17,14 @@
--baseAlt3Color: #c6cdd7;
--baseAlt4Color: #a5b0c0;
--infoColor: #3da9fc;
--infoAltColor: #d2ecfe;
--successColor: #2aac76;
--successAltColor: #d2f4e6;
--dangerColor: #e13756;
--dangerAltColor: #fcdee4;
--warningColor: #ff8e3c;
--warningAltColor: #ffeadb;
--infoColor: #5499e8;
--infoAltColor: #cee2f8;
--successColor: #32ad84;
--successAltColor: #c4eedc;
--dangerColor: #e34562;
--dangerAltColor: #f7cad2;
--warningColor: #ff944d;
--warningAltColor: #ffd4b8;
--overlayColor: rgba(53, 71, 104, 0.25);
--tooltipColor: rgba(0, 0, 0, 0.85);
@@ -64,9 +64,9 @@
--activeAnimationSpeed: 70ms;
--entranceAnimationSpeed: 250ms;
--baseRadius: 3px;
--baseRadius: 6px;
--lgRadius: 12px;
--btnRadius: 3px;
--btnRadius: 6px;
// https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color
accent-color: var(--primaryColor);
+2
View File
@@ -39,3 +39,5 @@
@import 'flatpickr';
@import 'docs_panel';
@import 'schema_field';
+204
View File
@@ -31,6 +31,16 @@ export default class CommonHelper {
return value !== null && typeof value === "object" && value.constructor === Object;
}
/**
* Deep clones the provided value.
*
* @param {Mixed} val
* @return {Mixed}
*/
static clone(value) {
return typeof structuredClone !== "undefined" ? structuredClone(value) : JSON.parse(JSON.stringify(value));
}
/**
* Checks whether a value is empty. The following values are considered as empty:
* - null
@@ -1422,4 +1432,198 @@ export default class CommonHelper {
return result;
}
/**
* Parses the specified SQL index and returns an object with its components.
*
* For example:
*
* ```js
* parseIndex("CREATE UNIQUE INDEX IF NOT EXISTS schemaname.idxname on tablename (col1, col2) where expr")
* // output:
* {
* "unique": true,
* "optional": true,
* "schemaName": "schemaname"
* "indexName": "idxname"
* "tableName": "tablename"
* "columns": [{column: "col1", "collate": "", "sort": ""}, {column: "col1", "collate": "", "sort": ""}]
* expression: "expr"
* }
* ```
*
* @param {String} idx
* @return {Object}
*/
static parseIndex(idx) {
const result = {
unique: false,
optional: false,
schemaName: "",
indexName: "",
tableName: "",
columns: [],
expression: "",
};
const indexRegex = /create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?([\w\"\'\`\[\]\.]*)\s+on\s+([\w\"\'\`\[\]\.]*)\s+\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi;
const matches = indexRegex.exec((idx || "").trim())
if (matches?.length != 7) {
return result;
}
const sqlQuoteRegex = /^[\"\'\`\[]|[\"\'\`\]]$/gm
// unique
result.unique = matches[1]?.trim().toLowerCase() === "unique";
// optional
result.optional = !CommonHelper.isEmpty(matches[2]?.trim());
// schemaName and indexName
const namePair = (matches[3] || "").split(".");
if (namePair.length == 2) {
result.schemaName = namePair[0].replace(sqlQuoteRegex, "");
result.indexName = namePair[1].replace(sqlQuoteRegex, "");
} else {
result.schemaName = "";
result.indexName = namePair[0].replace(sqlQuoteRegex, "");
}
// tableName
result.tableName = (matches[4] || "").replace(sqlQuoteRegex, "");
// columns
const rawColumns = (matches[5] || "")
.replace(/,(?=[^\(]*\))/gmi, "{PB_TEMP}") // temporary replace comma within expressions for easier splitting
.split(","); // split columns
for (let col of rawColumns) {
col = col.trim().replaceAll("{PB_TEMP}", ",") // revert temp replacement
const colRegex = /^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi
const colMatches = colRegex.exec(col);
if (colMatches?.length != 4) {
continue
}
const colOrExpr = colMatches[1]?.trim()?.replace(sqlQuoteRegex, "");
if (!colOrExpr) {
continue;
}
result.columns.push({
column: colOrExpr,
collate: colMatches[2] || "",
sort: colMatches[3]?.toUpperCase() || "",
});
}
// expression
result.expression = matches[6] || "";
return result;
}
/**
* Builds an index expression from parsed index parts (see parseIndex()).
*
* @param {Array} indexParts
* @return {String}
*/
static buildIndex(indexParts) {
let result = "CREATE ";
if (indexParts.unique) {
result += "UNIQUE ";
}
result += "INDEX ";
if (indexParts.optional) {
result += "IF NOT EXISTS ";
}
if (indexParts.schemaName) {
result += `"${indexParts.schemaName}".`;
}
result += `"${indexParts.indexName || "idx_" + CommonHelper.randomString(7)}" `;
result += `ON "${indexParts.tableName}" (\n`;
result += indexParts.columns
.filter((c) => !!c?.column)
.map((c) => {
let item = "";
if (c.column.includes("(") || c.column.includes(" ")) {
// most likely an expression
item += c.column;
} else {
// regular identifier
item += `"${c.column}"`;
}
if (c.collate) {
item += (" COLLATE " + c.collate);
}
if (c.sort) {
item += (" " + c.sort.toUpperCase());
}
return item;
})
.join(",\n");
result += `\n)`;
if (indexParts.expression) {
result += ` WHERE ${indexParts.expression}`;
}
return result;
}
/**
* Replaces the idx table name with newTableName.
*
* @param {String} idx
* @param {String} newTableName
* @return {String}
*/
static replaceIndexTableName(idx, newTableName) {
const parsed = CommonHelper.parseIndex(idx);
parsed.tableName = newTableName;
return CommonHelper.buildIndex(parsed);
}
/**
* Replaces an idx column name with a new one (if exists).
*
* @param {String} idx
* @param {String} oldColumn
* @param {String} newColumn
* @return {String}
*/
static replaceIndexColumn(idx, oldColumn, newColumn) {
if (oldColumn === newColumn) {
return idx; // no change
}
const parsed = CommonHelper.parseIndex(idx);
let hasChange = false;
for (let col of parsed.columns) {
if (col.column === oldColumn) {
col.column = newColumn;
hasChange = true;
}
}
return hasChange ? CommonHelper.buildIndex(parsed) : idx;
}
}