From ebf73f5602e5b0980fbcb61c21e1a88902e28ceb Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sat, 30 Sep 2023 14:43:12 +0300 Subject: [PATCH] updated ui/dist --- ...7e62d57.js => AuthMethodsDocs-e774430d.js} | 2 +- ...2184593.js => AuthRefreshDocs-f65b5244.js} | 2 +- ...5201.js => AuthWithOAuth2Docs-82293e93.js} | 2 +- ...cb.js => AuthWithPasswordDocs-edf28f39.js} | 2 +- ui/dist/assets/CodeEditor-0c1b2f4c.js | 14 -- ui/dist/assets/CodeEditor-73c7d443.js | 14 ++ ....js => ConfirmEmailChangeDocs-b51b3632.js} | 2 +- ...s => ConfirmPasswordResetDocs-e2ce0748.js} | 2 +- ...js => ConfirmVerificationDocs-0837f663.js} | 2 +- ...-77256c2f.js => CreateApiDocs-c095c404.js} | 2 +- ...-2b517a5d.js => DeleteApiDocs-ffcdcabf.js} | 2 +- ...cce9e6.js => FieldsQueryParam-153e53dc.js} | 2 +- ...js => FilterAutocompleteInput-cff6df53.js} | 2 +- ...cs-fa4c012b.js => ListApiDocs-00164b6a.js} | 2 +- ...3.js => ListExternalAuthsDocs-17872c67.js} | 2 +- ...PageAdminConfirmPasswordReset-d4de5d9d.js} | 2 +- ...PageAdminRequestPasswordReset-d3ed729d.js} | 2 +- ...785f.js => PageOAuth2Redirect-70afa6ea.js} | 2 +- ... PageRecordConfirmEmailChange-40a7baa1.js} | 2 +- ...ageRecordConfirmPasswordReset-71871f92.js} | 2 +- ...PageRecordConfirmVerification-733361e3.js} | 2 +- ...86d9a62.js => RealtimeApiDocs-5e8eb48d.js} | 2 +- ....js => RequestEmailChangeDocs-cc78294d.js} | 2 +- ...s => RequestPasswordResetDocs-d0ffa20e.js} | 2 +- ...js => RequestVerificationDocs-7ffbd86b.js} | 2 +- ...dkTabs-08de669b.js => SdkTabs-32d3aea6.js} | 2 +- ....js => UnlinkExternalAuthDocs-c1b416b8.js} | 2 +- ...-9077f7d5.js => UpdateApiDocs-70cf4d12.js} | 2 +- ...cs-f8b0e458.js => ViewApiDocs-8138d595.js} | 2 +- .../{index-85ca1a91.js => index-284695d1.js} | 86 +++---- ui/dist/assets/index-808c8630.js | 13 -- ui/dist/assets/index-9cd23da9.js | 13 ++ ui/dist/index.html | 2 +- ui/package-lock.json | 212 +++++++++--------- 34 files changed, 204 insertions(+), 204 deletions(-) rename ui/dist/assets/{AuthMethodsDocs-a7e62d57.js => AuthMethodsDocs-e774430d.js} (97%) rename ui/dist/assets/{AuthRefreshDocs-52184593.js => AuthRefreshDocs-f65b5244.js} (97%) rename ui/dist/assets/{AuthWithOAuth2Docs-47895201.js => AuthWithOAuth2Docs-82293e93.js} (98%) rename ui/dist/assets/{AuthWithPasswordDocs-773628cb.js => AuthWithPasswordDocs-edf28f39.js} (98%) delete mode 100644 ui/dist/assets/CodeEditor-0c1b2f4c.js create mode 100644 ui/dist/assets/CodeEditor-73c7d443.js rename ui/dist/assets/{ConfirmEmailChangeDocs-3b92aaf9.js => ConfirmEmailChangeDocs-b51b3632.js} (97%) rename ui/dist/assets/{ConfirmPasswordResetDocs-587b11b5.js => ConfirmPasswordResetDocs-e2ce0748.js} (98%) rename ui/dist/assets/{ConfirmVerificationDocs-755c037a.js => ConfirmVerificationDocs-0837f663.js} (97%) rename ui/dist/assets/{CreateApiDocs-77256c2f.js => CreateApiDocs-c095c404.js} (98%) rename ui/dist/assets/{DeleteApiDocs-2b517a5d.js => DeleteApiDocs-ffcdcabf.js} (97%) rename ui/dist/assets/{FieldsQueryParam-ddcce9e6.js => FieldsQueryParam-153e53dc.js} (88%) rename ui/dist/assets/{FilterAutocompleteInput-5c53fc35.js => FilterAutocompleteInput-cff6df53.js} (98%) rename ui/dist/assets/{ListApiDocs-fa4c012b.js => ListApiDocs-00164b6a.js} (99%) rename ui/dist/assets/{ListExternalAuthsDocs-474c78a3.js => ListExternalAuthsDocs-17872c67.js} (97%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-52e8e3c4.js => PageAdminConfirmPasswordReset-d4de5d9d.js} (98%) rename ui/dist/assets/{PageAdminRequestPasswordReset-20a6c3b2.js => PageAdminRequestPasswordReset-d3ed729d.js} (98%) rename ui/dist/assets/{PageOAuth2Redirect-5550785f.js => PageOAuth2Redirect-70afa6ea.js} (87%) rename ui/dist/assets/{PageRecordConfirmEmailChange-3ecd2702.js => PageRecordConfirmEmailChange-40a7baa1.js} (98%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-86dd6b83.js => PageRecordConfirmPasswordReset-71871f92.js} (98%) rename ui/dist/assets/{PageRecordConfirmVerification-05cb41fe.js => PageRecordConfirmVerification-733361e3.js} (97%) rename ui/dist/assets/{RealtimeApiDocs-286d9a62.js => RealtimeApiDocs-5e8eb48d.js} (98%) rename ui/dist/assets/{RequestEmailChangeDocs-7a88b05d.js => RequestEmailChangeDocs-cc78294d.js} (98%) rename ui/dist/assets/{RequestPasswordResetDocs-7b10f4ab.js => RequestPasswordResetDocs-d0ffa20e.js} (97%) rename ui/dist/assets/{RequestVerificationDocs-adb376ea.js => RequestVerificationDocs-7ffbd86b.js} (97%) rename ui/dist/assets/{SdkTabs-08de669b.js => SdkTabs-32d3aea6.js} (98%) rename ui/dist/assets/{UnlinkExternalAuthDocs-0a775f45.js => UnlinkExternalAuthDocs-c1b416b8.js} (98%) rename ui/dist/assets/{UpdateApiDocs-9077f7d5.js => UpdateApiDocs-70cf4d12.js} (98%) rename ui/dist/assets/{ViewApiDocs-f8b0e458.js => ViewApiDocs-8138d595.js} (97%) rename ui/dist/assets/{index-85ca1a91.js => index-284695d1.js} (80%) delete mode 100644 ui/dist/assets/index-808c8630.js create mode 100644 ui/dist/assets/index-9cd23da9.js diff --git a/ui/dist/assets/AuthMethodsDocs-a7e62d57.js b/ui/dist/assets/AuthMethodsDocs-e774430d.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-a7e62d57.js rename to ui/dist/assets/AuthMethodsDocs-e774430d.js index 75587976..b6101075 100644 --- a/ui/dist/assets/AuthMethodsDocs-a7e62d57.js +++ b/ui/dist/assets/AuthMethodsDocs-e774430d.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-85ca1a91.js";import{S as Ke}from"./SdkTabs-08de669b.js";import{F as qe}from"./FieldsQueryParam-ddcce9e6.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` +import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-284695d1.js";import{S as Ke}from"./SdkTabs-32d3aea6.js";import{F as qe}from"./FieldsQueryParam-153e53dc.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-52184593.js b/ui/dist/assets/AuthRefreshDocs-f65b5244.js similarity index 97% rename from ui/dist/assets/AuthRefreshDocs-52184593.js rename to ui/dist/assets/AuthRefreshDocs-f65b5244.js index 33add8d8..15720ec2 100644 --- a/ui/dist/assets/AuthRefreshDocs-52184593.js +++ b/ui/dist/assets/AuthRefreshDocs-f65b5244.js @@ -1,4 +1,4 @@ -import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-85ca1a91.js";import{S as Ze}from"./SdkTabs-08de669b.js";import{F as et}from"./FieldsQueryParam-ddcce9e6.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,z,ue,Q,q,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` +import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-284695d1.js";import{S as Ze}from"./SdkTabs-32d3aea6.js";import{F as et}from"./FieldsQueryParam-153e53dc.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,z,ue,Q,q,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-47895201.js b/ui/dist/assets/AuthWithOAuth2Docs-82293e93.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-47895201.js rename to ui/dist/assets/AuthWithOAuth2Docs-82293e93.js index 470deae8..699dcccf 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-47895201.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-82293e93.js @@ -1,4 +1,4 @@ -import{S as Le,i as Ee,s as Je,N as Ve,O as z,e as s,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as We,Q as Ne,k as Qe,R as ze,n as Ie,t as V,a as L,o as c,d as G,C as Ue,p as Ke,r as X,u as Ge}from"./index-85ca1a91.js";import{S as Xe}from"./SdkTabs-08de669b.js";import{F as Ye}from"./FieldsQueryParam-ddcce9e6.js";function Be(i,l,o){const n=i.slice();return n[5]=l[o],n}function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function He(i,l){let o,n=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),f=k(n),g=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,f),a(o,g),d||(b=Ge(o,"click",_),d=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&pe(f,n),A&6&&X(o,"active",l[1]===l[5].code)},d(v){v&&c(o),d=!1,b()}}}function je(i,l){let o,n,f,g;return n=new Ve({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),I(n.$$.fragment),f=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),K(n,o,null),a(o,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!g||b&6)&&X(o,"active",l[1]===l[5].code)},i(d){g||(V(n.$$.fragment,d),g=!0)},o(d){L(n.$$.fragment,d),g=!1},d(d){d&&c(o),G(n)}}}function Ze(i){let l,o,n=i[0].name+"",f,g,d,b,_,v,A,P,Y,S,E,be,J,R,me,Z,N=i[0].name+"",ee,fe,te,M,ae,x,le,W,oe,y,se,ge,U,$,ne,ke,ie,_e,m,ve,C,we,Oe,Ae,re,Se,ce,ye,$e,Te,de,Ce,qe,q,ue,B,he,T,F,O=[],De=new Map,Pe,H,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as Le,i as Ee,s as Je,N as Ve,O as z,e as s,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as We,Q as Ne,k as Qe,R as ze,n as Ie,t as V,a as L,o as c,d as G,C as Ue,p as Ke,r as X,u as Ge}from"./index-284695d1.js";import{S as Xe}from"./SdkTabs-32d3aea6.js";import{F as Ye}from"./FieldsQueryParam-153e53dc.js";function Be(i,l,o){const n=i.slice();return n[5]=l[o],n}function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function He(i,l){let o,n=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),f=k(n),g=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(v,A){r(v,o,A),a(o,f),a(o,g),d||(b=Ge(o,"click",_),d=!0)},p(v,A){l=v,A&4&&n!==(n=l[5].code+"")&&pe(f,n),A&6&&X(o,"active",l[1]===l[5].code)},d(v){v&&c(o),d=!1,b()}}}function je(i,l){let o,n,f,g;return n=new Ve({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),I(n.$$.fragment),f=h(),p(o,"class","tab-item"),X(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),K(n,o,null),a(o,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),n.$set(_),(!g||b&6)&&X(o,"active",l[1]===l[5].code)},i(d){g||(V(n.$$.fragment,d),g=!0)},o(d){L(n.$$.fragment,d),g=!1},d(d){d&&c(o),G(n)}}}function Ze(i){let l,o,n=i[0].name+"",f,g,d,b,_,v,A,P,Y,S,E,be,J,R,me,Z,N=i[0].name+"",ee,fe,te,M,ae,x,le,W,oe,y,se,ge,U,$,ne,ke,ie,_e,m,ve,C,we,Oe,Ae,re,Se,ce,ye,$e,Te,de,Ce,qe,q,ue,B,he,T,F,O=[],De=new Map,Pe,H,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-773628cb.js b/ui/dist/assets/AuthWithPasswordDocs-edf28f39.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-773628cb.js rename to ui/dist/assets/AuthWithPasswordDocs-edf28f39.js index d181e191..99f83614 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-773628cb.js +++ b/ui/dist/assets/AuthWithPasswordDocs-edf28f39.js @@ -1,4 +1,4 @@ -import{S as we,i as ye,s as $e,N as ve,O as ot,e as n,w as p,b as d,c as nt,f as m,g as r,h as e,m as st,x as Dt,P as pe,Q as Pe,k as Re,R as Ce,n as Oe,t as Z,a as x,o as c,d as it,C as fe,p as Ae,r as rt,u as Te}from"./index-85ca1a91.js";import{S as Ue}from"./SdkTabs-08de669b.js";import{F as Me}from"./FieldsQueryParam-ddcce9e6.js";function he(s,l,a){const i=s.slice();return i[8]=l[a],i}function be(s,l,a){const i=s.slice();return i[8]=l[a],i}function De(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Ee(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function We(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function me(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _e(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ke(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ge(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),e(a,g),e(a,b),f||(u=Te(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Dt(g,i),C&24&&rt(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function Se(s,l){let a,i,g,b;return i=new ve({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),nt(i.$$.fragment),g=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),st(i,a,null),e(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&rt(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),it(i)}}}function Le(s){var re,ce;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Et,ct,T,dt,N,ut,U,tt,Wt,et,I,Lt,pt,lt=s[0].name+"",ft,Bt,ht,V,bt,M,mt,qt,Q,D,_t,Ft,kt,Ht,$,Yt,gt,St,vt,Nt,wt,yt,j,$t,E,Pt,It,J,W,Rt,Vt,Ct,Qt,k,jt,q,Jt,Kt,zt,Ot,Gt,At,Xt,Zt,xt,Tt,te,ee,F,Ut,K,Mt,L,z,A=[],le=new Map,ae,G,S=[],oe=new Map,H;function ne(t,o){if(t[1]&&t[2])return We;if(t[1])return Ee;if(t[2])return De}let Y=ne(s),P=Y&&Y(s);T=new Ue({props:{js:` +import{S as we,i as ye,s as $e,N as ve,O as ot,e as n,w as p,b as d,c as nt,f as m,g as r,h as e,m as st,x as Dt,P as pe,Q as Pe,k as Re,R as Ce,n as Oe,t as Z,a as x,o as c,d as it,C as fe,p as Ae,r as rt,u as Te}from"./index-284695d1.js";import{S as Ue}from"./SdkTabs-32d3aea6.js";import{F as Me}from"./FieldsQueryParam-153e53dc.js";function he(s,l,a){const i=s.slice();return i[8]=l[a],i}function be(s,l,a){const i=s.slice();return i[8]=l[a],i}function De(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Ee(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function We(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function me(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _e(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ke(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ge(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),e(a,g),e(a,b),f||(u=Te(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Dt(g,i),C&24&&rt(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function Se(s,l){let a,i,g,b;return i=new ve({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),nt(i.$$.fragment),g=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),st(i,a,null),e(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&rt(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),it(i)}}}function Le(s){var re,ce;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Et,ct,T,dt,N,ut,U,tt,Wt,et,I,Lt,pt,lt=s[0].name+"",ft,Bt,ht,V,bt,M,mt,qt,Q,D,_t,Ft,kt,Ht,$,Yt,gt,St,vt,Nt,wt,yt,j,$t,E,Pt,It,J,W,Rt,Vt,Ct,Qt,k,jt,q,Jt,Kt,zt,Ot,Gt,At,Xt,Zt,xt,Tt,te,ee,F,Ut,K,Mt,L,z,A=[],le=new Map,ae,G,S=[],oe=new Map,H;function ne(t,o){if(t[1]&&t[2])return We;if(t[1])return Ee;if(t[2])return De}let Y=ne(s),P=Y&&Y(s);T=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); diff --git a/ui/dist/assets/CodeEditor-0c1b2f4c.js b/ui/dist/assets/CodeEditor-0c1b2f4c.js deleted file mode 100644 index f95010bc..00000000 --- a/ui/dist/assets/CodeEditor-0c1b2f4c.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as ft,i as gt,s as mt,e as Pt,f as Zt,U as K,g as bt,y as ze,o as Xt,J as xt,K as Yt,L as yt,I as kt,C as wt,M as vt}from"./index-85ca1a91.js";import{P as Tt,N as _t,u as Wt,D as Ut,v as we,T as ee,I as ve,w as D,x as o,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as j,J as bO,K as XO,M as xO,E as U,O as YO,Q as P,R as Rt,U as qt,V as yO,W as Vt,X as jt,a as z,h as zt,b as Gt,c as Et,d as At,e as It,s as Nt,t as Bt,f as Dt,g as Jt,r as Lt,i as Ft,k as Mt,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as Ge,C as H}from"./index-808c8630.js";class re{constructor(e,a,t,r,s,i,l,n,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new re(e,[],a,t,t,0,[],0,r?new Ee(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(n==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,n)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t){let r=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let s=e,{parser:i}=this.p;(t>this.pos||a<=i.maxNode)&&(this.pos=t,i.stateFlag(s,1)||(this.reducePos=t)),this.pushState(s,r),this.shiftContext(a,r),a<=i.maxNode&&this.buffer.push(a,r,t,4)}}apply(e,a,t){e&65536?this.reduce(e):this.shift(e,a,t)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new re(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new ra(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],n,!1)>=0)return l<<19|65536|n}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ee{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class ra{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class ie{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new ie(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ie(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class Oe{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ae=new Oe;class ia{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ae,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ae,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;kO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class se{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(kO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}se.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class x{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function kO(O,e,a,t,r,s){let i=0,l=1<0){let S=O[p];if(n.allows(S)&&(e.token.value==-1||e.token.value==S||sa(S,e.token.value,r,s))){e.acceptToken(S);break}}let d=e.next,c=0,u=O[i+2];if(e.next<0&&u>c&&O[Q+u*3-3]==65535&&O[Q+u*3-3]==65535){i=O[Q+u*3-1];continue e}for(;c>1,S=Q+p+(p<<1),f=O[S],g=O[S+1]||65536;if(d=g)c=p+1;else{i=O[S+2],e.advance();continue e}}break}}function Ie(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function sa(O,e,a,t){let r=Ie(a,t,e);return r<0||Ie(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class la{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ne(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ne(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof ee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class oa{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Oe)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,n=0;for(let Q=0;Qc.end+25&&(n=Math.max(c.lookAhead,n)),c.value!=0)){let u=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>u))break}}for(;this.actions.length>a;)this.actions.pop();return n&&e.setLookAhead(n),!t&&e.pos==this.stream.end&&(t=new Oe,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new Oe,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,e))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Qa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,n)=>n.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,u),Z&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof ee&&c.positions[0]==0)c=p;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let n=this.tokens.getActions(e);for(let Q=0;Qr?a.push(S):t.push(S)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Be(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),u=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(u=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(n))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,n=0),l.recoverByDelete(n,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),Be(l,t)):(!r||r.scoreO;class wO{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Tt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(d,n,l[Q++]);else{let c=l[Q+-d];for(let u=-d;u>0;u--)s(l[Q++],n,c);Q++}}}this.nodeSet=new _t(a.map((l,n)=>Wt.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Ut;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new R(i,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new na(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&t)return n;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;r=a(k(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=De(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const pa=54,da=1,ha=55,ua=2,Sa=56,$a=3,Je=4,fa=5,le=6,vO=7,TO=8,_O=9,WO=10,ga=11,ma=12,Pa=13,ue=57,Za=14,Le=58,UO=20,ba=22,CO=23,Xa=24,Xe=26,RO=27,xa=28,Ya=31,ya=34,ka=36,wa=37,va=0,Ta=1,_a={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Fe={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ua(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function qO(O){return O==9||O==10||O==13||O==32}let Me=null,Ke=null,He=0;function xe(O,e){let a=O.pos+e;if(He==a&&Ke==O)return Me;let t=O.peek(e);for(;qO(t);)t=O.peek(++e);let r="";for(;Ua(t);)r+=String.fromCharCode(t),t=O.peek(++e);return Ke=O,He=a,Me=r?r.toLowerCase():t==Ca||t==Ra?void 0:null}const VO=60,oe=62,_e=47,Ca=63,Ra=33,qa=45;function eO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new eO(xe(t,1)||"",O):O},reduce(O,e){return e==UO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==le||r==ka?new eO(xe(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new x((O,e)=>{if(O.next!=VO){O.next<0&&e.context&&O.acceptToken(ue);return}O.advance();let a=O.next==_e;a&&O.advance();let t=xe(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Za:le);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ga);if(r&&Wa[r])return O.acceptToken(ue,-2);if(e.dialectEnabled(va))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Pa)}else{if(t=="script")return O.acceptToken(vO);if(t=="style")return O.acceptToken(TO);if(t=="textarea")return O.acceptToken(_O);if(_a.hasOwnProperty(t))return O.acceptToken(WO);r&&Fe[r]&&Fe[r][t]?O.acceptToken(ue,-1):O.acceptToken(le)}},{contextual:!0}),Ga=new x(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Le);break}if(O.next==qa)e++;else if(O.next==oe&&e>=2){a>3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Ea(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Aa=new x((O,e)=>{if(O.next==_e&&O.peek(1)==oe){let a=e.dialectEnabled(Ta)||Ea(e.context);O.acceptToken(a?fa:Je,2)}else O.next==oe&&O.acceptToken(Je,1)});function We(O,e,a){let t=2+O.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==VO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ia=We("script",pa,da),Na=We("style",ha,ua),Ba=We("textarea",Sa,$a),Da=D({"Text RawText":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),Ja=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Da],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==xa)return Se(l,n,a);if(Q==Ya)return Se(l,n,t);if(Q==ya)return Se(l,n,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,u=c&&OO(c,n),p;if(u){for(let S of s)if(S.tag==u&&(!S.attrs||S.attrs(p||(p=jO(d,n))))){let f=d.lastChild;return{parser:S.parser,overlay:[{from:c.to,to:f.type.id==wa?f.from:d.to}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let u=i[n.read(c.from,c.to)];if(u)for(let p of u){if(p.tagName&&p.tagName!=OO(d.parent,n))continue;let S=d.lastChild;if(S.type.id==Xe){let f=S.from+1,g=S.lastChild,X=S.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(S.type.id==RO)return{parser:p.parser,overlay:[{from:S.from,to:S.to}]}}}}return null})}const La=96,tO=1,Fa=97,Ma=98,aO=2,GO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ka=58,Ha=40,EO=95,er=91,te=45,Or=46,tr=35,ar=37;function ne(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function rr(O){return O>=48&&O<=57}const ir=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(ne(s)||s==te||s==EO||a&&rr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),sr=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(ne(e)||e==EO||e==tr||e==Or||e==er||e==Ka||e==te)&&O.acceptToken(La)}}),lr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),ne(e)){do O.advance();while(ne(O.next));O.acceptToken(tO)}}}),or=D({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,MatchOp:o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),nr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},cr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qr={__proto__:null,not:128,only:128},pr=T.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[sr,lr,ir,1,2,3,4,new se("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>nr[O]||-1},{term:56,get:O=>cr[O]||-1},{term:98,get:O=>Qr[O]||-1}],tokenPrec:1169});let $e=null;function fe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const rO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),iO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),dr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),v=/^(\w[\w-]*|-\w[\w-]*|)$/,hr=/^-(-[\w-]*)?$/;function ur(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const sO=new bO,Sr=["Declaration"];function $r(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function AO(O,e,a){if(e.to-e.from>4096){let t=sO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let l of AO(O,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return sO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Sr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=O.sliceString(s.from,s.to);r.has(l)||(r.add(l),t.push({label:l,type:"variable"}))}}),t}}const fr=O=>e=>{let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:fe(),validFor:v};if(r.name=="ValueName")return{from:r.from,options:iO,validFor:v};if(r.name=="PseudoClassName")return{from:r.from,options:rO,validFor:v};if(O(r)||(e.explicit||s)&&ur(r,a.doc))return{from:O(r)||s?r.from:t,options:AO(a.doc,$r(r),O),validFor:hr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:dr,validFor:v}}if(!e.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:rO,validFor:v}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:iO,validFor:v}:i.name=="Block"||i.name=="Styles"?{from:t,options:fe(),validFor:v}:null},gr=fr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:pr.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mr(){return new M(ce,ce.data.of({autocomplete:gr}))}const Pr=304,lO=1,Zr=2,br=305,Xr=307,xr=308,Yr=3,yr=4,kr=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],IO=125,wr=59,oO=47,vr=42,Tr=43,_r=45,Wr=new wO({start:!1,shift(O,e){return e==Yr||e==yr||e==Xr?O:e==xr},strict:!1}),Ur=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(br)},{contextual:!0,fallback:!0}),Cr=new x((O,e)=>{let{next:a}=O,t;kr.indexOf(a)>-1||a==oO&&((t=O.peek(1))==oO||t==vr)||a!=IO&&a!=wr&&a!=-1&&!e.context&&O.acceptToken(Pr)},{contextual:!0}),Rr=new x((O,e)=>{let{next:a}=O;if((a==Tr||a==_r)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:Zr)}},{contextual:!0}),qr=D({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case":o.controlKeyword,"in of await yield void typeof delete instanceof":o.operatorKeyword,"let var const function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger as new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),Vr={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},jr={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},zr={__proto__:null,"<":139},Gr=T.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-ElOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-ExQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AcQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AkQSO,5=sO!ApQSO,5=sO!AuQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BTQWO,5=`O!B]Q,UO,5=aO!BhQSO,5=cO!BmQ`O,5=fO!BuQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!BzQSO'#HRO9{Q,UO'#HTO!CPQSO'#HTOOQQ,5=i,5=iO!CUQSO'#HUO!C^QSO'#CmO!CcQSO,58}O!CmQSO,58}O!ErQUO,58}OOQQ,58},58}O!FSQ(C[O,58}O%[QUO,58}O!H_QUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!HuQSO,5=uO`QUO,5={O`QUO,5=}O!HzQSO,5>PO`QUO,5>RO!IPQSO,5>UO!IUQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!M`QSO,5>fOOQQ,5>h,5>hO!M`QSO,5>hOOQQ,5>j,5>jO!MeQWO'#DYO%[QUO'#JiO!NSQWO'#JiO!NqQWO'#DhO# SQWO'#DhO##eQUO'#DhO##lQSO'#JhO##tQSO,5:RO##yQSO'#EnO#$XQSO'#JvO#$aQSO,5;XO#$fQWO'#DhO#$sQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#$zQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%SQSO,5@TO#%XQ!LQO,5:pOOQO-E<_-E<_O#&_Q(C`O,5:{OChQWO,5:oO#&iQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#&vQ(C[O,5:{O#'RQ(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'aQ(C[O,5:{POOO'#IU'#IUP#'uO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(aQUO'#I[OOQO-ERQ(CjO1G0yO#?yQ(CjO1G0yO#ByQ$IUO'#CgO#DwQ$IUO1G1[O#EOQ$IUO'#JfO!,YQSO1G1bO#E`Q(CjO,5?SOOQ(CW-EeQSO1G3kO$.VQUO1G3mO$2ZQUO'#HlOOQQ1G3p1G3pO$2hQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$2pQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$6wQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$6|Q$IUO,5:SOOQO,5;Y,5;YO$7WQWO'#I]O$7nQSO,5@SOOQ(CY1G/m1G/mO$7vQWO'#IcO$8QQSO,5@bOOQ(CW1G0s1G0sO# SQWO,5:SOOQO'#I`'#I`O$8YQWO,5:nOOQ(CY,5:n,5:nO#$}QSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8aQ(C[O1G0gO$8lQ(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$8zQ(C[O1G0gOOQO1G0Z1G0ZO$9`Q(CjO1G0gPOOO-EvO$9|QSO1G5mO$:UQSO1G5zO$:^QbO1G5{O9TQSO,5>|O$:hQ(CjO1G5xO%[QUO1G5xO$:xQ(C[O1G5xO$;ZQSO1G5wO$;ZQSO1G5wO9TQSO1G5wO$;cQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$;wQSO,5?PO$$XQSO,5?POOQO-ExQ(CjO,5WOOQQ,5>W,5>WO%[QUO'#HmO%(ZQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%(`QWO1G5oO%(tQ$IUO1G0tO%)OQSO1G0tOOQO1G/n1G/nO%)ZQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9`Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%)eQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%)pQ(C[O7+&RO%*OQ(CjO7++dO%[QUO7++dO%*`QSO7++cO%*`QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%*hQSO1G4kOOQO7+%z7+%zO#$}QSO<xOOQO-E<[-E<[O%2^QbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%2hQSO1G5qOOQ(CY<XQ$IUO1G0yO%>`Q$IUO1G0yO%@WQ$IUO1G0yO%@kQ(CjO<XOOQQ,5>Z,5>ZO%NUQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO%NZQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&5rQSO<{AN>{O%[QUOAN?XOOQO<SQSO7++uO%LgQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&>[QSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#MzQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&>dQSOANBTOOQQ<iQSOLD,jO&>qQ$IUO7+'tO&@gQ$IUO7+'vO&B]Q,UOG26|OOQO<YOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#@sOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#CQO#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,gO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#CQO!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,gO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,gO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ hOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!^Oz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#PO#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$nOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+dO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#CQOm!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ hO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!^O#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#PO#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,gO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#CQO#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,gO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,gOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$I|Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$JoO(d$ZO~P#,gO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,gO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,gO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,gO!Y$|O~P#,gO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%$nOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O'v#mO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#CQO#Y5lO!W#bi!X#bi~O!W![i!X![i~P#CQO_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$I|O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$JoO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,gOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#CQOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%2}O#h9zO~P%2}OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5YOl9|O~P%5YOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%7eOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%7eOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:PO(k#|O~P%:POP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%<[O(l#}O~P%<[OP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO(TVO(k#|O(l#}O~O#w#gi#z#gi(d#gi!W#gi!X#gi~P%>gO_#xy!W#xy'm#xy'k#xy!T#xy!h#xyp#xy!Y#xy%b#xy!b#xy~P!7zOh;mOz)vO})wO(k)yO(l){O~OP#giY#gil#gi{#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(T#gi(d#gi!W#gi!X#gi~P%A_O!g#wOP(SXY(SXh(SXl(SXz(SX{(SX}(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX#z(SX(T(SX(d(SX(k(SX(l(SX!W(SX!X(SX~O#z#{i!W#{i!X#{i~P#CQO#z!oi!X!oi~P$$nO!X6`O~O!W'[a!X'[a~P#CQO!b#uO(d'gO!W']a!h']a~O!W/VO!h(qi~O!W/VO!b#uO!h(qi~Oe$vq!W$vq#Y$vq#z$vq~P!0kO!T'_a!W'_a~P#,gO!b6gO~O!W/_O!T(ri~P#,gO!W/_O!T(ri~O!T6kO~O!b#uO#p6pO~Ol6qO!b#uO(d'gO~O!T6sO~Oe$xq!W$xq#Y$xq#z$xq~P!0kO_$jy!W$jy'm$jy'k$jy!T$jy!h$jyp$jy!Y$jy%b$jy!b$jy~P!7zO!b5kO~O!W4WO!Y(sa~O_#]y!W#]y'm#]y'k#]y!T#]y!h#]yp#]y!Y#]y%b#]y!b#]y~P!7zOY6xO~O!W0bO!X(zi~O^7OO~O(W(tO!W'dX!X'dX~O!W4nO!X(wa~OjkO'v7VO~P.iO!X7YO~P%$nOm!nO}7ZO'xTO'{UO(W!mO(c!sO~O!Y0zO~O!Y0zO%b7]O~Oh7`O!Y0zO%b7]O~OY7eO!W'ga!X'ga~O!W1VO!X(xi~O!h7iO~O!h7jO~O!h7mO~O!h7mO~P%[O_7oO~O!b7pO~O!h7qO~O!W(ii!X(ii~P#CQO_%gO#Y7yO'm%gO~O!W(fy!h(fy_(fy'm(fy~P!7zO!W(`O!h(ey~O!Y'VO%b7|O~O#e$vqP$vqY$vq_$vql$vq{$vq!W$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq'm$vq(T$vq(d$vq!h$vq!T$vq'k$vq#Y$vqp$vq!Y$vq%b$vq!b$vq~P#,gO#e$xqP$xqY$xq_$xql$xq{$xq!W$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq'm$xq(T$xq(d$xq!h$xq!T$xq'k$xq#Y$xqp$xq!Y$xq%b$xq!b$xq~P#,gO!W'Ri!h'Ri~P!7zO#z#]q!W#]q!X#]q~P#CQOz/yO{/yO}/zOPwaYwahwalwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa#zwa(Twa(dwa(kwa(lwa!Wwa!Xwa~Oz)vO})wOP$maY$mah$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma#z$ma(T$ma(d$ma(k$ma(l$ma!W$ma!X$ma~Oz)vO})wOP$oaY$oah$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa#z$oa(T$oa(d$oa(k$oa(l$oa!W$oa!X$oa~OP$}aY$}al$}a{$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a#z$}a(T$}a(d$}a!W$}a!X$}a~P%A_O#z$iq!W$iq!X$iq~P#CQO#z$jq!W$jq!X$jq~P#CQO!X8WO~O#z8XO~P!0kO!b#uO!W']i!h']i~O!b#uO(d'gO!W']i!h']i~O!W/VO!h(qq~O!T'_i!W'_i~P#,gO!W/_O!T(rq~O!T8_O~P#,gO!T8_O~Oe(Ry!W(Ry~P!0kO!W'ba!Y'ba~P#,gO_%Uq!Y%Uq'm%Uq!W%Uq~P#,gOY8dO~O!W0bO!X(zq~O#Y8hO!W'da!X'da~O!W4nO!X(wi~P#CQOPZXYZXlZXzZX{ZX}ZX!TZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!b%SX#p%SX~P&2_O!Y0zO%b8lO~O'xTO'{UO(W8qO~O!W1VO!X(xq~O!h8tO~O!h8uO~O!h8vO~O!h8vO~P%[O#Y8yO!W#by!X#by~O!W#by!X#by~P#CQO!Y'VO%b9OO~O#z#xy!W#xy!X#xy~P#CQOP$viY$vil$vi{$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi#z$vi(T$vi(d$vi!W$vi!X$vi~P%A_Oz)vO})wO(l){OP%YiY%Yih%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi#z%Yi(T%Yi(d%Yi(k%Yi!W%Yi!X%Yi~Oz)vO})wOP%[iY%[ih%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i#z%[i(T%[i(d%[i(k%[i(l%[i!W%[i!X%[i~O#z$jy!W$jy!X$jy~P#CQO#z#]y!W#]y!X#]y~P#CQO!b#uO!W']q!h']q~O!W/VO!h(qy~O!T'_q!W'_q~P#,gO!T9VO~P#,gO!W0bO!X(zy~O!W4nO!X(wq~O!Y0zO%b9^O~O!h9aO~O!Y'VO%b9fO~OP$vqY$vql$vq{$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq#z$vq(T$vq(d$vq!W$vq!X$vq~P%A_OP$xqY$xql$xq{$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq#z$xq(T$xq(d$xq!W$xq!X$xq~P%A_Oe%^!Z!W%^!Z#Y%^!Z#z%^!Z~P!0kO!W'dq!X'dq~P#CQO!W#b!Z!X#b!Z~P#CQO#e%^!ZP%^!ZY%^!Z_%^!Zl%^!Z{%^!Z!W%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z'm%^!Z(T%^!Z(d%^!Z!h%^!Z!T%^!Z'k%^!Z#Y%^!Zp%^!Z!Y%^!Z%b%^!Z!b%^!Z~P#,gOP%^!ZY%^!Zl%^!Z{%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z#z%^!Z(T%^!Z(d%^!Z!W%^!Z!X%^!Z~P%A_Op(XX~P1qO'w!lO~P!*SO!TdX!WdX#YdX~P&2_OPZXYZXlZXzZX{ZX}ZX!WZX!WdX!fZX!gZX!iZX!mZX#YZX#YdX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!bdX!hZX!hdX(ddX~P&GuOP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!YXO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O!W:VO!X$la~Oj%SOl$tOm$sOn$sOt%TOv%UOx:]O}${O!Y$|O!d;gO!i$xO#d:cO$R%YO$n:_O$p:aO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#q)]O~P&LkO!XZX!XdX~P&GuO#e9yO~O!b#uO#e9yO~O#Y:ZO~O#p:OO~O#Y:eO!W(iX!X(iX~O#Y:ZO!W(gX!X(gX~O#e:fO~Oe:hO~P!0kO#e:mO~O#e:nO~O!b#uO#e:oO~O!b#uO#e:fO~O#z:pO~P#CQO#e:qO~O#e:rO~O#e:sO~O#e:tO~O#e:uO~O#e:vO~O#z:wO~P!0kO#z:xO~P!0kO$V~!g!}#O#Q#R#U#c#d#o(p$n$p$s%V%a%b%c%j%l%o%p%r%t~'qR$V(p#i!S'o'w#jm#h#klz'p(W'p'v$X$Z$X~",goto:"$'R)OPPPP)PPP)SP)eP*t.xPPPP5YPP5pP;l>sP?WP?WPPP?WP@xP?WP?WP?WP@|PPARPAlPFdPPPFhPPPPFhIiPPPIoJjPFhPLxPPPP! WFhPPPFhPFhP!#fFhP!&z!'|!(VP!(y!(}!(yPPPPP!,Y!'|PP!,v!-pP!0dFhFh!0i!3s!8Y!8Y!wP#@W#@_#@gPPPP#Du#Gl#NT#NW#NZ$ S$ V$ Y$ a$ iPP$ o$ s$!k$#j$#n$$SPP$$W$$^$$bP$$e$$i$$l$%b$%y$&b$&f$&i$&l$&r$&u$&y$&}R!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:Wr,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[qr],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Vr[O]||-1},{term:330,get:O=>jr[O]||-1},{term:68,get:O=>zr[O]||-1}],tokenPrec:12827}),NO=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { - \${} -} catch (\${error}) { - \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),P("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),P(`if (\${}) { - \${} -} else { - \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),P(`class \${name} { - constructor(\${params}) { - \${} - } -}`,{label:"class",detail:"definition",type:"keyword"}),P('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),P('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Er=NO.concat([P("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),P("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),P("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),nO=new bO,BO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function G(O){return(e,a)=>{let t=e.node.getChild("VariableDefinition");return t&&a(t,O),!0}}const Ar=["FunctionDeclaration"],Ir={FunctionDeclaration:G("function"),ClassDeclaration:G("class"),ClassExpression:()=>!0,EnumDeclaration:G("constant"),TypeAliasDeclaration:G("type"),NamespaceDeclaration:G("namespace"),VariableDefinition(O,e){O.matchContext(Ar)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function DO(O,e){let a=nO.get(e);if(a)return a;let t=[],r=!0;function s(i,l){let n=O.sliceString(i.from,i.to);t.push({label:n,type:l})}return e.cursor(ve.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let l=Ir[i.name];if(l&&l(i,s)||BO.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of DO(O,i.node))t.push(l);return!1}}),nO.set(e,t),t}const cO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,JO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Nr(O){let e=j(O.state).resolveInner(O.pos,-1);if(JO.indexOf(e.name)>-1)return null;let a=e.name=="VariableName"||e.to-e.from<20&&cO.test(O.state.sliceDoc(e.from,e.to));if(!a&&!O.explicit)return null;let t=[];for(let r=e;r;r=r.parent)BO.has(r.name)&&(t=t.concat(DO(O.state.doc,r)));return{options:t,from:a?e.from:O.pos,validFor:cO}}const Y=J.define({name:"javascript",parser:Gr.configure({props:[L.add({IfStatement:C({except:/^\s*({|else\b)/}),TryStatement:C({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Rt,SwitchBody:O=>{let e=O.textAfter,a=/^\s*\}/.test(e),t=/^\s*(case|default)\b/.test(e);return O.baseIndent+(a?0:t?1:2)*O.unit},Block:qt({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":C({except:/^{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),F.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Te,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),LO={test:O=>/^JSX/.test(O.name),facet:Vt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},FO=Y.configure({dialect:"ts"},"typescript"),MO=Y.configure({dialect:"jsx",props:[yO.add(O=>O.isTop?[LO]:void 0)]}),KO=Y.configure({dialect:"jsx ts",props:[yO.add(O=>O.isTop?[LO]:void 0)]},"typescript");let HO=O=>({label:O,type:"keyword"});const et="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(HO),Br=et.concat(["declare","implements","private","protected","public"].map(HO));function Ot(O={}){let e=O.jsx?O.typescript?KO:MO:O.typescript?FO:Y,a=O.typescript?Er.concat(Br):NO.concat(et);return new M(e,[Y.data.of({autocomplete:XO(JO,xO(a))}),Y.data.of({autocomplete:Nr}),O.jsx?Lr:[]])}function Dr(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function QO(O,e,a=O.length){for(let t=e==null?void 0:e.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return O.sliceString(t.from,Math.min(t.to,a));return""}const Jr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Lr=U.inputHandler.of((O,e,a,t,r)=>{if((Jr?O.composing:O.compositionStarted)||O.state.readOnly||e!=a||t!=">"&&t!="/"||!Y.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(n=>{var Q;let{head:d}=n,c=j(i).resolveInner(d-1,-1),u;if(c.name=="JSXStartTag"&&(c=c.parent),!(i.doc.sliceString(d-1,d)!=t||c.name=="JSXAttributeValue"&&c.to>d)){if(t==">"&&c.name=="JSXFragmentTag")return{range:n,changes:{from:d,insert:""}};if(t=="/"&&c.name=="JSXStartCloseTag"){let p=c.parent,S=p.parent;if(S&&p.from==d-2&&((u=QO(i.doc,S.firstChild,d))||((Q=S.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let f=`${u}>`;return{range:YO.cursor(d+f.length,-1),changes:{from:d,insert:f}}}}else if(t==">"){let p=Dr(c);if(p&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(u=QO(i.doc,p,d)))return{range:n,changes:{from:d,insert:``}}}}return{range:n}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E=["_blank","_self","_top","_parent"],ge=["ascii","utf-8","utf-16","latin1","latin1"],me=["get","post","put","delete"],Pe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],h={},Fr={a:{attrs:{href:null,ping:null,type:null,media:null,target:E,hreflang:null}},abbr:h,address:h,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:h,aside:h,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:h,base:{attrs:{href:null,target:E}},bdi:h,bdo:h,blockquote:{attrs:{cite:null}},body:h,br:h,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:E,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:h,center:h,cite:h,code:h,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:h,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:h,div:h,dl:h,dt:h,em:h,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:h,figure:h,footer:h,form:{attrs:{action:null,name:null,"accept-charset":ge,autocomplete:["on","off"],enctype:Pe,method:me,novalidate:["novalidate"],target:E}},h1:h,h2:h,h3:h,h4:h,h5:h,h6:h,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:h,hgroup:h,hr:h,html:{attrs:{manifest:null}},i:h,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:E,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:h,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:h,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:h,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ge,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:h,noscript:h,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:h,param:{attrs:{name:null,value:null}},pre:h,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:h,rt:h,ruby:h,samp:h,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ge}},section:h,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:h,source:{attrs:{src:null,type:null,media:null}},span:h,strong:h,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:h,summary:h,sup:h,table:h,tbody:h,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:h,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:h,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:h,time:{attrs:{datetime:null}},title:h,tr:h,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:h,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:h},tt={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},at="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(O=>"on"+O);for(let O of at)tt[O]=null;class Qe{constructor(e,a){this.tags=Object.assign(Object.assign({},Fr),e),this.globalAttrs=Object.assign(Object.assign({},tt),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Qe.default=new Qe;function q(O,e,a=O.length){if(!e)return"";let t=e.firstChild,r=t&&t.getChild("TagName");return r?O.sliceString(r.from,Math.min(r.to,a)):""}function V(O,e=!1){for(;O;O=O.parent)if(O.name=="Element")if(e)e=!1;else return O;return null}function rt(O,e,a){let t=a.tags[q(O,V(e))];return(t==null?void 0:t.children)||a.allTags}function Ue(O,e){let a=[];for(let t=V(e);t&&!t.type.isTop;t=V(t.parent)){let r=q(O,t);if(r&&t.lastChild.name=="CloseTag")break;r&&a.indexOf(r)<0&&(e.name=="EndTag"||e.from>=t.firstChild.to)&&a.push(r)}return a}const it=/^[:\-\.\w\u00b7-\uffff]*$/;function pO(O,e,a,t,r){let s=/\s*>/.test(O.sliceDoc(r,r+5))?"":">",i=V(a,!0);return{from:t,to:r,options:rt(O.doc,i,e).map(l=>({label:l,type:"type"})).concat(Ue(O.doc,a).map((l,n)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function dO(O,e,a,t){let r=/\s*>/.test(O.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:Ue(O.doc,e).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:it}}function Mr(O,e,a,t){let r=[],s=0;for(let i of rt(O.doc,a,e))r.push({label:"<"+i,type:"type"});for(let i of Ue(O.doc,a))r.push({label:"",type:"type",boost:99-s++});return{from:t,to:t,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Kr(O,e,a,t,r){let s=V(a),i=s?e.tags[q(O.doc,s)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],n=i&&i.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:t,to:r,options:n.map(Q=>({label:Q,type:"property"})),validFor:it}}function Hr(O,e,a,t,r){var s;let i=(s=a.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],n;if(i){let Q=O.sliceDoc(i.from,i.to),d=e.globalAttrs[Q];if(!d){let c=V(a),u=c?e.tags[q(O.doc,c)]:null;d=(u==null?void 0:u.attrs)&&u.attrs[Q]}if(d){let c=O.sliceDoc(t,r).toLowerCase(),u='"',p='"';/^['"]/.test(c)?(n=c[0]=='"'?/^[^"]*$/:/^[^']*$/,u="",p=O.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),t++):n=/^[^\s<>='"]*$/;for(let S of d)l.push({label:S,apply:u+S+p,type:"constant"})}}return{from:t,to:r,options:l,validFor:n}}function ei(O,e){let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.resolve(t);for(let i=t,l;s==r&&(l=r.childBefore(i));){let n=l.lastChild;if(!n||!n.type.isError||n.fromei(t,r)}const ti=Y.parser.configure({top:"SingleExpression"}),st=[{tag:"script",attrs:O=>O.type=="text/typescript"||O.lang=="ts",parser:FO.parser},{tag:"script",attrs:O=>O.type=="text/babel"||O.type=="text/jsx",parser:MO.parser},{tag:"script",attrs:O=>O.type=="text/typescript-jsx",parser:KO.parser},{tag:"script",attrs:O=>O.type=="importmap"||O.type=="speculationrules",parser:ti},{tag:"script",attrs(O){return!O.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(O.type)},parser:Y.parser},{tag:"style",attrs(O){return(!O.lang||O.lang=="css")&&(!O.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(O.type))},parser:ce.parser}],lt=[{name:"style",parser:ce.parser.configure({top:"Styles"})}].concat(at.map(O=>({name:O,parser:Y.parser}))),ot=J.define({name:"html",parser:Ja.configure({props:[L.add({Element(O){let e=/^(\s*)(<\/)?/.exec(O.textAfter);return O.node.to<=O.pos+e[0].length?O.continue():O.lineIndent(O.node.from)+(e[2]?0:O.unit)},"OpenTag CloseTag SelfClosingTag"(O){return O.column(O.node.from)+O.unit},Document(O){if(O.pos+/\s*/.exec(O.textAfter)[0].lengthO.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ae=ot.configure({wrap:zO(st,lt)});function ai(O={}){let e="",a;O.matchClosingTags===!1&&(e="noMatch"),O.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(a=zO((O.nestedLanguages||[]).concat(st),(O.nestedAttributes||[]).concat(lt)));let t=a?ot.configure({wrap:a,dialect:e}):e?ae.configure({dialect:e}):ae;return new M(t,[ae.data.of({autocomplete:Oi(O)}),O.autoCloseTags!==!1?ri:[],Ot().support,mr().support])}const hO=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),ri=U.inputHandler.of((O,e,a,t,r)=>{if(O.composing||O.state.readOnly||e!=a||t!=">"&&t!="/"||!ae.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(n=>{var Q,d,c;let u=i.doc.sliceString(n.from-1,n.to)==t,{head:p}=n,S=j(i).resolveInner(p-1,-1),f;if((S.name=="TagName"||S.name=="StartTag")&&(S=S.parent),u&&t==">"&&S.name=="OpenTag"){if(((d=(Q=S.parent)===null||Q===void 0?void 0:Q.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(f=q(i.doc,S.parent,p))&&!hO.has(f)){let g=p+(i.doc.sliceString(p,p+1)===">"?1:0),X=``;return{range:n,changes:{from:p,to:g,insert:X}}}}else if(u&&t=="/"&&S.name=="IncompleteCloseTag"){let g=S.parent;if(S.from==p-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(f=q(i.doc,g,p))&&!hO.has(f)){let X=p+(i.doc.sliceString(p,p+1)===">"?1:0),y=`${f}>`;return{range:YO.cursor(p+y.length,-1),changes:{from:p,to:X,insert:y}}}}return{range:n}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),ii=D({String:o.string,Number:o.number,"True False":o.bool,PropertyName:o.propertyName,Null:o.null,",":o.separator,"[ ]":o.squareBracket,"{ }":o.brace}),si=T.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[ii],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),li=J.define({name:"json",parser:si.configure({props:[L.add({Object:C({except:/^\s*\}/}),Array:C({except:/^\s*\]/})}),F.add({"Object Array":Te})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function oi(){return new M(li)}const ni=36,uO=1,ci=2,A=3,Ze=4,Qi=5,pi=6,di=7,hi=8,ui=9,Si=10,$i=11,fi=12,gi=13,mi=14,Pi=15,Zi=16,bi=17,SO=18,Xi=19,nt=20,ct=21,$O=22,xi=23,Yi=24;function Ye(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function yi(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function W(O,e,a){for(let t=!1;;){if(O.next<0)return;if(O.next==e&&!t){O.advance();return}t=a&&!t&&O.next==92,O.advance()}}function ki(O){for(;;){if(O.next<0||O.peek(1)<0)return;if(O.next==36&&O.peek(1)==36){O.advance(2);return}O.advance()}}function wi(O,e){let a="[{<(".indexOf(String.fromCharCode(e)),t=a<0?e:"]}>)".charCodeAt(a);for(;;){if(O.next<0)return;if(O.next==t&&O.peek(1)==39){O.advance(2);return}O.advance()}}function Qt(O,e){for(;!(O.next!=95&&!Ye(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function vi(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),W(O,e,!1)}else Qt(O)}function fO(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function gO(O,e){for(;;){if(O.next==46){if(e)break;e=!0}else if(O.next<48||O.next>57)break;O.advance()}if(O.next==69||O.next==101)for(O.advance(),(O.next==43||O.next==45)&&O.advance();O.next>=48&&O.next<=57;)O.advance()}function mO(O){for(;!(O.next<0||O.next==10);)O.advance()}function _(O,e){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:pt(_i,Ti)};function Wi(O,e,a,t){let r={};for(let s in ye)r[s]=(O.hasOwnProperty(s)?O:ye)[s];return e&&(r.words=pt(e,a||"",t)),r}function dt(O){return new x(e=>{var a;let{next:t}=e;if(e.advance(),_(t,be)){for(;_(e.next,be);)e.advance();e.acceptToken(ni)}else if(t==36&&e.next==36&&O.doubleDollarQuotedStrings)ki(e),e.acceptToken(A);else if(t==39||t==34&&O.doubleQuotedStrings)W(e,t,O.backslashEscapes),e.acceptToken(A);else if(t==35&&O.hashComments||t==47&&e.next==47&&O.slashComments)mO(e),e.acceptToken(uO);else if(t==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))mO(e),e.acceptToken(uO);else if(t==47&&e.next==42){e.advance();for(let r=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(r--,e.advance(),!r)break}else s==47&&e.next==42&&(r++,e.advance())}e.acceptToken(ci)}else if((t==101||t==69)&&e.next==39)e.advance(),W(e,39,!0);else if((t==110||t==78)&&e.next==39&&O.charSetCasts)e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(A);else if(t==95&&O.charSetCasts)for(let r=0;;r++){if(e.next==39&&r>1){e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(A);break}if(!Ye(e.next))break;e.advance()}else if(O.plsqlQuotingMechanism&&(t==113||t==81)&&e.next==39&&e.peek(1)>0&&!_(e.peek(1),be)){let r=e.peek(1);e.advance(2),wi(e,r),e.acceptToken(A)}else if(t==40)e.acceptToken(di);else if(t==41)e.acceptToken(hi);else if(t==123)e.acceptToken(ui);else if(t==125)e.acceptToken(Si);else if(t==91)e.acceptToken($i);else if(t==93)e.acceptToken(fi);else if(t==59)e.acceptToken(gi);else if(O.unquotedBitLiterals&&t==48&&e.next==98)e.advance(),fO(e),e.acceptToken($O);else if((t==98||t==66)&&(e.next==39||e.next==34)){const r=e.next;e.advance(),O.treatBitsAsBytes?(W(e,r,O.backslashEscapes),e.acceptToken(xi)):(fO(e,r),e.acceptToken($O))}else if(t==48&&(e.next==120||e.next==88)||(t==120||t==88)&&e.next==39){let r=e.next==39;for(e.advance();yi(e.next);)e.advance();r&&e.next==39&&e.advance(),e.acceptToken(Ze)}else if(t==46&&e.next>=48&&e.next<=57)gO(e,!0),e.acceptToken(Ze);else if(t==46)e.acceptToken(mi);else if(t>=48&&t<=57)gO(e,!1),e.acceptToken(Ze);else if(_(t,O.operatorChars)){for(;_(e.next,O.operatorChars);)e.advance();e.acceptToken(Pi)}else if(_(t,O.specialVar))e.next==t&&e.advance(),vi(e),e.acceptToken(bi);else if(_(t,O.identifierQuotes))W(e,t,!1),e.acceptToken(Xi);else if(t==58||t==44)e.acceptToken(Zi);else if(Ye(t)){let r=Qt(e,String.fromCharCode(t));e.acceptToken(e.next==46?SO:(a=O.words[r.toLowerCase()])!==null&&a!==void 0?a:SO)}})}const ht=dt(ye),Ui=T.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ht],topRules:{Script:[0,25]},tokenPrec:0});function ke(O){let e=O.cursor().moveTo(O.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function N(O,e){let a=O.sliceString(e.from,e.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function pe(O){return O&&(O.name=="Identifier"||O.name=="QuotedIdentifier")}function Ci(O,e){if(e.name=="CompositeIdentifier"){let a=[];for(let t=e.firstChild;t;t=t.nextSibling)pe(t)&&a.push(N(O,t));return a}return[N(O,e)]}function PO(O,e){for(let a=[];;){if(!e||e.name!=".")return a;let t=ke(e);if(!pe(t))return a;a.unshift(N(O,t)),e=ke(t)}}function Ri(O,e){let a=j(O).resolveInner(e,-1),t=Vi(O.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?O.doc.sliceString(a.from,a.from+1):null,parents:PO(O.doc,ke(a)),aliases:t}:a.name=="."?{from:e,quoted:null,parents:PO(O.doc,a),aliases:t}:{from:e,quoted:null,parents:[],empty:!0,aliases:t}}const qi=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function Vi(O,e){let a;for(let r=e;!a;r=r.parent){if(!r)return null;r.name=="Statement"&&(a=r)}let t=null;for(let r=a.firstChild,s=!1,i=null;r;r=r.nextSibling){let l=r.name=="Keyword"?O.sliceString(r.from,r.to).toLowerCase():null,n=null;if(!s)s=l=="from";else if(l=="as"&&i&&pe(r.nextSibling))n=N(O,r.nextSibling);else{if(l&&qi.has(l))break;i&&pe(r)&&(n=N(O,r))}n&&(t||(t=Object.create(null)),t[n]=Ci(O,i)),i=/Identifier$/.test(r.name)?r:null}return t}function ji(O,e){return O?e.map(a=>Object.assign(Object.assign({},a),{label:O+a.label+O,apply:void 0})):e}const zi=/^\w*$/,Gi=/^[`'"]?\w*[`'"]?$/;class Ce{constructor(){this.list=[],this.children=void 0}child(e,a){let t=this.children||(this.children=Object.create(null)),r=t[e];return r||(e&&this.list.push(ut(e,"type",a)),t[e]=new Ce)}addCompletions(e){for(let a of e){let t=this.list.findIndex(r=>r.label==a.label);t>-1?this.list[t]=a:this.list.push(a)}}}function ut(O,e,a){return/[^\w\xb5-\uffff]/.test(O)?{label:O,type:e,apply:a+O+a}:{label:O,type:e}}function Ei(O,e,a,t,r,s){var i;let l=new Ce,n=((i=s==null?void 0:s.spec.identifierQuotes)===null||i===void 0?void 0:i[0])||'"',Q=l.child(r||"",n);for(let d in O){let c=d.replace(/\\?\./g,p=>p=="."?"\0":p).split("\0"),u=c.length==1?Q:l;for(let p of c)u=u.child(p.replace(/\\\./g,"."),n);for(let p of O[d])p&&u.list.push(typeof p=="string"?ut(p,"property",n):p)}return e&&Q.addCompletions(e),a&&l.addCompletions(a),l.addCompletions(Q.list),t&&l.addCompletions(Q.child(t,n).list),d=>{let{parents:c,from:u,quoted:p,empty:S,aliases:f}=Ri(d.state,d.pos);if(S&&!d.explicit)return null;f&&c.length==1&&(c=f[c[0]]||c);let g=l;for(let w of c){for(;!g.children||!g.children[w];)if(g==l)g=Q;else if(g==Q&&t)g=g.child(t,n);else return null;g=g.child(w,n)}let X=p&&d.state.sliceDoc(d.pos,d.pos+1)==p,y=g.list;return g==l&&f&&(y=y.concat(Object.keys(f).map(w=>({label:w,type:"constant"})))),{from:u,to:X?d.pos+1:void 0,options:ji(p,y),validFor:p?Gi:zi}}}function Ai(O,e){let a=Object.keys(O).map(t=>({label:e?t.toUpperCase():t,type:O[t]==ct?"type":O[t]==nt?"keyword":"variable",boost:-1}));return XO(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],xO(a))}let Ii=Ui.configure({props:[L.add({Statement:C()}),F.add({Statement(O){return{from:O.firstChild.to,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}}),D({Keyword:o.keyword,Type:o.typeName,Builtin:o.standard(o.name),Bits:o.number,Bytes:o.string,Bool:o.bool,Null:o.null,Number:o.number,String:o.string,Identifier:o.name,QuotedIdentifier:o.special(o.string),SpecialVar:o.special(o.name),LineComment:o.lineComment,BlockComment:o.blockComment,Operator:o.operator,"Semi Punctuation":o.punctuation,"( )":o.paren,"{ }":o.brace,"[ ]":o.squareBracket})]});class B{constructor(e,a,t){this.dialect=e,this.language=a,this.spec=t}get extension(){return this.language.extension}static define(e){let a=Wi(e,e.keywords,e.types,e.builtin),t=J.define({name:"sql",parser:Ii.configure({tokenizers:[{from:ht,to:dt(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new B(a,t,e)}}function Ni(O,e=!1){return Ai(O.dialect.words,e)}function Bi(O,e=!1){return O.language.data.of({autocomplete:Ni(O,e)})}function Di(O){return O.schema?Ei(O.schema,O.tables,O.schemas,O.defaultTable,O.defaultSchema,O.dialect||Re):()=>null}function Ji(O){return O.schema?(O.dialect||Re).language.data.of({autocomplete:Di(O)}):[]}function ZO(O={}){let e=O.dialect||Re;return new M(e.language,[Ji(O),Bi(e,!!O.upperCaseKeywords)])}const Re=B.define({});function Li(O){let e;return{c(){e=Pt("div"),Zt(e,"class","code-editor"),K(e,"min-height",O[0]?O[0]+"px":null),K(e,"max-height",O[1]?O[1]+"px":"auto")},m(a,t){bt(a,e,t),O[11](e)},p(a,[t]){t&1&&K(e,"min-height",a[0]?a[0]+"px":null),t&2&&K(e,"max-height",a[1]?a[1]+"px":"auto")},i:ze,o:ze,d(a){a&&Xt(e),O[11](null)}}}function Fi(O,e,a){let t;xt(O,Yt,$=>a(12,t=$));const r=yt();let{id:s=""}=e,{value:i=""}=e,{minHeight:l=null}=e,{maxHeight:n=null}=e,{disabled:Q=!1}=e,{placeholder:d=""}=e,{language:c="javascript"}=e,{singleLine:u=!1}=e,p,S,f=new H,g=new H,X=new H,y=new H;function w(){p==null||p.focus()}function St(){S==null||S.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function qe(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.removeEventListener("click",w)}function Ve(){if(!s)return;qe();const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.addEventListener("click",w)}function je(){switch(c){case"html":return ai();case"json":return oi();case"sql-create-index":return ZO({dialect:B.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:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let m of t)$[m.name]=wt.getAllCollectionIdentifiers(m);return ZO({dialect:B.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return Ot()}}kt(()=>{const $={key:"Enter",run:m=>{u&&r("submit",i)}};return Ve(),a(10,p=new U({parent:S,state:z.create({doc:i,extensions:[zt(),Gt(),Et(),At(),It(),z.allowMultipleSelections.of(!0),Nt(Bt,{fallback:!0}),Dt(),Jt(),Lt(),Ft(),Mt.of([$,...Kt,...Ht,ea.find(m=>m.key==="Mod-d"),...Oa,...ta]),U.lineWrapping,aa({icons:!1}),f.of(je()),y.of(Ge(d)),g.of(U.editable.of(!0)),X.of(z.readOnly.of(!1)),z.transactionFilter.of(m=>u&&m.newDoc.lines>1?[]:m),U.updateListener.of(m=>{!m.docChanged||Q||(a(3,i=m.state.doc.toString()),St())})]})})),()=>{qe(),p==null||p.destroy()}});function $t($){vt[$?"unshift":"push"](()=>{S=$,a(2,S)})}return O.$$set=$=>{"id"in $&&a(4,s=$.id),"value"in $&&a(3,i=$.value),"minHeight"in $&&a(0,l=$.minHeight),"maxHeight"in $&&a(1,n=$.maxHeight),"disabled"in $&&a(5,Q=$.disabled),"placeholder"in $&&a(6,d=$.placeholder),"language"in $&&a(7,c=$.language),"singleLine"in $&&a(8,u=$.singleLine)},O.$$.update=()=>{O.$$.dirty&16&&s&&Ve(),O.$$.dirty&1152&&p&&c&&p.dispatch({effects:[f.reconfigure(je())]}),O.$$.dirty&1056&&p&&typeof Q<"u"&&p.dispatch({effects:[g.reconfigure(U.editable.of(!Q)),X.reconfigure(z.readOnly.of(Q))]}),O.$$.dirty&1032&&p&&i!=p.state.doc.toString()&&p.dispatch({changes:{from:0,to:p.state.doc.length,insert:i}}),O.$$.dirty&1088&&p&&typeof d<"u"&&p.dispatch({effects:[y.reconfigure(Ge(d))]})},[l,n,S,i,s,Q,d,c,u,w,p,$t]}class Hi extends ft{constructor(e){super(),gt(this,e,Fi,Li,mt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{Hi as default}; diff --git a/ui/dist/assets/CodeEditor-73c7d443.js b/ui/dist/assets/CodeEditor-73c7d443.js new file mode 100644 index 00000000..b84f322f --- /dev/null +++ b/ui/dist/assets/CodeEditor-73c7d443.js @@ -0,0 +1,14 @@ +import{S as ft,i as gt,s as mt,e as Pt,f as Zt,U as K,g as bt,y as ze,o as Xt,J as xt,K as Yt,L as yt,I as kt,C as wt,M as vt}from"./index-284695d1.js";import{P as Tt,N as _t,u as Wt,D as Ut,v as we,T as ee,I as ve,w as D,x as n,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as j,J as bO,K as XO,M as xO,E as U,O as YO,Q as P,R as Rt,U as qt,V as yO,W as Vt,X as jt,a as z,h as zt,b as Gt,c as Et,d as At,e as It,s as Nt,t as Bt,f as Dt,g as Jt,r as Lt,i as Ft,k as Mt,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as Ge,C as H}from"./index-9cd23da9.js";class re{constructor(e,a,t,r,s,i,l,o,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=o,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new re(e,[],a,t,t,0,[],0,r?new Ee(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=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.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,o)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new re(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new ra(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;so&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let o=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],o,!1)>=0)return l<<19|65536|o}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ee{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class ra{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class ie{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new ie(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ie(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class Oe{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ae=new Oe;class ia{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ae,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ae,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;kO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class se{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(kO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}se.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class x{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function kO(O,e,a,t,r,s){let i=0,l=1<0){let u=O[p];if(o.allows(u)&&(e.token.value==-1||e.token.value==u||sa(u,e.token.value,r,s))){e.acceptToken(u);break}}let d=e.next,c=0,S=O[i+2];if(e.next<0&&S>c&&O[Q+S*3-3]==65535&&O[Q+S*3-3]==65535){i=O[Q+S*3-1];continue e}for(;c>1,u=Q+p+(p<<1),f=O[u],g=O[u+1]||65536;if(d=g)c=p+1;else{i=O[u+2],e.advance();continue e}}break}}function Ie(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function sa(O,e,a,t){let r=Ie(a,t,e);return r<0||Ie(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class la{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ne(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ne(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof ee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class na{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Oe)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let S=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>S))break}}for(;this.actions.length>a;)this.actions.pop();return o&&e.setLookAhead(o),!t&&e.pos==this.stream.end&&(t=new Oe,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new Oe,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,e))continue;{r||(r=[],s=[]),r.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!t.length){let i=r&&Qa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,o)=>o.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(o--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let S=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(S>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,S),Z&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof ee&&c.positions[0]==0)c=p;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let Q=0;Qr?a.push(u):t.push(u)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Be(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),S=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(S+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(S=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,o=0),l.recoverByDelete(o,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),Be(l,t)):(!r||r.scoreO;class wO{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Tt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(d,o,l[Q++]);else{let c=l[Q+-d];for(let S=-d;S>0;S--)s(l[Q++],o,c);Q++}}}this.nodeSet=new _t(a.map((l,o)=>Wt.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:t.indexOf(o)>-1,error:o==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Ut;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new R(i,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new oa(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,o=r[s++];if(l&&t)return o;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;r=a(k(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=De(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const pa=54,da=1,ha=55,ua=2,Sa=56,$a=3,Je=4,fa=5,le=6,vO=7,TO=8,_O=9,WO=10,ga=11,ma=12,Pa=13,ue=57,Za=14,Le=58,UO=20,ba=22,CO=23,Xa=24,Xe=26,RO=27,xa=28,Ya=31,ya=34,ka=36,wa=37,va=0,Ta=1,_a={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Fe={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ua(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function qO(O){return O==9||O==10||O==13||O==32}let Me=null,Ke=null,He=0;function xe(O,e){let a=O.pos+e;if(He==a&&Ke==O)return Me;let t=O.peek(e);for(;qO(t);)t=O.peek(++e);let r="";for(;Ua(t);)r+=String.fromCharCode(t),t=O.peek(++e);return Ke=O,He=a,Me=r?r.toLowerCase():t==Ca||t==Ra?void 0:null}const VO=60,ne=62,_e=47,Ca=63,Ra=33,qa=45;function eO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new eO(xe(t,1)||"",O):O},reduce(O,e){return e==UO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==le||r==ka?new eO(xe(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new x((O,e)=>{if(O.next!=VO){O.next<0&&e.context&&O.acceptToken(ue);return}O.advance();let a=O.next==_e;a&&O.advance();let t=xe(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Za:le);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ga);if(r&&Wa[r])return O.acceptToken(ue,-2);if(e.dialectEnabled(va))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Pa)}else{if(t=="script")return O.acceptToken(vO);if(t=="style")return O.acceptToken(TO);if(t=="textarea")return O.acceptToken(_O);if(_a.hasOwnProperty(t))return O.acceptToken(WO);r&&Fe[r]&&Fe[r][t]?O.acceptToken(ue,-1):O.acceptToken(le)}},{contextual:!0}),Ga=new x(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Le);break}if(O.next==qa)e++;else if(O.next==ne&&e>=2){a>3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Ea(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Aa=new x((O,e)=>{if(O.next==_e&&O.peek(1)==ne){let a=e.dialectEnabled(Ta)||Ea(e.context);O.acceptToken(a?fa:Je,2)}else O.next==ne&&O.acceptToken(Je,1)});function We(O,e,a){let t=2+O.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==VO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ia=We("script",pa,da),Na=We("style",ha,ua),Ba=We("textarea",Sa,$a),Da=D({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),Ja=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Da],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==xa)return Se(l,o,a);if(Q==Ya)return Se(l,o,t);if(Q==ya)return Se(l,o,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,S=c&&OO(c,o),p;if(S){for(let u of s)if(u.tag==S&&(!u.attrs||u.attrs(p||(p=jO(d,o))))){let f=d.lastChild;return{parser:u.parser,overlay:[{from:c.to,to:f.type.id==wa?f.from:d.to}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let S=i[o.read(c.from,c.to)];if(S)for(let p of S){if(p.tagName&&p.tagName!=OO(d.parent,o))continue;let u=d.lastChild;if(u.type.id==Xe){let f=u.from+1,g=u.lastChild,X=u.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(u.type.id==RO)return{parser:p.parser,overlay:[{from:u.from,to:u.to}]}}}}return null})}const La=96,tO=1,Fa=97,Ma=98,aO=2,GO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ka=58,Ha=40,EO=95,er=91,te=45,Or=46,tr=35,ar=37;function oe(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function rr(O){return O>=48&&O<=57}const ir=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(oe(s)||s==te||s==EO||a&&rr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),sr=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(oe(e)||e==EO||e==tr||e==Or||e==er||e==Ka||e==te)&&O.acceptToken(La)}}),lr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),oe(e)){do O.advance();while(oe(O.next));O.acceptToken(tO)}}}),nr=D({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),or={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},cr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qr={__proto__:null,not:128,only:128},pr=T.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[sr,lr,ir,1,2,3,4,new se("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>or[O]||-1},{term:56,get:O=>cr[O]||-1},{term:98,get:O=>Qr[O]||-1}],tokenPrec:1169});let $e=null;function fe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const rO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),iO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),dr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),v=/^(\w[\w-]*|-\w[\w-]*|)$/,hr=/^-(-[\w-]*)?$/;function ur(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const sO=new bO,Sr=["Declaration"];function $r(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function AO(O,e,a){if(e.to-e.from>4096){let t=sO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let l of AO(O,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return sO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Sr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=O.sliceString(s.from,s.to);r.has(l)||(r.add(l),t.push({label:l,type:"variable"}))}}),t}}const fr=O=>e=>{let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:fe(),validFor:v};if(r.name=="ValueName")return{from:r.from,options:iO,validFor:v};if(r.name=="PseudoClassName")return{from:r.from,options:rO,validFor:v};if(O(r)||(e.explicit||s)&&ur(r,a.doc))return{from:O(r)||s?r.from:t,options:AO(a.doc,$r(r),O),validFor:hr};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:dr,validFor:v}}if(!e.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:rO,validFor:v}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:iO,validFor:v}:i.name=="Block"||i.name=="Styles"?{from:t,options:fe(),validFor:v}:null},gr=fr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:pr.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mr(){return new M(ce,ce.data.of({autocomplete:gr}))}const Pr=304,lO=1,Zr=2,br=305,Xr=307,xr=308,Yr=3,yr=4,kr=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],IO=125,wr=59,nO=47,vr=42,Tr=43,_r=45,Wr=new wO({start:!1,shift(O,e){return e==Yr||e==yr||e==Xr?O:e==xr},strict:!1}),Ur=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(br)},{contextual:!0,fallback:!0}),Cr=new x((O,e)=>{let{next:a}=O,t;kr.indexOf(a)>-1||a==nO&&((t=O.peek(1))==nO||t==vr)||a!=IO&&a!=wr&&a!=-1&&!e.context&&O.acceptToken(Pr)},{contextual:!0}),Rr=new x((O,e)=>{let{next:a}=O;if((a==Tr||a==_r)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:Zr)}},{contextual:!0}),qr=D({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),Vr={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},jr={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},zr={__proto__:null,"<":139},Gr=T.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-ElOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-ExQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AcQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AkQSO,5=sO!ApQSO,5=sO!AuQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BTQWO,5=`O!B]Q,UO,5=aO!BhQSO,5=cO!BmQ`O,5=fO!BuQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!BzQSO'#HRO9{Q,UO'#HTO!CPQSO'#HTOOQQ,5=i,5=iO!CUQSO'#HUO!C^QSO'#CmO!CcQSO,58}O!CmQSO,58}O!ErQUO,58}OOQQ,58},58}O!FSQ(C[O,58}O%[QUO,58}O!H_QUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!HuQSO,5=uO`QUO,5={O`QUO,5=}O!HzQSO,5>PO`QUO,5>RO!IPQSO,5>UO!IUQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!M`QSO,5>fOOQQ,5>h,5>hO!M`QSO,5>hOOQQ,5>j,5>jO!MeQWO'#DYO%[QUO'#JiO!NSQWO'#JiO!NqQWO'#DhO# SQWO'#DhO##eQUO'#DhO##lQSO'#JhO##tQSO,5:RO##yQSO'#EnO#$XQSO'#JvO#$aQSO,5;XO#$fQWO'#DhO#$sQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#$zQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%SQSO,5@TO#%XQ!LQO,5:pOOQO-E<_-E<_O#&_Q(C`O,5:{OChQWO,5:oO#&iQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#&vQ(C[O,5:{O#'RQ(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'aQ(C[O,5:{POOO'#IU'#IUP#'uO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(aQUO'#I[OOQO-ERQ(CjO1G0yO#?yQ(CjO1G0yO#ByQ$IUO'#CgO#DwQ$IUO1G1[O#EOQ$IUO'#JfO!,YQSO1G1bO#E`Q(CjO,5?SOOQ(CW-EeQSO1G3kO$.VQUO1G3mO$2ZQUO'#HlOOQQ1G3p1G3pO$2hQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$2pQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$6wQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$6|Q$IUO,5:SOOQO,5;Y,5;YO$7WQWO'#I]O$7nQSO,5@SOOQ(CY1G/m1G/mO$7vQWO'#IcO$8QQSO,5@bOOQ(CW1G0s1G0sO# SQWO,5:SOOQO'#I`'#I`O$8YQWO,5:nOOQ(CY,5:n,5:nO#$}QSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8aQ(C[O1G0gO$8lQ(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$8zQ(C[O1G0gOOQO1G0Z1G0ZO$9`Q(CjO1G0gPOOO-EvO$9|QSO1G5mO$:UQSO1G5zO$:^QbO1G5{O9TQSO,5>|O$:hQ(CjO1G5xO%[QUO1G5xO$:xQ(C[O1G5xO$;ZQSO1G5wO$;ZQSO1G5wO9TQSO1G5wO$;cQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$;wQSO,5?PO$$XQSO,5?POOQO-ExQ(CjO,5WOOQQ,5>W,5>WO%[QUO'#HmO%(ZQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%(`QWO1G5oO%(tQ$IUO1G0tO%)OQSO1G0tOOQO1G/n1G/nO%)ZQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9`Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%)eQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%)pQ(C[O7+&RO%*OQ(CjO7++dO%[QUO7++dO%*`QSO7++cO%*`QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%*hQSO1G4kOOQO7+%z7+%zO#$}QSO<xOOQO-E<[-E<[O%2^QbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%2hQSO1G5qOOQ(CY<XQ$IUO1G0yO%>`Q$IUO1G0yO%@WQ$IUO1G0yO%@kQ(CjO<XOOQQ,5>Z,5>ZO%NUQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO%NZQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&5rQSO<{AN>{O%[QUOAN?XOOQO<SQSO7++uO%LgQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&>[QSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#MzQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&>dQSOANBTOOQQ<iQSOLD,jO&>qQ$IUO7+'tO&@gQ$IUO7+'vO&B]Q,UOG26|OOQO<YOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#@sOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#CQO#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,gO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#CQO!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,gO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,gO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ hOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!^Oz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#PO#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$nOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+dO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#CQOm!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ hO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!^O#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#PO#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,gO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#CQO#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,gO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,gOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$I|Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$JoO(d$ZO~P#,gO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,gO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,gO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,gO!Y$|O~P#,gO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%$nOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O'v#mO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#CQO#Y5lO!W#bi!X#bi~O!W![i!X![i~P#CQO_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$I|O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$JoO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,gOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#CQOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%2}O#h9zO~P%2}OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5YOl9|O~P%5YOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%7eOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%7eOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:PO(k#|O~P%:POP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%<[O(l#}O~P%<[OP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO(TVO(k#|O(l#}O~O#w#gi#z#gi(d#gi!W#gi!X#gi~P%>gO_#xy!W#xy'm#xy'k#xy!T#xy!h#xyp#xy!Y#xy%b#xy!b#xy~P!7zOh;mOz)vO})wO(k)yO(l){O~OP#giY#gil#gi{#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(T#gi(d#gi!W#gi!X#gi~P%A_O!g#wOP(SXY(SXh(SXl(SXz(SX{(SX}(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX#z(SX(T(SX(d(SX(k(SX(l(SX!W(SX!X(SX~O#z#{i!W#{i!X#{i~P#CQO#z!oi!X!oi~P$$nO!X6`O~O!W'[a!X'[a~P#CQO!b#uO(d'gO!W']a!h']a~O!W/VO!h(qi~O!W/VO!b#uO!h(qi~Oe$vq!W$vq#Y$vq#z$vq~P!0kO!T'_a!W'_a~P#,gO!b6gO~O!W/_O!T(ri~P#,gO!W/_O!T(ri~O!T6kO~O!b#uO#p6pO~Ol6qO!b#uO(d'gO~O!T6sO~Oe$xq!W$xq#Y$xq#z$xq~P!0kO_$jy!W$jy'm$jy'k$jy!T$jy!h$jyp$jy!Y$jy%b$jy!b$jy~P!7zO!b5kO~O!W4WO!Y(sa~O_#]y!W#]y'm#]y'k#]y!T#]y!h#]yp#]y!Y#]y%b#]y!b#]y~P!7zOY6xO~O!W0bO!X(zi~O^7OO~O(W(tO!W'dX!X'dX~O!W4nO!X(wa~OjkO'v7VO~P.iO!X7YO~P%$nOm!nO}7ZO'xTO'{UO(W!mO(c!sO~O!Y0zO~O!Y0zO%b7]O~Oh7`O!Y0zO%b7]O~OY7eO!W'ga!X'ga~O!W1VO!X(xi~O!h7iO~O!h7jO~O!h7mO~O!h7mO~P%[O_7oO~O!b7pO~O!h7qO~O!W(ii!X(ii~P#CQO_%gO#Y7yO'm%gO~O!W(fy!h(fy_(fy'm(fy~P!7zO!W(`O!h(ey~O!Y'VO%b7|O~O#e$vqP$vqY$vq_$vql$vq{$vq!W$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq'm$vq(T$vq(d$vq!h$vq!T$vq'k$vq#Y$vqp$vq!Y$vq%b$vq!b$vq~P#,gO#e$xqP$xqY$xq_$xql$xq{$xq!W$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq'm$xq(T$xq(d$xq!h$xq!T$xq'k$xq#Y$xqp$xq!Y$xq%b$xq!b$xq~P#,gO!W'Ri!h'Ri~P!7zO#z#]q!W#]q!X#]q~P#CQOz/yO{/yO}/zOPwaYwahwalwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa#zwa(Twa(dwa(kwa(lwa!Wwa!Xwa~Oz)vO})wOP$maY$mah$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma#z$ma(T$ma(d$ma(k$ma(l$ma!W$ma!X$ma~Oz)vO})wOP$oaY$oah$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa#z$oa(T$oa(d$oa(k$oa(l$oa!W$oa!X$oa~OP$}aY$}al$}a{$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a#z$}a(T$}a(d$}a!W$}a!X$}a~P%A_O#z$iq!W$iq!X$iq~P#CQO#z$jq!W$jq!X$jq~P#CQO!X8WO~O#z8XO~P!0kO!b#uO!W']i!h']i~O!b#uO(d'gO!W']i!h']i~O!W/VO!h(qq~O!T'_i!W'_i~P#,gO!W/_O!T(rq~O!T8_O~P#,gO!T8_O~Oe(Ry!W(Ry~P!0kO!W'ba!Y'ba~P#,gO_%Uq!Y%Uq'm%Uq!W%Uq~P#,gOY8dO~O!W0bO!X(zq~O#Y8hO!W'da!X'da~O!W4nO!X(wi~P#CQOPZXYZXlZXzZX{ZX}ZX!TZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!b%SX#p%SX~P&2_O!Y0zO%b8lO~O'xTO'{UO(W8qO~O!W1VO!X(xq~O!h8tO~O!h8uO~O!h8vO~O!h8vO~P%[O#Y8yO!W#by!X#by~O!W#by!X#by~P#CQO!Y'VO%b9OO~O#z#xy!W#xy!X#xy~P#CQOP$viY$vil$vi{$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi#z$vi(T$vi(d$vi!W$vi!X$vi~P%A_Oz)vO})wO(l){OP%YiY%Yih%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi#z%Yi(T%Yi(d%Yi(k%Yi!W%Yi!X%Yi~Oz)vO})wOP%[iY%[ih%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i#z%[i(T%[i(d%[i(k%[i(l%[i!W%[i!X%[i~O#z$jy!W$jy!X$jy~P#CQO#z#]y!W#]y!X#]y~P#CQO!b#uO!W']q!h']q~O!W/VO!h(qy~O!T'_q!W'_q~P#,gO!T9VO~P#,gO!W0bO!X(zy~O!W4nO!X(wq~O!Y0zO%b9^O~O!h9aO~O!Y'VO%b9fO~OP$vqY$vql$vq{$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq#z$vq(T$vq(d$vq!W$vq!X$vq~P%A_OP$xqY$xql$xq{$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq#z$xq(T$xq(d$xq!W$xq!X$xq~P%A_Oe%^!Z!W%^!Z#Y%^!Z#z%^!Z~P!0kO!W'dq!X'dq~P#CQO!W#b!Z!X#b!Z~P#CQO#e%^!ZP%^!ZY%^!Z_%^!Zl%^!Z{%^!Z!W%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z'm%^!Z(T%^!Z(d%^!Z!h%^!Z!T%^!Z'k%^!Z#Y%^!Zp%^!Z!Y%^!Z%b%^!Z!b%^!Z~P#,gOP%^!ZY%^!Zl%^!Z{%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z#z%^!Z(T%^!Z(d%^!Z!W%^!Z!X%^!Z~P%A_Op(XX~P1qO'w!lO~P!*SO!TdX!WdX#YdX~P&2_OPZXYZXlZXzZX{ZX}ZX!WZX!WdX!fZX!gZX!iZX!mZX#YZX#YdX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!bdX!hZX!hdX(ddX~P&GuOP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!YXO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O!W:VO!X$la~Oj%SOl$tOm$sOn$sOt%TOv%UOx:]O}${O!Y$|O!d;gO!i$xO#d:cO$R%YO$n:_O$p:aO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#q)]O~P&LkO!XZX!XdX~P&GuO#e9yO~O!b#uO#e9yO~O#Y:ZO~O#p:OO~O#Y:eO!W(iX!X(iX~O#Y:ZO!W(gX!X(gX~O#e:fO~Oe:hO~P!0kO#e:mO~O#e:nO~O!b#uO#e:oO~O!b#uO#e:fO~O#z:pO~P#CQO#e:qO~O#e:rO~O#e:sO~O#e:tO~O#e:uO~O#e:vO~O#z:wO~P!0kO#z:xO~P!0kO$V~!g!}#O#Q#R#U#c#d#o(p$n$p$s%V%a%b%c%j%l%o%p%r%t~'qR$V(p#i!S'o'w#jm#h#klz'p(W'p'v$X$Z$X~",goto:"$'R)OPPPP)PPP)SP)eP*t.xPPPP5YPP5pP;l>sP?WP?WPPP?WP@xP?WP?WP?WP@|PPARPAlPFdPPPFhPPPPFhIiPPPIoJjPFhPLxPPPP! WFhPPPFhPFhP!#fFhP!&z!'|!(VP!(y!(}!(yPPPPP!,Y!'|PP!,v!-pP!0dFhFh!0i!3s!8Y!8Y!wP#@W#@_#@gPPPP#Du#Gl#NT#NW#NZ$ S$ V$ Y$ a$ iPP$ o$ s$!k$#j$#n$$SPP$$W$$^$$bP$$e$$i$$l$%b$%y$&b$&f$&i$&l$&r$&u$&y$&}R!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:Wr,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[qr],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Vr[O]||-1},{term:330,get:O=>jr[O]||-1},{term:68,get:O=>zr[O]||-1}],tokenPrec:12827}),NO=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),P("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),P(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),P(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),P('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),P('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Er=NO.concat([P("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),P("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),P("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),oO=new bO,BO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function G(O){return(e,a)=>{let t=e.node.getChild("VariableDefinition");return t&&a(t,O),!0}}const Ar=["FunctionDeclaration"],Ir={FunctionDeclaration:G("function"),ClassDeclaration:G("class"),ClassExpression:()=>!0,EnumDeclaration:G("constant"),TypeAliasDeclaration:G("type"),NamespaceDeclaration:G("namespace"),VariableDefinition(O,e){O.matchContext(Ar)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function DO(O,e){let a=oO.get(e);if(a)return a;let t=[],r=!0;function s(i,l){let o=O.sliceString(i.from,i.to);t.push({label:o,type:l})}return e.cursor(ve.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let l=Ir[i.name];if(l&&l(i,s)||BO.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of DO(O,i.node))t.push(l);return!1}}),oO.set(e,t),t}const cO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,JO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Nr(O){let e=j(O.state).resolveInner(O.pos,-1);if(JO.indexOf(e.name)>-1)return null;let a=e.name=="VariableName"||e.to-e.from<20&&cO.test(O.state.sliceDoc(e.from,e.to));if(!a&&!O.explicit)return null;let t=[];for(let r=e;r;r=r.parent)BO.has(r.name)&&(t=t.concat(DO(O.state.doc,r)));return{options:t,from:a?e.from:O.pos,validFor:cO}}const Y=J.define({name:"javascript",parser:Gr.configure({props:[L.add({IfStatement:C({except:/^\s*({|else\b)/}),TryStatement:C({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Rt,SwitchBody:O=>{let e=O.textAfter,a=/^\s*\}/.test(e),t=/^\s*(case|default)\b/.test(e);return O.baseIndent+(a?0:t?1:2)*O.unit},Block:qt({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":C({except:/^{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),F.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Te,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),LO={test:O=>/^JSX/.test(O.name),facet:Vt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},FO=Y.configure({dialect:"ts"},"typescript"),MO=Y.configure({dialect:"jsx",props:[yO.add(O=>O.isTop?[LO]:void 0)]}),KO=Y.configure({dialect:"jsx ts",props:[yO.add(O=>O.isTop?[LO]:void 0)]},"typescript");let HO=O=>({label:O,type:"keyword"});const et="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(HO),Br=et.concat(["declare","implements","private","protected","public"].map(HO));function Ot(O={}){let e=O.jsx?O.typescript?KO:MO:O.typescript?FO:Y,a=O.typescript?Er.concat(Br):NO.concat(et);return new M(e,[Y.data.of({autocomplete:XO(JO,xO(a))}),Y.data.of({autocomplete:Nr}),O.jsx?Lr:[]])}function Dr(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function QO(O,e,a=O.length){for(let t=e==null?void 0:e.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return O.sliceString(t.from,Math.min(t.to,a));return""}const Jr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Lr=U.inputHandler.of((O,e,a,t,r)=>{if((Jr?O.composing:O.compositionStarted)||O.state.readOnly||e!=a||t!=">"&&t!="/"||!Y.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var Q;let{head:d}=o,c=j(i).resolveInner(d-1,-1),S;if(c.name=="JSXStartTag"&&(c=c.parent),!(i.doc.sliceString(d-1,d)!=t||c.name=="JSXAttributeValue"&&c.to>d)){if(t==">"&&c.name=="JSXFragmentTag")return{range:o,changes:{from:d,insert:""}};if(t=="/"&&c.name=="JSXStartCloseTag"){let p=c.parent,u=p.parent;if(u&&p.from==d-2&&((S=QO(i.doc,u.firstChild,d))||((Q=u.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let f=`${S}>`;return{range:YO.cursor(d+f.length,-1),changes:{from:d,insert:f}}}}else if(t==">"){let p=Dr(c);if(p&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(S=QO(i.doc,p,d)))return{range:o,changes:{from:d,insert:``}}}}return{range:o}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E=["_blank","_self","_top","_parent"],ge=["ascii","utf-8","utf-16","latin1","latin1"],me=["get","post","put","delete"],Pe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],h={},Fr={a:{attrs:{href:null,ping:null,type:null,media:null,target:E,hreflang:null}},abbr:h,address:h,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:h,aside:h,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:h,base:{attrs:{href:null,target:E}},bdi:h,bdo:h,blockquote:{attrs:{cite:null}},body:h,br:h,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:E,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:h,center:h,cite:h,code:h,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:h,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:h,div:h,dl:h,dt:h,em:h,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:h,figure:h,footer:h,form:{attrs:{action:null,name:null,"accept-charset":ge,autocomplete:["on","off"],enctype:Pe,method:me,novalidate:["novalidate"],target:E}},h1:h,h2:h,h3:h,h4:h,h5:h,h6:h,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:h,hgroup:h,hr:h,html:{attrs:{manifest:null}},i:h,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:E,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:h,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:h,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:h,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ge,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:h,noscript:h,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:h,param:{attrs:{name:null,value:null}},pre:h,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:h,rt:h,ruby:h,samp:h,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ge}},section:h,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:h,source:{attrs:{src:null,type:null,media:null}},span:h,strong:h,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:h,summary:h,sup:h,table:h,tbody:h,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:h,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:h,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:h,time:{attrs:{datetime:null}},title:h,tr:h,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:h,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:h},tt={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},at="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(O=>"on"+O);for(let O of at)tt[O]=null;class Qe{constructor(e,a){this.tags=Object.assign(Object.assign({},Fr),e),this.globalAttrs=Object.assign(Object.assign({},tt),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Qe.default=new Qe;function q(O,e,a=O.length){if(!e)return"";let t=e.firstChild,r=t&&t.getChild("TagName");return r?O.sliceString(r.from,Math.min(r.to,a)):""}function V(O,e=!1){for(;O;O=O.parent)if(O.name=="Element")if(e)e=!1;else return O;return null}function rt(O,e,a){let t=a.tags[q(O,V(e))];return(t==null?void 0:t.children)||a.allTags}function Ue(O,e){let a=[];for(let t=V(e);t&&!t.type.isTop;t=V(t.parent)){let r=q(O,t);if(r&&t.lastChild.name=="CloseTag")break;r&&a.indexOf(r)<0&&(e.name=="EndTag"||e.from>=t.firstChild.to)&&a.push(r)}return a}const it=/^[:\-\.\w\u00b7-\uffff]*$/;function pO(O,e,a,t,r){let s=/\s*>/.test(O.sliceDoc(r,r+5))?"":">",i=V(a,!0);return{from:t,to:r,options:rt(O.doc,i,e).map(l=>({label:l,type:"type"})).concat(Ue(O.doc,a).map((l,o)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-o}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function dO(O,e,a,t){let r=/\s*>/.test(O.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:Ue(O.doc,e).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:it}}function Mr(O,e,a,t){let r=[],s=0;for(let i of rt(O.doc,a,e))r.push({label:"<"+i,type:"type"});for(let i of Ue(O.doc,a))r.push({label:"",type:"type",boost:99-s++});return{from:t,to:t,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Kr(O,e,a,t,r){let s=V(a),i=s?e.tags[q(O.doc,s)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],o=i&&i.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:t,to:r,options:o.map(Q=>({label:Q,type:"property"})),validFor:it}}function Hr(O,e,a,t,r){var s;let i=(s=a.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],o;if(i){let Q=O.sliceDoc(i.from,i.to),d=e.globalAttrs[Q];if(!d){let c=V(a),S=c?e.tags[q(O.doc,c)]:null;d=(S==null?void 0:S.attrs)&&S.attrs[Q]}if(d){let c=O.sliceDoc(t,r).toLowerCase(),S='"',p='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,S="",p=O.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let u of d)l.push({label:u,apply:S+u+p,type:"constant"})}}return{from:t,to:r,options:l,validFor:o}}function ei(O,e){let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.resolve(t);for(let i=t,l;s==r&&(l=r.childBefore(i));){let o=l.lastChild;if(!o||!o.type.isError||o.fromei(t,r)}const ti=Y.parser.configure({top:"SingleExpression"}),st=[{tag:"script",attrs:O=>O.type=="text/typescript"||O.lang=="ts",parser:FO.parser},{tag:"script",attrs:O=>O.type=="text/babel"||O.type=="text/jsx",parser:MO.parser},{tag:"script",attrs:O=>O.type=="text/typescript-jsx",parser:KO.parser},{tag:"script",attrs:O=>O.type=="importmap"||O.type=="speculationrules",parser:ti},{tag:"script",attrs(O){return!O.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(O.type)},parser:Y.parser},{tag:"style",attrs(O){return(!O.lang||O.lang=="css")&&(!O.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(O.type))},parser:ce.parser}],lt=[{name:"style",parser:ce.parser.configure({top:"Styles"})}].concat(at.map(O=>({name:O,parser:Y.parser}))),nt=J.define({name:"html",parser:Ja.configure({props:[L.add({Element(O){let e=/^(\s*)(<\/)?/.exec(O.textAfter);return O.node.to<=O.pos+e[0].length?O.continue():O.lineIndent(O.node.from)+(e[2]?0:O.unit)},"OpenTag CloseTag SelfClosingTag"(O){return O.column(O.node.from)+O.unit},Document(O){if(O.pos+/\s*/.exec(O.textAfter)[0].lengthO.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ae=nt.configure({wrap:zO(st,lt)});function ai(O={}){let e="",a;O.matchClosingTags===!1&&(e="noMatch"),O.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(a=zO((O.nestedLanguages||[]).concat(st),(O.nestedAttributes||[]).concat(lt)));let t=a?nt.configure({wrap:a,dialect:e}):e?ae.configure({dialect:e}):ae;return new M(t,[ae.data.of({autocomplete:Oi(O)}),O.autoCloseTags!==!1?ri:[],Ot().support,mr().support])}const hO=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),ri=U.inputHandler.of((O,e,a,t,r)=>{if(O.composing||O.state.readOnly||e!=a||t!=">"&&t!="/"||!ae.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var Q,d,c;let S=i.doc.sliceString(o.from-1,o.to)==t,{head:p}=o,u=j(i).resolveInner(p-1,-1),f;if((u.name=="TagName"||u.name=="StartTag")&&(u=u.parent),S&&t==">"&&u.name=="OpenTag"){if(((d=(Q=u.parent)===null||Q===void 0?void 0:Q.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(f=q(i.doc,u.parent,p))&&!hO.has(f)){let g=p+(i.doc.sliceString(p,p+1)===">"?1:0),X=``;return{range:o,changes:{from:p,to:g,insert:X}}}}else if(S&&t=="/"&&u.name=="IncompleteCloseTag"){let g=u.parent;if(u.from==p-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(f=q(i.doc,g,p))&&!hO.has(f)){let X=p+(i.doc.sliceString(p,p+1)===">"?1:0),y=`${f}>`;return{range:YO.cursor(p+y.length,-1),changes:{from:p,to:X,insert:y}}}}return{range:o}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),ii=D({String:n.string,Number:n.number,"True False":n.bool,PropertyName:n.propertyName,Null:n.null,",":n.separator,"[ ]":n.squareBracket,"{ }":n.brace}),si=T.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[ii],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),li=J.define({name:"json",parser:si.configure({props:[L.add({Object:C({except:/^\s*\}/}),Array:C({except:/^\s*\]/})}),F.add({"Object Array":Te})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function ni(){return new M(li)}const oi=36,uO=1,ci=2,A=3,Ze=4,Qi=5,pi=6,di=7,hi=8,ui=9,Si=10,$i=11,fi=12,gi=13,mi=14,Pi=15,Zi=16,bi=17,SO=18,Xi=19,ot=20,ct=21,$O=22,xi=23,Yi=24;function Ye(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function yi(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function W(O,e,a){for(let t=!1;;){if(O.next<0)return;if(O.next==e&&!t){O.advance();return}t=a&&!t&&O.next==92,O.advance()}}function ki(O){for(;;){if(O.next<0||O.peek(1)<0)return;if(O.next==36&&O.peek(1)==36){O.advance(2);return}O.advance()}}function wi(O,e){let a="[{<(".indexOf(String.fromCharCode(e)),t=a<0?e:"]}>)".charCodeAt(a);for(;;){if(O.next<0)return;if(O.next==t&&O.peek(1)==39){O.advance(2);return}O.advance()}}function Qt(O,e){for(;!(O.next!=95&&!Ye(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function vi(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),W(O,e,!1)}else Qt(O)}function fO(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function gO(O,e){for(;;){if(O.next==46){if(e)break;e=!0}else if(O.next<48||O.next>57)break;O.advance()}if(O.next==69||O.next==101)for(O.advance(),(O.next==43||O.next==45)&&O.advance();O.next>=48&&O.next<=57;)O.advance()}function mO(O){for(;!(O.next<0||O.next==10);)O.advance()}function _(O,e){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:pt(_i,Ti)};function Wi(O,e,a,t){let r={};for(let s in ye)r[s]=(O.hasOwnProperty(s)?O:ye)[s];return e&&(r.words=pt(e,a||"",t)),r}function dt(O){return new x(e=>{var a;let{next:t}=e;if(e.advance(),_(t,be)){for(;_(e.next,be);)e.advance();e.acceptToken(oi)}else if(t==36&&e.next==36&&O.doubleDollarQuotedStrings)ki(e),e.acceptToken(A);else if(t==39||t==34&&O.doubleQuotedStrings)W(e,t,O.backslashEscapes),e.acceptToken(A);else if(t==35&&O.hashComments||t==47&&e.next==47&&O.slashComments)mO(e),e.acceptToken(uO);else if(t==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))mO(e),e.acceptToken(uO);else if(t==47&&e.next==42){e.advance();for(let r=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(r--,e.advance(),!r)break}else s==47&&e.next==42&&(r++,e.advance())}e.acceptToken(ci)}else if((t==101||t==69)&&e.next==39)e.advance(),W(e,39,!0);else if((t==110||t==78)&&e.next==39&&O.charSetCasts)e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(A);else if(t==95&&O.charSetCasts)for(let r=0;;r++){if(e.next==39&&r>1){e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(A);break}if(!Ye(e.next))break;e.advance()}else if(O.plsqlQuotingMechanism&&(t==113||t==81)&&e.next==39&&e.peek(1)>0&&!_(e.peek(1),be)){let r=e.peek(1);e.advance(2),wi(e,r),e.acceptToken(A)}else if(t==40)e.acceptToken(di);else if(t==41)e.acceptToken(hi);else if(t==123)e.acceptToken(ui);else if(t==125)e.acceptToken(Si);else if(t==91)e.acceptToken($i);else if(t==93)e.acceptToken(fi);else if(t==59)e.acceptToken(gi);else if(O.unquotedBitLiterals&&t==48&&e.next==98)e.advance(),fO(e),e.acceptToken($O);else if((t==98||t==66)&&(e.next==39||e.next==34)){const r=e.next;e.advance(),O.treatBitsAsBytes?(W(e,r,O.backslashEscapes),e.acceptToken(xi)):(fO(e,r),e.acceptToken($O))}else if(t==48&&(e.next==120||e.next==88)||(t==120||t==88)&&e.next==39){let r=e.next==39;for(e.advance();yi(e.next);)e.advance();r&&e.next==39&&e.advance(),e.acceptToken(Ze)}else if(t==46&&e.next>=48&&e.next<=57)gO(e,!0),e.acceptToken(Ze);else if(t==46)e.acceptToken(mi);else if(t>=48&&t<=57)gO(e,!1),e.acceptToken(Ze);else if(_(t,O.operatorChars)){for(;_(e.next,O.operatorChars);)e.advance();e.acceptToken(Pi)}else if(_(t,O.specialVar))e.next==t&&e.advance(),vi(e),e.acceptToken(bi);else if(_(t,O.identifierQuotes))W(e,t,!1),e.acceptToken(Xi);else if(t==58||t==44)e.acceptToken(Zi);else if(Ye(t)){let r=Qt(e,String.fromCharCode(t));e.acceptToken(e.next==46?SO:(a=O.words[r.toLowerCase()])!==null&&a!==void 0?a:SO)}})}const ht=dt(ye),Ui=T.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ht],topRules:{Script:[0,25]},tokenPrec:0});function ke(O){let e=O.cursor().moveTo(O.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function N(O,e){let a=O.sliceString(e.from,e.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function pe(O){return O&&(O.name=="Identifier"||O.name=="QuotedIdentifier")}function Ci(O,e){if(e.name=="CompositeIdentifier"){let a=[];for(let t=e.firstChild;t;t=t.nextSibling)pe(t)&&a.push(N(O,t));return a}return[N(O,e)]}function PO(O,e){for(let a=[];;){if(!e||e.name!=".")return a;let t=ke(e);if(!pe(t))return a;a.unshift(N(O,t)),e=ke(t)}}function Ri(O,e){let a=j(O).resolveInner(e,-1),t=Vi(O.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?O.doc.sliceString(a.from,a.from+1):null,parents:PO(O.doc,ke(a)),aliases:t}:a.name=="."?{from:e,quoted:null,parents:PO(O.doc,a),aliases:t}:{from:e,quoted:null,parents:[],empty:!0,aliases:t}}const qi=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function Vi(O,e){let a;for(let r=e;!a;r=r.parent){if(!r)return null;r.name=="Statement"&&(a=r)}let t=null;for(let r=a.firstChild,s=!1,i=null;r;r=r.nextSibling){let l=r.name=="Keyword"?O.sliceString(r.from,r.to).toLowerCase():null,o=null;if(!s)s=l=="from";else if(l=="as"&&i&&pe(r.nextSibling))o=N(O,r.nextSibling);else{if(l&&qi.has(l))break;i&&pe(r)&&(o=N(O,r))}o&&(t||(t=Object.create(null)),t[o]=Ci(O,i)),i=/Identifier$/.test(r.name)?r:null}return t}function ji(O,e){return O?e.map(a=>Object.assign(Object.assign({},a),{label:O+a.label+O,apply:void 0})):e}const zi=/^\w*$/,Gi=/^[`'"]?\w*[`'"]?$/;class Ce{constructor(){this.list=[],this.children=void 0}child(e,a){let t=this.children||(this.children=Object.create(null)),r=t[e];return r||(e&&this.list.push(ut(e,"type",a)),t[e]=new Ce)}addCompletions(e){for(let a of e){let t=this.list.findIndex(r=>r.label==a.label);t>-1?this.list[t]=a:this.list.push(a)}}}function ut(O,e,a){return/[^\w\xb5-\uffff]/.test(O)?{label:O,type:e,apply:a+O+a}:{label:O,type:e}}function Ei(O,e,a,t,r,s){var i;let l=new Ce,o=((i=s==null?void 0:s.spec.identifierQuotes)===null||i===void 0?void 0:i[0])||'"',Q=l.child(r||"",o);for(let d in O){let c=d.replace(/\\?\./g,p=>p=="."?"\0":p).split("\0"),S=c.length==1?Q:l;for(let p of c)S=S.child(p.replace(/\\\./g,"."),o);for(let p of O[d])p&&S.list.push(typeof p=="string"?ut(p,"property",o):p)}return e&&Q.addCompletions(e),a&&l.addCompletions(a),l.addCompletions(Q.list),t&&l.addCompletions(Q.child(t,o).list),d=>{let{parents:c,from:S,quoted:p,empty:u,aliases:f}=Ri(d.state,d.pos);if(u&&!d.explicit)return null;f&&c.length==1&&(c=f[c[0]]||c);let g=l;for(let w of c){for(;!g.children||!g.children[w];)if(g==l)g=Q;else if(g==Q&&t)g=g.child(t,o);else return null;g=g.child(w,o)}let X=p&&d.state.sliceDoc(d.pos,d.pos+1)==p,y=g.list;return g==l&&f&&(y=y.concat(Object.keys(f).map(w=>({label:w,type:"constant"})))),{from:S,to:X?d.pos+1:void 0,options:ji(p,y),validFor:p?Gi:zi}}}function Ai(O,e){let a=Object.keys(O).map(t=>({label:e?t.toUpperCase():t,type:O[t]==ct?"type":O[t]==ot?"keyword":"variable",boost:-1}));return XO(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],xO(a))}let Ii=Ui.configure({props:[L.add({Statement:C()}),F.add({Statement(O){return{from:O.firstChild.to,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}}),D({Keyword:n.keyword,Type:n.typeName,Builtin:n.standard(n.name),Bits:n.number,Bytes:n.string,Bool:n.bool,Null:n.null,Number:n.number,String:n.string,Identifier:n.name,QuotedIdentifier:n.special(n.string),SpecialVar:n.special(n.name),LineComment:n.lineComment,BlockComment:n.blockComment,Operator:n.operator,"Semi Punctuation":n.punctuation,"( )":n.paren,"{ }":n.brace,"[ ]":n.squareBracket})]});class B{constructor(e,a,t){this.dialect=e,this.language=a,this.spec=t}get extension(){return this.language.extension}static define(e){let a=Wi(e,e.keywords,e.types,e.builtin),t=J.define({name:"sql",parser:Ii.configure({tokenizers:[{from:ht,to:dt(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new B(a,t,e)}}function Ni(O,e=!1){return Ai(O.dialect.words,e)}function Bi(O,e=!1){return O.language.data.of({autocomplete:Ni(O,e)})}function Di(O){return O.schema?Ei(O.schema,O.tables,O.schemas,O.defaultTable,O.defaultSchema,O.dialect||Re):()=>null}function Ji(O){return O.schema?(O.dialect||Re).language.data.of({autocomplete:Di(O)}):[]}function ZO(O={}){let e=O.dialect||Re;return new M(e.language,[Ji(O),Bi(e,!!O.upperCaseKeywords)])}const Re=B.define({});function Li(O){let e;return{c(){e=Pt("div"),Zt(e,"class","code-editor"),K(e,"min-height",O[0]?O[0]+"px":null),K(e,"max-height",O[1]?O[1]+"px":"auto")},m(a,t){bt(a,e,t),O[11](e)},p(a,[t]){t&1&&K(e,"min-height",a[0]?a[0]+"px":null),t&2&&K(e,"max-height",a[1]?a[1]+"px":"auto")},i:ze,o:ze,d(a){a&&Xt(e),O[11](null)}}}function Fi(O,e,a){let t;xt(O,Yt,$=>a(12,t=$));const r=yt();let{id:s=""}=e,{value:i=""}=e,{minHeight:l=null}=e,{maxHeight:o=null}=e,{disabled:Q=!1}=e,{placeholder:d=""}=e,{language:c="javascript"}=e,{singleLine:S=!1}=e,p,u,f=new H,g=new H,X=new H,y=new H;function w(){p==null||p.focus()}function St(){u==null||u.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function qe(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.removeEventListener("click",w)}function Ve(){if(!s)return;qe();const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.addEventListener("click",w)}function je(){switch(c){case"html":return ai();case"json":return ni();case"sql-create-index":return ZO({dialect:B.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:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let m of t)$[m.name]=wt.getAllCollectionIdentifiers(m);return ZO({dialect:B.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return Ot()}}kt(()=>{const $={key:"Enter",run:m=>{S&&r("submit",i)}};return Ve(),a(10,p=new U({parent:u,state:z.create({doc:i,extensions:[zt(),Gt(),Et(),At(),It(),z.allowMultipleSelections.of(!0),Nt(Bt,{fallback:!0}),Dt(),Jt(),Lt(),Ft(),Mt.of([$,...Kt,...Ht,ea.find(m=>m.key==="Mod-d"),...Oa,...ta]),U.lineWrapping,aa({icons:!1}),f.of(je()),y.of(Ge(d)),g.of(U.editable.of(!0)),X.of(z.readOnly.of(!1)),z.transactionFilter.of(m=>S&&m.newDoc.lines>1?[]:m),U.updateListener.of(m=>{!m.docChanged||Q||(a(3,i=m.state.doc.toString()),St())})]})})),()=>{qe(),p==null||p.destroy()}});function $t($){vt[$?"unshift":"push"](()=>{u=$,a(2,u)})}return O.$$set=$=>{"id"in $&&a(4,s=$.id),"value"in $&&a(3,i=$.value),"minHeight"in $&&a(0,l=$.minHeight),"maxHeight"in $&&a(1,o=$.maxHeight),"disabled"in $&&a(5,Q=$.disabled),"placeholder"in $&&a(6,d=$.placeholder),"language"in $&&a(7,c=$.language),"singleLine"in $&&a(8,S=$.singleLine)},O.$$.update=()=>{O.$$.dirty&16&&s&&Ve(),O.$$.dirty&1152&&p&&c&&p.dispatch({effects:[f.reconfigure(je())]}),O.$$.dirty&1056&&p&&typeof Q<"u"&&p.dispatch({effects:[g.reconfigure(U.editable.of(!Q)),X.reconfigure(z.readOnly.of(Q))]}),O.$$.dirty&1032&&p&&i!=p.state.doc.toString()&&p.dispatch({changes:{from:0,to:p.state.doc.length,insert:i}}),O.$$.dirty&1088&&p&&typeof d<"u"&&p.dispatch({effects:[y.reconfigure(Ge(d))]})},[l,o,u,i,s,Q,d,c,S,w,p,$t]}class Hi extends ft{constructor(e){super(),gt(this,e,Fi,Li,mt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{Hi as default}; diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-3b92aaf9.js b/ui/dist/assets/ConfirmEmailChangeDocs-b51b3632.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-3b92aaf9.js rename to ui/dist/assets/ConfirmEmailChangeDocs-b51b3632.js index 7f2b2c22..837e916f 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-3b92aaf9.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-b51b3632.js @@ -1,4 +1,4 @@ -import{S as $e,i as Pe,s as Se,O as Y,e as r,w as v,b as k,c as ge,f as b,g as d,h as o,m as ve,x as j,P as ue,Q as we,k as Oe,R as Re,n as Te,t as x,a as ee,o as m,d as Ce,C as ye,p as Ee,r as H,u as Be,N as qe}from"./index-85ca1a91.js";import{S as Ae}from"./SdkTabs-08de669b.js";function be(n,l,s){const a=n.slice();return a[5]=l[s],a}function _e(n,l,s){const a=n.slice();return a[5]=l[s],a}function he(n,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),o(s,_),o(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ke(n,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){s=r("div"),ge(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),ve(a,s,null),o(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(x(a.$$.fragment,i),u=!0)},o(i){ee(a.$$.fragment,i),u=!1},d(i){i&&m(s),Ce(a)}}}function Ue(n){var de,me;let l,s,a=n[0].name+"",_,u,i,p,f,C,$,D=n[0].name+"",F,te,I,P,L,R,Q,S,N,le,K,T,se,z,M=n[0].name+"",G,ae,J,y,V,E,X,B,Z,w,q,g=[],ne=new Map,oe,A,h=[],ie=new Map,O;P=new Ae({props:{js:` +import{S as $e,i as Pe,s as Se,O as Y,e as r,w as v,b as k,c as ge,f as b,g as d,h as o,m as ve,x as j,P as ue,Q as we,k as Oe,R as Re,n as Te,t as x,a as ee,o as m,d as Ce,C as ye,p as Ee,r as H,u as Be,N as qe}from"./index-284695d1.js";import{S as Ae}from"./SdkTabs-32d3aea6.js";function be(n,l,s){const a=n.slice();return a[5]=l[s],a}function _e(n,l,s){const a=n.slice();return a[5]=l[s],a}function he(n,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),o(s,_),o(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ke(n,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){s=r("div"),ge(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),ve(a,s,null),o(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(x(a.$$.fragment,i),u=!0)},o(i){ee(a.$$.fragment,i),u=!1},d(i){i&&m(s),Ce(a)}}}function Ue(n){var de,me;let l,s,a=n[0].name+"",_,u,i,p,f,C,$,D=n[0].name+"",F,te,I,P,L,R,Q,S,N,le,K,T,se,z,M=n[0].name+"",G,ae,J,y,V,E,X,B,Z,w,q,g=[],ne=new Map,oe,A,h=[],ie=new Map,O;P=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-587b11b5.js b/ui/dist/assets/ConfirmPasswordResetDocs-e2ce0748.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-587b11b5.js rename to ui/dist/assets/ConfirmPasswordResetDocs-e2ce0748.js index b43e756d..ce8c6a51 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-587b11b5.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-e2ce0748.js @@ -1,4 +1,4 @@ -import{S as Re,i as Oe,s as Ce,O as K,e as r,w,b as h,c as ge,f as b,g as d,h as n,m as Pe,x as U,P as _e,Q as Ne,k as We,R as $e,n as Ee,t as ee,a as te,o as p,d as Se,C as ye,p as Ae,r as j,u as Te,N as De}from"./index-85ca1a91.js";import{S as qe}from"./SdkTabs-08de669b.js";function ke(o,s,l){const a=o.slice();return a[5]=s[l],a}function he(o,s,l){const a=o.slice();return a[5]=s[l],a}function ve(o,s){let l,a=s[5].code+"",_,u,i,f;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=w(a),u=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(g,P){d(g,l,P),n(l,_),n(l,u),i||(f=Te(l,"click",m),i=!0)},p(g,P){s=g,P&4&&a!==(a=s[5].code+"")&&U(_,a),P&6&&j(l,"active",s[1]===s[5].code)},d(g){g&&p(l),i=!1,f()}}}function we(o,s){let l,a,_,u;return a=new De({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ge(a.$$.fragment),_=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(i,f){d(i,l,f),Pe(a,l,null),n(l,_),u=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[5].body),a.$set(m),(!u||f&6)&&j(l,"active",s[1]===s[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&p(l),Se(a)}}}function Be(o){var fe,me;let s,l,a=o[0].name+"",_,u,i,f,m,g,P,q=o[0].name+"",H,se,le,L,Q,S,z,N,G,R,B,ae,M,W,ne,J,F=o[0].name+"",V,oe,X,$,Y,E,Z,y,x,O,A,v=[],ie=new Map,ce,T,k=[],re=new Map,C;S=new qe({props:{js:` +import{S as Re,i as Oe,s as Ce,O as K,e as r,w,b as h,c as ge,f as b,g as d,h as n,m as Pe,x as U,P as _e,Q as Ne,k as We,R as $e,n as Ee,t as ee,a as te,o as p,d as Se,C as ye,p as Ae,r as j,u as Te,N as De}from"./index-284695d1.js";import{S as qe}from"./SdkTabs-32d3aea6.js";function ke(o,s,l){const a=o.slice();return a[5]=s[l],a}function he(o,s,l){const a=o.slice();return a[5]=s[l],a}function ve(o,s){let l,a=s[5].code+"",_,u,i,f;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=w(a),u=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(g,P){d(g,l,P),n(l,_),n(l,u),i||(f=Te(l,"click",m),i=!0)},p(g,P){s=g,P&4&&a!==(a=s[5].code+"")&&U(_,a),P&6&&j(l,"active",s[1]===s[5].code)},d(g){g&&p(l),i=!1,f()}}}function we(o,s){let l,a,_,u;return a=new De({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ge(a.$$.fragment),_=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(i,f){d(i,l,f),Pe(a,l,null),n(l,_),u=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[5].body),a.$set(m),(!u||f&6)&&j(l,"active",s[1]===s[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&p(l),Se(a)}}}function Be(o){var fe,me;let s,l,a=o[0].name+"",_,u,i,f,m,g,P,q=o[0].name+"",H,se,le,L,Q,S,z,N,G,R,B,ae,M,W,ne,J,F=o[0].name+"",V,oe,X,$,Y,E,Z,y,x,O,A,v=[],ie=new Map,ce,T,k=[],re=new Map,C;S=new qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-755c037a.js b/ui/dist/assets/ConfirmVerificationDocs-0837f663.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-755c037a.js rename to ui/dist/assets/ConfirmVerificationDocs-0837f663.js index 24e4002b..96472823 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-755c037a.js +++ b/ui/dist/assets/ConfirmVerificationDocs-0837f663.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-85ca1a91.js";import{S as Ae}from"./SdkTabs-08de669b.js";function ve(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 we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-284695d1.js";import{S as Ae}from"./SdkTabs-32d3aea6.js";function ve(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 we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-77256c2f.js b/ui/dist/assets/CreateApiDocs-c095c404.js similarity index 98% rename from ui/dist/assets/CreateApiDocs-77256c2f.js rename to ui/dist/assets/CreateApiDocs-c095c404.js index c95360ac..7c298a65 100644 --- a/ui/dist/assets/CreateApiDocs-77256c2f.js +++ b/ui/dist/assets/CreateApiDocs-c095c404.js @@ -1,4 +1,4 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-85ca1a91.js";import{S as At}from"./SdkTabs-08de669b.js";import{F as Bt}from"./FieldsQueryParam-ddcce9e6.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
Optional username
String The username of the auth record. +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-284695d1.js";import{S as At}from"./SdkTabs-32d3aea6.js";import{F as Bt}from"./FieldsQueryParam-153e53dc.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
Optional username
String The username of the auth record.
If not set, it will be auto generated.`,f=u(),m=i("tr"),c=i("td"),p=i("div"),F.c(),y=u(),S=i("span"),S.textContent="email",T=u(),w=i("td"),w.innerHTML='String',H=u(),D=i("td"),D.textContent="Auth record email address.",E=u(),P=i("tr"),P.innerHTML='
Optional emailVisibility
Boolean Whether to show/hide the auth record email when fetching the record data.',I=u(),j=i("tr"),j.innerHTML='
Required password
String Auth record password.',B=u(),$=i("tr"),$.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',N=u(),q=i("tr"),q.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
diff --git a/ui/dist/assets/DeleteApiDocs-2b517a5d.js b/ui/dist/assets/DeleteApiDocs-ffcdcabf.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-2b517a5d.js rename to ui/dist/assets/DeleteApiDocs-ffcdcabf.js index 6a75b8b2..1eac3447 100644 --- a/ui/dist/assets/DeleteApiDocs-2b517a5d.js +++ b/ui/dist/assets/DeleteApiDocs-ffcdcabf.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-85ca1a91.js";import{S as He}from"./SdkTabs-08de669b.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-284695d1.js";import{S as He}from"./SdkTabs-32d3aea6.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/FieldsQueryParam-ddcce9e6.js b/ui/dist/assets/FieldsQueryParam-153e53dc.js similarity index 88% rename from ui/dist/assets/FieldsQueryParam-ddcce9e6.js rename to ui/dist/assets/FieldsQueryParam-153e53dc.js index 2f6c0e48..6776827a 100644 --- a/ui/dist/assets/FieldsQueryParam-ddcce9e6.js +++ b/ui/dist/assets/FieldsQueryParam-153e53dc.js @@ -1,3 +1,3 @@ -import{S as d,i as n,s as i,e as l,g as o,y as s,o as p}from"./index-85ca1a91.js";function c(a){let e;return{c(){e=l("tr"),e.innerHTML=`fields String Comma separated string of the fields to return in the JSON response +import{S as d,i as n,s as i,e as l,g as o,y as s,o as p}from"./index-284695d1.js";function c(a){let e;return{c(){e=l("tr"),e.innerHTML=`fields String Comma separated string of the fields to return in the JSON response (by default returns all fields). For example:
?fields=id,expand.relField.id,expand.relField.created`},m(t,r){o(t,e,r)},p:s,i:s,o:s,d(t){t&&p(e)}}}class f extends d{constructor(e){super(),n(this,e,null,c,i,{})}}export{f as F}; diff --git a/ui/dist/assets/FilterAutocompleteInput-5c53fc35.js b/ui/dist/assets/FilterAutocompleteInput-cff6df53.js similarity index 98% rename from ui/dist/assets/FilterAutocompleteInput-5c53fc35.js rename to ui/dist/assets/FilterAutocompleteInput-cff6df53.js index d1374144..3d646f81 100644 --- a/ui/dist/assets/FilterAutocompleteInput-5c53fc35.js +++ b/ui/dist/assets/FilterAutocompleteInput-cff6df53.js @@ -1 +1 @@ -import{S as se,i as ae,s as le,e as ce,f as ue,g as de,y as M,o as fe,J as he,K as ge,L as pe,I as ye,C as f,M as ke}from"./index-85ca1a91.js";import{E as K,a as C,h as xe,b as me,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Le,j as Ie,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as L,S as Me,t as De}from"./index-808c8630.js";function He(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var h=r[y]=[],s=e[y],i=0;i2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,h=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:h=""}=r,{value:s=""}=r,{disabled:i=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:m=!1}=r,{extraAutocompleteKeys:I=[]}=r,{disableRequestKeys:w=!1}=r,{disableIndirectCollectionsKeys:E=!1}=r,d,b,A=i,D=new L,H=new L,F=new L,T=new L,q=[],U=[],W=[],N=[],R="",B="";function O(){d==null||d.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{q=$(p),N=ee(),U=w?[]:te(),W=E?[]:ne()},300)}function $(t){let o=t.slice();return a&&f.pushOrReplaceByKey(o,a,"id"),o}function J(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function P(){if(!h)return;const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.removeEventListener("click",O)}function V(){if(!h)return;P();const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.addEventListener("click",O)}function S(t,o="",u=0){var x,z,Q;let g=q.find(k=>k.name==t||k.id==t);if(!g||u>=4)return[];let c=f.getAllCollectionIdentifiers(g,o);for(const k of g.schema){const v=o+k.name;if(k.type==="relation"&&((x=k.options)!=null&&x.collectionId)){const X=S(k.options.collectionId,v+".",u+1);X.length&&(c=c.concat(X))}k.type==="select"&&((z=k.options)==null?void 0:z.maxSelect)!=1&&c.push(v+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&c.push(v+":length")}return c}function ee(){return S(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 o=q.filter(g=>g.type==="auth");for(const g of o){const c=S(g.id,"@request.auth.");for(const x of c)f.pushUnique(t,x)}const u=["created","updated"];if(a!=null&&a.id){const g=S(a.name,"@request.data.");for(const c of g){t.push(c);const x=c.split(".");x.length===3&&x[2].indexOf(":")===-1&&!u.includes(x[2])&&t.push(c+":isset")}}return t}function ne(){const t=[];for(const o of q){const u="@collection."+o.name+".",g=S(o.name,u);for(const c of g)t.push(c)}return t}function re(t=!0,o=!0){let u=[].concat(I);return u=u.concat(N||[]),t&&(u=u.concat(U||[])),o&&(u=u.concat(W||[])),u.sort(function(g,c){return c.length-g.length}),u}function ie(t){let o=t.matchBefore(/[\'\"\@\w\.]*/);if(o&&o.from==o.to&&!t.explicit)return null;let u=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];E||u.push({label:"@collection.*",apply:"@collection."});const g=re(!w,!w&&o.text.startsWith("@c"));for(const c of g)u.push({label:c.endsWith(".")?c+"*":c,apply:c});return{from:o.from,options:u}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:f.escapeRegExp("@now"),token:"keyword"},{regex:f.escapeRegExp("@second"),token:"keyword"},{regex:f.escapeRegExp("@minute"),token:"keyword"},{regex:f.escapeRegExp("@hour"),token:"keyword"},{regex:f.escapeRegExp("@year"),token:"keyword"},{regex:f.escapeRegExp("@day"),token:"keyword"},{regex:f.escapeRegExp("@month"),token:"keyword"},{regex:f.escapeRegExp("@weekday"),token:"keyword"},{regex:f.escapeRegExp("@todayStart"),token:"keyword"},{regex:f.escapeRegExp("@todayEnd"),token:"keyword"},{regex:f.escapeRegExp("@monthStart"),token:"keyword"},{regex:f.escapeRegExp("@monthEnd"),token:"keyword"},{regex:f.escapeRegExp("@yearStart"),token:"keyword"},{regex:f.escapeRegExp("@yearEnd"),token:"keyword"},{regex:f.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:o=>{m&&y("submit",s)}};return V(),n(11,d=new K({parent:b,state:C.create({doc:s,extensions:[xe(),me(),be(),we(),Ee(),C.allowMultipleSelections.of(!0),Se(De,{fallback:!0}),Ke(),Ce(),qe(),Re(),Le.of([t,...Ie,...Ae,Be.find(o=>o.key==="Mod-d"),...Oe,..._e]),K.lineWrapping,ve({override:[ie],icons:!1}),T.of(Y(l)),H.of(K.editable.of(!i)),F.of(C.readOnly.of(i)),D.of(G()),C.transactionFilter.of(o=>m&&o.newDoc.lines>1?[]:o),K.updateListener.of(o=>{!o.docChanged||i||(n(1,s=o.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy()}});function oe(t){ke[t?"unshift":"push"](()=>{b=t,n(0,b)})}return e.$$set=t=>{"id"in t&&n(2,h=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,i=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,m=t.singleLine),"extraAutocompleteKeys"in t&&n(7,I=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,w=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,E=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,R=Pe(a)),e.$$.dirty[0]&25352&&!i&&(B!=R||w!==-1||E!==-1)&&(n(14,B=R),j()),e.$$.dirty[0]&4&&h&&V(),e.$$.dirty[0]&2080&&d&&a!=null&&a.schema&&d.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&d&&A!=i&&(d.dispatch({effects:[H.reconfigure(K.editable.of(!i)),F.reconfigure(C.readOnly.of(i))]}),n(12,A=i),J()),e.$$.dirty[0]&2050&&d&&s!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&d&&typeof l<"u"&&d.dispatch({effects:[T.reconfigure(Y(l))]})},[b,s,h,i,l,a,m,I,w,E,O,d,A,R,B,oe]}class Qe extends se{constructor(r){super(),ae(this,r,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; +import{S as se,i as ae,s as le,e as ce,f as ue,g as de,y as M,o as fe,J as he,K as ge,L as pe,I as ye,C as f,M as ke}from"./index-284695d1.js";import{E as K,a as C,h as xe,b as me,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Le,j as Ie,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as L,S as Me,t as De}from"./index-9cd23da9.js";function He(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var h=r[y]=[],s=e[y],i=0;i2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,h=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:h=""}=r,{value:s=""}=r,{disabled:i=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:m=!1}=r,{extraAutocompleteKeys:I=[]}=r,{disableRequestKeys:w=!1}=r,{disableIndirectCollectionsKeys:E=!1}=r,d,b,A=i,D=new L,H=new L,F=new L,T=new L,q=[],U=[],W=[],N=[],R="",B="";function O(){d==null||d.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{q=$(p),N=ee(),U=w?[]:te(),W=E?[]:ne()},300)}function $(t){let o=t.slice();return a&&f.pushOrReplaceByKey(o,a,"id"),o}function J(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function P(){if(!h)return;const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.removeEventListener("click",O)}function V(){if(!h)return;P();const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.addEventListener("click",O)}function S(t,o="",u=0){var x,z,Q;let g=q.find(k=>k.name==t||k.id==t);if(!g||u>=4)return[];let c=f.getAllCollectionIdentifiers(g,o);for(const k of g.schema){const v=o+k.name;if(k.type==="relation"&&((x=k.options)!=null&&x.collectionId)){const X=S(k.options.collectionId,v+".",u+1);X.length&&(c=c.concat(X))}k.type==="select"&&((z=k.options)==null?void 0:z.maxSelect)!=1&&c.push(v+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&c.push(v+":length")}return c}function ee(){return S(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 o=q.filter(g=>g.type==="auth");for(const g of o){const c=S(g.id,"@request.auth.");for(const x of c)f.pushUnique(t,x)}const u=["created","updated"];if(a!=null&&a.id){const g=S(a.name,"@request.data.");for(const c of g){t.push(c);const x=c.split(".");x.length===3&&x[2].indexOf(":")===-1&&!u.includes(x[2])&&t.push(c+":isset")}}return t}function ne(){const t=[];for(const o of q){const u="@collection."+o.name+".",g=S(o.name,u);for(const c of g)t.push(c)}return t}function re(t=!0,o=!0){let u=[].concat(I);return u=u.concat(N||[]),t&&(u=u.concat(U||[])),o&&(u=u.concat(W||[])),u.sort(function(g,c){return c.length-g.length}),u}function ie(t){let o=t.matchBefore(/[\'\"\@\w\.]*/);if(o&&o.from==o.to&&!t.explicit)return null;let u=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];E||u.push({label:"@collection.*",apply:"@collection."});const g=re(!w,!w&&o.text.startsWith("@c"));for(const c of g)u.push({label:c.endsWith(".")?c+"*":c,apply:c});return{from:o.from,options:u}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:f.escapeRegExp("@now"),token:"keyword"},{regex:f.escapeRegExp("@second"),token:"keyword"},{regex:f.escapeRegExp("@minute"),token:"keyword"},{regex:f.escapeRegExp("@hour"),token:"keyword"},{regex:f.escapeRegExp("@year"),token:"keyword"},{regex:f.escapeRegExp("@day"),token:"keyword"},{regex:f.escapeRegExp("@month"),token:"keyword"},{regex:f.escapeRegExp("@weekday"),token:"keyword"},{regex:f.escapeRegExp("@todayStart"),token:"keyword"},{regex:f.escapeRegExp("@todayEnd"),token:"keyword"},{regex:f.escapeRegExp("@monthStart"),token:"keyword"},{regex:f.escapeRegExp("@monthEnd"),token:"keyword"},{regex:f.escapeRegExp("@yearStart"),token:"keyword"},{regex:f.escapeRegExp("@yearEnd"),token:"keyword"},{regex:f.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:o=>{m&&y("submit",s)}};return V(),n(11,d=new K({parent:b,state:C.create({doc:s,extensions:[xe(),me(),be(),we(),Ee(),C.allowMultipleSelections.of(!0),Se(De,{fallback:!0}),Ke(),Ce(),qe(),Re(),Le.of([t,...Ie,...Ae,Be.find(o=>o.key==="Mod-d"),...Oe,..._e]),K.lineWrapping,ve({override:[ie],icons:!1}),T.of(Y(l)),H.of(K.editable.of(!i)),F.of(C.readOnly.of(i)),D.of(G()),C.transactionFilter.of(o=>m&&o.newDoc.lines>1?[]:o),K.updateListener.of(o=>{!o.docChanged||i||(n(1,s=o.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy()}});function oe(t){ke[t?"unshift":"push"](()=>{b=t,n(0,b)})}return e.$$set=t=>{"id"in t&&n(2,h=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,i=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,m=t.singleLine),"extraAutocompleteKeys"in t&&n(7,I=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,w=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,E=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,R=Pe(a)),e.$$.dirty[0]&25352&&!i&&(B!=R||w!==-1||E!==-1)&&(n(14,B=R),j()),e.$$.dirty[0]&4&&h&&V(),e.$$.dirty[0]&2080&&d&&a!=null&&a.schema&&d.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&d&&A!=i&&(d.dispatch({effects:[H.reconfigure(K.editable.of(!i)),F.reconfigure(C.readOnly.of(i))]}),n(12,A=i),J()),e.$$.dirty[0]&2050&&d&&s!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&d&&typeof l<"u"&&d.dispatch({effects:[T.reconfigure(Y(l))]})},[b,s,h,i,l,a,m,I,w,E,O,d,A,R,B,oe]}class Qe extends se{constructor(r){super(),ae(this,r,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; diff --git a/ui/dist/assets/ListApiDocs-fa4c012b.js b/ui/dist/assets/ListApiDocs-00164b6a.js similarity index 99% rename from ui/dist/assets/ListApiDocs-fa4c012b.js rename to ui/dist/assets/ListApiDocs-00164b6a.js index c2b88fe6..6a0f83a1 100644 --- a/ui/dist/assets/ListApiDocs-fa4c012b.js +++ b/ui/dist/assets/ListApiDocs-00164b6a.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Ue,o as m,w as _,h as t,N as Fe,O as te,c as ee,m as le,x as ke,P as je,Q as nl,k as ol,R as al,n as il,t as Bt,a as Gt,d as se,T as rl,C as ve,p as cl,r as Le}from"./index-85ca1a91.js";import{S as dl}from"./SdkTabs-08de669b.js";function pl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ze(d){let n,o,i,f,h,r,b,C,$,g,p,Z,Ct,Ut,E,jt,M,it,S,tt,ne,G,U,oe,rt,$t,et,kt,ae,ct,dt,lt,N,zt,yt,y,st,vt,Jt,Ft,j,nt,Lt,Kt,At,F,pt,Tt,ie,ft,re,D,Pt,ot,St,O,ut,ce,z,Ot,Qt,Rt,de,q,Vt,J,mt,pe,I,fe,B,ue,P,Et,K,ht,me,bt,he,w,Nt,at,qt,be,Ht,Wt,Q,gt,ge,Mt,_e,_t,xe,V,xt,we,wt,Xt,W,Yt,L,X,R,Dt,Ce,Y,v,It;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Ue,o as m,w as _,h as t,N as Fe,O as te,c as ee,m as le,x as ke,P as je,Q as nl,k as ol,R as al,n as il,t as Bt,a as Gt,d as se,T as rl,C as ve,p as cl,r as Le}from"./index-284695d1.js";import{S as dl}from"./SdkTabs-32d3aea6.js";function pl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ze(d){let n,o,i,f,h,r,b,C,$,g,p,Z,Ct,Ut,E,jt,M,it,S,tt,ne,G,U,oe,rt,$t,et,kt,ae,ct,dt,lt,N,zt,yt,y,st,vt,Jt,Ft,j,nt,Lt,Kt,At,F,pt,Tt,ie,ft,re,D,Pt,ot,St,O,ut,ce,z,Ot,Qt,Rt,de,q,Vt,J,mt,pe,I,fe,B,ue,P,Et,K,ht,me,bt,he,w,Nt,at,qt,be,Ht,Wt,Q,gt,ge,Mt,_e,_t,xe,V,xt,we,wt,Xt,W,Yt,L,X,R,Dt,Ce,Y,v,It;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",C=_(` - is one of: `),$=e("br"),g=s(),p=e("ul"),Z=e("li"),Ct=e("code"),Ct.textContent="=",Ut=s(),E=e("span"),E.textContent="Equal",jt=s(),M=e("li"),it=e("code"),it.textContent="!=",S=s(),tt=e("span"),tt.textContent="NOT equal",ne=s(),G=e("li"),U=e("code"),U.textContent=">",oe=s(),rt=e("span"),rt.textContent="Greater than",$t=s(),et=e("li"),kt=e("code"),kt.textContent=">=",ae=s(),ct=e("span"),ct.textContent="Greater than or equal",dt=s(),lt=e("li"),N=e("code"),N.textContent="<",zt=s(),yt=e("span"),yt.textContent="Less than",y=s(),st=e("li"),vt=e("code"),vt.textContent="<=",Jt=s(),Ft=e("span"),Ft.textContent="Less than or equal",j=s(),nt=e("li"),Lt=e("code"),Lt.textContent="~",Kt=s(),At=e("span"),At.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-474c78a3.js b/ui/dist/assets/ListExternalAuthsDocs-17872c67.js similarity index 97% rename from ui/dist/assets/ListExternalAuthsDocs-474c78a3.js rename to ui/dist/assets/ListExternalAuthsDocs-17872c67.js index cc49793a..378c49ae 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-474c78a3.js +++ b/ui/dist/assets/ListExternalAuthsDocs-17872c67.js @@ -1,4 +1,4 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-85ca1a91.js";import{S as Ye}from"./SdkTabs-08de669b.js";import{F as Ze}from"./FieldsQueryParam-ddcce9e6.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-284695d1.js";import{S as Ye}from"./SdkTabs-32d3aea6.js";import{F as Ze}from"./FieldsQueryParam-153e53dc.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-52e8e3c4.js b/ui/dist/assets/PageAdminConfirmPasswordReset-d4de5d9d.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-52e8e3c4.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-d4de5d9d.js index a9f77c3d..fd8916b9 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-52e8e3c4.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-d4de5d9d.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,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 q}from"./index-85ca1a91.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,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 q}from"./index-284695d1.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password `),m&&m.c(),t=k(),R(u.$$.fragment),p=k(),R(d.$$.fragment),r=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],L(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),A(u,e,null),c(e,p),A(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(z=[j(e,"submit",O(i[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),u.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(B(u.$$.fragment,o),B(d.$$.fragment,o),h=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(u),T(d),F=!1,V(z)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},m(s,l){A(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-20a6c3b2.js b/ui/dist/assets/PageAdminRequestPasswordReset-d3ed729d.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-20a6c3b2.js rename to ui/dist/assets/PageAdminRequestPasswordReset-d3ed729d.js index 6bc344a1..e818079a 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-20a6c3b2.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-d3ed729d.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-85ca1a91.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),R(l.$$.fragment),t=v(),o=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=u[1],F(o,"btn-loading",u[1]),p(e,"class","m-b-base")},m(i,$){g(i,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,c),d(o,m),d(o,r),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(i,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:i}),l.$set(q),(!a||$&2)&&(o.disabled=i[1]),(!a||$&2)&&F(o,"btn-loading",i[1])},i(i){a||(w(l.$$.fragment,i),a=!0)},o(i){y(l.$$.fragment,i),a=!1},d(i){i&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,o,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),o=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,o,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",o=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),L(t,u[0]),t.focus(),c||(m=H(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&o!==(o=r[5])&&p(t,"id",o),a&1&&t.value!==r[0]&&L(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,o,c,m;const r=[O,K],a=[];function b(f,i){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),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(f,i){a[e].m(f,i),g(f,n,i),g(f,l,i),d(l,t),o=!0,c||(m=A(B.call(null,t)),c=!0)},p(f,i){let $=e;e=b(f),e===$?a[e].p(f,i):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,i):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){o||(w(s),o=!0)},o(f){y(s),o=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){R(e.$$.fragment)},m(n,l){S(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){E(e,n)}}}function W(u,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.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,o,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; +import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-284695d1.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),R(l.$$.fragment),t=v(),o=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=u[1],F(o,"btn-loading",u[1]),p(e,"class","m-b-base")},m(i,$){g(i,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,c),d(o,m),d(o,r),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(i,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:i}),l.$set(q),(!a||$&2)&&(o.disabled=i[1]),(!a||$&2)&&F(o,"btn-loading",i[1])},i(i){a||(w(l.$$.fragment,i),a=!0)},o(i){y(l.$$.fragment,i),a=!1},d(i){i&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,o,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),o=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,o,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",o=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),L(t,u[0]),t.focus(),c||(m=H(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&o!==(o=r[5])&&p(t,"id",o),a&1&&t.value!==r[0]&&L(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,o,c,m;const r=[O,K],a=[];function b(f,i){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),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(f,i){a[e].m(f,i),g(f,n,i),g(f,l,i),d(l,t),o=!0,c||(m=A(B.call(null,t)),c=!0)},p(f,i){let $=e;e=b(f),e===$?a[e].p(f,i):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,i):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){o||(w(s),o=!0)},o(f){y(s),o=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){R(e.$$.fragment)},m(n,l){S(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){E(e,n)}}}function W(u,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.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,o,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageOAuth2Redirect-5550785f.js b/ui/dist/assets/PageOAuth2Redirect-70afa6ea.js similarity index 87% rename from ui/dist/assets/PageOAuth2Redirect-5550785f.js rename to ui/dist/assets/PageOAuth2Redirect-70afa6ea.js index 12ef0354..1fa1b371 100644 --- a/ui/dist/assets/PageOAuth2Redirect-5550785f.js +++ b/ui/dist/assets/PageOAuth2Redirect-70afa6ea.js @@ -1 +1 @@ -import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,I as h}from"./index-85ca1a91.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can go back to the app if this window is not automatically closed.
',l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function m(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,m,f,c,{})}}export{x as default}; +import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,I as h}from"./index-284695d1.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can go back to the app if this window is not automatically closed.
',l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function m(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,m,f,c,{})}}export{x as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-3ecd2702.js b/ui/dist/assets/PageRecordConfirmEmailChange-40a7baa1.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-3ecd2702.js rename to ui/dist/assets/PageRecordConfirmEmailChange-40a7baa1.js index 01135699..b47c79fe 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-3ecd2702.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-40a7baa1.js @@ -1,2 +1,2 @@ -import{S as G,i as I,s as J,F as M,c as S,m as L,t as h,a as v,d as z,C as N,E as R,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 y,b as C,f as p,r as T,h as g,u as P,v as K,y as E,x as O,z as F}from"./index-85ca1a91.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address +import{S as G,i as I,s as J,F as M,c as S,m as L,t as h,a as v,d as z,C as N,E as R,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 y,b as C,f as p,r as T,h as g,u as P,v as K,y as E,x as O,z as F}from"./index-284695d1.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address `),d&&d.c(),s=C(),S(o.$$.fragment),f=C(),a=m("button"),r=m("span"),r.textContent="Confirm new email",p(t,"class","content txt-center m-b-base"),p(r,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=i[1],T(a,"btn-loading",i[1])},m(c,w){_(c,e,w),g(e,t),g(t,n),g(n,l),d&&d.m(n,null),g(e,s),L(o,e,null),g(e,f),g(e,a),g(a,r),u=!0,k||($=P(e,"submit",K(i[4])),k=!0)},p(c,w){c[3]?d?d.p(c,w):(d=H(c),d.c(),d.m(n,null)):d&&(d.d(1),d=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:c}),o.$set(q),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(h(o.$$.fragment,c),u=!0)},o(c){v(o.$$.fragment,c),u=!1},d(c){c&&b(e),d&&d.d(),z(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=C(),n=m("button"),n.textContent="Close",p(e,"class","alert alert-success"),p(n,"type","button"),p(n,"class","btn btn-transparent btn-block")},m(o,f){_(o,e,f),_(o,t,f),_(o,n,f),l||(s=P(n,"click",i[6]),l=!0)},p:E,i:E,o:E,d(o){o&&(b(e),b(t),b(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=y("to "),t=m("strong"),n=y(i[3]),p(t,"class","txt-nowrap")},m(l,s){_(l,e,s),_(l,t,s),g(t,n)},p(l,s){s&8&&O(n,l[3])},d(l){l&&(b(e),b(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=y("Password"),l=C(),s=m("input"),p(e,"for",n=i[8]),p(s,"type","password"),p(s,"id",o=i[8]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),g(e,t),_(r,l,u),_(r,s,u),F(s,i[0]),s.focus(),f||(a=P(s,"input",i[7]),f=!0)},p(r,u){u&256&&n!==(n=r[8])&&p(e,"for",n),u&256&&o!==(o=r[8])&&p(s,"id",o),u&1&&s.value!==r[0]&&F(s,r[0])},d(r){r&&(b(e),b(l),b(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=R()},m(a,r){o[e].m(a,r),_(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(W(),v(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),h(t,1),t.m(n.parentNode,n))},i(a){l||(h(t),l=!0)},o(a){v(t),l=!1},d(a){a&&b(n),o[e].d(a)}}}function Z(i){let e,t;return e=new M({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){S(e.$$.fragment)},m(n,l){L(e,n,l),t=!0},p(n,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||(h(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new j("../");try{const $=A(l==null?void 0:l.token);await k.collection($.collectionId).confirmEmailChange(l==null?void 0:l.token,s),t(2,f=!0)}catch($){B.error($)}t(1,o=!1)}const r=()=>window.close();function u(){s=this.value,t(0,s)}return i.$$set=k=>{"params"in k&&t(5,l=k.params)},i.$$.update=()=>{i.$$.dirty&32&&t(3,n=N.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends G{constructor(e){super(),I(this,e,x,Z,J,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-86dd6b83.js b/ui/dist/assets/PageRecordConfirmPasswordReset-71871f92.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-86dd6b83.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-71871f92.js index 1448ab05..7ab3c376 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-86dd6b83.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-71871f92.js @@ -1,2 +1,2 @@ -import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,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 q,b as C,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-85ca1a91.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);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:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password +import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,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 q,b as C,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-284695d1.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);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:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password `),d&&d.c(),t=C(),H(o.$$.fragment),c=C(),H(r.$$.fragment),i=C(),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=a[2],G(u,"btn-loading",a[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(r,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(h=S(e,"submit",U(a[5])),k=!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}),r.$set(z),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&G(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){y(o.$$.fragment,f),y(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),T(o),T(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),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=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(m(e),m(l),m(s)),n=!1,t()}}}function I(a){let e,l,s;return{c(){e=q("for "),l=b("strong"),s=q(a[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),m(l))}}}function x(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[0]),t.focus(),c||(r=S(t,"input",a[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]&&R(t,i[0])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function ee(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password confirm"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[1]),c||(r=S(t,"input",a[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]&&R(t,i[1])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function te(a){let e,l,s,n;const t=[Z,X],o=[];function c(r,i){return r[3]?0:1}return e=c(a),l=o[e]=t[e](a),{c(){l.c(),s=A()},m(r,i){o[e].m(r,i),_(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),y(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),P(l,1),l.m(s.parentNode,s))},i(r){n||(P(l),n=!0)},o(r){y(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(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||(P(e.$$.fragment,s),l=!0)},o(s){y(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-05cb41fe.js b/ui/dist/assets/PageRecordConfirmVerification-733361e3.js similarity index 97% rename from ui/dist/assets/PageRecordConfirmVerification-05cb41fe.js rename to ui/dist/assets/PageRecordConfirmVerification-733361e3.js index c811157a..b25b77e7 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-05cb41fe.js +++ b/ui/dist/assets/PageRecordConfirmVerification-733361e3.js @@ -1 +1 @@ -import{S as v,i as y,s as g,F as w,c as C,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as a,o as r,e as f,b as _,f as d,u as b,y as p}from"./index-85ca1a91.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(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){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){C(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 q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; +import{S as v,i as y,s as g,F as w,c as C,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as a,o as r,e as f,b as _,f as d,u as b,y as p}from"./index-284695d1.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(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){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){C(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 q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-286d9a62.js b/ui/dist/assets/RealtimeApiDocs-5e8eb48d.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-286d9a62.js rename to ui/dist/assets/RealtimeApiDocs-5e8eb48d.js index 7ab743e5..c47f0f5f 100644 --- a/ui/dist/assets/RealtimeApiDocs-286d9a62.js +++ b/ui/dist/assets/RealtimeApiDocs-5e8eb48d.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-85ca1a91.js";import{S as de}from"./SdkTabs-08de669b.js";function fe(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,D,f,_,$,k,l,S,g,C,v,w,h,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-284695d1.js";import{S as de}from"./SdkTabs-32d3aea6.js";function fe(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,D,f,_,$,k,l,S,g,C,v,w,h,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); diff --git a/ui/dist/assets/RequestEmailChangeDocs-7a88b05d.js b/ui/dist/assets/RequestEmailChangeDocs-cc78294d.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-7a88b05d.js rename to ui/dist/assets/RequestEmailChangeDocs-cc78294d.js index 01506714..697c5872 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-7a88b05d.js +++ b/ui/dist/assets/RequestEmailChangeDocs-cc78294d.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-85ca1a91.js";import{S as je}from"./SdkTabs-08de669b.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-284695d1.js";import{S as je}from"./SdkTabs-32d3aea6.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestPasswordResetDocs-7b10f4ab.js b/ui/dist/assets/RequestPasswordResetDocs-d0ffa20e.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-7b10f4ab.js rename to ui/dist/assets/RequestPasswordResetDocs-d0ffa20e.js index ef210e1b..132416af 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-7b10f4ab.js +++ b/ui/dist/assets/RequestPasswordResetDocs-d0ffa20e.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-85ca1a91.js";import{S as Ue}from"./SdkTabs-08de669b.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-284695d1.js";import{S as Ue}from"./SdkTabs-32d3aea6.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestVerificationDocs-adb376ea.js b/ui/dist/assets/RequestVerificationDocs-7ffbd86b.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-adb376ea.js rename to ui/dist/assets/RequestVerificationDocs-7ffbd86b.js index 3438f435..863d62b2 100644 --- a/ui/dist/assets/RequestVerificationDocs-adb376ea.js +++ b/ui/dist/assets/RequestVerificationDocs-7ffbd86b.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-85ca1a91.js";import{S as Ae}from"./SdkTabs-08de669b.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` +import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-284695d1.js";import{S as Ae}from"./SdkTabs-32d3aea6.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/SdkTabs-08de669b.js b/ui/dist/assets/SdkTabs-32d3aea6.js similarity index 98% rename from ui/dist/assets/SdkTabs-08de669b.js rename to ui/dist/assets/SdkTabs-32d3aea6.js index 783be39f..192df283 100644 --- a/ui/dist/assets/SdkTabs-08de669b.js +++ b/ui/dist/assets/SdkTabs-32d3aea6.js @@ -1 +1 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as w,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,w as E,r as y,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-85ca1a91.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(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=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(_,f){w(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&y(l,"active",e[1]===e[6].language)},d(_){_&&C(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 G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=S(),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"),y(l,"active",e[1]===e[6].language),this.first=l},m(b,t){w(b,l,t),L(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+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&y(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&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(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 Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as w,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,w as E,r as y,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-284695d1.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(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=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(_,f){w(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&y(l,"active",e[1]===e[6].language)},d(_){_&&C(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 G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=S(),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"),y(l,"active",e[1]===e[6].language),this.first=l},m(b,t){w(b,l,t),L(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+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&y(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&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(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 Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-0a775f45.js b/ui/dist/assets/UnlinkExternalAuthDocs-c1b416b8.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-0a775f45.js rename to ui/dist/assets/UnlinkExternalAuthDocs-c1b416b8.js index 823a7d50..e56aa723 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-0a775f45.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-c1b416b8.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-85ca1a91.js";import{S as Ke}from"./SdkTabs-08de669b.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-284695d1.js";import{S as Ke}from"./SdkTabs-32d3aea6.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/UpdateApiDocs-9077f7d5.js b/ui/dist/assets/UpdateApiDocs-70cf4d12.js similarity index 98% rename from ui/dist/assets/UpdateApiDocs-9077f7d5.js rename to ui/dist/assets/UpdateApiDocs-70cf4d12.js index 5fe05cb0..82baf150 100644 --- a/ui/dist/assets/UpdateApiDocs-9077f7d5.js +++ b/ui/dist/assets/UpdateApiDocs-70cf4d12.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-85ca1a91.js";import{S as Ft}from"./SdkTabs-08de669b.js";import{F as Nt}from"./FieldsQueryParam-ddcce9e6.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-284695d1.js";import{S as Ft}from"./SdkTabs-32d3aea6.js";import{F as Nt}from"./FieldsQueryParam-153e53dc.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
Optional username
String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/ViewApiDocs-f8b0e458.js b/ui/dist/assets/ViewApiDocs-8138d595.js similarity index 97% rename from ui/dist/assets/ViewApiDocs-f8b0e458.js rename to ui/dist/assets/ViewApiDocs-8138d595.js index 95f00a78..b1e8a2e9 100644 --- a/ui/dist/assets/ViewApiDocs-f8b0e458.js +++ b/ui/dist/assets/ViewApiDocs-8138d595.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-85ca1a91.js";import{S as pt}from"./SdkTabs-08de669b.js";import{F as ut}from"./FieldsQueryParam-ddcce9e6.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-284695d1.js";import{S as pt}from"./SdkTabs-32d3aea6.js";import{F as ut}from"./FieldsQueryParam-153e53dc.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-85ca1a91.js b/ui/dist/assets/index-284695d1.js similarity index 80% rename from ui/dist/assets/index-85ca1a91.js rename to ui/dist/assets/index-284695d1.js index 90d7c768..c13547a6 100644 --- a/ui/dist/assets/index-85ca1a91.js +++ b/ui/dist/assets/index-284695d1.js @@ -1,17 +1,17 @@ -var V1=Object.defineProperty;var z1=(n,e,t)=>e in n?V1(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var tr=(n,e,t)=>(z1(n,typeof e!="symbol"?e+"":e,t),t);(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 kl=n=>n;function He(n,e){for(const t in e)n[t]=e[t];return n}function B1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function e_(n){return n()}function fu(){return Object.create(null)}function $e(n){n.forEach(e_)}function Et(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Pl;function _n(n,e){return n===e?!0:(Pl||(Pl=document.createElement("a")),Pl.href=e,n===Pl.href)}function U1(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function W1(n){let e;return ha(n,t=>e=t)(),e}function Ke(n,e,t){n.$$.on_destroy.push(ha(e,t))}function Tt(n,e,t,i){if(n){const s=t_(n,e,t,i);return n[0](s)}}function t_(n,e,t,i){return n[1]&&i?He(t.ctx.slice(),n[1](i(e))):t.ctx}function Ct(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ma=n_?n=>requestAnimationFrame(n):x;const vs=new Set;function i_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&ma(i_)}function No(n){let e;return vs.size===0&&ma(i_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function b(n,e){n.appendChild(e)}function s_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Y1(n){const e=v("style");return e.textContent="/* empty */",K1(s_(n),e),e.sheet}function K1(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function gt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function xe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function An(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const J1=["width","height"];function fi(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&&J1.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function G1(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 dt(n){return n===""?null:+n}function Z1(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function ae(n,e){n.value=e??""}function jr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList.toggle(e,!!t)}function l_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const po=new Map;let ho=0;function X1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Q1(n,e){const t={stylesheet:Y1(e),rules:{}};return po.set(n,t),t}function fl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ +var V1=Object.defineProperty;var z1=(n,e,t)=>e in n?V1(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var tr=(n,e,t)=>(z1(n,typeof e!="symbol"?e+"":e,t),t);(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 kl=n=>n;function He(n,e){for(const t in e)n[t]=e[t];return n}function B1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function e_(n){return n()}function fu(){return Object.create(null)}function $e(n){n.forEach(e_)}function At(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Pl;function _n(n,e){return n===e?!0:(Pl||(Pl=document.createElement("a")),Pl.href=e,n===Pl.href)}function U1(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function W1(n){let e;return ha(n,t=>e=t)(),e}function Ke(n,e,t){n.$$.on_destroy.push(ha(e,t))}function Tt(n,e,t,i){if(n){const s=t_(n,e,t,i);return n[0](s)}}function t_(n,e,t,i){return n[1]&&i?He(t.ctx.slice(),n[1](i(e))):t.ctx}function Ct(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ma=n_?n=>requestAnimationFrame(n):x;const vs=new Set;function i_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&ma(i_)}function No(n){let e;return vs.size===0&&ma(i_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function b(n,e){n.appendChild(e)}function s_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Y1(n){const e=v("style");return e.textContent="/* empty */",K1(s_(n),e),e.sheet}function K1(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function gt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function xe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function An(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const J1=["width","height"];function fi(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&&J1.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function G1(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 dt(n){return n===""?null:+n}function Z1(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function ae(n,e){n.value=e??""}function jr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList.toggle(e,!!t)}function l_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Et(n,e){return new n(e)}const po=new Map;let ho=0;function X1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Q1(n,e){const t={stylesheet:Y1(e),rules:{}};return po.set(n,t),t}function fl(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_${X1(f)}_${r}`,d=s_(n),{stylesheet:h,rules:g}=po.get(d)||Q1(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const m=n.style.animation||"";return n.style.animation=`${m?`${m}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function cl(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||x1())}function x1(){ma(()=>{ho||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),po.clear())})}function e0(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=kl,start:a=Fo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function m(){c&&(g=fl(n,0,1,o,l,r,c)),l||(h=!0)}function _(){c&&cl(n,g),d=!1}return No(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),m(),f(0,1),_}function t0(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,o_(n,s)}}function o_(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 dl;function yi(n){dl=n}function wl(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Gt(n){wl().$$.on_mount.push(n)}function n0(n){wl().$$.after_update.push(n)}function Is(n){wl().$$.on_destroy.push(n)}function pt(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=l_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bs=[],te=[];let ys=[];const Hr=[],r_=Promise.resolve();let Vr=!1;function a_(){Vr||(Vr=!0,r_.then(ga))}function ln(){return a_(),r_}function Qe(n){ys.push(n)}function ye(n){Hr.push(n)}const nr=new Set;let ds=0;function ga(){if(ds!==0)return;const n=dl;do{try{for(;dsn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let Hs;function _a(){return Hs||(Hs=Promise.resolve(),Hs.then(()=>{Hs=null})),Hs}function ts(n,e,t){n.dispatchEvent(l_(`${e?"intro":"outro"}${t}`))}const io=new Set;let ri;function ue(){ri={r:0,c:[],p:ri}}function fe(){ri.r||$e(ri.c),ri=ri.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ri.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function u_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&cl(n,o)}function f(){const{delay:d=0,duration:h=300,easing:g=kl,tick:m=x,css:_}=s||ba;_&&(o=fl(n,0,1,h,d,g,_,a++)),m(0,1);const y=Fo()+d,S=y+h;r&&r.abort(),l=!0,Qe(()=>ts(n,!0,"start")),r=No(C=>{if(l){if(C>=S)return m(1,0),ts(n,!0,"end"),u(),l=!1;if(C>=y){const T=g((C-y)/h);m(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,cl(n),Et(s)?(s=s(i),_a().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function va(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=ri;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=kl,tick:h=x,css:g}=s||ba;g&&(o=fl(n,1,0,c,f,d,g));const m=Fo()+f,_=m+c;Qe(()=>ts(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),No(y=>{if(l){if(y>=_)return h(0,1),ts(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=m){const S=d((y-m)/c);h(1-S,S)}}return l})}return Et(s)?_a().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&cl(n,o),l=!1)}}}function qe(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&cl(n,u)}function d(g,m){const _=g.b-o;return m*=Math.abs(_),{a:o,b:g.b,d:_,duration:m,start:g.start,end:g.start+m,group:g.group}}function h(g){const{delay:m=0,duration:_=300,easing:y=kl,tick:S=x,css:C}=l||ba,T={start:Fo()+m,b:g};g||(T.group=ri,ri.r+=1),"inert"in n&&(g?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:(C&&(c(),u=fl(n,o,g,_,m,y,C)),g&&S(0,1),r=d(T,_),Qe(()=>ts(n,g,"start")),No($=>{if(a&&$>a.start&&(r=d(a,_),a=null,ts(n,r.b,"start"),C&&(c(),u=fl(n,o,r.b,r.duration,0,y,l.css))),r){if($>=r.end)S(o=r.b,1-o),ts(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if($>=r.start){const O=$-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(g){Et(l)?_a().then(()=>{l=l({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),r=a=null}}}function du(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(ue(),L(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),fe())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ga()}if(B1(n)){const s=wl();if(n.then(l=>{yi(s),i(e.then,1,e.value,l),yi(null)},l=>{if(yi(s),i(e.catch,2,e.error,l),yi(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function l0(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function ge(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function rs(n,e){n.d(1),e.delete(n.key)}function Ut(n,e){L(n,1,1,()=>{e.delete(n.key)})}function o0(n,e){n.f(),Ut(n,e)}function vt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const m={};for(;g--;)m[n[g].key]=g;const _=[],y=new Map,S=new Map,C=[];for(g=h;g--;){const M=c(s,l,g),D=t(M);let I=o.get(D);I?i&&C.push(()=>I.p(M,e)):(I=u(D,M),I.c()),y.set(D,_[g]=I),D in m&&S.set(D,Math.abs(g-m[D]))}const T=new Set,$=new Set;function O(M){A(M,1),M.m(r,f),o.set(M.key,M),f=M.first,h--}for(;d&&h;){const M=_[h-1],D=n[d-1],I=M.key,F=D.key;M===D?(f=M.first,d--,h--):y.has(F)?!o.has(I)||T.has(I)?O(M):$.has(F)?d--:S.get(I)>S.get(F)?($.add(I),O(M)):(T.add(F),d--):(a(D,o),d--)}for(;d--;){const M=n[d];y.has(M.key)||a(M,o)}for(;h;)O(_[h-1]);return $e(C),_}function yt(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Pt(n){return typeof n=="object"&&n!==null?n:{}}function he(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function H(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),Qe(()=>{const l=n.$$.on_mount.map(e_).filter(Et);n.$$.on_destroy?n.$$.on_destroy.push(...l):$e(l),n.$$.on_mount=[]}),s.forEach(Qe)}function V(n,e){const t=n.$$;t.fragment!==null&&(s0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function r0(n,e){n.$$.dirty[0]===-1&&(bs.push(n),a_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&r0(n,c)),d}):[],u.update(),f=!0,$e(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Z1(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),H(n,e.target,e.anchor),ga()}yi(a)}class ve{constructor(){tr(this,"$$");tr(this,"$$set")}$destroy(){V(this,1),this.$destroy=x}$on(e,t){if(!Et(t))return x;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!U1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const a0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(a0);function Nt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function c_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return f_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=x;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,o,r);l?o(g):c=Et(g)?g:x},h=s.map((g,m)=>ha(g,_=>{u[m]=_,f&=~(1<{f|=1<{V(u,1)}),fe()}l?(e=Dt(l,o(r,a)),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&4?yt(s,[Pt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function f0(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=yt(s,[a&2&&{params:r[1]},a&4&&Pt(r[2])]);else for(let f=0;f{V(u,1)}),fe()}l?(e=Dt(l,o(r,a)),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&6?yt(s,[a&2&&{params:r[1]},a&4&&Pt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function c0(n){let e,t,i,s;const l=[f0,u0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function pu(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ro=f_(null,function(e){e(pu());const t=()=>{e(pu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});c_(Ro,n=>n.location);const ya=c_(Ro,n=>n.querystring),hu=In(void 0);async function Hi(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ln();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function un(n,e){if(e=gu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return mu(n,e),{update(t){t=gu(t),mu(n,t)}}}function d0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function mu(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||p0(i.currentTarget.getAttribute("href"))})}function gu(n){return n&&typeof n=="string"?{href:n}:n||{}}function p0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function h0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor($,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!$||typeof $=="string"&&($.length<1||$.charAt(0)!="/"&&$.charAt(0)!="*")||typeof $=="object"&&!($ instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:M,keys:D}=d_($);this.path=$,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=M,this._keys=D}match($){if(s){if(typeof s=="string")if($.startsWith(s))$=$.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=$.match(s);if(I&&I[0])$=$.substr(I[0].length)||"/";else return null}}const O=this._pattern.exec($);if(O===null)return null;if(this._keys===!1)return O;const M={};let D=0;for(;D{r.push(new o($,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=pt();async function d(T,$){await ln(),c(T,$)}let h=null,g=null;l&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?h=T.state:h=null},window.addEventListener("popstate",g),n0(()=>{d0(h)}));let m=null,_=null;const y=Ro.subscribe(async T=>{m=T;let $=0;for(;${hu.set(u)});return}t(0,a=null),_=null,hu.set(void 0)});Is(()=>{y(),g&&window.removeEventListener("popstate",g)});function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,C]}class m0 extends ve{constructor(e){super(),be(this,e,h0,c0,me,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let p_;function h_(n){const e=n.pattern.test(p_);_u(n,n.className,e),_u(n,n.inactiveClassName,!e)}function _u(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ro.subscribe(n=>{p_=n.location+(n.querystring?"?"+n.querystring:""),so.map(h_)});function zn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?d_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),h_(i),{destroy(){so.splice(so.indexOf(i),1)}}}const g0="modulepreload",_0=function(n,e){return new URL(n,e).href},bu={},rt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=_0(l,i),l in bu)return;bu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":g0,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})};function Yt(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}class Kn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Kn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Kn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)===null||t===void 0?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((l=(s=(i=this.originalError)===null||i===void 0?void 0:i.cause)===null||s===void 0?void 0:s.message)===null||l===void 0)&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return Object.assign({},this)}}const Fl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function b0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||v0;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}m_=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const yu="pb_auth";class k0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ka(this.token)}get isAdmin(){return lo(this.token).type==="admin"}get isAuthRecord(){return lo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=yu){const i=b0(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(e,t=yu){var i,s;const l={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},o=lo(this.token);o!=null&&o.exp?l.expires=new Date(1e3*o.exp):l.expires=new Date("1970-01-01"),e=Object.assign({},l,e);const r={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let a=vu(t,JSON.stringify(r),e);const u=typeof Blob<"u"?new Blob([a]).size:a.length;if(r.model&&u>4096){r.model={id:(i=r==null?void 0:r.model)===null||i===void 0?void 0:i.id,email:(s=r==null?void 0:r.model)===null||s===void 0?void 0:s.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(r.model[c]=this.model[c]);a=vu(t,JSON.stringify(r),e)}return a}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class g_ extends k0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class as{constructor(e){this.client=e}}class w0 extends as{getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class wa extends as{decode(e){return e}getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(s=>{var l;return s.items=((l=s.items)===null||l===void 0?void 0:l.map(o=>this.decode(o)))||[],s})}getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var s;if(!(!((s=i==null?void 0:i.items)===null||s===void 0)&&s.length))throw new Kn({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(s=>this.decode(s))}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],s=l=>Yt(this,void 0,void 0,function*(){return this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i})});return s(1)}}function Mn(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function ir(n){var e,t;(t=(e=n)._resetAutoRefresh)===null||t===void 0||t.call(e)}class S0 extends wa{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)===s.id&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l;return i&&((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)===e&&((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}authWithPassword(e,t,i,s){return Yt(this,void 0,void 0,function*(){let l={method:"POST",body:{identity:e,password:t}};l=Mn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",l,i,s);const o=l.autoRefreshThreshold;delete l.autoRefreshThreshold,l.autoRefresh||ir(this.client);let r=yield this.client.send(this.baseCrudPath+"/auth-with-password",l);return r=this.authResponse(r),o&&function(u,f,c,d){ir(u);const h=u.beforeSend,g=u.authStore.model,m=u.authStore.onChange((_,y)=>{(!_||(y==null?void 0:y.id)!=(g==null?void 0:g.id)||(y!=null&&y.collectionId||g!=null&&g.collectionId)&&(y==null?void 0:y.collectionId)!=(g==null?void 0:g.collectionId))&&ir(u)});u._resetAutoRefresh=function(){m(),u.beforeSend=h,delete u._resetAutoRefresh},u.beforeSend=(_,y)=>Yt(this,void 0,void 0,function*(){var S;const C=u.authStore.token;if(!((S=y.query)===null||S===void 0)&&S.autoRefresh)return h?h(_,y):{url:_,sendOptions:y};let T=u.authStore.isValid;if(T&&ka(u.authStore.token,f))try{yield c()}catch{T=!1}T||(yield d());const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&C==$[O]&&u.authStore.token){$[O]=u.authStore.token;break}return y.headers=$,h?h(_,y):{url:_,sendOptions:y}})}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},l))),r})}authRefresh(e,t){let i={method:"POST"};return i=Mn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Mn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Mn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}class __ extends as{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentTopics=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}subscribe(e,t){var i;return Yt(this,void 0,void 0,function*(){if(!e)throw new Error("topic must be set.");const s=function(l){const o=l;let r;try{r=JSON.parse(o==null?void 0:o.data)}catch{}t(r||{})};return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e].push(s),this.isConnected?this.subscriptions[e].length===1?yield this.submitSubscriptions():(i=this.eventSource)===null||i===void 0||i.addEventListener(e,s):yield this.connect(),()=>Yt(this,void 0,void 0,function*(){return this.unsubscribeByTopicAndListener(e,s)})})}unsubscribe(e){var t;return Yt(this,void 0,void 0,function*(){if(this.hasSubscriptionListeners(e)){if(e){for(let i of this.subscriptions[e])(t=this.eventSource)===null||t===void 0||t.removeEventListener(e,i);delete this.subscriptions[e]}else this.subscriptions={};this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect()}})}unsubscribeByPrefix(e){var t;return Yt(this,void 0,void 0,function*(){let i=!1;for(let s in this.subscriptions)if(s.startsWith(e)){i=!0;for(let l of this.subscriptions[s])(t=this.eventSource)===null||t===void 0||t.removeEventListener(s,l);delete this.subscriptions[s]}i&&(this.hasSubscriptionListeners()?yield this.submitSubscriptions():this.disconnect())})}unsubscribeByTopicAndListener(e,t){var i;return Yt(this,void 0,void 0,function*(){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)return;let s=!1;for(let l=this.subscriptions[e].length-1;l>=0;l--)this.subscriptions[e][l]===t&&(s=!0,delete this.subscriptions[e][l],this.subscriptions[e].splice(l,1),(i=this.eventSource)===null||i===void 0||i.removeEventListener(e,t));s&&(this.subscriptions[e].length||delete this.subscriptions[e],this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect())})}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!(!((t=this.subscriptions[e])===null||t===void 0)&&t.length);for(let s in this.subscriptions)if(!((i=this.subscriptions[s])===null||i===void 0)&&i.length)return!0;return!1}submitSubscriptions(){return Yt(this,void 0,void 0,function*(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},query:{requestKey:this.getSubscriptionsCancelKey()}}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getNonEmptySubscriptionTopics(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}connect(){return Yt(this,void 0,void 0,function*(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(()=>Yt(this,void 0,void 0,function*(){let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,yield this.submitSubscriptions()})).then(()=>{for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionTopics();if(e.length!=this.lastSentTopics.length)return!0;for(const t of e)if(!this.lastSentTopics.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Kn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)===null||t===void 0||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class T0 extends wa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}subscribeOne(e,t){return Yt(this,void 0,void 0,function*(){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t)})}subscribe(e,t){return Yt(this,void 0,void 0,function*(){if(typeof e=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),this.client.realtime.subscribe(this.collectionIdOrName,e);if(!t)throw new Error("Missing subscription callback.");if(e==="")throw new Error("Missing topic.");let i=this.collectionIdOrName;return e!=="*"&&(i+="/"+e),this.client.realtime.subscribe(i,t)})}unsubscribe(e){return Yt(this,void 0,void 0,function*(){return e==="*"?this.client.realtime.unsubscribe(this.collectionIdOrName):e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)})}getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}getList(e=1,t=30,i){return super.getList(e,t,i)}getFirstListItem(e,t){return super.getFirstListItem(e,t)}getOne(e,t){return super.getOne(e,t)}create(e,t){return super.create(e,t)}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o,r;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)!==(s==null?void 0:s.id)||((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)===null||r===void 0?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)!==e||((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}authWithPassword(e,t,i,s){let l={method:"POST",body:{identity:e,password:t}};return l=Mn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/auth-with-password",l).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:s,createData:l}};return a=Mn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){return Yt(this,void 0,void 0,function*(){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(yield this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new Kn(new Error(`Missing or invalid provider "${t.provider}".`));const s=this.client.buildUrl("/api/oauth2-redirect"),l=new __(this.client);let o=null;function r(){o==null||o.close(),l.unsubscribe()}return t.urlCallback||(o=ku(void 0)),new Promise((a,u)=>Yt(this,void 0,void 0,function*(){var f;try{yield l.subscribe("@oauth2",g=>Yt(this,void 0,void 0,function*(){const m=l.clientId;try{if(!g.state||m!==g.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const y=yield this.authWithOAuth2Code(i.name,g.code,i.codeVerifier,s,t.createData,_);a(y)}catch(_){u(new Kn(_))}r()}));const c={state:l.clientId};!((f=t.scopes)===null||f===void 0)&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+s,c);yield(t.urlCallback||function(g){o?o.location.href=g:o=ku(g)})(d)}catch(c){r(),u(new Kn(c))}}))})}authRefresh(e,t){let i={method:"POST"};return i=Mn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(s=>this.authResponse(s))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Mn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Mn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=Mn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=Mn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>!0)}requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=Mn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=Mn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>!0)}listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function ku(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Kn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class C0 extends wa{get baseCrudPath(){return"/api/collections"}import(e,t=!1,i){return Yt(this,void 0,void 0,function*(){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)})}}class $0 extends as{getRequestsList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs/requests",i)}getRequest(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/requests/"+encodeURIComponent(e),t)}getRequestsStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/requests/stats",e)}}class M0 extends as{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class O0 extends as{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildUrl(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class E0 extends as{getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}const D0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];class qo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new g_,this.admins=new S0(this),this.collections=new C0(this),this.files=new O0(this),this.logs=new $0(this),this.settings=new w0(this),this.realtime=new __(this),this.health=new M0(this),this.backups=new E0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new T0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var t;let i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i}send(e,t){return Yt(this,void 0,void 0,function*(){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const s=Object.assign({},yield this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=this.serializeQueryParams(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(s=>Yt(this,void 0,void 0,function*(){let l={};try{l=yield s.json()}catch{}if(this.afterSend&&(l=yield this.afterSend(s,l)),s.status>=400)throw new Kn({url:s.url,status:s.status,data:l});return l})).catch(s=>{throw new Kn(s)})})}initSendOptions(e,t){(t=Object.assign({method:"GET"},t)).query=t.query||{},t.body=this.convertToFormDataIfNeeded(t.body);for(let i in t)D0.includes(i)||(t.query[i]=t[i],delete t[i]);if(t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const s=new AbortController;this.cancelControllers[i]=s,t.signal=s.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const s=Array.isArray(e[i])?e[i]:[e[i]];for(let l of s)t.append(i,l)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let s of i)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(const o of s)t.push(l+"="+encodeURIComponent(o));else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")}}class us extends Error{}class A0 extends us{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class I0 extends us{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class L0 extends us{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Qs extends us{}class b_ extends us{constructor(e){super(`Invalid unit ${e}`)}}class Un extends us{}class Ei extends us{constructor(){super("Zone is an abstract class")}}const Ie="numeric",ni="short",Dn="long",zr={year:Ie,month:Ie,day:Ie},v_={year:Ie,month:ni,day:Ie},P0={year:Ie,month:ni,day:Ie,weekday:ni},y_={year:Ie,month:Dn,day:Ie},k_={year:Ie,month:Dn,day:Ie,weekday:Dn},w_={hour:Ie,minute:Ie},S_={hour:Ie,minute:Ie,second:Ie},T_={hour:Ie,minute:Ie,second:Ie,timeZoneName:ni},C_={hour:Ie,minute:Ie,second:Ie,timeZoneName:Dn},$_={hour:Ie,minute:Ie,hourCycle:"h23"},M_={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23"},O_={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:ni},E_={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:Dn},D_={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie},A_={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie,second:Ie},I_={year:Ie,month:ni,day:Ie,hour:Ie,minute:Ie},L_={year:Ie,month:ni,day:Ie,hour:Ie,minute:Ie,second:Ie},F0={year:Ie,month:ni,day:Ie,weekday:ni,hour:Ie,minute:Ie},P_={year:Ie,month:Dn,day:Ie,hour:Ie,minute:Ie,timeZoneName:ni},F_={year:Ie,month:Dn,day:Ie,hour:Ie,minute:Ie,second:Ie,timeZoneName:ni},N_={year:Ie,month:Dn,day:Ie,weekday:Dn,hour:Ie,minute:Ie,timeZoneName:Dn},R_={year:Ie,month:Dn,day:Ie,weekday:Dn,hour:Ie,minute:Ie,second:Ie,timeZoneName:Dn};function st(n){return typeof n>"u"}function ns(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function N0(n){return typeof n=="string"}function R0(n){return Object.prototype.toString.call(n)==="[object Date]"}function q_(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function q0(n){return Array.isArray(n)?n:[n]}function wu(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function j0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function $s(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return jo(n)&&n>=e&&n<=t}function H0(n,e){return n-e*Math.floor(n/e)}function Wt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ai(n){if(!(st(n)||n===null||n===""))return parseInt(n,10)}function Ui(n){if(!(st(n)||n===null||n===""))return parseFloat(n)}function Sa(n){if(!(st(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Ta(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Sl(n){return n%4===0&&(n%100!==0||n%400===0)}function nl(n){return Sl(n)?366:365}function mo(n,e){const t=H0(e-1,12)+1,i=n+(e-t)/12;return t===2?Sl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ca(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function go(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Br(n){return n>99?n:n>60?1900+n:2e3+n}function j_(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ho(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function H_(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Un(`Invalid unit value ${n}`);return e}function _o(n,e){const t={};for(const i in n)if($s(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=H_(s)}return t}function il(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Wt(t,2)}:${Wt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Wt(t,2)}${Wt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return j0(n,["hour","minute","second","millisecond"])}const V_=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,V0=["January","February","March","April","May","June","July","August","September","October","November","December"],z_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],z0=["J","F","M","A","M","J","J","A","S","O","N","D"];function B_(n){switch(n){case"narrow":return[...z0];case"short":return[...z_];case"long":return[...V0];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const U_=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],W_=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],B0=["M","T","W","T","F","S","S"];function Y_(n){switch(n){case"narrow":return[...B0];case"short":return[...W_];case"long":return[...U_];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const K_=["AM","PM"],U0=["Before Christ","Anno Domini"],W0=["BC","AD"],Y0=["B","A"];function J_(n){switch(n){case"narrow":return[...Y0];case"short":return[...W0];case"long":return[...U0];default:return null}}function K0(n){return K_[n.hour<12?0:1]}function J0(n,e){return Y_(e)[n.weekday-1]}function G0(n,e){return B_(e)[n.month-1]}function Z0(n,e){return J_(e)[n.year<0?0:1]}function X0(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Su(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Q0={D:zr,DD:v_,DDD:y_,DDDD:k_,t:w_,tt:S_,ttt:T_,tttt:C_,T:$_,TT:M_,TTT:O_,TTTT:E_,f:D_,ff:I_,fff:P_,ffff:N_,F:A_,FF:L_,FFF:F_,FFFF:R_};class wn{static create(e,t={}){return new wn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return Q0[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Wt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?K0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?G0(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?J0(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=wn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?Z0(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return Su(wn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=wn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Su(l,s(r))}}class ei{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Tl{get type(){throw new Ei}get name(){throw new Ei}get ianaName(){return this.name}get isUniversal(){throw new Ei}offsetName(e,t){throw new Ei}formatOffset(e,t){throw new Ei}offset(e){throw new Ei}equals(e){throw new Ei}get isValid(){throw new Ei}}let sr=null;class $a extends Tl{static get instance(){return sr===null&&(sr=new $a),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return j_(e,t,i)}formatOffset(e,t){return il(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let oo={};function x0(n){return oo[n]||(oo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),oo[n]}const ev={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function tv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function nv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let lr=null;class gn extends Tl{static get utcInstance(){return lr===null&&(lr=new gn(0)),lr}static instance(e){return e===0?gn.utcInstance:new gn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new gn(Ho(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${il(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${il(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return il(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class iv extends Tl{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ii(n,e){if(st(n)||n===null)return e;if(n instanceof Tl)return n;if(N0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?gn.utcInstance:gn.parseSpecifier(t)||Si.create(n)}else return ns(n)?gn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new iv(n)}let Tu=()=>Date.now(),Cu="system",$u=null,Mu=null,Ou=null,Eu;class Xt{static get now(){return Tu}static set now(e){Tu=e}static set defaultZone(e){Cu=e}static get defaultZone(){return Ii(Cu,$a.instance)}static get defaultLocale(){return $u}static set defaultLocale(e){$u=e}static get defaultNumberingSystem(){return Mu}static set defaultNumberingSystem(e){Mu=e}static get defaultOutputCalendar(){return Ou}static set defaultOutputCalendar(e){Ou=e}static get throwOnInvalid(){return Eu}static set throwOnInvalid(e){Eu=e}static resetCaches(){Lt.resetCache(),Si.resetCache()}}let Du={};function sv(n,e={}){const t=JSON.stringify([n,e]);let i=Du[t];return i||(i=new Intl.ListFormat(n,e),Du[t]=i),i}let Ur={};function Wr(n,e={}){const t=JSON.stringify([n,e]);let i=Ur[t];return i||(i=new Intl.DateTimeFormat(n,e),Ur[t]=i),i}let Yr={};function lv(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.NumberFormat(n,e),Yr[t]=i),i}let Kr={};function ov(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Kr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Kr[s]=l),l}let xs=null;function rv(){return xs||(xs=new Intl.DateTimeFormat().resolvedOptions().locale,xs)}function av(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Wr(n).resolvedOptions()}catch{t=Wr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function uv(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function fv(n){const e=[];for(let t=1;t<=12;t++){const i=Be.utc(2016,t,1);e.push(n(i))}return e}function cv(n){const e=[];for(let t=1;t<=7;t++){const i=Be.utc(2016,11,13+t);e.push(n(i))}return e}function Rl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function dv(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class pv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=lv(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Ta(e,3);return Wt(t,this.padTo)}}}class hv{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Si.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Be.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Wr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class mv{constructor(e,t,i){this.opts={style:"long",...i},!t&&q_()&&(this.rtf=ov(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):X0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Lt{static fromOpts(e){return Lt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Xt.defaultLocale,o=l||(s?"en-US":rv()),r=t||Xt.defaultNumberingSystem,a=i||Xt.defaultOutputCalendar;return new Lt(o,r,a,l)}static resetCache(){xs=null,Ur={},Yr={},Kr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Lt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=av(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=uv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=dv(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Lt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Rl(this,e,i,B_,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=fv(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Rl(this,e,i,Y_,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=cv(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Rl(this,void 0,e,()=>K_,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Be.utc(2016,11,13,9),Be.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Rl(this,e,t,J_,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Be.utc(-40,1,1),Be.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new pv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new hv(e,this.intl,t)}relFormatter(e={}){return new mv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return sv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ls(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ps(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function G_(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(g||h&&f)?-h:h;return[{years:d(Ui(t)),months:d(Ui(i)),weeks:d(Ui(s)),days:d(Ui(l)),hours:d(Ui(o)),minutes:d(Ui(r)),seconds:d(Ui(a),a==="-0"),milliseconds:d(Sa(u),c)}]}const Ov={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ea(n,e,t,i,s,l,o){const r={year:e.length===2?Br(Ai(e)):Ai(e),month:z_.indexOf(t)+1,day:Ai(i),hour:Ai(s),minute:Ai(l)};return o&&(r.second=Ai(o)),n&&(r.weekday=n.length>3?U_.indexOf(n)+1:W_.indexOf(n)+1),r}const Ev=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Dv(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Ea(e,s,i,t,l,o,r);let h;return a?h=Ov[a]:u?h=0:h=Ho(f,c),[d,new gn(h)]}function Av(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Iv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Lv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Pv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Au(n){const[,e,t,i,s,l,o,r]=n;return[Ea(e,s,i,t,l,o,r),gn.utcInstance]}function Fv(n){const[,e,t,i,s,l,o,r]=n;return[Ea(e,r,t,i,s,l,o),gn.utcInstance]}const Nv=Ls(_v,Oa),Rv=Ls(bv,Oa),qv=Ls(vv,Oa),jv=Ls(X_),x_=Ps(Tv,Ns,Cl,$l),Hv=Ps(yv,Ns,Cl,$l),Vv=Ps(kv,Ns,Cl,$l),zv=Ps(Ns,Cl,$l);function Bv(n){return Fs(n,[Nv,x_],[Rv,Hv],[qv,Vv],[jv,zv])}function Uv(n){return Fs(Av(n),[Ev,Dv])}function Wv(n){return Fs(n,[Iv,Au],[Lv,Au],[Pv,Fv])}function Yv(n){return Fs(n,[$v,Mv])}const Kv=Ps(Ns);function Jv(n){return Fs(n,[Cv,Kv])}const Gv=Ls(wv,Sv),Zv=Ls(Q_),Xv=Ps(Ns,Cl,$l);function Qv(n){return Fs(n,[Gv,x_],[Zv,Xv])}const xv="Invalid Duration",eb={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},ey={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...eb},qn=146097/400,hs=146097/4800,ty={years:{quarters:4,months:12,weeks:qn/7,days:qn,hours:qn*24,minutes:qn*24*60,seconds:qn*24*60*60,milliseconds:qn*24*60*60*1e3},quarters:{months:3,weeks:qn/28,days:qn/4,hours:qn*24/4,minutes:qn*24*60/4,seconds:qn*24*60*60/4,milliseconds:qn*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...eb},Zi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ny=Zi.slice(0).reverse();function Wi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new at(i)}function iy(n){return n<0?Math.floor(n):Math.ceil(n)}function tb(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?iy(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function sy(n,e){ny.reduce((t,i)=>st(e[i])?t:(t&&tb(n,e,t,e,i),i),null)}class at{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Lt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?ty:ey,this.isLuxonDuration=!0}static fromMillis(e,t){return at.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Un(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new at({values:_o(e,at.normalizeUnit),loc:Lt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ns(e))return at.fromMillis(e);if(at.isDuration(e))return e;if(typeof e=="object")return at.fromObject(e);throw new Un(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=Yv(e);return i?at.fromObject(i,t):at.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Jv(e);return i?at.fromObject(i,t):at.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the Duration is invalid");const i=e instanceof ei?e:new ei(e,t);if(Xt.throwOnInvalid)throw new L0(i);return new at({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new b_(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?wn.create(this.loc,i).formatDurationFromString(this,e):xv}toHuman(e={}){const t=Zi.map(i=>{const s=this.values[i];return st(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ta(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e),i={};for(const s of Zi)($s(t.values,s)||$s(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Wi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=H_(e(this.values[i],i));return Wi(this,{values:t},!0)}get(e){return this[at.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,..._o(e,at.normalizeUnit)};return Wi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Wi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return sy(this.matrix,e),Wi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>at.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Zi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;ns(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Zi.indexOf(u)>Zi.indexOf(o)&&tb(this.matrix,s,u,t,o)}else ns(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Wi(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Wi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Zi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Vs="Invalid Interval";function ly(n,e){return!n||!n.isValid?Rt.invalid("missing or invalid start"):!e||!e.isValid?Rt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Rt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Us).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Rt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=at.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Rt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Rt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Rt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Rt.fromDateTimes(t,a.time)),t=null);return Rt.merge(s)}difference(...e){return Rt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Vs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Vs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Vs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Vs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):at.invalid(this.invalidReason)}mapEndpoints(e){return Rt.fromDateTimes(e(this.s),e(this.e))}}class ql{static hasDST(e=Xt.defaultZone){const t=Be.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Si.isValidZone(e)}static normalizeZone(e){return Ii(e,Xt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Lt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Lt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Lt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Lt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Lt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Lt.create(t,null,"gregory").eras(e)}static features(){return{relative:q_()}}}function Iu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(at.fromMillis(i).as("days"))}function oy(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=Iu(r,a);return(u-u%7)/7}],["days",Iu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function ry(n,e,t,i){let[s,l,o,r]=oy(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?at.fromMillis(a,i).shiftTo(...u).plus(f):f}const Da={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Lu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ay=Da.hanidec.replace(/[\[|\]]/g,"").split("");function uy(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Qn({numberingSystem:n},e=""){return new RegExp(`${Da[n||"latn"]}${e}`)}const fy="missing Intl.DateTimeFormat.formatToParts support";function ut(n,e=t=>t){return{regex:n,deser:([t])=>e(uy(t))}}const cy=String.fromCharCode(160),nb=`[ ${cy}]`,ib=new RegExp(nb,"g");function dy(n){return n.replace(/\./g,"\\.?").replace(ib,nb)}function Pu(n){return n.replace(/\./g,"").replace(ib," ").toLowerCase()}function xn(n,e){return n===null?null:{regex:RegExp(n.map(dy).join("|")),deser:([t])=>n.findIndex(i=>Pu(t)===Pu(i))+e}}function Fu(n,e){return{regex:n,deser:([,t,i])=>Ho(t,i),groups:e}}function or(n){return{regex:n,deser:([e])=>e}}function py(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hy(n,e){const t=Qn(e),i=Qn(e,"{2}"),s=Qn(e,"{3}"),l=Qn(e,"{4}"),o=Qn(e,"{6}"),r=Qn(e,"{1,2}"),a=Qn(e,"{1,3}"),u=Qn(e,"{1,6}"),f=Qn(e,"{1,9}"),c=Qn(e,"{2,4}"),d=Qn(e,"{4,6}"),h=_=>({regex:RegExp(py(_.val)),deser:([y])=>y,literal:!0}),m=(_=>{if(n.literal)return h(_);switch(_.val){case"G":return xn(e.eras("short",!1),0);case"GG":return xn(e.eras("long",!1),0);case"y":return ut(u);case"yy":return ut(c,Br);case"yyyy":return ut(l);case"yyyyy":return ut(d);case"yyyyyy":return ut(o);case"M":return ut(r);case"MM":return ut(i);case"MMM":return xn(e.months("short",!0,!1),1);case"MMMM":return xn(e.months("long",!0,!1),1);case"L":return ut(r);case"LL":return ut(i);case"LLL":return xn(e.months("short",!1,!1),1);case"LLLL":return xn(e.months("long",!1,!1),1);case"d":return ut(r);case"dd":return ut(i);case"o":return ut(a);case"ooo":return ut(s);case"HH":return ut(i);case"H":return ut(r);case"hh":return ut(i);case"h":return ut(r);case"mm":return ut(i);case"m":return ut(r);case"q":return ut(r);case"qq":return ut(i);case"s":return ut(r);case"ss":return ut(i);case"S":return ut(a);case"SSS":return ut(s);case"u":return or(f);case"uu":return or(r);case"uuu":return ut(t);case"a":return xn(e.meridiems(),0);case"kkkk":return ut(l);case"kk":return ut(c,Br);case"W":return ut(r);case"WW":return ut(i);case"E":case"c":return ut(t);case"EEE":return xn(e.weekdays("short",!1,!1),1);case"EEEE":return xn(e.weekdays("long",!1,!1),1);case"ccc":return xn(e.weekdays("short",!0,!1),1);case"cccc":return xn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Fu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Fu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return or(/[a-z_+-/]{1,256}?/i);default:return h(_)}})(n)||{invalidReason:fy};return m.token=n,m}const my={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function gy(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=my[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function _y(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function by(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if($s(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function vy(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return st(n.z)||(t=Si.create(n.z)),st(n.Z)||(t||(t=new gn(n.Z)),i=n.Z),st(n.q)||(n.M=(n.q-1)*3+1),st(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),st(n.u)||(n.S=Sa(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let rr=null;function yy(){return rr||(rr=Be.fromMillis(1555555555555)),rr}function ky(n,e){if(n.literal)return n;const t=wn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=wn.create(e,t).formatDateTimeParts(yy()).map(o=>gy(o,e,t));return l.includes(void 0)?n:l}function wy(n,e){return Array.prototype.concat(...n.map(t=>ky(t,e)))}function sb(n,e,t){const i=wy(wn.parseFormat(t),n),s=i.map(o=>hy(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=_y(s),a=RegExp(o,"i"),[u,f]=by(e,a,r),[c,d,h]=f?vy(f):[null,null,void 0];if($s(f,"a")&&$s(f,"H"))throw new Qs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function Sy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=sb(n,e,t);return[i,s,l,o]}const lb=[0,31,59,90,120,151,181,212,243,273,304,334],ob=[0,31,60,91,121,152,182,213,244,274,305,335];function Yn(n,e){return new ei("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function rb(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function ab(n,e,t){return t+(Sl(n)?ob:lb)[e-1]}function ub(n,e){const t=Sl(n)?ob:lb,i=t.findIndex(l=>lgo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function Nu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=rb(e,1,4),l=nl(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=nl(r)):o>l?(r=e+1,o-=nl(e)):r=e;const{month:a,day:u}=ub(r,o);return{year:r,month:a,day:u,...Vo(n)}}function ar(n){const{year:e,month:t,day:i}=n,s=ab(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function Ru(n){const{year:e,ordinal:t}=n,{month:i,day:s}=ub(e,t);return{year:e,month:i,day:s,...Vo(n)}}function Ty(n){const e=jo(n.weekYear),t=ki(n.weekNumber,1,go(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Yn("weekday",n.weekday):Yn("week",n.week):Yn("weekYear",n.weekYear)}function Cy(n){const e=jo(n.year),t=ki(n.ordinal,1,nl(n.year));return e?t?!1:Yn("ordinal",n.ordinal):Yn("year",n.year)}function fb(n){const e=jo(n.year),t=ki(n.month,1,12),i=ki(n.day,1,mo(n.year,n.month));return e?t?i?!1:Yn("day",n.day):Yn("month",n.month):Yn("year",n.year)}function cb(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ki(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ki(t,0,59),r=ki(i,0,59),a=ki(s,0,999);return l?o?r?a?!1:Yn("millisecond",s):Yn("second",i):Yn("minute",t):Yn("hour",e)}const ur="Invalid DateTime",qu=864e13;function jl(n){return new ei("unsupported zone",`the zone "${n.name}" is not supported`)}function fr(n){return n.weekData===null&&(n.weekData=Jr(n.c)),n.weekData}function zs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Be({...t,...e,old:t})}function db(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function ju(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ro(n,e,t){return db(Ca(n),e,t)}function Hu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,mo(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=at.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Ca(l);let[a,u]=db(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Bs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Be.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Be.invalid(new ei("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Hl(n,e,t=!0){return n.isValid?wn.create(Lt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function cr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Wt(n.c.year,t?6:4),e?(i+="-",i+=Wt(n.c.month),i+="-",i+=Wt(n.c.day)):(i+=Wt(n.c.month),i+=Wt(n.c.day)),i}function Vu(n,e,t,i,s,l){let o=Wt(n.c.hour);return e?(o+=":",o+=Wt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Wt(n.c.minute),(n.c.second!==0||!t)&&(o+=Wt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Wt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Wt(Math.trunc(-n.o/60)),o+=":",o+=Wt(Math.trunc(-n.o%60))):(o+="+",o+=Wt(Math.trunc(n.o/60)),o+=":",o+=Wt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const pb={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},$y={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},My={ordinal:1,hour:0,minute:0,second:0,millisecond:0},hb=["year","month","day","hour","minute","second","millisecond"],Oy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ey=["year","ordinal","hour","minute","second","millisecond"];function zu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new b_(n);return e}function Bu(n,e){const t=Ii(e.zone,Xt.defaultZone),i=Lt.fromObject(e),s=Xt.now();let l,o;if(st(n.year))l=s;else{for(const u of hb)st(n[u])&&(n[u]=pb[u]);const r=fb(n)||cb(n);if(r)return Be.invalid(r);const a=t.offset(s);[l,o]=ro(n,a,t)}return new Be({ts:l,zone:t,loc:i,o})}function Uu(n,e,t){const i=st(t.round)?!0:t.round,s=(o,r)=>(o=Ta(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Wu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Be{constructor(e){const t=e.zone||Xt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ei("invalid input"):null)||(t.isValid?null:jl(t));this.ts=st(e.ts)?Xt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=ju(this.ts,r),i=Number.isNaN(s.year)?new ei("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Lt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Be({})}static local(){const[e,t]=Wu(arguments),[i,s,l,o,r,a,u]=t;return Bu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Wu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=gn.utcInstance,Bu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=R0(e)?e.valueOf():NaN;if(Number.isNaN(i))return Be.invalid("invalid input");const s=Ii(t.zone,Xt.defaultZone);return s.isValid?new Be({ts:i,zone:s,loc:Lt.fromObject(t)}):Be.invalid(jl(s))}static fromMillis(e,t={}){if(ns(e))return e<-qu||e>qu?Be.invalid("Timestamp out of range"):new Be({ts:e,zone:Ii(t.zone,Xt.defaultZone),loc:Lt.fromObject(t)});throw new Un(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ns(e))return new Be({ts:e*1e3,zone:Ii(t.zone,Xt.defaultZone),loc:Lt.fromObject(t)});throw new Un("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ii(t.zone,Xt.defaultZone);if(!i.isValid)return Be.invalid(jl(i));const s=Xt.now(),l=st(t.specificOffset)?i.offset(s):t.specificOffset,o=_o(e,zu),r=!st(o.ordinal),a=!st(o.year),u=!st(o.month)||!st(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Lt.fromObject(t);if((f||r)&&c)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Qs("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,m,_=ju(s,l);h?(g=Oy,m=$y,_=Jr(_)):r?(g=Ey,m=My,_=ar(_)):(g=hb,m=pb);let y=!1;for(const D of g){const I=o[D];st(I)?y?o[D]=m[D]:o[D]=_[D]:y=!0}const S=h?Ty(o):r?Cy(o):fb(o),C=S||cb(o);if(C)return Be.invalid(C);const T=h?Nu(o):r?Ru(o):o,[$,O]=ro(T,l,i),M=new Be({ts:$,zone:i,o:O,loc:d});return o.weekday&&f&&e.weekday!==M.weekday?Be.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${M.toISO()}`):M}static fromISO(e,t={}){const[i,s]=Bv(e);return Bs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=Uv(e);return Bs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=Wv(e);return Bs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(st(e)||st(t))throw new Un("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Lt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Sy(o,e,t);return f?Be.invalid(f):Bs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Be.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Qv(e);return Bs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the DateTime is invalid");const i=e instanceof ei?e:new ei(e,t);if(Xt.throwOnInvalid)throw new A0(i);return new Be({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?fr(this).weekYear:NaN}get weekNumber(){return this.isValid?fr(this).weekNumber:NaN}get weekday(){return this.isValid?fr(this).weekday:NaN}get ordinal(){return this.isValid?ar(this.c).ordinal:NaN}get monthShort(){return this.isValid?ql.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ql.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ql.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ql.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Sl(this.year)}get daysInMonth(){return mo(this.year,this.month)}get daysInYear(){return this.isValid?nl(this.year):NaN}get weeksInWeekYear(){return this.isValid?go(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=wn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(gn.instance(e),t)}toLocal(){return this.setZone(Xt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ii(e,Xt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=ro(o,l,e)}return zs(this,{ts:s,zone:e})}else return Be.invalid(jl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return zs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_o(e,zu),i=!st(t.weekYear)||!st(t.weekNumber)||!st(t.weekday),s=!st(t.ordinal),l=!st(t.year),o=!st(t.month)||!st(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Qs("Can't mix ordinal dates with month/day");let u;i?u=Nu({...Jr(this.c),...t}):st(t.ordinal)?(u={...this.toObject(),...t},st(t.day)&&(u.day=Math.min(mo(u.year,u.month),u.day))):u=Ru({...ar(this.c),...t});const[f,c]=ro(u,this.o,this.zone);return zs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e);return zs(this,Hu(this,t))}minus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e).negate();return zs(this,Hu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=at.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?wn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ur}toLocaleString(e=zr,t={}){return this.isValid?wn.create(this.loc.clone(t),e).formatDateTime(this):ur}toLocaleParts(e={}){return this.isValid?wn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=cr(this,o);return r+="T",r+=Vu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?cr(this,e==="extended"):null}toISOWeekDate(){return Hl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Vu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Hl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Hl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ur}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return at.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=q0(t).map(at.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=ry(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Be.now(),e,t)}until(e){return this.isValid?Rt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Be.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Be.isDateTime))throw new Un("max requires all arguments be DateTimes");return wu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Lt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return sb(o,e,t)}static fromStringExplain(e,t,i={}){return Be.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return zr}static get DATE_MED(){return v_}static get DATE_MED_WITH_WEEKDAY(){return P0}static get DATE_FULL(){return y_}static get DATE_HUGE(){return k_}static get TIME_SIMPLE(){return w_}static get TIME_WITH_SECONDS(){return S_}static get TIME_WITH_SHORT_OFFSET(){return T_}static get TIME_WITH_LONG_OFFSET(){return C_}static get TIME_24_SIMPLE(){return $_}static get TIME_24_WITH_SECONDS(){return M_}static get TIME_24_WITH_SHORT_OFFSET(){return O_}static get TIME_24_WITH_LONG_OFFSET(){return E_}static get DATETIME_SHORT(){return D_}static get DATETIME_SHORT_WITH_SECONDS(){return A_}static get DATETIME_MED(){return I_}static get DATETIME_MED_WITH_SECONDS(){return L_}static get DATETIME_MED_WITH_WEEKDAY(){return F0}static get DATETIME_FULL(){return P_}static get DATETIME_FULL_WITH_SECONDS(){return F_}static get DATETIME_HUGE(){return N_}static get DATETIME_HUGE_WITH_SECONDS(){return R_}}function Us(n){if(Be.isDateTime(n))return n;if(n&&n.valueOf&&ns(n.valueOf()))return Be.fromJSDate(n);if(n&&typeof n=="object")return Be.fromObject(n);throw new Un(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Dy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Ay=[".mp4",".avi",".mov",".3gp",".wmv"],Iy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Ly=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=j.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!j.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):j.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||j.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),j.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],s=t.length>1?t.trim():t;for(let l of e)l=typeof l=="string"?l.trim():"",j.isEmpty(l)||i.push(l.replaceAll(s,"\\"+s));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Be.fromFormat(e,i,{zone:"UTC"})}return Be.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",j.download(i,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return!!Dy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Ay.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Iy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Ly.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)j.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,h,g;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",s=(e==null?void 0:e.type)==="view",l={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(l.username="username123",l.verified=!1,l.emailVisibility=!0,l.email="test@example.com"),(!s||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(l.created="2022-01-01 01:00:00.123Z"),(!s||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(l.updated="2022-01-01 23:59:59.456Z");for(const m of t){let _=null;m.type==="number"?_=123:m.type==="date"?_="2022-01-01 10:00:00.123Z":m.type==="bool"?_=!0:m.type==="email"?_="test@example.com":m.type==="url"?_="https://example.com":m.type==="json"?_="JSON":m.type==="file"?(_="filename.jpg",((f=m.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):m.type==="select"?(_=(d=(c=m.options)==null?void 0:c.values)==null?void 0:d[0],((h=m.options)==null?void 0:h.maxSelect)!==1&&(_=[_])):m.type==="relation"?(_="RELATION_RECORD_ID",((g=m.options)==null?void 0:g.maxSelect)!==1&&(_=[_])):_="test",l[m.name]=_}return l}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=j.isObject(u)&&j.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample direction | code fullscreen",paste_postprocess:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,h=f.result.split(",")[1],g=d.create(c,u,h);d.add(g),s(g.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"ltr"),tinymce.activeEditor.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),tinymce.activeEditor.execCommand("mceDirectionRTL")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(j.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return j.truncate(JSON.stringify(e))||t}catch{return t}return""+e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+l);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)j.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let h of r){h=h.trim().replaceAll("{PB_TEMP}",",");const m=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(h);if((m==null?void 0:m.length)!=4)continue;const _=(c=(f=m[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");_&&t.columns.push({name:_,collate:m[2]||"",sort:((d=m[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` +}`,c=`__svelte_${X1(f)}_${r}`,d=s_(n),{stylesheet:h,rules:g}=po.get(d)||Q1(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const m=n.style.animation||"";return n.style.animation=`${m?`${m}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function cl(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||x1())}function x1(){ma(()=>{ho||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),po.clear())})}function e0(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=kl,start:a=Fo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function m(){c&&(g=fl(n,0,1,o,l,r,c)),l||(h=!0)}function _(){c&&cl(n,g),d=!1}return No(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),m(),f(0,1),_}function t0(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,o_(n,s)}}function o_(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 dl;function yi(n){dl=n}function wl(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Gt(n){wl().$$.on_mount.push(n)}function n0(n){wl().$$.after_update.push(n)}function Is(n){wl().$$.on_destroy.push(n)}function pt(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=l_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bs=[],te=[];let ys=[];const Hr=[],r_=Promise.resolve();let Vr=!1;function a_(){Vr||(Vr=!0,r_.then(ga))}function ln(){return a_(),r_}function Qe(n){ys.push(n)}function ye(n){Hr.push(n)}const nr=new Set;let ds=0;function ga(){if(ds!==0)return;const n=dl;do{try{for(;dsn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let Hs;function _a(){return Hs||(Hs=Promise.resolve(),Hs.then(()=>{Hs=null})),Hs}function ts(n,e,t){n.dispatchEvent(l_(`${e?"intro":"outro"}${t}`))}const io=new Set;let ri;function ue(){ri={r:0,c:[],p:ri}}function fe(){ri.r||$e(ri.c),ri=ri.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ri.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function u_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&cl(n,o)}function f(){const{delay:d=0,duration:h=300,easing:g=kl,tick:m=x,css:_}=s||ba;_&&(o=fl(n,0,1,h,d,g,_,a++)),m(0,1);const y=Fo()+d,S=y+h;r&&r.abort(),l=!0,Qe(()=>ts(n,!0,"start")),r=No(C=>{if(l){if(C>=S)return m(1,0),ts(n,!0,"end"),u(),l=!1;if(C>=y){const T=g((C-y)/h);m(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,cl(n),At(s)?(s=s(i),_a().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function va(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=ri;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=kl,tick:h=x,css:g}=s||ba;g&&(o=fl(n,1,0,c,f,d,g));const m=Fo()+f,_=m+c;Qe(()=>ts(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),No(y=>{if(l){if(y>=_)return h(0,1),ts(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=m){const S=d((y-m)/c);h(1-S,S)}}return l})}return At(s)?_a().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&cl(n,o),l=!1)}}}function qe(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&cl(n,u)}function d(g,m){const _=g.b-o;return m*=Math.abs(_),{a:o,b:g.b,d:_,duration:m,start:g.start,end:g.start+m,group:g.group}}function h(g){const{delay:m=0,duration:_=300,easing:y=kl,tick:S=x,css:C}=l||ba,T={start:Fo()+m,b:g};g||(T.group=ri,ri.r+=1),"inert"in n&&(g?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:(C&&(c(),u=fl(n,o,g,_,m,y,C)),g&&S(0,1),r=d(T,_),Qe(()=>ts(n,g,"start")),No($=>{if(a&&$>a.start&&(r=d(a,_),a=null,ts(n,r.b,"start"),C&&(c(),u=fl(n,o,r.b,r.duration,0,y,l.css))),r){if($>=r.end)S(o=r.b,1-o),ts(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if($>=r.start){const O=$-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(g){At(l)?_a().then(()=>{l=l({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),r=a=null}}}function du(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(ue(),L(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),fe())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ga()}if(B1(n)){const s=wl();if(n.then(l=>{yi(s),i(e.then,1,e.value,l),yi(null)},l=>{if(yi(s),i(e.catch,2,e.error,l),yi(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function l0(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function ge(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function rs(n,e){n.d(1),e.delete(n.key)}function Ut(n,e){L(n,1,1,()=>{e.delete(n.key)})}function o0(n,e){n.f(),Ut(n,e)}function vt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const m={};for(;g--;)m[n[g].key]=g;const _=[],y=new Map,S=new Map,C=[];for(g=h;g--;){const M=c(s,l,g),D=t(M);let I=o.get(D);I?i&&C.push(()=>I.p(M,e)):(I=u(D,M),I.c()),y.set(D,_[g]=I),D in m&&S.set(D,Math.abs(g-m[D]))}const T=new Set,$=new Set;function O(M){A(M,1),M.m(r,f),o.set(M.key,M),f=M.first,h--}for(;d&&h;){const M=_[h-1],D=n[d-1],I=M.key,F=D.key;M===D?(f=M.first,d--,h--):y.has(F)?!o.has(I)||T.has(I)?O(M):$.has(F)?d--:S.get(I)>S.get(F)?($.add(I),O(M)):(T.add(F),d--):(a(D,o),d--)}for(;d--;){const M=n[d];y.has(M.key)||a(M,o)}for(;h;)O(_[h-1]);return $e(C),_}function yt(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Pt(n){return typeof n=="object"&&n!==null?n:{}}function he(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function j(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),Qe(()=>{const l=n.$$.on_mount.map(e_).filter(At);n.$$.on_destroy?n.$$.on_destroy.push(...l):$e(l),n.$$.on_mount=[]}),s.forEach(Qe)}function H(n,e){const t=n.$$;t.fragment!==null&&(s0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function r0(n,e){n.$$.dirty[0]===-1&&(bs.push(n),a_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&r0(n,c)),d}):[],u.update(),f=!0,$e(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Z1(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),j(n,e.target,e.anchor),ga()}yi(a)}class ve{constructor(){tr(this,"$$");tr(this,"$$set")}$destroy(){H(this,1),this.$destroy=x}$on(e,t){if(!At(t))return x;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!U1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const a0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(a0);function Nt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function c_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return f_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=x;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,o,r);l?o(g):c=At(g)?g:x},h=s.map((g,m)=>ha(g,_=>{u[m]=_,f&=~(1<{f|=1<{H(u,1)}),fe()}l?(e=Et(l,o(r,a)),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(l){const u=a&4?yt(s,[Pt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function f0(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=yt(s,[a&2&&{params:r[1]},a&4&&Pt(r[2])]);else for(let f=0;f{H(u,1)}),fe()}l?(e=Et(l,o(r,a)),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(l){const u=a&6?yt(s,[a&2&&{params:r[1]},a&4&&Pt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function c0(n){let e,t,i,s;const l=[f0,u0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function pu(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ro=f_(null,function(e){e(pu());const t=()=>{e(pu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});c_(Ro,n=>n.location);const ya=c_(Ro,n=>n.querystring),hu=In(void 0);async function Hi(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ln();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function un(n,e){if(e=gu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return mu(n,e),{update(t){t=gu(t),mu(n,t)}}}function d0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function mu(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||p0(i.currentTarget.getAttribute("href"))})}function gu(n){return n&&typeof n=="string"?{href:n}:n||{}}function p0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function h0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor($,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!$||typeof $=="string"&&($.length<1||$.charAt(0)!="/"&&$.charAt(0)!="*")||typeof $=="object"&&!($ instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:M,keys:D}=d_($);this.path=$,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=M,this._keys=D}match($){if(s){if(typeof s=="string")if($.startsWith(s))$=$.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=$.match(s);if(I&&I[0])$=$.substr(I[0].length)||"/";else return null}}const O=this._pattern.exec($);if(O===null)return null;if(this._keys===!1)return O;const M={};let D=0;for(;D{r.push(new o($,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=pt();async function d(T,$){await ln(),c(T,$)}let h=null,g=null;l&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?h=T.state:h=null},window.addEventListener("popstate",g),n0(()=>{d0(h)}));let m=null,_=null;const y=Ro.subscribe(async T=>{m=T;let $=0;for(;${hu.set(u)});return}t(0,a=null),_=null,hu.set(void 0)});Is(()=>{y(),g&&window.removeEventListener("popstate",g)});function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,C]}class m0 extends ve{constructor(e){super(),be(this,e,h0,c0,me,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let p_;function h_(n){const e=n.pattern.test(p_);_u(n,n.className,e),_u(n,n.inactiveClassName,!e)}function _u(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ro.subscribe(n=>{p_=n.location+(n.querystring?"?"+n.querystring:""),so.map(h_)});function zn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?d_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),h_(i),{destroy(){so.splice(so.indexOf(i),1)}}}const g0="modulepreload",_0=function(n,e){return new URL(n,e).href},bu={},rt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=_0(l,i),l in bu)return;bu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":g0,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})};function Yt(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}class Kn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Kn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Kn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)===null||t===void 0?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((l=(s=(i=this.originalError)===null||i===void 0?void 0:i.cause)===null||s===void 0?void 0:s.message)===null||l===void 0)&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return Object.assign({},this)}}const Fl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function b0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||v0;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}m_=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const yu="pb_auth";class k0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ka(this.token)}get isAdmin(){return lo(this.token).type==="admin"}get isAuthRecord(){return lo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=yu){const i=b0(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(e,t=yu){var i,s;const l={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},o=lo(this.token);o!=null&&o.exp?l.expires=new Date(1e3*o.exp):l.expires=new Date("1970-01-01"),e=Object.assign({},l,e);const r={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let a=vu(t,JSON.stringify(r),e);const u=typeof Blob<"u"?new Blob([a]).size:a.length;if(r.model&&u>4096){r.model={id:(i=r==null?void 0:r.model)===null||i===void 0?void 0:i.id,email:(s=r==null?void 0:r.model)===null||s===void 0?void 0:s.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(r.model[c]=this.model[c]);a=vu(t,JSON.stringify(r),e)}return a}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class g_ extends k0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class as{constructor(e){this.client=e}}class w0 extends as{getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class wa extends as{decode(e){return e}getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(s=>{var l;return s.items=((l=s.items)===null||l===void 0?void 0:l.map(o=>this.decode(o)))||[],s})}getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var s;if(!(!((s=i==null?void 0:i.items)===null||s===void 0)&&s.length))throw new Kn({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(s=>this.decode(s))}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],s=l=>Yt(this,void 0,void 0,function*(){return this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i})});return s(1)}}function Mn(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function ir(n){var e,t;(t=(e=n)._resetAutoRefresh)===null||t===void 0||t.call(e)}class S0 extends wa{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)===s.id&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l;return i&&((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)===e&&((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}authWithPassword(e,t,i,s){return Yt(this,void 0,void 0,function*(){let l={method:"POST",body:{identity:e,password:t}};l=Mn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",l,i,s);const o=l.autoRefreshThreshold;delete l.autoRefreshThreshold,l.autoRefresh||ir(this.client);let r=yield this.client.send(this.baseCrudPath+"/auth-with-password",l);return r=this.authResponse(r),o&&function(u,f,c,d){ir(u);const h=u.beforeSend,g=u.authStore.model,m=u.authStore.onChange((_,y)=>{(!_||(y==null?void 0:y.id)!=(g==null?void 0:g.id)||(y!=null&&y.collectionId||g!=null&&g.collectionId)&&(y==null?void 0:y.collectionId)!=(g==null?void 0:g.collectionId))&&ir(u)});u._resetAutoRefresh=function(){m(),u.beforeSend=h,delete u._resetAutoRefresh},u.beforeSend=(_,y)=>Yt(this,void 0,void 0,function*(){var S;const C=u.authStore.token;if(!((S=y.query)===null||S===void 0)&&S.autoRefresh)return h?h(_,y):{url:_,sendOptions:y};let T=u.authStore.isValid;if(T&&ka(u.authStore.token,f))try{yield c()}catch{T=!1}T||(yield d());const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&C==$[O]&&u.authStore.token){$[O]=u.authStore.token;break}return y.headers=$,h?h(_,y):{url:_,sendOptions:y}})}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},l))),r})}authRefresh(e,t){let i={method:"POST"};return i=Mn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Mn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Mn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}class __ extends as{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentTopics=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}subscribe(e,t){var i;return Yt(this,void 0,void 0,function*(){if(!e)throw new Error("topic must be set.");const s=function(l){const o=l;let r;try{r=JSON.parse(o==null?void 0:o.data)}catch{}t(r||{})};return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e].push(s),this.isConnected?this.subscriptions[e].length===1?yield this.submitSubscriptions():(i=this.eventSource)===null||i===void 0||i.addEventListener(e,s):yield this.connect(),()=>Yt(this,void 0,void 0,function*(){return this.unsubscribeByTopicAndListener(e,s)})})}unsubscribe(e){var t;return Yt(this,void 0,void 0,function*(){if(this.hasSubscriptionListeners(e)){if(e){for(let i of this.subscriptions[e])(t=this.eventSource)===null||t===void 0||t.removeEventListener(e,i);delete this.subscriptions[e]}else this.subscriptions={};this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect()}})}unsubscribeByPrefix(e){var t;return Yt(this,void 0,void 0,function*(){let i=!1;for(let s in this.subscriptions)if(s.startsWith(e)){i=!0;for(let l of this.subscriptions[s])(t=this.eventSource)===null||t===void 0||t.removeEventListener(s,l);delete this.subscriptions[s]}i&&(this.hasSubscriptionListeners()?yield this.submitSubscriptions():this.disconnect())})}unsubscribeByTopicAndListener(e,t){var i;return Yt(this,void 0,void 0,function*(){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)return;let s=!1;for(let l=this.subscriptions[e].length-1;l>=0;l--)this.subscriptions[e][l]===t&&(s=!0,delete this.subscriptions[e][l],this.subscriptions[e].splice(l,1),(i=this.eventSource)===null||i===void 0||i.removeEventListener(e,t));s&&(this.subscriptions[e].length||delete this.subscriptions[e],this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect())})}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!(!((t=this.subscriptions[e])===null||t===void 0)&&t.length);for(let s in this.subscriptions)if(!((i=this.subscriptions[s])===null||i===void 0)&&i.length)return!0;return!1}submitSubscriptions(){return Yt(this,void 0,void 0,function*(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},query:{requestKey:this.getSubscriptionsCancelKey()}}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getNonEmptySubscriptionTopics(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}connect(){return Yt(this,void 0,void 0,function*(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(()=>Yt(this,void 0,void 0,function*(){let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,yield this.submitSubscriptions()})).then(()=>{for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionTopics();if(e.length!=this.lastSentTopics.length)return!0;for(const t of e)if(!this.lastSentTopics.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Kn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)===null||t===void 0||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class T0 extends wa{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}subscribeOne(e,t){return Yt(this,void 0,void 0,function*(){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t)})}subscribe(e,t){return Yt(this,void 0,void 0,function*(){if(typeof e=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),this.client.realtime.subscribe(this.collectionIdOrName,e);if(!t)throw new Error("Missing subscription callback.");if(e==="")throw new Error("Missing topic.");let i=this.collectionIdOrName;return e!=="*"&&(i+="/"+e),this.client.realtime.subscribe(i,t)})}unsubscribe(e){return Yt(this,void 0,void 0,function*(){return e==="*"?this.client.realtime.unsubscribe(this.collectionIdOrName):e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)})}getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}getList(e=1,t=30,i){return super.getList(e,t,i)}getFirstListItem(e,t){return super.getFirstListItem(e,t)}getOne(e,t){return super.getOne(e,t)}create(e,t){return super.create(e,t)}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o,r;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)!==(s==null?void 0:s.id)||((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)===null||r===void 0?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)!==e||((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}authWithPassword(e,t,i,s){let l={method:"POST",body:{identity:e,password:t}};return l=Mn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/auth-with-password",l).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:s,createData:l}};return a=Mn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){return Yt(this,void 0,void 0,function*(){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(yield this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new Kn(new Error(`Missing or invalid provider "${t.provider}".`));const s=this.client.buildUrl("/api/oauth2-redirect"),l=new __(this.client);let o=null;function r(){o==null||o.close(),l.unsubscribe()}return t.urlCallback||(o=ku(void 0)),new Promise((a,u)=>Yt(this,void 0,void 0,function*(){var f;try{yield l.subscribe("@oauth2",g=>Yt(this,void 0,void 0,function*(){const m=l.clientId;try{if(!g.state||m!==g.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const y=yield this.authWithOAuth2Code(i.name,g.code,i.codeVerifier,s,t.createData,_);a(y)}catch(_){u(new Kn(_))}r()}));const c={state:l.clientId};!((f=t.scopes)===null||f===void 0)&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+s,c);yield(t.urlCallback||function(g){o?o.location.href=g:o=ku(g)})(d)}catch(c){r(),u(new Kn(c))}}))})}authRefresh(e,t){let i={method:"POST"};return i=Mn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(s=>this.authResponse(s))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Mn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Mn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=Mn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=Mn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>!0)}requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=Mn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=Mn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>!0)}listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function ku(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Kn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class C0 extends wa{get baseCrudPath(){return"/api/collections"}import(e,t=!1,i){return Yt(this,void 0,void 0,function*(){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)})}}class $0 extends as{getRequestsList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs/requests",i)}getRequest(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/requests/"+encodeURIComponent(e),t)}getRequestsStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/requests/stats",e)}}class M0 extends as{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class O0 extends as{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildUrl(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class E0 extends as{getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}const D0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];class qo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new g_,this.admins=new S0(this),this.collections=new C0(this),this.files=new O0(this),this.logs=new $0(this),this.settings=new w0(this),this.realtime=new __(this),this.health=new M0(this),this.backups=new E0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new T0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var t;let i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i}send(e,t){return Yt(this,void 0,void 0,function*(){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const s=Object.assign({},yield this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=this.serializeQueryParams(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(s=>Yt(this,void 0,void 0,function*(){let l={};try{l=yield s.json()}catch{}if(this.afterSend&&(l=yield this.afterSend(s,l)),s.status>=400)throw new Kn({url:s.url,status:s.status,data:l});return l})).catch(s=>{throw new Kn(s)})})}initSendOptions(e,t){(t=Object.assign({method:"GET"},t)).query=t.query||{},t.body=this.convertToFormDataIfNeeded(t.body);for(let i in t)D0.includes(i)||(t.query[i]=t[i],delete t[i]);if(t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const s=new AbortController;this.cancelControllers[i]=s,t.signal=s.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const s=Array.isArray(e[i])?e[i]:[e[i]];for(let l of s)t.append(i,l)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let s of i)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(const o of s)t.push(l+"="+encodeURIComponent(o));else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")}}class us extends Error{}class A0 extends us{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class I0 extends us{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class L0 extends us{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Qs extends us{}class b_ extends us{constructor(e){super(`Invalid unit ${e}`)}}class Un extends us{}class Ei extends us{constructor(){super("Zone is an abstract class")}}const Ie="numeric",ni="short",Dn="long",zr={year:Ie,month:Ie,day:Ie},v_={year:Ie,month:ni,day:Ie},P0={year:Ie,month:ni,day:Ie,weekday:ni},y_={year:Ie,month:Dn,day:Ie},k_={year:Ie,month:Dn,day:Ie,weekday:Dn},w_={hour:Ie,minute:Ie},S_={hour:Ie,minute:Ie,second:Ie},T_={hour:Ie,minute:Ie,second:Ie,timeZoneName:ni},C_={hour:Ie,minute:Ie,second:Ie,timeZoneName:Dn},$_={hour:Ie,minute:Ie,hourCycle:"h23"},M_={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23"},O_={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:ni},E_={hour:Ie,minute:Ie,second:Ie,hourCycle:"h23",timeZoneName:Dn},D_={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie},A_={year:Ie,month:Ie,day:Ie,hour:Ie,minute:Ie,second:Ie},I_={year:Ie,month:ni,day:Ie,hour:Ie,minute:Ie},L_={year:Ie,month:ni,day:Ie,hour:Ie,minute:Ie,second:Ie},F0={year:Ie,month:ni,day:Ie,weekday:ni,hour:Ie,minute:Ie},P_={year:Ie,month:Dn,day:Ie,hour:Ie,minute:Ie,timeZoneName:ni},F_={year:Ie,month:Dn,day:Ie,hour:Ie,minute:Ie,second:Ie,timeZoneName:ni},N_={year:Ie,month:Dn,day:Ie,weekday:Dn,hour:Ie,minute:Ie,timeZoneName:Dn},R_={year:Ie,month:Dn,day:Ie,weekday:Dn,hour:Ie,minute:Ie,second:Ie,timeZoneName:Dn};function st(n){return typeof n>"u"}function ns(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function N0(n){return typeof n=="string"}function R0(n){return Object.prototype.toString.call(n)==="[object Date]"}function q_(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function q0(n){return Array.isArray(n)?n:[n]}function wu(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function j0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function $s(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return jo(n)&&n>=e&&n<=t}function H0(n,e){return n-e*Math.floor(n/e)}function Wt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ai(n){if(!(st(n)||n===null||n===""))return parseInt(n,10)}function Ui(n){if(!(st(n)||n===null||n===""))return parseFloat(n)}function Sa(n){if(!(st(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Ta(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Sl(n){return n%4===0&&(n%100!==0||n%400===0)}function nl(n){return Sl(n)?366:365}function mo(n,e){const t=H0(e-1,12)+1,i=n+(e-t)/12;return t===2?Sl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ca(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function go(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Br(n){return n>99?n:n>60?1900+n:2e3+n}function j_(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ho(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function H_(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Un(`Invalid unit value ${n}`);return e}function _o(n,e){const t={};for(const i in n)if($s(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=H_(s)}return t}function il(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Wt(t,2)}:${Wt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Wt(t,2)}${Wt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return j0(n,["hour","minute","second","millisecond"])}const V_=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,V0=["January","February","March","April","May","June","July","August","September","October","November","December"],z_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],z0=["J","F","M","A","M","J","J","A","S","O","N","D"];function B_(n){switch(n){case"narrow":return[...z0];case"short":return[...z_];case"long":return[...V0];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const U_=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],W_=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],B0=["M","T","W","T","F","S","S"];function Y_(n){switch(n){case"narrow":return[...B0];case"short":return[...W_];case"long":return[...U_];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const K_=["AM","PM"],U0=["Before Christ","Anno Domini"],W0=["BC","AD"],Y0=["B","A"];function J_(n){switch(n){case"narrow":return[...Y0];case"short":return[...W0];case"long":return[...U0];default:return null}}function K0(n){return K_[n.hour<12?0:1]}function J0(n,e){return Y_(e)[n.weekday-1]}function G0(n,e){return B_(e)[n.month-1]}function Z0(n,e){return J_(e)[n.year<0?0:1]}function X0(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Su(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Q0={D:zr,DD:v_,DDD:y_,DDDD:k_,t:w_,tt:S_,ttt:T_,tttt:C_,T:$_,TT:M_,TTT:O_,TTTT:E_,f:D_,ff:I_,fff:P_,ffff:N_,F:A_,FF:L_,FFF:F_,FFFF:R_};class wn{static create(e,t={}){return new wn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return Q0[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Wt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?K0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?G0(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?J0(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=wn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?Z0(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return Su(wn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=wn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Su(l,s(r))}}class ei{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Tl{get type(){throw new Ei}get name(){throw new Ei}get ianaName(){return this.name}get isUniversal(){throw new Ei}offsetName(e,t){throw new Ei}formatOffset(e,t){throw new Ei}offset(e){throw new Ei}equals(e){throw new Ei}get isValid(){throw new Ei}}let sr=null;class $a extends Tl{static get instance(){return sr===null&&(sr=new $a),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return j_(e,t,i)}formatOffset(e,t){return il(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let oo={};function x0(n){return oo[n]||(oo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),oo[n]}const ev={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function tv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function nv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let lr=null;class gn extends Tl{static get utcInstance(){return lr===null&&(lr=new gn(0)),lr}static instance(e){return e===0?gn.utcInstance:new gn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new gn(Ho(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${il(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${il(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return il(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class iv extends Tl{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ii(n,e){if(st(n)||n===null)return e;if(n instanceof Tl)return n;if(N0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?gn.utcInstance:gn.parseSpecifier(t)||Si.create(n)}else return ns(n)?gn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new iv(n)}let Tu=()=>Date.now(),Cu="system",$u=null,Mu=null,Ou=null,Eu;class Xt{static get now(){return Tu}static set now(e){Tu=e}static set defaultZone(e){Cu=e}static get defaultZone(){return Ii(Cu,$a.instance)}static get defaultLocale(){return $u}static set defaultLocale(e){$u=e}static get defaultNumberingSystem(){return Mu}static set defaultNumberingSystem(e){Mu=e}static get defaultOutputCalendar(){return Ou}static set defaultOutputCalendar(e){Ou=e}static get throwOnInvalid(){return Eu}static set throwOnInvalid(e){Eu=e}static resetCaches(){Lt.resetCache(),Si.resetCache()}}let Du={};function sv(n,e={}){const t=JSON.stringify([n,e]);let i=Du[t];return i||(i=new Intl.ListFormat(n,e),Du[t]=i),i}let Ur={};function Wr(n,e={}){const t=JSON.stringify([n,e]);let i=Ur[t];return i||(i=new Intl.DateTimeFormat(n,e),Ur[t]=i),i}let Yr={};function lv(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.NumberFormat(n,e),Yr[t]=i),i}let Kr={};function ov(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Kr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Kr[s]=l),l}let xs=null;function rv(){return xs||(xs=new Intl.DateTimeFormat().resolvedOptions().locale,xs)}function av(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Wr(n).resolvedOptions()}catch{t=Wr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function uv(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function fv(n){const e=[];for(let t=1;t<=12;t++){const i=Be.utc(2016,t,1);e.push(n(i))}return e}function cv(n){const e=[];for(let t=1;t<=7;t++){const i=Be.utc(2016,11,13+t);e.push(n(i))}return e}function Rl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function dv(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class pv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=lv(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Ta(e,3);return Wt(t,this.padTo)}}}class hv{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Si.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Be.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Wr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class mv{constructor(e,t,i){this.opts={style:"long",...i},!t&&q_()&&(this.rtf=ov(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):X0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Lt{static fromOpts(e){return Lt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Xt.defaultLocale,o=l||(s?"en-US":rv()),r=t||Xt.defaultNumberingSystem,a=i||Xt.defaultOutputCalendar;return new Lt(o,r,a,l)}static resetCache(){xs=null,Ur={},Yr={},Kr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Lt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=av(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=uv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=dv(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Lt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Rl(this,e,i,B_,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=fv(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Rl(this,e,i,Y_,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=cv(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Rl(this,void 0,e,()=>K_,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Be.utc(2016,11,13,9),Be.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Rl(this,e,t,J_,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Be.utc(-40,1,1),Be.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new pv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new hv(e,this.intl,t)}relFormatter(e={}){return new mv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return sv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ls(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ps(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function G_(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(g||h&&f)?-h:h;return[{years:d(Ui(t)),months:d(Ui(i)),weeks:d(Ui(s)),days:d(Ui(l)),hours:d(Ui(o)),minutes:d(Ui(r)),seconds:d(Ui(a),a==="-0"),milliseconds:d(Sa(u),c)}]}const Ov={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ea(n,e,t,i,s,l,o){const r={year:e.length===2?Br(Ai(e)):Ai(e),month:z_.indexOf(t)+1,day:Ai(i),hour:Ai(s),minute:Ai(l)};return o&&(r.second=Ai(o)),n&&(r.weekday=n.length>3?U_.indexOf(n)+1:W_.indexOf(n)+1),r}const Ev=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Dv(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Ea(e,s,i,t,l,o,r);let h;return a?h=Ov[a]:u?h=0:h=Ho(f,c),[d,new gn(h)]}function Av(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Iv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Lv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Pv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Au(n){const[,e,t,i,s,l,o,r]=n;return[Ea(e,s,i,t,l,o,r),gn.utcInstance]}function Fv(n){const[,e,t,i,s,l,o,r]=n;return[Ea(e,r,t,i,s,l,o),gn.utcInstance]}const Nv=Ls(_v,Oa),Rv=Ls(bv,Oa),qv=Ls(vv,Oa),jv=Ls(X_),x_=Ps(Tv,Ns,Cl,$l),Hv=Ps(yv,Ns,Cl,$l),Vv=Ps(kv,Ns,Cl,$l),zv=Ps(Ns,Cl,$l);function Bv(n){return Fs(n,[Nv,x_],[Rv,Hv],[qv,Vv],[jv,zv])}function Uv(n){return Fs(Av(n),[Ev,Dv])}function Wv(n){return Fs(n,[Iv,Au],[Lv,Au],[Pv,Fv])}function Yv(n){return Fs(n,[$v,Mv])}const Kv=Ps(Ns);function Jv(n){return Fs(n,[Cv,Kv])}const Gv=Ls(wv,Sv),Zv=Ls(Q_),Xv=Ps(Ns,Cl,$l);function Qv(n){return Fs(n,[Gv,x_],[Zv,Xv])}const xv="Invalid Duration",eb={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},ey={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...eb},qn=146097/400,hs=146097/4800,ty={years:{quarters:4,months:12,weeks:qn/7,days:qn,hours:qn*24,minutes:qn*24*60,seconds:qn*24*60*60,milliseconds:qn*24*60*60*1e3},quarters:{months:3,weeks:qn/28,days:qn/4,hours:qn*24/4,minutes:qn*24*60/4,seconds:qn*24*60*60/4,milliseconds:qn*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...eb},Zi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ny=Zi.slice(0).reverse();function Wi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new at(i)}function iy(n){return n<0?Math.floor(n):Math.ceil(n)}function tb(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?iy(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function sy(n,e){ny.reduce((t,i)=>st(e[i])?t:(t&&tb(n,e,t,e,i),i),null)}class at{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Lt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?ty:ey,this.isLuxonDuration=!0}static fromMillis(e,t){return at.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Un(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new at({values:_o(e,at.normalizeUnit),loc:Lt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ns(e))return at.fromMillis(e);if(at.isDuration(e))return e;if(typeof e=="object")return at.fromObject(e);throw new Un(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=Yv(e);return i?at.fromObject(i,t):at.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Jv(e);return i?at.fromObject(i,t):at.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the Duration is invalid");const i=e instanceof ei?e:new ei(e,t);if(Xt.throwOnInvalid)throw new L0(i);return new at({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new b_(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?wn.create(this.loc,i).formatDurationFromString(this,e):xv}toHuman(e={}){const t=Zi.map(i=>{const s=this.values[i];return st(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ta(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e),i={};for(const s of Zi)($s(t.values,s)||$s(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Wi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=H_(e(this.values[i],i));return Wi(this,{values:t},!0)}get(e){return this[at.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,..._o(e,at.normalizeUnit)};return Wi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Wi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return sy(this.matrix,e),Wi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>at.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Zi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;ns(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)Zi.indexOf(u)>Zi.indexOf(o)&&tb(this.matrix,s,u,t,o)}else ns(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Wi(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Wi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Zi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Vs="Invalid Interval";function ly(n,e){return!n||!n.isValid?Rt.invalid("missing or invalid start"):!e||!e.isValid?Rt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Rt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Us).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Rt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=at.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Rt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Rt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Rt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Rt.fromDateTimes(t,a.time)),t=null);return Rt.merge(s)}difference(...e){return Rt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Vs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Vs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Vs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Vs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):at.invalid(this.invalidReason)}mapEndpoints(e){return Rt.fromDateTimes(e(this.s),e(this.e))}}class ql{static hasDST(e=Xt.defaultZone){const t=Be.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Si.isValidZone(e)}static normalizeZone(e){return Ii(e,Xt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Lt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Lt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Lt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Lt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Lt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Lt.create(t,null,"gregory").eras(e)}static features(){return{relative:q_()}}}function Iu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(at.fromMillis(i).as("days"))}function oy(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=Iu(r,a);return(u-u%7)/7}],["days",Iu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function ry(n,e,t,i){let[s,l,o,r]=oy(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?at.fromMillis(a,i).shiftTo(...u).plus(f):f}const Da={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Lu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ay=Da.hanidec.replace(/[\[|\]]/g,"").split("");function uy(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Qn({numberingSystem:n},e=""){return new RegExp(`${Da[n||"latn"]}${e}`)}const fy="missing Intl.DateTimeFormat.formatToParts support";function ut(n,e=t=>t){return{regex:n,deser:([t])=>e(uy(t))}}const cy=String.fromCharCode(160),nb=`[ ${cy}]`,ib=new RegExp(nb,"g");function dy(n){return n.replace(/\./g,"\\.?").replace(ib,nb)}function Pu(n){return n.replace(/\./g,"").replace(ib," ").toLowerCase()}function xn(n,e){return n===null?null:{regex:RegExp(n.map(dy).join("|")),deser:([t])=>n.findIndex(i=>Pu(t)===Pu(i))+e}}function Fu(n,e){return{regex:n,deser:([,t,i])=>Ho(t,i),groups:e}}function or(n){return{regex:n,deser:([e])=>e}}function py(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hy(n,e){const t=Qn(e),i=Qn(e,"{2}"),s=Qn(e,"{3}"),l=Qn(e,"{4}"),o=Qn(e,"{6}"),r=Qn(e,"{1,2}"),a=Qn(e,"{1,3}"),u=Qn(e,"{1,6}"),f=Qn(e,"{1,9}"),c=Qn(e,"{2,4}"),d=Qn(e,"{4,6}"),h=_=>({regex:RegExp(py(_.val)),deser:([y])=>y,literal:!0}),m=(_=>{if(n.literal)return h(_);switch(_.val){case"G":return xn(e.eras("short",!1),0);case"GG":return xn(e.eras("long",!1),0);case"y":return ut(u);case"yy":return ut(c,Br);case"yyyy":return ut(l);case"yyyyy":return ut(d);case"yyyyyy":return ut(o);case"M":return ut(r);case"MM":return ut(i);case"MMM":return xn(e.months("short",!0,!1),1);case"MMMM":return xn(e.months("long",!0,!1),1);case"L":return ut(r);case"LL":return ut(i);case"LLL":return xn(e.months("short",!1,!1),1);case"LLLL":return xn(e.months("long",!1,!1),1);case"d":return ut(r);case"dd":return ut(i);case"o":return ut(a);case"ooo":return ut(s);case"HH":return ut(i);case"H":return ut(r);case"hh":return ut(i);case"h":return ut(r);case"mm":return ut(i);case"m":return ut(r);case"q":return ut(r);case"qq":return ut(i);case"s":return ut(r);case"ss":return ut(i);case"S":return ut(a);case"SSS":return ut(s);case"u":return or(f);case"uu":return or(r);case"uuu":return ut(t);case"a":return xn(e.meridiems(),0);case"kkkk":return ut(l);case"kk":return ut(c,Br);case"W":return ut(r);case"WW":return ut(i);case"E":case"c":return ut(t);case"EEE":return xn(e.weekdays("short",!1,!1),1);case"EEEE":return xn(e.weekdays("long",!1,!1),1);case"ccc":return xn(e.weekdays("short",!0,!1),1);case"cccc":return xn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Fu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Fu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return or(/[a-z_+-/]{1,256}?/i);default:return h(_)}})(n)||{invalidReason:fy};return m.token=n,m}const my={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function gy(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=my[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function _y(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function by(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if($s(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function vy(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return st(n.z)||(t=Si.create(n.z)),st(n.Z)||(t||(t=new gn(n.Z)),i=n.Z),st(n.q)||(n.M=(n.q-1)*3+1),st(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),st(n.u)||(n.S=Sa(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let rr=null;function yy(){return rr||(rr=Be.fromMillis(1555555555555)),rr}function ky(n,e){if(n.literal)return n;const t=wn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=wn.create(e,t).formatDateTimeParts(yy()).map(o=>gy(o,e,t));return l.includes(void 0)?n:l}function wy(n,e){return Array.prototype.concat(...n.map(t=>ky(t,e)))}function sb(n,e,t){const i=wy(wn.parseFormat(t),n),s=i.map(o=>hy(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=_y(s),a=RegExp(o,"i"),[u,f]=by(e,a,r),[c,d,h]=f?vy(f):[null,null,void 0];if($s(f,"a")&&$s(f,"H"))throw new Qs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function Sy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=sb(n,e,t);return[i,s,l,o]}const lb=[0,31,59,90,120,151,181,212,243,273,304,334],ob=[0,31,60,91,121,152,182,213,244,274,305,335];function Yn(n,e){return new ei("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function rb(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function ab(n,e,t){return t+(Sl(n)?ob:lb)[e-1]}function ub(n,e){const t=Sl(n)?ob:lb,i=t.findIndex(l=>lgo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function Nu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=rb(e,1,4),l=nl(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=nl(r)):o>l?(r=e+1,o-=nl(e)):r=e;const{month:a,day:u}=ub(r,o);return{year:r,month:a,day:u,...Vo(n)}}function ar(n){const{year:e,month:t,day:i}=n,s=ab(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function Ru(n){const{year:e,ordinal:t}=n,{month:i,day:s}=ub(e,t);return{year:e,month:i,day:s,...Vo(n)}}function Ty(n){const e=jo(n.weekYear),t=ki(n.weekNumber,1,go(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Yn("weekday",n.weekday):Yn("week",n.week):Yn("weekYear",n.weekYear)}function Cy(n){const e=jo(n.year),t=ki(n.ordinal,1,nl(n.year));return e?t?!1:Yn("ordinal",n.ordinal):Yn("year",n.year)}function fb(n){const e=jo(n.year),t=ki(n.month,1,12),i=ki(n.day,1,mo(n.year,n.month));return e?t?i?!1:Yn("day",n.day):Yn("month",n.month):Yn("year",n.year)}function cb(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ki(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ki(t,0,59),r=ki(i,0,59),a=ki(s,0,999);return l?o?r?a?!1:Yn("millisecond",s):Yn("second",i):Yn("minute",t):Yn("hour",e)}const ur="Invalid DateTime",qu=864e13;function jl(n){return new ei("unsupported zone",`the zone "${n.name}" is not supported`)}function fr(n){return n.weekData===null&&(n.weekData=Jr(n.c)),n.weekData}function zs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Be({...t,...e,old:t})}function db(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function ju(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ro(n,e,t){return db(Ca(n),e,t)}function Hu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,mo(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=at.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Ca(l);let[a,u]=db(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Bs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Be.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Be.invalid(new ei("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Hl(n,e,t=!0){return n.isValid?wn.create(Lt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function cr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Wt(n.c.year,t?6:4),e?(i+="-",i+=Wt(n.c.month),i+="-",i+=Wt(n.c.day)):(i+=Wt(n.c.month),i+=Wt(n.c.day)),i}function Vu(n,e,t,i,s,l){let o=Wt(n.c.hour);return e?(o+=":",o+=Wt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Wt(n.c.minute),(n.c.second!==0||!t)&&(o+=Wt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Wt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Wt(Math.trunc(-n.o/60)),o+=":",o+=Wt(Math.trunc(-n.o%60))):(o+="+",o+=Wt(Math.trunc(n.o/60)),o+=":",o+=Wt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const pb={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},$y={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},My={ordinal:1,hour:0,minute:0,second:0,millisecond:0},hb=["year","month","day","hour","minute","second","millisecond"],Oy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ey=["year","ordinal","hour","minute","second","millisecond"];function zu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new b_(n);return e}function Bu(n,e){const t=Ii(e.zone,Xt.defaultZone),i=Lt.fromObject(e),s=Xt.now();let l,o;if(st(n.year))l=s;else{for(const u of hb)st(n[u])&&(n[u]=pb[u]);const r=fb(n)||cb(n);if(r)return Be.invalid(r);const a=t.offset(s);[l,o]=ro(n,a,t)}return new Be({ts:l,zone:t,loc:i,o})}function Uu(n,e,t){const i=st(t.round)?!0:t.round,s=(o,r)=>(o=Ta(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Wu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Be{constructor(e){const t=e.zone||Xt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ei("invalid input"):null)||(t.isValid?null:jl(t));this.ts=st(e.ts)?Xt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=ju(this.ts,r),i=Number.isNaN(s.year)?new ei("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Lt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Be({})}static local(){const[e,t]=Wu(arguments),[i,s,l,o,r,a,u]=t;return Bu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Wu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=gn.utcInstance,Bu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=R0(e)?e.valueOf():NaN;if(Number.isNaN(i))return Be.invalid("invalid input");const s=Ii(t.zone,Xt.defaultZone);return s.isValid?new Be({ts:i,zone:s,loc:Lt.fromObject(t)}):Be.invalid(jl(s))}static fromMillis(e,t={}){if(ns(e))return e<-qu||e>qu?Be.invalid("Timestamp out of range"):new Be({ts:e,zone:Ii(t.zone,Xt.defaultZone),loc:Lt.fromObject(t)});throw new Un(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ns(e))return new Be({ts:e*1e3,zone:Ii(t.zone,Xt.defaultZone),loc:Lt.fromObject(t)});throw new Un("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ii(t.zone,Xt.defaultZone);if(!i.isValid)return Be.invalid(jl(i));const s=Xt.now(),l=st(t.specificOffset)?i.offset(s):t.specificOffset,o=_o(e,zu),r=!st(o.ordinal),a=!st(o.year),u=!st(o.month)||!st(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Lt.fromObject(t);if((f||r)&&c)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Qs("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,m,_=ju(s,l);h?(g=Oy,m=$y,_=Jr(_)):r?(g=Ey,m=My,_=ar(_)):(g=hb,m=pb);let y=!1;for(const D of g){const I=o[D];st(I)?y?o[D]=m[D]:o[D]=_[D]:y=!0}const S=h?Ty(o):r?Cy(o):fb(o),C=S||cb(o);if(C)return Be.invalid(C);const T=h?Nu(o):r?Ru(o):o,[$,O]=ro(T,l,i),M=new Be({ts:$,zone:i,o:O,loc:d});return o.weekday&&f&&e.weekday!==M.weekday?Be.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${M.toISO()}`):M}static fromISO(e,t={}){const[i,s]=Bv(e);return Bs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=Uv(e);return Bs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=Wv(e);return Bs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(st(e)||st(t))throw new Un("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Lt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Sy(o,e,t);return f?Be.invalid(f):Bs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Be.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Qv(e);return Bs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the DateTime is invalid");const i=e instanceof ei?e:new ei(e,t);if(Xt.throwOnInvalid)throw new A0(i);return new Be({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?fr(this).weekYear:NaN}get weekNumber(){return this.isValid?fr(this).weekNumber:NaN}get weekday(){return this.isValid?fr(this).weekday:NaN}get ordinal(){return this.isValid?ar(this.c).ordinal:NaN}get monthShort(){return this.isValid?ql.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ql.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ql.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ql.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Sl(this.year)}get daysInMonth(){return mo(this.year,this.month)}get daysInYear(){return this.isValid?nl(this.year):NaN}get weeksInWeekYear(){return this.isValid?go(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=wn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(gn.instance(e),t)}toLocal(){return this.setZone(Xt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ii(e,Xt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=ro(o,l,e)}return zs(this,{ts:s,zone:e})}else return Be.invalid(jl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return zs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_o(e,zu),i=!st(t.weekYear)||!st(t.weekNumber)||!st(t.weekday),s=!st(t.ordinal),l=!st(t.year),o=!st(t.month)||!st(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Qs("Can't mix ordinal dates with month/day");let u;i?u=Nu({...Jr(this.c),...t}):st(t.ordinal)?(u={...this.toObject(),...t},st(t.day)&&(u.day=Math.min(mo(u.year,u.month),u.day))):u=Ru({...ar(this.c),...t});const[f,c]=ro(u,this.o,this.zone);return zs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e);return zs(this,Hu(this,t))}minus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e).negate();return zs(this,Hu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=at.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?wn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ur}toLocaleString(e=zr,t={}){return this.isValid?wn.create(this.loc.clone(t),e).formatDateTime(this):ur}toLocaleParts(e={}){return this.isValid?wn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=cr(this,o);return r+="T",r+=Vu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?cr(this,e==="extended"):null}toISOWeekDate(){return Hl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Vu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Hl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Hl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ur}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return at.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=q0(t).map(at.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=ry(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Be.now(),e,t)}until(e){return this.isValid?Rt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Be.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Be.isDateTime))throw new Un("max requires all arguments be DateTimes");return wu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Lt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return sb(o,e,t)}static fromStringExplain(e,t,i={}){return Be.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return zr}static get DATE_MED(){return v_}static get DATE_MED_WITH_WEEKDAY(){return P0}static get DATE_FULL(){return y_}static get DATE_HUGE(){return k_}static get TIME_SIMPLE(){return w_}static get TIME_WITH_SECONDS(){return S_}static get TIME_WITH_SHORT_OFFSET(){return T_}static get TIME_WITH_LONG_OFFSET(){return C_}static get TIME_24_SIMPLE(){return $_}static get TIME_24_WITH_SECONDS(){return M_}static get TIME_24_WITH_SHORT_OFFSET(){return O_}static get TIME_24_WITH_LONG_OFFSET(){return E_}static get DATETIME_SHORT(){return D_}static get DATETIME_SHORT_WITH_SECONDS(){return A_}static get DATETIME_MED(){return I_}static get DATETIME_MED_WITH_SECONDS(){return L_}static get DATETIME_MED_WITH_WEEKDAY(){return F0}static get DATETIME_FULL(){return P_}static get DATETIME_FULL_WITH_SECONDS(){return F_}static get DATETIME_HUGE(){return N_}static get DATETIME_HUGE_WITH_SECONDS(){return R_}}function Us(n){if(Be.isDateTime(n))return n;if(n&&n.valueOf&&ns(n.valueOf()))return Be.fromJSDate(n);if(n&&typeof n=="object")return Be.fromObject(n);throw new Un(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Dy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Ay=[".mp4",".avi",".mov",".3gp",".wmv"],Iy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Ly=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class V{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||V.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return V.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!V.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!V.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){V.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=V.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!V.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!V.isObject(l)&&!Array.isArray(l)||!V.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!V.isObject(s)&&!Array.isArray(s)||!V.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):V.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||V.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||V.isObject(e)&&Object.keys(e).length>0)&&V.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return V.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),V.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],s=t.length>1?t.trim():t;for(let l of e)l=typeof l=="string"?l.trim():"",V.isEmpty(l)||i.push(l.replaceAll(s,"\\"+s));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Be.fromFormat(e,i,{zone:"UTC"})}return Be.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return V.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",V.download(i,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return!!Dy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Ay.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Iy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Ly.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return V.hasImageExtension(e)?"image":V.hasDocumentExtension(e)?"document":V.hasVideoExtension(e)?"video":V.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(V.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)V.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):V.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,h,g;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",s=(e==null?void 0:e.type)==="view",l={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(l.username="username123",l.verified=!1,l.emailVisibility=!0,l.email="test@example.com"),(!s||V.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(l.created="2022-01-01 01:00:00.123Z"),(!s||V.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(l.updated="2022-01-01 23:59:59.456Z");for(const m of t){let _=null;m.type==="number"?_=123:m.type==="date"?_="2022-01-01 10:00:00.123Z":m.type==="bool"?_=!0:m.type==="email"?_="test@example.com":m.type==="url"?_="https://example.com":m.type==="json"?_="JSON":m.type==="file"?(_="filename.jpg",((f=m.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):m.type==="select"?(_=(d=(c=m.options)==null?void 0:c.values)==null?void 0:d[0],((h=m.options)==null?void 0:h.maxSelect)!==1&&(_=[_])):m.type==="relation"?(_="RELATION_RECORD_ID",((g=m.options)==null?void 0:g.maxSelect)!==1&&(_=[_])):_="test",l[m.name]=_}return l}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!V.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=V.isObject(u)&&V.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample direction | code fullscreen",paste_postprocess:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,h=f.result.split(",")[1],g=d.create(c,u,h);d.add(g),s(g.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"ltr"),tinymce.activeEditor.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),tinymce.activeEditor.execCommand("mceDirectionRTL")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=V.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){let r=V.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(V.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?V.plainText(e):e,V.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return V.truncate(JSON.stringify(e))||t}catch{return t}return""+e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of V.extractColumnsFromQuery(e.options.query))V.pushUnique(i,t+l);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)V.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!V.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let h of r){h=h.trim().replaceAll("{PB_TEMP}",",");const m=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(h);if((m==null?void 0:m.length)!=4)continue;const _=(c=(f=m[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");_&&t.columns.push({name:_,collate:m[2]||"",sort:((d=m[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+V.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}}const zo=In([]);function bo(n,e=4e3){return Bo(n,"info",e)}function jt(n,e=3e3){return Bo(n,"success",e)}function ls(n,e=4500){return Bo(n,"error",e)}function Py(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(()=>{mb(i)},t)};zo.update(s=>(Ia(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function mb(n){zo.update(e=>(Ia(e,n),e))}function Aa(){zo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const $i=In({});function en(n){$i.set(n||{})}function ci(n){$i.update(e=>(j.deleteByPath(e,n),e))}const La=In({});function Gr(n){La.set(n||{})}const ii=In([]),Ti=In({}),vo=In(!1),gb=In({});function Fy(n){ii.update(e=>{const t=j.findByKey(e,"id",n);return t?Ti.set(t):e.length&&Ti.set(e[0]),e})}function Ny(n){Ti.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ii.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Pa(),j.sortCollections(e)))}function Ry(n){ii.update(e=>(j.removeByKey(e,"id",n.id),Ti.update(t=>t.id===n.id?e[0]:t),Pa(),e))}async function qy(n=null){vo.set(!0);try{let e=await de.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),ii.set(e);const t=n&&j.findByKey(e,"id",n);t?Ti.set(t):e.length&&Ti.set(e[0]),Pa()}catch(e){de.error(e)}vo.set(!1)}function Pa(){gb.update(n=>(ii.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const dr="pb_admin_file_token";qo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Hi("/login")};qo.prototype.error=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)||{},l=s.message||n.message||t;if(e&&l&&ls(l),j.isEmpty(s.data)||en(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Hi("/")};qo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=W1(gb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(dr)||"";return(!t||ka(t,10))&&(t&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(dr,t),this._adminFileTokenRequest=null),t};class jy extends g_{save(e,t){super.save(e,t),t&&!t.collectionId&&Gr(t)}clear(){super.clear(),Gr(null)}}const de=new qo("../",new jy("pb_admin_auth"));de.authStore.model&&!de.authStore.model.collectionId&&Gr(de.authStore.model);const Hy=n=>({}),Yu=n=>({});function Vy(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;const g=n[3].default,m=Tt(g,n,n[2],null),_=n[3].footer,y=Tt(_,n,n[2],Yu);return{c(){e=v("div"),t=v("main"),m&&m.c(),i=E(),s=v("footer"),y&&y.c(),l=E(),o=v("a"),o.innerHTML=' Docs',r=E(),a=v("span"),a.textContent="|",u=E(),f=v("a"),c=v("span"),c.textContent="PocketBase v0.18.9",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(s,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(S,C){w(S,e,C),b(e,t),m&&m.m(t,null),b(e,i),b(e,s),y&&y.m(s,null),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(s,f),b(f,c),h=!0},p(S,[C]){m&&m.p&&(!h||C&4)&&$t(m,g,S,S[2],h?Ct(g,S[2],C,null):Mt(S[2]),null),y&&y.p&&(!h||C&4)&&$t(y,_,S,S[2],h?Ct(_,S[2],C,Hy):Mt(S[2]),Yu),(!h||C&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!h||C&3)&&Q(e,"center-content",S[0])},i(S){h||(A(m,S),A(y,S),h=!0)},o(S){L(m,S),L(y,S),h=!1},d(S){S&&k(e),m&&m.d(S),y&&y.d(S)}}}function zy(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 Sn extends ve{constructor(e){super(),be(this,e,zy,Vy,me,{center:0,class:1})}}function Ku(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',t=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function By(n){let e,t,i,s=!n[0]&&Ku();const l=n[1].default,o=Tt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(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=Ku(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,l,r,r[2],i?Ct(l,r[2],a,null):Mt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function Uy(n){let e,t;return e=new Sn({props:{class:"full-page",center:!0,$$slots:{default:[By]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Wy(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 _b extends ve{constructor(e){super(),be(this,e,Wy,Uy,me,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function Zr(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 di(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]=cu(s),[h,g]=cu(l);return{delay:e,duration:t,easing:i,css:(m,_)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=V.parseIndex(e);return i.tableName=t,V.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=V.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?V.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}}const zo=In([]);function bo(n,e=4e3){return Bo(n,"info",e)}function jt(n,e=3e3){return Bo(n,"success",e)}function ls(n,e=4500){return Bo(n,"error",e)}function Py(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(()=>{mb(i)},t)};zo.update(s=>(Ia(s,i.message),V.pushOrReplaceByKey(s,i,"message"),s))}function mb(n){zo.update(e=>(Ia(e,n),e))}function Aa(){zo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(n,e){let t;typeof e=="string"?t=V.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),V.removeByKey(n,"message",t.message))}const $i=In({});function en(n){$i.set(n||{})}function ci(n){$i.update(e=>(V.deleteByPath(e,n),e))}const La=In({});function Gr(n){La.set(n||{})}const ii=In([]),Ti=In({}),vo=In(!1),gb=In({});function Fy(n){ii.update(e=>{const t=V.findByKey(e,"id",n);return t?Ti.set(t):e.length&&Ti.set(e[0]),e})}function Ny(n){Ti.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ii.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Pa(),V.sortCollections(e)))}function Ry(n){ii.update(e=>(V.removeByKey(e,"id",n.id),Ti.update(t=>t.id===n.id?e[0]:t),Pa(),e))}async function qy(n=null){vo.set(!0);try{let e=await de.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),ii.set(e);const t=n&&V.findByKey(e,"id",n);t?Ti.set(t):e.length&&Ti.set(e[0]),Pa()}catch(e){de.error(e)}vo.set(!1)}function Pa(){gb.update(n=>(ii.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const dr="pb_admin_file_token";qo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Hi("/login")};qo.prototype.error=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)||{},l=s.message||n.message||t;if(e&&l&&ls(l),V.isEmpty(s.data)||en(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Hi("/")};qo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=W1(gb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(dr)||"";return(!t||ka(t,10))&&(t&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(dr,t),this._adminFileTokenRequest=null),t};class jy extends g_{save(e,t){super.save(e,t),t&&!t.collectionId&&Gr(t)}clear(){super.clear(),Gr(null)}}const de=new qo("../",new jy("pb_admin_auth"));de.authStore.model&&!de.authStore.model.collectionId&&Gr(de.authStore.model);const Hy=n=>({}),Yu=n=>({});function Vy(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;const g=n[3].default,m=Tt(g,n,n[2],null),_=n[3].footer,y=Tt(_,n,n[2],Yu);return{c(){e=v("div"),t=v("main"),m&&m.c(),i=E(),s=v("footer"),y&&y.c(),l=E(),o=v("a"),o.innerHTML=' Docs',r=E(),a=v("span"),a.textContent="|",u=E(),f=v("a"),c=v("span"),c.textContent="PocketBase v0.18.9",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(s,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(S,C){w(S,e,C),b(e,t),m&&m.m(t,null),b(e,i),b(e,s),y&&y.m(s,null),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(s,f),b(f,c),h=!0},p(S,[C]){m&&m.p&&(!h||C&4)&&$t(m,g,S,S[2],h?Ct(g,S[2],C,null):Mt(S[2]),null),y&&y.p&&(!h||C&4)&&$t(y,_,S,S[2],h?Ct(_,S[2],C,Hy):Mt(S[2]),Yu),(!h||C&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!h||C&3)&&Q(e,"center-content",S[0])},i(S){h||(A(m,S),A(y,S),h=!0)},o(S){L(m,S),L(y,S),h=!1},d(S){S&&k(e),m&&m.d(S),y&&y.d(S)}}}function zy(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 Sn extends ve{constructor(e){super(),be(this,e,zy,Vy,me,{center:0,class:1})}}function Ku(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',t=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function By(n){let e,t,i,s=!n[0]&&Ku();const l=n[1].default,o=Tt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(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=Ku(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,l,r,r[2],i?Ct(l,r[2],a,null):Mt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function Uy(n){let e,t;return e=new Sn({props:{class:"full-page",center:!0,$$slots:{default:[By]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Wy(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 _b extends ve{constructor(e){super(),be(this,e,Wy,Uy,me,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function Zr(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 di(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]=cu(s),[h,g]=cu(l);return{delay:e,duration:t,easing:i,css:(m,_)=>` transform: ${u} translate(${(1-m)*c}${d}, ${(1-m)*h}${g}); opacity: ${a-f*_}`}}function it(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]}`]),h=parseFloat(l[`margin${f[0]}`]),g=parseFloat(l[`margin${f[1]}`]),m=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*h}px;margin-${u[1]}: ${y*g}px;border-${u[0]}-width: ${y*m}px;border-${u[1]}-width: ${y*_}px;`}}function Jt(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 Xr,Yi;const Qr="app-tooltip";function Ju(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+Qr),Yi||(Yi=document.createElement("div"),Yi.classList.add(Qr),document.body.appendChild(Yi)),Yi}function bb(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){xr();return}t.textContent=e.text,t.className=Qr+" 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(Xr),Ni().classList.remove("active"),Ni().activeNode=void 0}function Yy(n,e){Ni().activeNode=n,clearTimeout(Xr),Xr=setTimeout(()=>{Ni().classList.add("active"),bb(n,e)},isNaN(e.delay)?0:e.delay)}function je(n,e){let t=Ju(e);function i(){Yy(n,t)}function s(){xr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Ju(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&bb(n,t)},destroy(){var l,o;(o=(l=Ni())==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 Gu(n,e,t){const i=n.slice();return i[12]=e[t],i}const Ky=n=>({}),Zu=n=>({uniqueId:n[4]});function Jy(n){let e,t,i=ge(n[3]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=qe(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Xu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(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])+"")&&se(s,i)},i(a){r||(a&&Qe(()=>{r&&(o||(o=qe(e,it,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,it,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Zy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Tt(a,n,n[8],Zu),f=[Gy,Jy],c=[];function d(h,g){return h[0]&&h[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(h,g){w(h,e,g),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(h,[g]){u&&u.p&&(!l||g&256)&&$t(u,a,h,h[8],l?Ct(a,h[8],g,Ky):Mt(h[8]),Zu);let m=i;i=d(h),i===m?c[i].p(h,g):(ue(),L(c[m],1,1,()=>{c[m]=null}),fe(),s=c[i],s?s.p(h,g):(s=c[i]=f[i](h),s.c()),A(s,1),s.m(e,null)),(!l||g&2)&&p(e,"class",h[1]),(!l||g&10)&&Q(e,"error",h[3].length)},i(h){l||(A(u,h),A(s),l=!0)},o(h){L(u,h),L(s),l=!1},d(h){h&&k(e),u&&u.d(h),c[i].d(),n[11](null),o=!1,r()}}}const Qu="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Qu:n||Qu}function Xy(n,e,t){let i;Ke(n,$i,m=>t(7,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ci(r)}Gt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function h(m){Fe.call(this,n,m)}function g(m){te[m?"unshift":"push"](()=>{f=m,t(2,f)})}return n.$$set=m=>{"name"in m&&t(5,r=m.name),"inlineError"in m&&t(0,a=m.inlineError),"class"in m&&t(1,u=m.class),"$$scope"in m&&t(8,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,h,g]}class pe extends ve{constructor(e){super(),be(this,e,Xy,Zy,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Qy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0]),l.focus(),r||(a=K(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]&&ae(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function xy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("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){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[1]),w(c,r,d),w(c,a,d),u||(f=K(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]&&ae(l,c[1])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function ek(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(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]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function tk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Qy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[xy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ek,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("button"),f.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,m){w(g,e,m),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),H(a,e,null),b(e,u),b(e,f),c=!0,d||(h=K(e,"submit",xe(n[4])),d=!0)},p(g,[m]){const _={};m&1537&&(_.$$scope={dirty:m,ctx:g}),s.$set(_);const y={};m&1538&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m&1540&&(S.$$scope={dirty:m,ctx:g}),a.$set(S),(!c||m&8)&&Q(f,"btn-disabled",g[3]),(!c||m&8)&&Q(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,h()}}}function nk(n,e,t){const i=pt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await de.admins.create({email:s,password:l,passwordConfirm:o}),await de.admins.authWithPassword(s,l),i("submit")}catch(d){de.error(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 ik extends ve{constructor(e){super(),be(this,e,nk,tk,me,{})}}function xu(n){let e,t;return e=new _b({props:{$$slots:{default:[sk]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function sk(n){let e,t;return e=new ik({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lk(n){let e,t,i=n[0]&&xu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=xu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ue(),L(i,1,1,()=>{i=null}),fe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function ok(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){de.logout(!1),t(0,i=!0);return}de.authStore.isValid?Hi("/collections"):de.logout()}return[i,async()=>{t(0,i=!1),await ln(),window.location.search=""}]}class rk extends ve{constructor(e){super(),be(this,e,ok,lk,me,{})}}const At=In(""),ko=In(""),Ms=In(!1);function ak(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),ae(e,n[7]),i||(s=K(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]&&ae(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function uk(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a,u){let f={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&&(f.value=a[7]),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{V(f,1)}),fe()}o?(e=Dt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};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],ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function ef(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(t||(t=qe(e,di,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,di,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function tf(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=K(e,"click",n[15]),s=!0)},p:x,i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,di,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,di,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function fk(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[uk,ak],h=[];function g(y,S){return y[4]&&!y[5]?0:1}l=g(n),o=h[l]=d[l](n);let m=(n[0].length||n[7].length)&&n[7]!=n[0]&&ef(),_=(n[0].length||n[7].length)&&tf(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=E(),o.c(),r=E(),m&&m.c(),a=E(),_&&_.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(y,S){w(y,e,S),b(e,t),b(t,i),b(e,s),h[l].m(e,null),b(e,r),m&&m.m(e,null),b(e,a),_&&_.m(e,null),u=!0,f||(c=[K(e,"click",An(n[11])),K(e,"submit",xe(n[10]))],f=!0)},p(y,[S]){let C=l;l=g(y),l===C?h[l].p(y,S):(ue(),L(h[C],1,1,()=>{h[C]=null}),fe(),o=h[l],o?o.p(y,S):(o=h[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?m?S&129&&A(m,1):(m=ef(),m.c(),A(m,1),m.m(e,a)):m&&(ue(),L(m,1,1,()=>{m=null}),fe()),y[0].length||y[7].length?_?(_.p(y,S),S&129&&A(_,1)):(_=tf(y),_.c(),A(_,1),_.m(e,null)):_&&(ue(),L(_,1,1,()=>{_=null}),fe())},i(y){u||(A(o),A(m),A(_),u=!0)},o(y){L(o),L(m),L(_),u=!1},d(y){y&&k(e),h[l].d(),m&&m.d(),_&&_.d(),f=!1,$e(c)}}}function ck(n,e,t){const i=pt(),s="search_"+j.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h($=!0){t(7,d=""),$&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function m(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-5c53fc35.js"),["./FilterAutocompleteInput-5c53fc35.js","./index-808c8630.js"],import.meta.url)).default),t(5,f=!1))}Gt(()=>{m()});function _($){Fe.call(this,n,$)}function y($){d=$,t(7,d),t(0,l)}function S($){te[$?"unshift":"push"](()=>{c=$,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const T=()=>{h(!1),g()};return n.$$set=$=>{"value"in $&&t(0,l=$.value),"placeholder"in $&&t(1,o=$.placeholder),"autocompleteCollection"in $&&t(2,r=$.autocompleteCollection),"extraAutocompleteKeys"in $&&t(3,a=$.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,_,y,S,C,T]}class Wo extends ve{constructor(e){super(),be(this,e,ck,fk,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function dk(n){let e,t,i,s,l,o;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),Q(e,"refreshing",n[2])},m(r,a){w(r,e,a),b(e,t),l||(o=[Te(s=je.call(null,e,n[0])),K(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&Et(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:x,o:x,d(r){r&&k(e),l=!1,$e(o)}}}function pk(n,e,t){const i=pt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Gt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Yo extends ve{constructor(e){super(),be(this,e,pk,dk,me,{tooltip:0,class:1})}}function hk(n){let e,t,i,s,l;const o=n[6].default,r=Tt(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[K(e,"click",n[7]),K(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&$t(r,o,a,a[5],i?Ct(o,a[5],u,null):Mt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function mk(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class cn extends ve{constructor(e){super(),be(this,e,mk,hk,me,{class:1,name:2,sort:0,disable:3})}}function gk(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _k(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("div"),t=v("div"),i=U(n[2]),s=E(),l=v("div"),o=U(n[1]),r=U(" UTC"),p(t,"class","date"),p(l,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(c,d){w(c,e,d),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(l,r),u||(f=Te(a=je.call(null,e,j.formatToLocalDate(n[0])+" Local")),u=!0)},p(c,d){d&4&&se(i,c[2]),d&2&&se(o,c[1]),a&&Et(a.update)&&d&1&&a.update.call(null,j.formatToLocalDate(c[0])+" Local")},d(c){c&&k(e),u=!1,f()}}}function bk(n){let e;function t(l,o){return l[0]?_k:gk}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function vk(n,e,t){let i,s,{date:l=""}=e;return n.$$set=o=>{"date"in o&&t(0,l=o.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i]}class Ci extends ve{constructor(e){super(),be(this,e,vk,bk,me,{date:0})}}const yk=n=>({}),nf=n=>({}),kk=n=>({}),sf=n=>({});function wk(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Tt(u,n,n[10],sf),c=n[11].default,d=Tt(c,n,n[10],null),h=n[11].after,g=Tt(h,n,n[10],nf);return{c(){e=v("div"),f&&f.c(),t=E(),i=v("div"),d&&d.c(),l=E(),g&&g.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-8i9d9f"),p(e,"class","scroller-wrapper svelte-8i9d9f")},m(m,_){w(m,e,_),f&&f.m(e,null),b(e,t),b(e,i),d&&d.m(i,null),n[12](i),b(e,l),g&&g.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(m,[_]){f&&f.p&&(!o||_&1024)&&$t(f,u,m,m[10],o?Ct(u,m[10],_,kk):Mt(m[10]),sf),d&&d.p&&(!o||_&1024)&&$t(d,c,m,m[10],o?Ct(c,m[10],_,null):Mt(m[10]),null),(!o||_&9&&s!==(s="scroller "+m[0]+" "+m[3]+" svelte-8i9d9f"))&&p(i,"class",s),g&&g.p&&(!o||_&1024)&&$t(g,h,m,m[10],o?Ct(h,m[10],_,yk):Mt(m[10]),nf)},i(m){o||(A(f,m),A(d,m),A(g,m),o=!0)},o(m){L(f,m),L(d,m),L(g,m),o=!1},d(m){m&&k(e),f&&f.d(m),d&&d.d(m),n[12](null),g&&g.d(m),r=!1,$e(a)}}}function Sk(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,h,g,m,_,y;function S(){f&&t(2,f.scrollTop=0,f)}function C(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),m=f.clientWidth+2,_=f.clientHeight+2,h=f.scrollWidth-m,g=f.scrollHeight-_,g>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),l("vScrollStart")),f.scrollTop+r>=g&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),h>0?(t(3,c+=" h-scroll"),a>=m&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=h&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function $(){d||(d=setTimeout(()=>{T(),d=null},150))}Gt(()=>($(),y=new MutationObserver($),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(M){te[M?"unshift":"push"](()=>{f=M,t(2,f)})}return n.$$set=M=>{"class"in M&&t(0,o=M.class),"vThreshold"in M&&t(4,r=M.vThreshold),"hThreshold"in M&&t(5,a=M.hThreshold),"dispatchOnNoScroll"in M&&t(6,u=M.dispatchOnNoScroll),"$$scope"in M&&t(10,s=M.$$scope)},[o,$,f,c,r,a,u,S,C,T,s,i,O]}class Fa extends ve{constructor(e){super(),be(this,e,Sk,wk,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function lf(n,e,t){const i=n.slice();return i[23]=e[t],i}function Tk(n){let e;return{c(){e=v("div"),e.innerHTML=' Method',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ck(n){let e;return{c(){e=v("div"),e.innerHTML=` URL`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $k(n){let e;return{c(){e=v("div"),e.innerHTML=` Referer`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Mk(n){let e;return{c(){e=v("div"),e.innerHTML=` User IP`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ok(n){let e;return{c(){e=v("div"),e.innerHTML=` Status`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ek(n){let e;return{c(){e=v("div"),e.innerHTML=` Created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function of(n){let e;function t(l,o){return l[6]?Ak:Dk}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function Dk(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&rf(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(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=rf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Ak(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function af(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uf(n,e){var Ce,We,_t;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,h,g,m,_,y,S=(e[23].referer||"N/A")+"",C,T,$,O,M,D=(e[23].userIp||"N/A")+"",I,F,P,N,R,q=e[23].status+"",B,Z,X,J,W,le,ee,ie,Ee,Ne,Ve=(((We=e[23].meta)==null?void 0:We.errorMessage)||((_t=e[23].meta)==null?void 0:_t.errorData))&&af();J=new Ci({props:{date:e[23].created}});function ze(){return e[17](e[23])}function oe(...Xe){return e[18](e[23],...Xe)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=E(),u=v("td"),f=v("span"),d=U(c),g=E(),Ve&&Ve.c(),m=E(),_=v("td"),y=v("span"),C=U(S),$=E(),O=v("td"),M=v("span"),I=U(D),P=E(),N=v("td"),R=v("span"),B=U(q),Z=E(),X=v("td"),z(J.$$.fragment),W=E(),le=v("td"),le.innerHTML='',ee=E(),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",h=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",T=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(_,"class","col-type-text col-field-referer"),p(M,"class","txt txt-ellipsis"),p(M,"title",F=e[23].userIp),Q(M,"txt-hint",!e[23].userIp),p(O,"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(le,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Xe,Je){w(Xe,t,Je),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,g),Ve&&Ve.m(u,null),b(t,m),b(t,_),b(_,y),b(y,C),b(t,$),b(t,O),b(O,M),b(M,I),b(t,P),b(t,N),b(N,R),b(R,B),b(t,Z),b(t,X),H(J,X,null),b(t,W),b(t,le),b(t,ee),ie=!0,Ee||(Ne=[K(t,"click",ze),K(t,"keydown",oe)],Ee=!0)},p(Xe,Je){var _e,ke,Ge;e=Xe,(!ie||Je&8)&&l!==(l=((_e=e[23].method)==null?void 0:_e.toUpperCase())+"")&&se(o,l),(!ie||Je&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ie||Je&8)&&c!==(c=e[23].url+"")&&se(d,c),(!ie||Je&8&&h!==(h=e[23].url))&&p(f,"title",h),(ke=e[23].meta)!=null&&ke.errorMessage||(Ge=e[23].meta)!=null&&Ge.errorData?Ve||(Ve=af(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!ie||Je&8)&&S!==(S=(e[23].referer||"N/A")+"")&&se(C,S),(!ie||Je&8&&T!==(T=e[23].referer))&&p(y,"title",T),(!ie||Je&8)&&Q(y,"txt-hint",!e[23].referer),(!ie||Je&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&se(I,D),(!ie||Je&8&&F!==(F=e[23].userIp))&&p(M,"title",F),(!ie||Je&8)&&Q(M,"txt-hint",!e[23].userIp),(!ie||Je&8)&&q!==(q=e[23].status+"")&&se(B,q),(!ie||Je&8)&&Q(R,"label-danger",e[23].status>=400);const wt={};Je&8&&(wt.date=e[23].created),J.$set(wt)},i(Xe){ie||(A(J.$$.fragment,Xe),ie=!0)},o(Xe){L(J.$$.fragment,Xe),ie=!1},d(Xe){Xe&&k(t),Ve&&Ve.d(),V(J),Ee=!1,$e(Ne)}}}function Ik(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I=[],F=new Map,P;function N(oe){n[11](oe)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Tk]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new cn({props:R}),te.push(()=>he(s,"sort",N));function q(oe){n[12](oe)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Ck]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new cn({props:B}),te.push(()=>he(r,"sort",q));function Z(oe){n[13](oe)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[$k]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new cn({props:X}),te.push(()=>he(f,"sort",Z));function J(oe){n[14](oe)}let W={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Mk]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),h=new cn({props:W}),te.push(()=>he(h,"sort",J));function le(oe){n[15](oe)}let ee={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Ok]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),_=new cn({props:ee}),te.push(()=>he(_,"sort",le));function ie(oe){n[16](oe)}let Ee={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Ek]},$$scope:{ctx:n}};n[1]!==void 0&&(Ee.sort=n[1]),C=new cn({props:Ee}),te.push(()=>he(C,"sort",ie));let Ne=ge(n[3]);const Ve=oe=>oe[23].id;for(let oe=0;oel=!1)),s.$set(We);const _t={};Ce&67108864&&(_t.$$scope={dirty:Ce,ctx:oe}),!a&&Ce&2&&(a=!0,_t.sort=oe[1],ye(()=>a=!1)),r.$set(_t);const Xe={};Ce&67108864&&(Xe.$$scope={dirty:Ce,ctx:oe}),!c&&Ce&2&&(c=!0,Xe.sort=oe[1],ye(()=>c=!1)),f.$set(Xe);const Je={};Ce&67108864&&(Je.$$scope={dirty:Ce,ctx:oe}),!g&&Ce&2&&(g=!0,Je.sort=oe[1],ye(()=>g=!1)),h.$set(Je);const wt={};Ce&67108864&&(wt.$$scope={dirty:Ce,ctx:oe}),!y&&Ce&2&&(y=!0,wt.sort=oe[1],ye(()=>y=!1)),_.$set(wt);const _e={};Ce&67108864&&(_e.$$scope={dirty:Ce,ctx:oe}),!T&&Ce&2&&(T=!0,_e.sort=oe[1],ye(()=>T=!1)),C.$set(_e),Ce&841&&(Ne=ge(oe[3]),ue(),I=vt(I,Ce,Ve,1,oe,Ne,F,D,Ut,uf,null,lf),fe(),!Ne.length&&ze?ze.p(oe,Ce):Ne.length?ze&&(ze.d(1),ze=null):(ze=of(oe),ze.c(),ze.m(D,null))),(!P||Ce&64)&&Q(e,"table-loading",oe[6])},i(oe){if(!P){A(s.$$.fragment,oe),A(r.$$.fragment,oe),A(f.$$.fragment,oe),A(h.$$.fragment,oe),A(_.$$.fragment,oe),A(C.$$.fragment,oe);for(let Ce=0;Ce{if(F<=1&&m(),t(6,d=!1),t(5,f=N.page),t(4,c=N.totalItems),s("load",u.concat(N.items)),P){const R=++h;for(;N.items.length&&h==R;)t(3,u=u.concat(N.items.splice(0,10))),await j.yieldToMain()}else t(3,u=u.concat(N.items))}).catch(N=>{N!=null&&N.isAbort||(t(6,d=!1),console.warn(N),m(),de.error(N,(N==null?void 0:N.status)!=400))})}function m(){t(3,u=[]),t(5,f=1),t(4,c=0)}function _(F){a=F,t(1,a)}function y(F){a=F,t(1,a)}function S(F){a=F,t(1,a)}function C(F){a=F,t(1,a)}function T(F){a=F,t(1,a)}function $(F){a=F,t(1,a)}const O=F=>s("select",F),M=(F,P)=>{P.code==="Enter"&&(P.preventDefault(),s("select",F))},D=()=>t(0,o=""),I=()=>g(f+1);return n.$$set=F=>{"filter"in F&&t(0,o=F.filter),"presets"in F&&t(10,r=F.presets),"sort"in F&&t(1,a=F.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(m(),g(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,g,u,c,f,d,i,s,l,r,_,y,S,C,T,$,O,M,D,I]}class Fk extends ve{constructor(e){super(),be(this,e,Pk,Lk,me,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! + `}}let Xr,Yi;const Qr="app-tooltip";function Ju(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+Qr),Yi||(Yi=document.createElement("div"),Yi.classList.add(Qr),document.body.appendChild(Yi)),Yi}function bb(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){xr();return}t.textContent=e.text,t.className=Qr+" 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(Xr),Ni().classList.remove("active"),Ni().activeNode=void 0}function Yy(n,e){Ni().activeNode=n,clearTimeout(Xr),Xr=setTimeout(()=>{Ni().classList.add("active"),bb(n,e)},isNaN(e.delay)?0:e.delay)}function je(n,e){let t=Ju(e);function i(){Yy(n,t)}function s(){xr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&V.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Ju(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&bb(n,t)},destroy(){var l,o;(o=(l=Ni())==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 Gu(n,e,t){const i=n.slice();return i[12]=e[t],i}const Ky=n=>({}),Zu=n=>({uniqueId:n[4]});function Jy(n){let e,t,i=ge(n[3]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=qe(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Xu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(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])+"")&&se(s,i)},i(a){r||(a&&Qe(()=>{r&&(o||(o=qe(e,it,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,it,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Zy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Tt(a,n,n[8],Zu),f=[Gy,Jy],c=[];function d(h,g){return h[0]&&h[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(h,g){w(h,e,g),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(h,[g]){u&&u.p&&(!l||g&256)&&$t(u,a,h,h[8],l?Ct(a,h[8],g,Ky):Mt(h[8]),Zu);let m=i;i=d(h),i===m?c[i].p(h,g):(ue(),L(c[m],1,1,()=>{c[m]=null}),fe(),s=c[i],s?s.p(h,g):(s=c[i]=f[i](h),s.c()),A(s,1),s.m(e,null)),(!l||g&2)&&p(e,"class",h[1]),(!l||g&10)&&Q(e,"error",h[3].length)},i(h){l||(A(u,h),A(s),l=!0)},o(h){L(u,h),L(s),l=!1},d(h){h&&k(e),u&&u.d(h),c[i].d(),n[11](null),o=!1,r()}}}const Qu="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Qu:n||Qu}function Xy(n,e,t){let i;Ke(n,$i,m=>t(7,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ci(r)}Gt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function h(m){Fe.call(this,n,m)}function g(m){te[m?"unshift":"push"](()=>{f=m,t(2,f)})}return n.$$set=m=>{"name"in m&&t(5,r=m.name),"inlineError"in m&&t(0,a=m.inlineError),"class"in m&&t(1,u=m.class),"$$scope"in m&&t(8,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,h,g]}class pe extends ve{constructor(e){super(),be(this,e,Xy,Zy,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Qy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0]),l.focus(),r||(a=K(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]&&ae(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function xy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("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){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[1]),w(c,r,d),w(c,a,d),u||(f=K(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]&&ae(l,c[1])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function ek(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(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]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function tk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Qy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[xy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ek,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("button"),f.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,m){w(g,e,m),b(e,t),b(e,i),j(s,e,null),b(e,l),j(o,e,null),b(e,r),j(a,e,null),b(e,u),b(e,f),c=!0,d||(h=K(e,"submit",xe(n[4])),d=!0)},p(g,[m]){const _={};m&1537&&(_.$$scope={dirty:m,ctx:g}),s.$set(_);const y={};m&1538&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m&1540&&(S.$$scope={dirty:m,ctx:g}),a.$set(S),(!c||m&8)&&Q(f,"btn-disabled",g[3]),(!c||m&8)&&Q(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),H(s),H(o),H(a),d=!1,h()}}}function nk(n,e,t){const i=pt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await de.admins.create({email:s,password:l,passwordConfirm:o}),await de.admins.authWithPassword(s,l),i("submit")}catch(d){de.error(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 ik extends ve{constructor(e){super(),be(this,e,nk,tk,me,{})}}function xu(n){let e,t;return e=new _b({props:{$$slots:{default:[sk]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function sk(n){let e,t;return e=new ik({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function lk(n){let e,t,i=n[0]&&xu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=xu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ue(),L(i,1,1,()=>{i=null}),fe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function ok(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){de.logout(!1),t(0,i=!0);return}de.authStore.isValid?Hi("/collections"):de.logout()}return[i,async()=>{t(0,i=!1),await ln(),window.location.search=""}]}class rk extends ve{constructor(e){super(),be(this,e,ok,lk,me,{})}}const Dt=In(""),ko=In(""),Ms=In(!1);function ak(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),ae(e,n[7]),i||(s=K(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]&&ae(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function uk(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a,u){let f={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&&(f.value=a[7]),{props:f}}return o&&(e=Et(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}o?(e=Et(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};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],ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function ef(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(t||(t=qe(e,di,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,di,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function tf(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=K(e,"click",n[15]),s=!0)},p:x,i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,di,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,di,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function fk(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[uk,ak],h=[];function g(y,S){return y[4]&&!y[5]?0:1}l=g(n),o=h[l]=d[l](n);let m=(n[0].length||n[7].length)&&n[7]!=n[0]&&ef(),_=(n[0].length||n[7].length)&&tf(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=E(),o.c(),r=E(),m&&m.c(),a=E(),_&&_.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(y,S){w(y,e,S),b(e,t),b(t,i),b(e,s),h[l].m(e,null),b(e,r),m&&m.m(e,null),b(e,a),_&&_.m(e,null),u=!0,f||(c=[K(e,"click",An(n[11])),K(e,"submit",xe(n[10]))],f=!0)},p(y,[S]){let C=l;l=g(y),l===C?h[l].p(y,S):(ue(),L(h[C],1,1,()=>{h[C]=null}),fe(),o=h[l],o?o.p(y,S):(o=h[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?m?S&129&&A(m,1):(m=ef(),m.c(),A(m,1),m.m(e,a)):m&&(ue(),L(m,1,1,()=>{m=null}),fe()),y[0].length||y[7].length?_?(_.p(y,S),S&129&&A(_,1)):(_=tf(y),_.c(),A(_,1),_.m(e,null)):_&&(ue(),L(_,1,1,()=>{_=null}),fe())},i(y){u||(A(o),A(m),A(_),u=!0)},o(y){L(o),L(m),L(_),u=!1},d(y){y&&k(e),h[l].d(),m&&m.d(),_&&_.d(),f=!1,$e(c)}}}function ck(n,e,t){const i=pt(),s="search_"+V.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=V.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h($=!0){t(7,d=""),$&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function m(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-cff6df53.js"),["./FilterAutocompleteInput-cff6df53.js","./index-9cd23da9.js"],import.meta.url)).default),t(5,f=!1))}Gt(()=>{m()});function _($){Fe.call(this,n,$)}function y($){d=$,t(7,d),t(0,l)}function S($){te[$?"unshift":"push"](()=>{c=$,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const T=()=>{h(!1),g()};return n.$$set=$=>{"value"in $&&t(0,l=$.value),"placeholder"in $&&t(1,o=$.placeholder),"autocompleteCollection"in $&&t(2,r=$.autocompleteCollection),"extraAutocompleteKeys"in $&&t(3,a=$.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,_,y,S,C,T]}class Wo extends ve{constructor(e){super(),be(this,e,ck,fk,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function dk(n){let e,t,i,s,l,o;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),Q(e,"refreshing",n[2])},m(r,a){w(r,e,a),b(e,t),l||(o=[Te(s=je.call(null,e,n[0])),K(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&At(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:x,o:x,d(r){r&&k(e),l=!1,$e(o)}}}function pk(n,e,t){const i=pt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Gt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Yo extends ve{constructor(e){super(),be(this,e,pk,dk,me,{tooltip:0,class:1})}}function hk(n){let e,t,i,s,l;const o=n[6].default,r=Tt(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[K(e,"click",n[7]),K(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&$t(r,o,a,a[5],i?Ct(o,a[5],u,null):Mt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function mk(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class cn extends ve{constructor(e){super(),be(this,e,mk,hk,me,{class:1,name:2,sort:0,disable:3})}}function gk(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _k(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("div"),t=v("div"),i=U(n[2]),s=E(),l=v("div"),o=U(n[1]),r=U(" UTC"),p(t,"class","date"),p(l,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(l,r),a||(u=Te(je.call(null,e,n[3])),a=!0)},p(f,c){c&4&&se(i,f[2]),c&2&&se(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function bk(n){let e;function t(l,o){return l[0]?_k:gk}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function vk(n,e,t){let i,s,{date:l=""}=e;const o={get text(){return V.formatToLocalDate(l)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,l=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i,o]}class Ci extends ve{constructor(e){super(),be(this,e,vk,bk,me,{date:0})}}const yk=n=>({}),nf=n=>({}),kk=n=>({}),sf=n=>({});function wk(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Tt(u,n,n[10],sf),c=n[11].default,d=Tt(c,n,n[10],null),h=n[11].after,g=Tt(h,n,n[10],nf);return{c(){e=v("div"),f&&f.c(),t=E(),i=v("div"),d&&d.c(),l=E(),g&&g.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-8i9d9f"),p(e,"class","scroller-wrapper svelte-8i9d9f")},m(m,_){w(m,e,_),f&&f.m(e,null),b(e,t),b(e,i),d&&d.m(i,null),n[12](i),b(e,l),g&&g.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(m,[_]){f&&f.p&&(!o||_&1024)&&$t(f,u,m,m[10],o?Ct(u,m[10],_,kk):Mt(m[10]),sf),d&&d.p&&(!o||_&1024)&&$t(d,c,m,m[10],o?Ct(c,m[10],_,null):Mt(m[10]),null),(!o||_&9&&s!==(s="scroller "+m[0]+" "+m[3]+" svelte-8i9d9f"))&&p(i,"class",s),g&&g.p&&(!o||_&1024)&&$t(g,h,m,m[10],o?Ct(h,m[10],_,yk):Mt(m[10]),nf)},i(m){o||(A(f,m),A(d,m),A(g,m),o=!0)},o(m){L(f,m),L(d,m),L(g,m),o=!1},d(m){m&&k(e),f&&f.d(m),d&&d.d(m),n[12](null),g&&g.d(m),r=!1,$e(a)}}}function Sk(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,h,g,m,_,y;function S(){f&&t(2,f.scrollTop=0,f)}function C(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),m=f.clientWidth+2,_=f.clientHeight+2,h=f.scrollWidth-m,g=f.scrollHeight-_,g>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),l("vScrollStart")),f.scrollTop+r>=g&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),h>0?(t(3,c+=" h-scroll"),a>=m&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=h&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function $(){d||(d=setTimeout(()=>{T(),d=null},150))}Gt(()=>($(),y=new MutationObserver($),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(M){te[M?"unshift":"push"](()=>{f=M,t(2,f)})}return n.$$set=M=>{"class"in M&&t(0,o=M.class),"vThreshold"in M&&t(4,r=M.vThreshold),"hThreshold"in M&&t(5,a=M.hThreshold),"dispatchOnNoScroll"in M&&t(6,u=M.dispatchOnNoScroll),"$$scope"in M&&t(10,s=M.$$scope)},[o,$,f,c,r,a,u,S,C,T,s,i,O]}class Fa extends ve{constructor(e){super(),be(this,e,Sk,wk,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function lf(n,e,t){const i=n.slice();return i[23]=e[t],i}function Tk(n){let e;return{c(){e=v("div"),e.innerHTML=' Method',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ck(n){let e;return{c(){e=v("div"),e.innerHTML=` URL`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $k(n){let e;return{c(){e=v("div"),e.innerHTML=` Referer`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Mk(n){let e;return{c(){e=v("div"),e.innerHTML=` User IP`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ok(n){let e;return{c(){e=v("div"),e.innerHTML=` Status`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Ek(n){let e;return{c(){e=v("div"),e.innerHTML=` Created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function of(n){let e;function t(l,o){return l[6]?Ak:Dk}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function Dk(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&rf(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(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=rf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Ak(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function af(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uf(n,e){var Ce,We,_t;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,h,g,m,_,y,S=(e[23].referer||"N/A")+"",C,T,$,O,M,D=(e[23].userIp||"N/A")+"",I,F,P,N,R,q=e[23].status+"",B,Z,X,J,W,le,ee,ie,Ee,Ne,Ve=(((We=e[23].meta)==null?void 0:We.errorMessage)||((_t=e[23].meta)==null?void 0:_t.errorData))&&af();J=new Ci({props:{date:e[23].created}});function ze(){return e[17](e[23])}function oe(...Xe){return e[18](e[23],...Xe)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=E(),u=v("td"),f=v("span"),d=U(c),g=E(),Ve&&Ve.c(),m=E(),_=v("td"),y=v("span"),C=U(S),$=E(),O=v("td"),M=v("span"),I=U(D),P=E(),N=v("td"),R=v("span"),B=U(q),Z=E(),X=v("td"),z(J.$$.fragment),W=E(),le=v("td"),le.innerHTML='',ee=E(),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",h=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",T=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(_,"class","col-type-text col-field-referer"),p(M,"class","txt txt-ellipsis"),p(M,"title",F=e[23].userIp),Q(M,"txt-hint",!e[23].userIp),p(O,"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(le,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Xe,Je){w(Xe,t,Je),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,g),Ve&&Ve.m(u,null),b(t,m),b(t,_),b(_,y),b(y,C),b(t,$),b(t,O),b(O,M),b(M,I),b(t,P),b(t,N),b(N,R),b(R,B),b(t,Z),b(t,X),j(J,X,null),b(t,W),b(t,le),b(t,ee),ie=!0,Ee||(Ne=[K(t,"click",ze),K(t,"keydown",oe)],Ee=!0)},p(Xe,Je){var _e,ke,Ge;e=Xe,(!ie||Je&8)&&l!==(l=((_e=e[23].method)==null?void 0:_e.toUpperCase())+"")&&se(o,l),(!ie||Je&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ie||Je&8)&&c!==(c=e[23].url+"")&&se(d,c),(!ie||Je&8&&h!==(h=e[23].url))&&p(f,"title",h),(ke=e[23].meta)!=null&&ke.errorMessage||(Ge=e[23].meta)!=null&&Ge.errorData?Ve||(Ve=af(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!ie||Je&8)&&S!==(S=(e[23].referer||"N/A")+"")&&se(C,S),(!ie||Je&8&&T!==(T=e[23].referer))&&p(y,"title",T),(!ie||Je&8)&&Q(y,"txt-hint",!e[23].referer),(!ie||Je&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&se(I,D),(!ie||Je&8&&F!==(F=e[23].userIp))&&p(M,"title",F),(!ie||Je&8)&&Q(M,"txt-hint",!e[23].userIp),(!ie||Je&8)&&q!==(q=e[23].status+"")&&se(B,q),(!ie||Je&8)&&Q(R,"label-danger",e[23].status>=400);const wt={};Je&8&&(wt.date=e[23].created),J.$set(wt)},i(Xe){ie||(A(J.$$.fragment,Xe),ie=!0)},o(Xe){L(J.$$.fragment,Xe),ie=!1},d(Xe){Xe&&k(t),Ve&&Ve.d(),H(J),Ee=!1,$e(Ne)}}}function Ik(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I=[],F=new Map,P;function N(oe){n[11](oe)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Tk]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new cn({props:R}),te.push(()=>he(s,"sort",N));function q(oe){n[12](oe)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Ck]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new cn({props:B}),te.push(()=>he(r,"sort",q));function Z(oe){n[13](oe)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[$k]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new cn({props:X}),te.push(()=>he(f,"sort",Z));function J(oe){n[14](oe)}let W={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Mk]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),h=new cn({props:W}),te.push(()=>he(h,"sort",J));function le(oe){n[15](oe)}let ee={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Ok]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),_=new cn({props:ee}),te.push(()=>he(_,"sort",le));function ie(oe){n[16](oe)}let Ee={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Ek]},$$scope:{ctx:n}};n[1]!==void 0&&(Ee.sort=n[1]),C=new cn({props:Ee}),te.push(()=>he(C,"sort",ie));let Ne=ge(n[3]);const Ve=oe=>oe[23].id;for(let oe=0;oel=!1)),s.$set(We);const _t={};Ce&67108864&&(_t.$$scope={dirty:Ce,ctx:oe}),!a&&Ce&2&&(a=!0,_t.sort=oe[1],ye(()=>a=!1)),r.$set(_t);const Xe={};Ce&67108864&&(Xe.$$scope={dirty:Ce,ctx:oe}),!c&&Ce&2&&(c=!0,Xe.sort=oe[1],ye(()=>c=!1)),f.$set(Xe);const Je={};Ce&67108864&&(Je.$$scope={dirty:Ce,ctx:oe}),!g&&Ce&2&&(g=!0,Je.sort=oe[1],ye(()=>g=!1)),h.$set(Je);const wt={};Ce&67108864&&(wt.$$scope={dirty:Ce,ctx:oe}),!y&&Ce&2&&(y=!0,wt.sort=oe[1],ye(()=>y=!1)),_.$set(wt);const _e={};Ce&67108864&&(_e.$$scope={dirty:Ce,ctx:oe}),!T&&Ce&2&&(T=!0,_e.sort=oe[1],ye(()=>T=!1)),C.$set(_e),Ce&841&&(Ne=ge(oe[3]),ue(),I=vt(I,Ce,Ve,1,oe,Ne,F,D,Ut,uf,null,lf),fe(),!Ne.length&&ze?ze.p(oe,Ce):Ne.length?ze&&(ze.d(1),ze=null):(ze=of(oe),ze.c(),ze.m(D,null))),(!P||Ce&64)&&Q(e,"table-loading",oe[6])},i(oe){if(!P){A(s.$$.fragment,oe),A(r.$$.fragment,oe),A(f.$$.fragment,oe),A(h.$$.fragment,oe),A(_.$$.fragment,oe),A(C.$$.fragment,oe);for(let Ce=0;Ce{if(F<=1&&m(),t(6,d=!1),t(5,f=N.page),t(4,c=N.totalItems),s("load",u.concat(N.items)),P){const R=++h;for(;N.items.length&&h==R;)t(3,u=u.concat(N.items.splice(0,10))),await V.yieldToMain()}else t(3,u=u.concat(N.items))}).catch(N=>{N!=null&&N.isAbort||(t(6,d=!1),console.warn(N),m(),de.error(N,(N==null?void 0:N.status)!=400))})}function m(){t(3,u=[]),t(5,f=1),t(4,c=0)}function _(F){a=F,t(1,a)}function y(F){a=F,t(1,a)}function S(F){a=F,t(1,a)}function C(F){a=F,t(1,a)}function T(F){a=F,t(1,a)}function $(F){a=F,t(1,a)}const O=F=>s("select",F),M=(F,P)=>{P.code==="Enter"&&(P.preventDefault(),s("select",F))},D=()=>t(0,o=""),I=()=>g(f+1);return n.$$set=F=>{"filter"in F&&t(0,o=F.filter),"presets"in F&&t(10,r=F.presets),"sort"in F&&t(1,a=F.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(m(),g(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,g,u,c,f,d,i,s,l,r,_,y,S,C,T,$,O,M,D,I]}class Fk extends ve{constructor(e){super(),be(this,e,Pk,Lk,me,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors @@ -44,86 +44,86 @@ var V1=Object.defineProperty;var z1=(n,e,t)=>e in n?V1(n,e,{enumerable:!0,config `),_.hasAttribute("data-start")||_.setAttribute("data-start",String(I+1))}y.textContent=O,t.highlightElement(y)},function(O){_.setAttribute(r,f),y.textContent=O})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(g1);var b4=g1.exports;const Xs=_4(b4);var v4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;ar&&(f[d]=` `+f[d],c=h)}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,h="",g="",m=!1,_=0;_>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),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 y4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(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")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function k4(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=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.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 Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _1 extends ve{constructor(e){super(),be(this,e,k4,y4,me,{class:0,content:2,language:3})}}const w4=n=>({}),$c=n=>({}),S4=n=>({}),Mc=n=>({});function Oc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C=n[4]&&!n[2]&&Ec(n);const T=n[19].header,$=Tt(T,n,n[18],Mc);let O=n[4]&&n[2]&&Dc(n);const M=n[19].default,D=Tt(M,n,n[18],null),I=n[19].footer,F=Tt(I,n,n[18],$c);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),C&&C.c(),r=E(),$&&$.c(),a=E(),O&&O.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),F&&F.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",h="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(P,N){w(P,e,N),b(e,t),b(e,s),b(e,l),b(l,o),C&&C.m(o,null),b(o,r),$&&$.m(o,null),b(o,a),O&&O.m(o,null),b(l,u),b(l,f),D&&D.m(f,null),n[21](f),b(l,c),b(l,d),F&&F.m(d,null),_=!0,y||(S=[K(t,"click",xe(n[20])),K(f,"scroll",n[22])],y=!0)},p(P,N){n=P,n[4]&&!n[2]?C?C.p(n,N):(C=Ec(n),C.c(),C.m(o,r)):C&&(C.d(1),C=null),$&&$.p&&(!_||N[0]&262144)&&$t($,T,n,n[18],_?Ct(T,n[18],N,S4):Mt(n[18]),Mc),n[4]&&n[2]?O?O.p(n,N):(O=Dc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),D&&D.p&&(!_||N[0]&262144)&&$t(D,M,n,n[18],_?Ct(M,n[18],N,null):Mt(n[18]),null),F&&F.p&&(!_||N[0]&262144)&&$t(F,I,n,n[18],_?Ct(I,n[18],N,w4):Mt(n[18]),$c),(!_||N[0]&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),(!_||N[0]&262)&&Q(l,"popup",n[2]),(!_||N[0]&4)&&Q(e,"padded",n[2]),(!_||N[0]&1)&&Q(e,"active",n[0])},i(P){_||(P&&Qe(()=>{_&&(i||(i=qe(t,Zr,{duration:_s,opacity:0},!0)),i.run(1))}),A($,P),A(D,P),A(F,P),P&&Qe(()=>{_&&(m&&m.end(1),g=u_(l,di,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),g.start())}),_=!0)},o(P){P&&(i||(i=qe(t,Zr,{duration:_s,opacity:0},!1)),i.run(0)),L($,P),L(D,P),L(F,P),g&&g.invalidate(),P&&(m=va(l,di,n[2]?{duration:_s,y:10}:{duration:_s,x:50})),_=!1},d(P){P&&k(e),P&&i&&i.end(),C&&C.d(),$&&$.d(P),O&&O.d(),D&&D.d(P),n[21](null),F&&F.d(P),P&&m&&m.end(),y=!1,$e(S)}}}function Ec(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=K(e,"click",xe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Dc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=K(e,"click",xe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function T4(n){let e,t,i,s,l=n[0]&&Oc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Oc(o),l.c(),A(l,1),l.m(e,null)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[23](null),i=!1,$e(s)}}}let Gi,Mr=[];function b1(){return Gi=Gi||document.querySelector(".overlays"),Gi||(Gi=document.createElement("div"),Gi.classList.add("overlays"),document.body.appendChild(Gi)),Gi}let _s=150;function Ac(){return 1e3+b1().querySelectorAll(".overlay-panel-container.active").length}function C4(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=pt(),g="op_"+j.randomString(10);let m,_,y,S,C="",T=o;function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(W){t(17,T=W),W?(y=document.activeElement,h("show"),m==null||m.focus()):(clearTimeout(S),h("hide"),y==null||y.focus()),await ln(),I()}function I(){m&&(o?t(6,m.style.zIndex=Ac(),m):t(6,m.style="",m))}function F(){j.pushUnique(Mr,g),document.body.classList.add("overlay-active")}function P(){j.removeByValue(Mr,g),Mr.length||document.body.classList.remove("overlay-active")}function N(W){o&&f&&W.code=="Escape"&&!j.isInput(W.target)&&m&&m.style.zIndex==Ac()&&(W.preventDefault(),O())}function R(W){o&&q(_)}function q(W,le){le&&t(8,C=""),W&&(S||(S=setTimeout(()=>{if(clearTimeout(S),S=null,!W)return;if(W.scrollHeight-W.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}W.scrollTop==0?t(8,C+=" scroll-top-reached"):W.scrollTop+W.offsetHeight==W.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Gt(()=>(b1().appendChild(m),()=>{var W;clearTimeout(S),P(),(W=m==null?void 0:m.classList)==null||W.add("hidden"),setTimeout(()=>{m==null||m.remove()},0)}));const B=()=>a?O():!0;function Z(W){te[W?"unshift":"push"](()=>{_=W,t(7,_)})}const X=W=>q(W.target);function J(W){te[W?"unshift":"push"](()=>{m=W,t(6,m)})}return n.$$set=W=>{"class"in W&&t(1,l=W.class),"active"in W&&t(0,o=W.active),"popup"in W&&t(2,r=W.popup),"overlayClose"in W&&t(3,a=W.overlayClose),"btnClose"in W&&t(4,u=W.btnClose),"escClose"in W&&t(12,f=W.escClose),"beforeOpen"in W&&t(13,c=W.beforeOpen),"beforeHide"in W&&t(14,d=W.beforeHide),"$$scope"in W&&t(18,s=W.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&D(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&m&&I(),n.$$.dirty[0]&1&&(o?F():P())},[o,l,r,a,u,O,m,_,C,N,R,q,f,c,d,$,M,T,s,i,B,Z,X,J]}class on extends ve{constructor(e){super(),be(this,e,C4,T4,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function $4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function M4(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=U(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&se(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function O4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function E4(n){let e,t,i;return t=new _1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function D4(n){var Le;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,m=n[2].status+"",_,y,S,C,T,$,O=((Le=n[2].method)==null?void 0:Le.toUpperCase())+"",M,D,I,F,P,N,R=n[2].auth+"",q,B,Z,X,J,W,le=n[2].url+"",ee,ie,Ee,Ne,Ve,ze,oe,Ce,We,_t,Xe,Je=n[2].remoteIp+"",wt,_e,ke,Ge,Oe,ht,Ft=n[2].userIp+"",rn,xt,tn,Pn,Ae,St,Fn=n[2].userAgent+"",bn,hi,Nn,Zn,mi,Rn,Xn,ce,we,Ze,It,tt,an,Zt,nn,pn;function Ll(Pe,De){return Pe[2].referer?M4:$4}let Y=Ll(n),G=Y(n);const ne=[E4,O4],re=[];function Me(Pe,De){return De&4&&(Xn=null),Xn==null&&(Xn=!j.isEmpty(Pe[2].meta)),Xn?0:1}return ce=Me(n,-1),we=re[ce]=ne[ce](n),nn=new Ci({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=E(),o=v("td"),a=U(r),u=E(),f=v("tr"),c=v("td"),c.textContent="Status",d=E(),h=v("td"),g=v("span"),_=U(m),y=E(),S=v("tr"),C=v("td"),C.textContent="Method",T=E(),$=v("td"),M=U(O),D=E(),I=v("tr"),F=v("td"),F.textContent="Auth",P=E(),N=v("td"),q=U(R),B=E(),Z=v("tr"),X=v("td"),X.textContent="URL",J=E(),W=v("td"),ee=U(le),ie=E(),Ee=v("tr"),Ne=v("td"),Ne.textContent="Referer",Ve=E(),ze=v("td"),G.c(),oe=E(),Ce=v("tr"),We=v("td"),We.textContent="Remote IP",_t=E(),Xe=v("td"),wt=U(Je),_e=E(),ke=v("tr"),Ge=v("td"),Ge.textContent="User IP",Oe=E(),ht=v("td"),rn=U(Ft),xt=E(),tn=v("tr"),Pn=v("td"),Pn.textContent="UserAgent",Ae=E(),St=v("td"),bn=U(Fn),hi=E(),Nn=v("tr"),Zn=v("td"),Zn.textContent="Meta",mi=E(),Rn=v("td"),we.c(),Ze=E(),It=v("tr"),tt=v("td"),tt.textContent="Created",an=E(),Zt=v("td"),z(nn.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),Q(g,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(F,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Ne,"class","min-width txt-hint txt-bold"),p(We,"class","min-width txt-hint txt-bold"),p(Ge,"class","min-width txt-hint txt-bold"),p(Pn,"class","min-width txt-hint txt-bold"),p(Zn,"class","min-width txt-hint txt-bold"),p(tt,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Pe,De){w(Pe,e,De),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,a),b(t,u),b(t,f),b(f,c),b(f,d),b(f,h),b(h,g),b(g,_),b(t,y),b(t,S),b(S,C),b(S,T),b(S,$),b($,M),b(t,D),b(t,I),b(I,F),b(I,P),b(I,N),b(N,q),b(t,B),b(t,Z),b(Z,X),b(Z,J),b(Z,W),b(W,ee),b(t,ie),b(t,Ee),b(Ee,Ne),b(Ee,Ve),b(Ee,ze),G.m(ze,null),b(t,oe),b(t,Ce),b(Ce,We),b(Ce,_t),b(Ce,Xe),b(Xe,wt),b(t,_e),b(t,ke),b(ke,Ge),b(ke,Oe),b(ke,ht),b(ht,rn),b(t,xt),b(t,tn),b(tn,Pn),b(tn,Ae),b(tn,St),b(St,bn),b(t,hi),b(t,Nn),b(Nn,Zn),b(Nn,mi),b(Nn,Rn),re[ce].m(Rn,null),b(t,Ze),b(t,It),b(It,tt),b(It,an),b(It,Zt),H(nn,Zt,null),pn=!0},p(Pe,De){var Ue;(!pn||De&4)&&r!==(r=Pe[2].id+"")&&se(a,r),(!pn||De&4)&&m!==(m=Pe[2].status+"")&&se(_,m),(!pn||De&4)&&Q(g,"label-danger",Pe[2].status>=400),(!pn||De&4)&&O!==(O=((Ue=Pe[2].method)==null?void 0:Ue.toUpperCase())+"")&&se(M,O),(!pn||De&4)&&R!==(R=Pe[2].auth+"")&&se(q,R),(!pn||De&4)&&le!==(le=Pe[2].url+"")&&se(ee,le),Y===(Y=Ll(Pe))&&G?G.p(Pe,De):(G.d(1),G=Y(Pe),G&&(G.c(),G.m(ze,null))),(!pn||De&4)&&Je!==(Je=Pe[2].remoteIp+"")&&se(wt,Je),(!pn||De&4)&&Ft!==(Ft=Pe[2].userIp+"")&&se(rn,Ft),(!pn||De&4)&&Fn!==(Fn=Pe[2].userAgent+"")&&se(bn,Fn);let Ye=ce;ce=Me(Pe,De),ce===Ye?re[ce].p(Pe,De):(ue(),L(re[Ye],1,1,()=>{re[Ye]=null}),fe(),we=re[ce],we?we.p(Pe,De):(we=re[ce]=ne[ce](Pe),we.c()),A(we,1),we.m(Rn,null));const Re={};De&4&&(Re.date=Pe[2].created),nn.$set(Re)},i(Pe){pn||(A(we),A(nn.$$.fragment,Pe),pn=!0)},o(Pe){L(we),L(nn.$$.fragment,Pe),pn=!1},d(Pe){Pe&&k(e),G.d(),re[ce].d(),V(nn)}}}function A4(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function I4(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[4]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function L4(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[I4],header:[A4],default:[D4]},$$scope:{ctx:n}};return e=new on({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function P4(n,e,t){let i,s={};function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){te[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Fe.call(this,n,c)}function f(c){Fe.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class F4 extends ve{constructor(e){super(),be(this,e,P4,L4,me,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function N4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Ic(n){let e,t;return e=new g4({props:{filter:n[4],presets:n[5]}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Lc(n){let e,t;return e=new Fk({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function R4(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S=n[3],C,T=n[3],$,O;r=new Yo({}),r.$on("refresh",n[9]),d=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[N4,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),g=new Wo({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),g.$on("submit",n[11]);let M=Ic(n),D=Lc(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=U(n[6]),o=E(),z(r.$$.fragment),a=E(),u=v("div"),f=E(),c=v("div"),z(d.$$.fragment),h=E(),z(g.$$.fragment),m=E(),_=v("div"),y=E(),M.c(),C=E(),D.c(),$=Se(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(_,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,F){w(I,e,F),b(e,t),b(t,i),b(i,s),b(s,l),b(t,o),H(r,t,null),b(t,a),b(t,u),b(t,f),b(t,c),H(d,c,null),b(e,h),H(g,e,null),b(e,m),b(e,_),b(e,y),M.m(e,null),w(I,C,F),D.m(I,F),w(I,$,F),O=!0},p(I,F){(!O||F&64)&&se(l,I[6]);const P={};F&49154&&(P.$$scope={dirty:F,ctx:I}),d.$set(P);const N={};F&1&&(N.value=I[0]),g.$set(N),F&8&&me(S,S=I[3])?(ue(),L(M,1,1,x),fe(),M=Ic(I),M.c(),A(M,1),M.m(e,null)):M.p(I,F),F&8&&me(T,T=I[3])?(ue(),L(D,1,1,x),fe(),D=Lc(I),D.c(),A(D,1),D.m($.parentNode,$)):D.p(I,F)},i(I){O||(A(r.$$.fragment,I),A(d.$$.fragment,I),A(g.$$.fragment,I),A(M),A(D),O=!0)},o(I){L(r.$$.fragment,I),L(d.$$.fragment,I),L(g.$$.fragment,I),L(M),L(D),O=!1},d(I){I&&(k(e),k(C),k($)),V(r),V(d),V(g),M.d(I),D.d(I)}}}function q4(n){let e,t,i,s;e=new Sn({props:{$$slots:{default:[R4]},$$scope:{ctx:n}}});let l={};return i=new F4({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[13](null),V(i,o)}}}const Pc="includeAdminLogs";function j4(n,e,t){var y;let i,s,l;Ke(n,At,S=>t(6,l=S));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];sn(At,l="Request logs",l);let r,a="",u=((y=window.localStorage)==null?void 0:y.getItem(Pc))<<0,f=1;function c(){t(3,f++,f)}const d=()=>c();function h(){u=this.checked,t(1,u)}const g=S=>t(0,a=S.detail),m=S=>r==null?void 0:r.show(S==null?void 0:S.detail);function _(S){te[S?"unshift":"push"](()=>{r=S,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Pc,u<<0),n.$$.dirty&1&&t(4,s=j.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,c,d,h,g,m,_]}class H4 extends ve{constructor(e){super(),be(this,e,j4,q4,me,{})}}const su=In({});function mn(n,e,t){su.set({text:n,yesCallback:e,noCallback:t})}function v1(){su.set({})}function Fc(n){let e,t,i;const s=n[17].default,l=Tt(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&$t(l,s,o,o[16],i?Ct(s,o[16],r,null):Mt(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&Qe(()=>{i&&(t||(t=qe(e,di,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,di,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function V4(n){let e,t,i,s,l=n[0]&&Fc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Fc(o),l.c(),A(l,1),l.m(e,null)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[19](null),i=!1,$e(s)}}}function z4(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,h,g,m=!1;const _=pt();function y(){t(0,o=!1),m=!1,clearTimeout(g)}function S(){t(0,o=!0),clearTimeout(g),g=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function C(){o?y():S()}function T(B){return!c||B.classList.contains(u)||(h==null?void 0:h.contains(B))&&!c.contains(B)||c.contains(B)&&B.closest&&B.closest("."+u)}function $(B){(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function O(B){(B.code==="Enter"||B.code==="Space")&&(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function M(B){o&&r&&B.code==="Escape"&&(B.preventDefault(),y())}function D(B){o&&!(c!=null&&c.contains(B.target))?m=!0:m&&(m=!1)}function I(B){var Z;o&&m&&!(c!=null&&c.contains(B.target))&&!(h!=null&&h.contains(B.target))&&!((Z=B.target)!=null&&Z.closest(".flatpickr-calendar"))&&y()}function F(B){D(B),I(B)}function P(B){N(),c==null||c.addEventListener("click",$),t(15,h=B||(c==null?void 0:c.parentNode)),h==null||h.addEventListener("click",$),h==null||h.addEventListener("keydown",O)}function N(){clearTimeout(g),c==null||c.removeEventListener("click",$),h==null||h.removeEventListener("click",$),h==null||h.removeEventListener("keydown",O)}Gt(()=>(P(),()=>N()));function R(B){te[B?"unshift":"push"](()=>{d=B,t(3,d)})}function q(B){te[B?"unshift":"push"](()=>{c=B,t(2,c)})}return n.$$set=B=>{"trigger"in B&&t(8,l=B.trigger),"active"in B&&t(0,o=B.active),"escClose"in B&&t(9,r=B.escClose),"autoScroll"in B&&t(10,a=B.autoScroll),"closableClass"in B&&t(11,u=B.closableClass),"class"in B&&t(1,f=B.class),"$$scope"in B&&t(16,s=B.$$scope)},n.$$.update=()=>{var B,Z;n.$$.dirty&260&&c&&P(l),n.$$.dirty&32769&&(o?((B=h==null?void 0:h.classList)==null||B.add("active"),_("show")):((Z=h==null?void 0:h.classList)==null||Z.remove("active"),_("hide")))},[o,f,c,d,M,D,I,F,l,r,a,u,y,S,C,h,s,i,R,q]}class Ln extends ve{constructor(e){super(),be(this,e,z4,V4,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Nc(n,e,t){const i=n.slice();return i[27]=e[t],i}function B4(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("input"),s=E(),l=v("label"),o=U("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),b(l,o),a||(u=K(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function U4(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){ue();const c=e;L(c.$$.fragment,1,0,()=>{V(c,1)}),fe()}o?(e=Dt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],ye(()=>t=!1)),e.$set(c)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function W4(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Y4(n){let e,t,i,s;const l=[W4,U4],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Rc(n){let e,t,i,s=ge(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[Y4,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Rc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=Se()},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Rc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s),k(l)),V(e,a),V(i,a),r&&r.d(a)}}}function J4(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=U(t),s=U(" index")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&se(i,t)},d(l){l&&k(e)}}}function jc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Te(je.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function G4(n){let e,t,i,s,l,o,r=n[5]!=""&&jc(n);return{c(){r&&r.c(),e=E(),t=v("button"),t.innerHTML='Cancel',i=E(),s=v("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),Q(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[K(t,"click",n[17]),K(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=jc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(s,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(s)),r&&r.d(a),l=!1,$e(o)}}}function Z4(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[G4],header:[J4],default:[K4]},$$scope:{ctx:n}};for(let l=0;lJ.name==B);X?j.removeByValue(Z.columns,X):j.pushUnique(Z.columns,{name:B}),t(2,d=j.buildIndex(Z))}Gt(async()=>{t(8,m=!0);try{t(7,g=(await rt(()=>import("./CodeEditor-0c1b2f4c.js"),["./CodeEditor-0c1b2f4c.js","./index-808c8630.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,m=!1)});const O=()=>C(),M=()=>y(),D=()=>T(),I=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=j.buildIndex(s))};function F(B){d=B,t(2,d)}const P=B=>$(B);function N(B){te[B?"unshift":"push"](()=>{f=B,t(4,f)})}function R(B){Fe.call(this,n,B)}function q(B){Fe.call(this,n,B)}return n.$$set=B=>{e=He(He({},e),Qt(B)),t(14,r=et(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,Z,X;n.$$.dirty[0]&1&&t(10,i=(((Z=(B=u==null?void 0:u.schema)==null?void 0:B.filter(J=>!J.toDelete))==null?void 0:Z.map(J=>J.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((X=s.columns)==null?void 0:X.map(J=>J.name))||[])},[u,y,d,s,f,c,h,g,m,l,i,C,T,$,r,_,O,M,D,I,F,P,N,R,q]}class Q4 extends ve{constructor(e){super(),be(this,e,X4,Z4,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Hc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=j.parseIndex(i[10]);return i[11]=s,i}function Vc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Bc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Vc();function c(){return n[4](n[10],n[13])}return{c(){var h,g;e=v("button"),f&&f.c(),t=E(),i=v("span"),l=U(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((g=(h=n[2].indexes)==null?void 0:h[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(h,g){var m,_;w(h,e,g),f&&f.m(e,null),b(e,t),b(e,i),b(i,l),a||(u=[Te(r=je.call(null,e,((_=(m=n[2].indexes)==null?void 0:m[n[13]])==null?void 0:_.message)||"")),K(e,"click",c)],a=!0)},p(h,g){var m,_,y,S,C;n=h,n[11].unique?f||(f=Vc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&s!==(s=((m=n[11].columns)==null?void 0:m.map(Bc).join(", "))+"")&&se(l,s),g&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Et(r.update)&&g&4&&r.update.call(null,((C=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:C.message)||"")},d(h){h&&k(e),f&&f.d(),a=!1,$e(u)}}}function x4(n){var T,$,O;let e,t,i=((($=(T=n[0])==null?void 0:T.indexes)==null?void 0:$.length)||0)+"",s,l,o,r,a,u,f,c,d,h,g,m,_=ge(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let M=0;M<_.length;M+=1)y[M]=zc(Hc(n,_,M));function S(M){n[7](M)}let C={};return n[0]!==void 0&&(C.collection=n[0]),c=new Q4({props:C}),n[6](c),te.push(()=>he(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=E(),r=v("div");for(let M=0;M+ New index',f=E(),z(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(M,D){w(M,e,D),b(e,t),b(e,s),b(e,l),w(M,o,D),w(M,r,D);for(let I=0;Id=!1)),c.$set(I)},i(M){h||(A(c.$$.fragment,M),h=!0)},o(M){L(c.$$.fragment,M),h=!1},d(M){M&&(k(e),k(o),k(r),k(f)),gt(y,M),n[6](null),V(c,M),g=!1,m()}}}const Bc=n=>n.name;function eT(n,e,t){let i;Ke(n,$i,h=>t(2,i=h));let{collection:s}=e,l;function o(h,g){for(let m=0;ml==null?void 0:l.show(h,g),a=()=>l==null?void 0:l.show();function u(h){te[h?"unshift":"push"](()=>{l=h,t(1,l)})}function f(h){s=h,t(0,s)}const c=h=>{for(let g=0;g{o(h.detail.old,h.detail.new)};return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},[s,l,i,o,r,a,u,f,c,d]}class tT extends ve{constructor(e){super(),be(this,e,eT,x4,me,{collection:0})}}function Uc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Wc(n){let e,t,i,s,l,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent=`${n[6].label}`,l=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),o||(r=[K(e,"click",An(a)),K(e,"keydown",An(u))],o=!0)},p(f,c){n=f},d(f){f&&k(e),o=!1,$e(r)}}}function nT(n){let e,t=ge(n[2]),i=[];for(let s=0;s{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 lT extends ve{constructor(e){super(),be(this,e,sT,iT,me,{class:0})}}const oT=n=>({interactive:n&64,hasErrors:n&32}),Yc=n=>({interactive:n[6],hasErrors:n[5]}),rT=n=>({interactive:n&64,hasErrors:n&32}),Kc=n=>({interactive:n[6],hasErrors:n[5]}),aT=n=>({interactive:n&64,hasErrors:n&32}),Jc=n=>({interactive:n[6],hasErrors:n[5]});function Gc(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zc(n){let e,t,i,s;return{c(){e=v("span"),p(e,"class","marker marker-required")},m(l,o){w(l,e,o),i||(s=Te(t=je.call(null,e,n[4])),i=!0)},p(l,o){t&&Et(t.update)&&o&16&&t.update.call(null,l[4])},d(l){l&&k(e),i=!1,s()}}}function uT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=n[0].required&&Zc(n);return{c(){e=v("div"),g&&g.c(),t=E(),i=v("div"),s=v("i"),o=E(),r=v("input"),p(e,"class","markers"),p(s,"class",l=j.getFieldTypeIcon(n[0].type)),p(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),Q(i,"txt-disabled",!n[6]),p(r,"type","text"),r.required=!0,r.disabled=a=!n[6],r.readOnly=u=n[0].id&&n[0].system,p(r,"spellcheck","false"),r.autofocus=f=!n[0].id,p(r,"placeholder","Field name"),r.value=c=n[0].name},m(m,_){w(m,e,_),g&&g.m(e,null),w(m,t,_),w(m,i,_),b(i,s),w(m,o,_),w(m,r,_),n[14](r),n[0].id||r.focus(),d||(h=K(r,"input",n[15]),d=!0)},p(m,_){m[0].required?g?g.p(m,_):(g=Zc(m),g.c(),g.m(e,null)):g&&(g.d(1),g=null),_&1&&l!==(l=j.getFieldTypeIcon(m[0].type))&&p(s,"class",l),_&64&&Q(i,"txt-disabled",!m[6]),_&64&&a!==(a=!m[6])&&(r.disabled=a),_&1&&u!==(u=m[0].id&&m[0].system)&&(r.readOnly=u),_&1&&f!==(f=!m[0].id)&&(r.autofocus=f),_&1&&c!==(c=m[0].name)&&r.value!==c&&(r.value=c)},d(m){m&&(k(e),k(t),k(i),k(o),k(r)),g&&g.d(),n[14](null),d=!1,h()}}}function fT(n){let e;return{c(){e=v("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function cT(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),Q(e,"btn-hint",!n[3]&&!n[5]),Q(e,"btn-danger",n[5])},m(o,r){w(o,e,r),b(e,t),s||(l=K(e,"click",n[11]),s=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&Q(e,"btn-hint",!o[3]&&!o[5]),r&40&&Q(e,"btn-danger",o[5])},d(o){o&&k(e),s=!1,l()}}}function dT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Te(je.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function Xc(n){let e,t,i,s,l,o,r,a,u,f,c;const d=n[13].options,h=Tt(d,n,n[18],Kc);l=new pe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[pT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[hT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}});const g=n[13].optionsFooter,m=Tt(g,n,n[18],Yc);let _=!n[0].toDelete&&Qc(n);return{c(){e=v("div"),t=v("div"),h&&h.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),z(r.$$.fragment),a=E(),m&&m.c(),u=E(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),H(l,s,null),b(s,o),H(r,s,null),b(s,a),m&&m.m(s,null),b(s,u),_&&_.m(s,null),c=!0},p(y,S){h&&h.p&&(!c||S&262240)&&$t(h,d,y,y[18],c?Ct(d,y[18],S,rT):Mt(y[18]),Kc);const C={};S&17039377&&(C.$$scope={dirty:S,ctx:y}),l.$set(C);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:y}),r.$set(T),m&&m.p&&(!c||S&262240)&&$t(m,g,y,y[18],c?Ct(g,y[18],S,oT):Mt(y[18]),Yc),y[0].toDelete?_&&(ue(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(y,S),S&1&&A(_,1)):(_=Qc(y),_.c(),A(_,1),_.m(s,null))},i(y){c||(A(h,y),A(l.$$.fragment,y),A(r.$$.fragment,y),A(m,y),A(_),y&&Qe(()=>{c&&(f||(f=qe(e,it,{duration:150},!0)),f.run(1))}),c=!0)},o(y){L(h,y),L(l.$$.fragment,y),L(r.$$.fragment,y),L(m,y),L(_),y&&(f||(f=qe(e,it,{duration:150},!1)),f.run(0)),c=!1},d(y){y&&k(e),h&&h.d(y),V(l),V(r),m&&m.d(y),_&&_.d(),y&&f&&f.end()}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),o=U(n[4]),r=E(),a=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[24])},m(h,g){w(h,e,g),e.checked=n[0].required,w(h,i,g),w(h,s,g),b(s,l),b(l,o),b(s,r),b(s,a),c||(d=[K(e,"change",n[16]),Te(u=je.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(h,g){g&16777216&&t!==(t=h[24])&&p(e,"id",t),g&1&&(e.checked=h[0].required),g&16&&se(o,h[4]),u&&Et(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(h[0])}.`}),g&16777216&&f!==(f=h[24])&&p(s,"for",f)},d(h){h&&(k(e),k(i),k(s)),c=!1,$e(d)}}}function hT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Presentable",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[17]),Te(je.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],u=!0)},p(c,d){d&16777216&&t!==(t=c[24])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&16777216&&a!==(a=c[24])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Qc(n){let e,t,i,s,l,o,r,a,u;return a=new Ln({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[mT]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=E(),s=v("div"),l=v("button"),o=v("i"),r=E(),z(a.$$.fragment),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","m-l-auto txt-right")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),H(a,l,null),u=!0},p(f,c){const d={};c&262144&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){L(a.$$.fragment,f),u=!1},d(f){f&&k(e),V(a)}}}function mT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function gT(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Gc();s=new pe({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[uT]},$$scope:{ctx:n}}});const c=n[13].default,d=Tt(c,n,n[18],Jc),h=d||fT();function g(S,C){if(S[0].toDelete)return dT;if(S[6])return cT}let m=g(n),_=m&&m(n),y=n[6]&&n[3]&&Xc(n);return{c(){e=v("div"),t=v("div"),f&&f.c(),i=E(),z(s.$$.fragment),l=E(),h&&h.c(),o=E(),_&&_.c(),r=E(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[6]&&n[3]),Q(e,"deleted",n[0].toDelete)},m(S,C){w(S,e,C),b(e,t),f&&f.m(t,null),b(t,i),H(s,t,null),b(t,l),h&&h.m(t,null),b(t,o),_&&_.m(t,null),b(e,r),y&&y.m(e,null),u=!0},p(S,[C]){S[6]?f||(f=Gc(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};C&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),C&2&&(T.name="schema."+S[1]+".name"),C&262229&&(T.$$scope={dirty:C,ctx:S}),s.$set(T),d&&d.p&&(!u||C&262240)&&$t(d,c,S,S[18],u?Ct(c,S[18],C,aT):Mt(S[18]),Jc),m===(m=g(S))&&_?_.p(S,C):(_&&_.d(1),_=m&&m(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?y?(y.p(S,C),C&72&&A(y,1)):(y=Xc(S),y.c(),A(y,1),y.m(e,null)):y&&(ue(),L(y,1,1,()=>{y=null}),fe()),(!u||C&1)&&Q(e,"required",S[0].required),(!u||C&72)&&Q(e,"expanded",S[6]&&S[3]),(!u||C&1)&&Q(e,"deleted",S[0].toDelete)},i(S){u||(A(s.$$.fragment,S),A(h,S),A(y),S&&Qe(()=>{u&&(a||(a=qe(e,it,{duration:150},!0)),a.run(1))}),u=!0)},o(S){L(s.$$.fragment,S),L(h,S),L(y),S&&(a||(a=qe(e,it,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),V(s),h&&h.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Or=[];function _T(n,e,t){let i,s,l,o;Ke(n,$i,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=pt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:h=j.initSchemaField()}=e,g,m=!1;function _(){h.id?t(0,h.toDelete=!0,h):f("remove")}function y(){t(0,h.toDelete=!1,h),en({})}function S(P){return j.slugify(P)}function C(){t(3,m=!0),O()}function T(){t(3,m=!1)}function $(){m?T():C()}function O(){for(let P of Or)P.id!=u&&P.collapse()}Gt(()=>(Or.push({id:u,collapse:T}),h.onMountSelect&&(t(0,h.onMountSelect=!1,h),g==null||g.select()),()=>{j.removeByKey(Or,"id",u)}));function M(P){te[P?"unshift":"push"](()=>{g=P,t(2,g)})}const D=P=>{const N=h.name;t(0,h.name=S(P.target.value),h),P.target.value=h.name,f("rename",{oldName:N,newName:h.name})};function I(){h.required=this.checked,t(0,h)}function F(){h.presentable=this.checked,t(0,h)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,h=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&h.toDelete&&h.originalName&&h.name!==h.originalName&&t(0,h.name=h.originalName,h),n.$$.dirty&1&&!h.originalName&&h.name&&t(0,h.originalName=h.name,h),n.$$.dirty&1&&typeof h.toDelete>"u"&&t(0,h.toDelete=!1,h),n.$$.dirty&1&&h.required&&t(0,h.nullable=!1,h),n.$$.dirty&1&&t(6,i=!h.toDelete&&!(h.id&&h.system)),n.$$.dirty&4098&&t(5,s=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,l=c[h==null?void 0:h.type]||"Nonempty")},[h,d,g,m,l,s,i,f,_,y,S,$,o,r,M,D,I,F,a]}class pi extends ve{constructor(e){super(),be(this,e,_T,gT,me,{key:1,field:0})}}function bT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.min),r||(a=K(l,"input",n[3]),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&&dt(l.value)!==u[0].options.min&&ae(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function vT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[0].options.max),a||(u=K(l,"input",n[4]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].options.max&&ae(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function yT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Regex pattern"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","text"),p(l,"id",o=n[9]),p(l,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.pattern),r||(a=K(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].options.pattern&&ae(l,u[0].options.pattern)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function kT(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[bT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[vT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[yT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),p(t,"class","col-sm-3"),p(l,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),f=!0},p(c,d){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&1537&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const m={};d&2&&(m.name="schema."+c[1]+".options.pattern"),d&1537&&(m.$$scope={dirty:d,ctx:c}),u.$set(m)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(o.$$.fragment,c),L(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function wT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[kT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function ST(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=dt(this.value),t(0,l)}function a(){l.options.max=dt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(2,s=et(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]}class TT extends ve{constructor(e){super(),be(this,e,ST,wT,me,{field:0,key:1})}}function CT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.min),r||(a=K(l,"input",n[4]),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&&dt(l.value)!==u[0].options.min&&ae(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function $T(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"min",r=n[0].options.min)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[0].options.max),a||(u=K(l,"input",n[5]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].options.max&&ae(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function MT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[CT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[$T,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function OT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="No decimals",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[3]),Te(je.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&512&&a!==(a=c[9])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function ET(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[OT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.noDecimal"),s&1537&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[ET],options:[MT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function AT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.noDecimal=this.checked,t(0,l)}function a(){l.options.min=dt(this.value),t(0,l)}function u(){l.options.max=dt(this.value),t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(2,s=et(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]}class IT extends ve{constructor(e){super(),be(this,e,AT,DT,me,{field:0,key:1})}}function LT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function PT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=He(He({},e),Qt(f)),t(2,s=et(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class FT extends ve{constructor(e){super(),be(this,e,PT,LT,me,{field:0,key:1})}}function NT(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=He(He({},e),Qt(c)),t(5,l=et(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class Rs extends ve{constructor(e){super(),be(this,e,RT,NT,me,{value:0,separator:1,readonly:2,disabled:3})}}function qT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[3](_)}let m={id:n[8],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(m.value=n[0].options.exceptDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.call(null,s,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[4](_)}let m={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(m.value=n[0].options.onlyDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.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&256&&l!==(l=_[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function HT(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:[qT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[jT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function VT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[HT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function zT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(2,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class y1 extends ve{constructor(e){super(),be(this,e,zT,VT,me,{field:0,key:1})}}function BT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function UT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=He(He({},e),Qt(f)),t(2,s=et(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class WT extends ve{constructor(e){super(),be(this,e,UT,BT,me,{field:0,key:1})}}function YT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Strip urls domain",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[3]),Te(je.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function KT(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[YT,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.convertUrls"),s&769&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function JT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[4](r)}let o={$$slots:{optionsFooter:[KT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function GT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.options={convertUrls:!1},l)}function a(){l.options.convertUrls=this.checked,t(0,l)}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(2,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(l.options)&&r()},[l,o,s,a,u,f,c]}class ZT extends ve{constructor(e){super(),be(this,e,GT,JT,me,{field:0,key:1})}}var Er=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Ss={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},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%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},vn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Vn=function(n){return n===!0?1:0};function xc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function hn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ft(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function k1(n,e){if(e(n))return n;if(n.parentNode)return k1(n.parentNode,e)}function to(n,e){var t=ft("div","numInputWrapper"),i=ft("input","numInput "+n),s=ft("span","arrowUp"),l=ft("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Cn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Ar=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},XT={D:Ar,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Vn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Ar,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Ar,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},xi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ul={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ul.w(n,e,t)]},F:function(n,e,t){return Po(ul.n(n,e,t)-1,!1,e)},G:function(n,e,t){return vn(ul.h(n,e,t))},H:function(n){return vn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Vn(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return vn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return vn(n.getFullYear(),4)},d:function(n){return vn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return vn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return vn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},w1=function(n){var e=n.config,t=e===void 0?Ss:e,i=n.l10n,s=i===void 0?bl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return ul[c]&&h[d-1]!=="\\"?ul[c](r,f,t):c!=="\\"?c:""}).join("")}},pa=function(n){var e=n.config,t=e===void 0?Ss:e,i=n.l10n,s=i===void 0?bl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||Ss).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,m=[],_=0,y=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Lr(t.config);G.setHours(ne.hours,ne.minutes,ne.seconds,G.getMilliseconds()),t.selectedDates=[G],t.latestSelectedDateObj=G}Y!==void 0&&Y.type!=="blur"&&Ll(Y);var re=t._input.value;c(),nn(),t._input.value!==re&&t._debouncedChange()}function u(Y,G){return Y%12+12*Vn(G===t.l10n.amPM[1])}function f(Y){switch(Y%24){case 0:case 12:return 12;default:return Y%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Y=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,G=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Y=u(Y,t.amPM.textContent));var re=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&$n(t.latestSelectedDateObj,t.config.minDate,!0)===0,Me=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&$n(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Le=Ir(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Pe=Ir(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),De=Ir(Y,G,ne);if(De>Pe&&De=12)]),t.secondElement!==void 0&&(t.secondElement.value=vn(ne)))}function g(Y){var G=Cn(Y),ne=parseInt(G.value)+(Y.delta||0);(ne/1e3>1||Y.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&oe(ne)}function m(Y,G,ne,re){if(G instanceof Array)return G.forEach(function(Me){return m(Y,Me,ne,re)});if(Y instanceof Array)return Y.forEach(function(Me){return m(Me,G,ne,re)});Y.addEventListener(G,ne,re),t._handlers.push({remove:function(){return Y.removeEventListener(G,ne,re)}})}function _(){we("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(re){return m(re,"click",t[ne])})}),t.isMobile){Xn();return}var Y=xc(wt,50);if(t._debouncedChange=xc(_,tC),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Je(Cn(ne))}),m(t._input,"keydown",Xe),t.calendarContainer!==void 0&&m(t.calendarContainer,"keydown",Xe),!t.config.inline&&!t.config.static&&m(window,"resize",Y),window.ontouchstart!==void 0?m(window.document,"touchstart",ze):m(window.document,"mousedown",ze),m(window.document,"focus",ze,{capture:!0}),t.config.clickOpens===!0&&(m(t._input,"focus",t.open),m(t._input,"click",t.open)),t.daysContainer!==void 0&&(m(t.monthNav,"click",pn),m(t.monthNav,["keyup","increment"],g),m(t.daysContainer,"click",Ae)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var G=function(ne){return Cn(ne).select()};m(t.timeContainer,["increment"],a),m(t.timeContainer,"blur",a,{capture:!0}),m(t.timeContainer,"click",C),m([t.hourElement,t.minuteElement],["focus","click"],G),t.secondElement!==void 0&&m(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&m(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&m(t._input,"blur",_t)}function S(Y,G){var ne=Y!==void 0?t.parseDate(Y):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Y);var Me=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Me&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Le=ft("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Le,t.element),Le.appendChild(t.element),t.altInput&&Le.appendChild(t.altInput),Le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Y,G,ne,re){var Me=Ce(G,!0),Le=ft("span",Y,G.getDate().toString());return Le.dateObj=G,Le.$i=re,Le.setAttribute("aria-label",t.formatDate(G,t.config.ariaDateFormat)),Y.indexOf("hidden")===-1&&$n(G,t.now)===0&&(t.todayDateElem=Le,Le.classList.add("today"),Le.setAttribute("aria-current","date")),Me?(Le.tabIndex=-1,It(G)&&(Le.classList.add("selected"),t.selectedDateElem=Le,t.config.mode==="range"&&(hn(Le,"startRange",t.selectedDates[0]&&$n(G,t.selectedDates[0],!0)===0),hn(Le,"endRange",t.selectedDates[1]&&$n(G,t.selectedDates[1],!0)===0),Y==="nextMonthDay"&&Le.classList.add("inRange")))):Le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&tt(G)&&!It(G)&&Le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Y!=="prevMonthDay"&&re%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(G)+""),we("onDayCreate",Le),Le}function M(Y){Y.focus(),t.config.mode==="range"&&Je(Y)}function D(Y){for(var G=Y>0?0:t.config.showMonths-1,ne=Y>0?t.config.showMonths:-1,re=G;re!=ne;re+=Y)for(var Me=t.daysContainer.children[re],Le=Y>0?0:Me.children.length-1,Pe=Y>0?Me.children.length:-1,De=Le;De!=Pe;De+=Y){var Ye=Me.children[De];if(Ye.className.indexOf("hidden")===-1&&Ce(Ye.dateObj))return Ye}}function I(Y,G){for(var ne=Y.className.indexOf("Month")===-1?Y.dateObj.getMonth():t.currentMonth,re=G>0?t.config.showMonths:-1,Me=G>0?1:-1,Le=ne-t.currentMonth;Le!=re;Le+=Me)for(var Pe=t.daysContainer.children[Le],De=ne-t.currentMonth===Le?Y.$i+G:G<0?Pe.children.length-1:0,Ye=Pe.children.length,Re=De;Re>=0&&Re0?Ye:-1);Re+=Me){var Ue=Pe.children[Re];if(Ue.className.indexOf("hidden")===-1&&Ce(Ue.dateObj)&&Math.abs(Y.$i-Re)>=Math.abs(G))return M(Ue)}t.changeMonth(Me),F(D(Me),0)}function F(Y,G){var ne=l(),re=We(ne||document.body),Me=Y!==void 0?Y:re?ne:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:D(G>0?1:-1);Me===void 0?t._input.focus():re?I(Me,G):M(Me)}function P(Y,G){for(var ne=(new Date(Y,G,1).getDay()-t.l10n.firstDayOfWeek+7)%7,re=t.utils.getDaysInMonth((G-1+12)%12,Y),Me=t.utils.getDaysInMonth(G,Y),Le=window.document.createDocumentFragment(),Pe=t.config.showMonths>1,De=Pe?"prevMonthDay hidden":"prevMonthDay",Ye=Pe?"nextMonthDay hidden":"nextMonthDay",Re=re+1-ne,Ue=0;Re<=re;Re++,Ue++)Le.appendChild(O("flatpickr-day "+De,new Date(Y,G-1,Re),Re,Ue));for(Re=1;Re<=Me;Re++,Ue++)Le.appendChild(O("flatpickr-day",new Date(Y,G,Re),Re,Ue));for(var kt=Me+1;kt<=42-ne&&(t.config.showMonths===1||Ue%7!==0);kt++,Ue++)Le.appendChild(O("flatpickr-day "+Ye,new Date(Y,G+1,kt%Me),kt,Ue));var li=ft("div","dayContainer");return li.appendChild(Le),li}function N(){if(t.daysContainer!==void 0){eo(t.daysContainer),t.weekNumbers&&eo(t.weekNumbers);for(var Y=document.createDocumentFragment(),G=0;G1||t.config.monthSelectorType!=="dropdown")){var Y=function(re){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&ret.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var G=0;G<12;G++)if(Y(G)){var ne=ft("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,G).getMonth().toString(),ne.textContent=Po(G,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===G&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Y=ft("div","flatpickr-month"),G=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ft("span","cur-month"):(t.monthsDropdownContainer=ft("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),m(t.monthsDropdownContainer,"change",function(Pe){var De=Cn(Pe),Ye=parseInt(De.value,10);t.changeMonth(Ye-t.currentMonth),we("onMonthChange")}),R(),ne=t.monthsDropdownContainer);var re=to("cur-year",{tabindex:"-1"}),Me=re.getElementsByTagName("input")[0];Me.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Me.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Me.setAttribute("max",t.config.maxDate.getFullYear().toString()),Me.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Le=ft("div","flatpickr-current-month");return Le.appendChild(ne),Le.appendChild(re),G.appendChild(Le),Y.appendChild(G),{container:Y,yearElement:Me,monthElement:ne}}function B(){eo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Y=t.config.showMonths;Y--;){var G=q();t.yearElements.push(G.yearElement),t.monthElements.push(G.monthElement),t.monthNav.appendChild(G.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ft("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ft("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ft("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Y){t.__hidePrevMonthArrow!==Y&&(hn(t.prevMonthNav,"flatpickr-disabled",Y),t.__hidePrevMonthArrow=Y)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Y){t.__hideNextMonthArrow!==Y&&(hn(t.nextMonthNav,"flatpickr-disabled",Y),t.__hideNextMonthArrow=Y)}}),t.currentYearElement=t.yearElements[0],an(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Y=Lr(t.config);t.timeContainer=ft("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var G=ft("span","flatpickr-time-separator",":"),ne=to("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var re=to("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=re.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Y.hours:f(Y.hours)),t.minuteElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Y.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(G),t.timeContainer.appendChild(re),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Me=to("flatpickr-second");t.secondElement=Me.getElementsByTagName("input")[0],t.secondElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Y.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ft("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Me)}return t.config.time_24hr||(t.amPM=ft("span","flatpickr-am-pm",t.l10n.amPM[Vn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function J(){t.weekdayContainer?eo(t.weekdayContainer):t.weekdayContainer=ft("div","flatpickr-weekdays");for(var Y=t.config.showMonths;Y--;){var G=ft("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(G)}return W(),t.weekdayContainer}function W(){if(t.weekdayContainer){var Y=t.l10n.firstDayOfWeek,G=ed(t.l10n.weekdays.shorthand);Y>0&&Y>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),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 y4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(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")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function k4(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=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.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 Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _1 extends ve{constructor(e){super(),be(this,e,k4,y4,me,{class:0,content:2,language:3})}}const w4=n=>({}),$c=n=>({}),S4=n=>({}),Mc=n=>({});function Oc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C=n[4]&&!n[2]&&Ec(n);const T=n[19].header,$=Tt(T,n,n[18],Mc);let O=n[4]&&n[2]&&Dc(n);const M=n[19].default,D=Tt(M,n,n[18],null),I=n[19].footer,F=Tt(I,n,n[18],$c);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),C&&C.c(),r=E(),$&&$.c(),a=E(),O&&O.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),F&&F.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",h="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(P,N){w(P,e,N),b(e,t),b(e,s),b(e,l),b(l,o),C&&C.m(o,null),b(o,r),$&&$.m(o,null),b(o,a),O&&O.m(o,null),b(l,u),b(l,f),D&&D.m(f,null),n[21](f),b(l,c),b(l,d),F&&F.m(d,null),_=!0,y||(S=[K(t,"click",xe(n[20])),K(f,"scroll",n[22])],y=!0)},p(P,N){n=P,n[4]&&!n[2]?C?C.p(n,N):(C=Ec(n),C.c(),C.m(o,r)):C&&(C.d(1),C=null),$&&$.p&&(!_||N[0]&262144)&&$t($,T,n,n[18],_?Ct(T,n[18],N,S4):Mt(n[18]),Mc),n[4]&&n[2]?O?O.p(n,N):(O=Dc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),D&&D.p&&(!_||N[0]&262144)&&$t(D,M,n,n[18],_?Ct(M,n[18],N,null):Mt(n[18]),null),F&&F.p&&(!_||N[0]&262144)&&$t(F,I,n,n[18],_?Ct(I,n[18],N,w4):Mt(n[18]),$c),(!_||N[0]&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),(!_||N[0]&262)&&Q(l,"popup",n[2]),(!_||N[0]&4)&&Q(e,"padded",n[2]),(!_||N[0]&1)&&Q(e,"active",n[0])},i(P){_||(P&&Qe(()=>{_&&(i||(i=qe(t,Zr,{duration:_s,opacity:0},!0)),i.run(1))}),A($,P),A(D,P),A(F,P),P&&Qe(()=>{_&&(m&&m.end(1),g=u_(l,di,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),g.start())}),_=!0)},o(P){P&&(i||(i=qe(t,Zr,{duration:_s,opacity:0},!1)),i.run(0)),L($,P),L(D,P),L(F,P),g&&g.invalidate(),P&&(m=va(l,di,n[2]?{duration:_s,y:10}:{duration:_s,x:50})),_=!1},d(P){P&&k(e),P&&i&&i.end(),C&&C.d(),$&&$.d(P),O&&O.d(),D&&D.d(P),n[21](null),F&&F.d(P),P&&m&&m.end(),y=!1,$e(S)}}}function Ec(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=K(e,"click",xe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Dc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=K(e,"click",xe(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function T4(n){let e,t,i,s,l=n[0]&&Oc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Oc(o),l.c(),A(l,1),l.m(e,null)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[23](null),i=!1,$e(s)}}}let Gi,Mr=[];function b1(){return Gi=Gi||document.querySelector(".overlays"),Gi||(Gi=document.createElement("div"),Gi.classList.add("overlays"),document.body.appendChild(Gi)),Gi}let _s=150;function Ac(){return 1e3+b1().querySelectorAll(".overlay-panel-container.active").length}function C4(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=pt(),g="op_"+V.randomString(10);let m,_,y,S,C="",T=o;function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(W){t(17,T=W),W?(y=document.activeElement,h("show"),m==null||m.focus()):(clearTimeout(S),h("hide"),y==null||y.focus()),await ln(),I()}function I(){m&&(o?t(6,m.style.zIndex=Ac(),m):t(6,m.style="",m))}function F(){V.pushUnique(Mr,g),document.body.classList.add("overlay-active")}function P(){V.removeByValue(Mr,g),Mr.length||document.body.classList.remove("overlay-active")}function N(W){o&&f&&W.code=="Escape"&&!V.isInput(W.target)&&m&&m.style.zIndex==Ac()&&(W.preventDefault(),O())}function R(W){o&&q(_)}function q(W,le){le&&t(8,C=""),W&&(S||(S=setTimeout(()=>{if(clearTimeout(S),S=null,!W)return;if(W.scrollHeight-W.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}W.scrollTop==0?t(8,C+=" scroll-top-reached"):W.scrollTop+W.offsetHeight==W.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Gt(()=>(b1().appendChild(m),()=>{var W;clearTimeout(S),P(),(W=m==null?void 0:m.classList)==null||W.add("hidden"),setTimeout(()=>{m==null||m.remove()},0)}));const B=()=>a?O():!0;function Z(W){te[W?"unshift":"push"](()=>{_=W,t(7,_)})}const X=W=>q(W.target);function J(W){te[W?"unshift":"push"](()=>{m=W,t(6,m)})}return n.$$set=W=>{"class"in W&&t(1,l=W.class),"active"in W&&t(0,o=W.active),"popup"in W&&t(2,r=W.popup),"overlayClose"in W&&t(3,a=W.overlayClose),"btnClose"in W&&t(4,u=W.btnClose),"escClose"in W&&t(12,f=W.escClose),"beforeOpen"in W&&t(13,c=W.beforeOpen),"beforeHide"in W&&t(14,d=W.beforeHide),"$$scope"in W&&t(18,s=W.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&D(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&m&&I(),n.$$.dirty[0]&1&&(o?F():P())},[o,l,r,a,u,O,m,_,C,N,R,q,f,c,d,$,M,T,s,i,B,Z,X,J]}class on extends ve{constructor(e){super(),be(this,e,C4,T4,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function $4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function M4(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=U(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&se(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function O4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function E4(n){let e,t,i;return t=new _1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function D4(n){var Le;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,m=n[2].status+"",_,y,S,C,T,$,O=((Le=n[2].method)==null?void 0:Le.toUpperCase())+"",M,D,I,F,P,N,R=n[2].auth+"",q,B,Z,X,J,W,le=n[2].url+"",ee,ie,Ee,Ne,Ve,ze,oe,Ce,We,_t,Xe,Je=n[2].remoteIp+"",wt,_e,ke,Ge,Oe,ht,Ft=n[2].userIp+"",rn,xt,tn,Pn,Ae,St,Fn=n[2].userAgent+"",bn,hi,Nn,Zn,mi,Rn,Xn,ce,we,Ze,It,tt,an,Zt,nn,pn;function Ll(Pe,De){return Pe[2].referer?M4:$4}let Y=Ll(n),G=Y(n);const ne=[E4,O4],re=[];function Me(Pe,De){return De&4&&(Xn=null),Xn==null&&(Xn=!V.isEmpty(Pe[2].meta)),Xn?0:1}return ce=Me(n,-1),we=re[ce]=ne[ce](n),nn=new Ci({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=E(),o=v("td"),a=U(r),u=E(),f=v("tr"),c=v("td"),c.textContent="Status",d=E(),h=v("td"),g=v("span"),_=U(m),y=E(),S=v("tr"),C=v("td"),C.textContent="Method",T=E(),$=v("td"),M=U(O),D=E(),I=v("tr"),F=v("td"),F.textContent="Auth",P=E(),N=v("td"),q=U(R),B=E(),Z=v("tr"),X=v("td"),X.textContent="URL",J=E(),W=v("td"),ee=U(le),ie=E(),Ee=v("tr"),Ne=v("td"),Ne.textContent="Referer",Ve=E(),ze=v("td"),G.c(),oe=E(),Ce=v("tr"),We=v("td"),We.textContent="Remote IP",_t=E(),Xe=v("td"),wt=U(Je),_e=E(),ke=v("tr"),Ge=v("td"),Ge.textContent="User IP",Oe=E(),ht=v("td"),rn=U(Ft),xt=E(),tn=v("tr"),Pn=v("td"),Pn.textContent="UserAgent",Ae=E(),St=v("td"),bn=U(Fn),hi=E(),Nn=v("tr"),Zn=v("td"),Zn.textContent="Meta",mi=E(),Rn=v("td"),we.c(),Ze=E(),It=v("tr"),tt=v("td"),tt.textContent="Created",an=E(),Zt=v("td"),z(nn.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),Q(g,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(F,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Ne,"class","min-width txt-hint txt-bold"),p(We,"class","min-width txt-hint txt-bold"),p(Ge,"class","min-width txt-hint txt-bold"),p(Pn,"class","min-width txt-hint txt-bold"),p(Zn,"class","min-width txt-hint txt-bold"),p(tt,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Pe,De){w(Pe,e,De),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,a),b(t,u),b(t,f),b(f,c),b(f,d),b(f,h),b(h,g),b(g,_),b(t,y),b(t,S),b(S,C),b(S,T),b(S,$),b($,M),b(t,D),b(t,I),b(I,F),b(I,P),b(I,N),b(N,q),b(t,B),b(t,Z),b(Z,X),b(Z,J),b(Z,W),b(W,ee),b(t,ie),b(t,Ee),b(Ee,Ne),b(Ee,Ve),b(Ee,ze),G.m(ze,null),b(t,oe),b(t,Ce),b(Ce,We),b(Ce,_t),b(Ce,Xe),b(Xe,wt),b(t,_e),b(t,ke),b(ke,Ge),b(ke,Oe),b(ke,ht),b(ht,rn),b(t,xt),b(t,tn),b(tn,Pn),b(tn,Ae),b(tn,St),b(St,bn),b(t,hi),b(t,Nn),b(Nn,Zn),b(Nn,mi),b(Nn,Rn),re[ce].m(Rn,null),b(t,Ze),b(t,It),b(It,tt),b(It,an),b(It,Zt),j(nn,Zt,null),pn=!0},p(Pe,De){var Ue;(!pn||De&4)&&r!==(r=Pe[2].id+"")&&se(a,r),(!pn||De&4)&&m!==(m=Pe[2].status+"")&&se(_,m),(!pn||De&4)&&Q(g,"label-danger",Pe[2].status>=400),(!pn||De&4)&&O!==(O=((Ue=Pe[2].method)==null?void 0:Ue.toUpperCase())+"")&&se(M,O),(!pn||De&4)&&R!==(R=Pe[2].auth+"")&&se(q,R),(!pn||De&4)&&le!==(le=Pe[2].url+"")&&se(ee,le),Y===(Y=Ll(Pe))&&G?G.p(Pe,De):(G.d(1),G=Y(Pe),G&&(G.c(),G.m(ze,null))),(!pn||De&4)&&Je!==(Je=Pe[2].remoteIp+"")&&se(wt,Je),(!pn||De&4)&&Ft!==(Ft=Pe[2].userIp+"")&&se(rn,Ft),(!pn||De&4)&&Fn!==(Fn=Pe[2].userAgent+"")&&se(bn,Fn);let Ye=ce;ce=Me(Pe,De),ce===Ye?re[ce].p(Pe,De):(ue(),L(re[Ye],1,1,()=>{re[Ye]=null}),fe(),we=re[ce],we?we.p(Pe,De):(we=re[ce]=ne[ce](Pe),we.c()),A(we,1),we.m(Rn,null));const Re={};De&4&&(Re.date=Pe[2].created),nn.$set(Re)},i(Pe){pn||(A(we),A(nn.$$.fragment,Pe),pn=!0)},o(Pe){L(we),L(nn.$$.fragment,Pe),pn=!1},d(Pe){Pe&&k(e),G.d(),re[ce].d(),H(nn)}}}function A4(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function I4(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[4]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function L4(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[I4],header:[A4],default:[D4]},$$scope:{ctx:n}};return e=new on({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[5](null),H(e,s)}}}function P4(n,e,t){let i,s={};function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){te[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Fe.call(this,n,c)}function f(c){Fe.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class F4 extends ve{constructor(e){super(),be(this,e,P4,L4,me,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function N4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Ic(n){let e,t;return e=new g4({props:{filter:n[4],presets:n[5]}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Lc(n){let e,t;return e=new Fk({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function R4(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S=n[3],C,T=n[3],$,O;r=new Yo({}),r.$on("refresh",n[9]),d=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[N4,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),g=new Wo({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),g.$on("submit",n[11]);let M=Ic(n),D=Lc(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=U(n[6]),o=E(),z(r.$$.fragment),a=E(),u=v("div"),f=E(),c=v("div"),z(d.$$.fragment),h=E(),z(g.$$.fragment),m=E(),_=v("div"),y=E(),M.c(),C=E(),D.c(),$=Se(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(_,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,F){w(I,e,F),b(e,t),b(t,i),b(i,s),b(s,l),b(t,o),j(r,t,null),b(t,a),b(t,u),b(t,f),b(t,c),j(d,c,null),b(e,h),j(g,e,null),b(e,m),b(e,_),b(e,y),M.m(e,null),w(I,C,F),D.m(I,F),w(I,$,F),O=!0},p(I,F){(!O||F&64)&&se(l,I[6]);const P={};F&49154&&(P.$$scope={dirty:F,ctx:I}),d.$set(P);const N={};F&1&&(N.value=I[0]),g.$set(N),F&8&&me(S,S=I[3])?(ue(),L(M,1,1,x),fe(),M=Ic(I),M.c(),A(M,1),M.m(e,null)):M.p(I,F),F&8&&me(T,T=I[3])?(ue(),L(D,1,1,x),fe(),D=Lc(I),D.c(),A(D,1),D.m($.parentNode,$)):D.p(I,F)},i(I){O||(A(r.$$.fragment,I),A(d.$$.fragment,I),A(g.$$.fragment,I),A(M),A(D),O=!0)},o(I){L(r.$$.fragment,I),L(d.$$.fragment,I),L(g.$$.fragment,I),L(M),L(D),O=!1},d(I){I&&(k(e),k(C),k($)),H(r),H(d),H(g),M.d(I),D.d(I)}}}function q4(n){let e,t,i,s;e=new Sn({props:{$$slots:{default:[R4]},$$scope:{ctx:n}}});let l={};return i=new F4({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){j(e,o,r),w(o,t,r),j(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){o&&k(t),H(e,o),n[13](null),H(i,o)}}}const Pc="includeAdminLogs";function j4(n,e,t){var y;let i,s,l;Ke(n,Dt,S=>t(6,l=S));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];sn(Dt,l="Request logs",l);let r,a="",u=((y=window.localStorage)==null?void 0:y.getItem(Pc))<<0,f=1;function c(){t(3,f++,f)}const d=()=>c();function h(){u=this.checked,t(1,u)}const g=S=>t(0,a=S.detail),m=S=>r==null?void 0:r.show(S==null?void 0:S.detail);function _(S){te[S?"unshift":"push"](()=>{r=S,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Pc,u<<0),n.$$.dirty&1&&t(4,s=V.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,c,d,h,g,m,_]}class H4 extends ve{constructor(e){super(),be(this,e,j4,q4,me,{})}}const su=In({});function mn(n,e,t){su.set({text:n,yesCallback:e,noCallback:t})}function v1(){su.set({})}function Fc(n){let e,t,i;const s=n[17].default,l=Tt(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&$t(l,s,o,o[16],i?Ct(s,o[16],r,null):Mt(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&Qe(()=>{i&&(t||(t=qe(e,di,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,di,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function V4(n){let e,t,i,s,l=n[0]&&Fc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Fc(o),l.c(),A(l,1),l.m(e,null)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[19](null),i=!1,$e(s)}}}function z4(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,h,g,m=!1;const _=pt();function y(){t(0,o=!1),m=!1,clearTimeout(g)}function S(){t(0,o=!0),clearTimeout(g),g=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function C(){o?y():S()}function T(B){return!c||B.classList.contains(u)||(h==null?void 0:h.contains(B))&&!c.contains(B)||c.contains(B)&&B.closest&&B.closest("."+u)}function $(B){(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function O(B){(B.code==="Enter"||B.code==="Space")&&(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function M(B){o&&r&&B.code==="Escape"&&(B.preventDefault(),y())}function D(B){o&&!(c!=null&&c.contains(B.target))?m=!0:m&&(m=!1)}function I(B){var Z;o&&m&&!(c!=null&&c.contains(B.target))&&!(h!=null&&h.contains(B.target))&&!((Z=B.target)!=null&&Z.closest(".flatpickr-calendar"))&&y()}function F(B){D(B),I(B)}function P(B){N(),c==null||c.addEventListener("click",$),t(15,h=B||(c==null?void 0:c.parentNode)),h==null||h.addEventListener("click",$),h==null||h.addEventListener("keydown",O)}function N(){clearTimeout(g),c==null||c.removeEventListener("click",$),h==null||h.removeEventListener("click",$),h==null||h.removeEventListener("keydown",O)}Gt(()=>(P(),()=>N()));function R(B){te[B?"unshift":"push"](()=>{d=B,t(3,d)})}function q(B){te[B?"unshift":"push"](()=>{c=B,t(2,c)})}return n.$$set=B=>{"trigger"in B&&t(8,l=B.trigger),"active"in B&&t(0,o=B.active),"escClose"in B&&t(9,r=B.escClose),"autoScroll"in B&&t(10,a=B.autoScroll),"closableClass"in B&&t(11,u=B.closableClass),"class"in B&&t(1,f=B.class),"$$scope"in B&&t(16,s=B.$$scope)},n.$$.update=()=>{var B,Z;n.$$.dirty&260&&c&&P(l),n.$$.dirty&32769&&(o?((B=h==null?void 0:h.classList)==null||B.add("active"),_("show")):((Z=h==null?void 0:h.classList)==null||Z.remove("active"),_("hide")))},[o,f,c,d,M,D,I,F,l,r,a,u,y,S,C,h,s,i,R,q]}class Ln extends ve{constructor(e){super(),be(this,e,z4,V4,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Nc(n,e,t){const i=n.slice();return i[27]=e[t],i}function B4(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("input"),s=E(),l=v("label"),o=U("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),b(l,o),a||(u=K(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function U4(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Et(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){ue();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),fe()}o?(e=Et(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],ye(()=>t=!1)),e.$set(c)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function W4(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Y4(n){let e,t,i,s;const l=[W4,U4],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Rc(n){let e,t,i,s=ge(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[Y4,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Rc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=Se()},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Rc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s),k(l)),H(e,a),H(i,a),r&&r.d(a)}}}function J4(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=U(t),s=U(" index")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&se(i,t)},d(l){l&&k(e)}}}function jc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Te(je.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function G4(n){let e,t,i,s,l,o,r=n[5]!=""&&jc(n);return{c(){r&&r.c(),e=E(),t=v("button"),t.innerHTML='Cancel',i=E(),s=v("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),Q(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[K(t,"click",n[17]),K(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=jc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(s,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(s)),r&&r.d(a),l=!1,$e(o)}}}function Z4(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[G4],header:[J4],default:[K4]},$$scope:{ctx:n}};for(let l=0;lJ.name==B);X?V.removeByValue(Z.columns,X):V.pushUnique(Z.columns,{name:B}),t(2,d=V.buildIndex(Z))}Gt(async()=>{t(8,m=!0);try{t(7,g=(await rt(()=>import("./CodeEditor-73c7d443.js"),["./CodeEditor-73c7d443.js","./index-9cd23da9.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,m=!1)});const O=()=>C(),M=()=>y(),D=()=>T(),I=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=V.buildIndex(s))};function F(B){d=B,t(2,d)}const P=B=>$(B);function N(B){te[B?"unshift":"push"](()=>{f=B,t(4,f)})}function R(B){Fe.call(this,n,B)}function q(B){Fe.call(this,n,B)}return n.$$set=B=>{e=He(He({},e),Qt(B)),t(14,r=et(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,Z,X;n.$$.dirty[0]&1&&t(10,i=(((Z=(B=u==null?void 0:u.schema)==null?void 0:B.filter(J=>!J.toDelete))==null?void 0:Z.map(J=>J.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=V.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((X=s.columns)==null?void 0:X.map(J=>J.name))||[])},[u,y,d,s,f,c,h,g,m,l,i,C,T,$,r,_,O,M,D,I,F,P,N,R,q]}class Q4 extends ve{constructor(e){super(),be(this,e,X4,Z4,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Hc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=V.parseIndex(i[10]);return i[11]=s,i}function Vc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Bc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Vc();function c(){return n[4](n[10],n[13])}return{c(){var h,g;e=v("button"),f&&f.c(),t=E(),i=v("span"),l=U(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((g=(h=n[2].indexes)==null?void 0:h[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(h,g){var m,_;w(h,e,g),f&&f.m(e,null),b(e,t),b(e,i),b(i,l),a||(u=[Te(r=je.call(null,e,((_=(m=n[2].indexes)==null?void 0:m[n[13]])==null?void 0:_.message)||"")),K(e,"click",c)],a=!0)},p(h,g){var m,_,y,S,C;n=h,n[11].unique?f||(f=Vc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&s!==(s=((m=n[11].columns)==null?void 0:m.map(Bc).join(", "))+"")&&se(l,s),g&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&At(r.update)&&g&4&&r.update.call(null,((C=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:C.message)||"")},d(h){h&&k(e),f&&f.d(),a=!1,$e(u)}}}function x4(n){var T,$,O;let e,t,i=((($=(T=n[0])==null?void 0:T.indexes)==null?void 0:$.length)||0)+"",s,l,o,r,a,u,f,c,d,h,g,m,_=ge(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let M=0;M<_.length;M+=1)y[M]=zc(Hc(n,_,M));function S(M){n[7](M)}let C={};return n[0]!==void 0&&(C.collection=n[0]),c=new Q4({props:C}),n[6](c),te.push(()=>he(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=E(),r=v("div");for(let M=0;M+ New index',f=E(),z(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(M,D){w(M,e,D),b(e,t),b(e,s),b(e,l),w(M,o,D),w(M,r,D);for(let I=0;Id=!1)),c.$set(I)},i(M){h||(A(c.$$.fragment,M),h=!0)},o(M){L(c.$$.fragment,M),h=!1},d(M){M&&(k(e),k(o),k(r),k(f)),gt(y,M),n[6](null),H(c,M),g=!1,m()}}}const Bc=n=>n.name;function eT(n,e,t){let i;Ke(n,$i,h=>t(2,i=h));let{collection:s}=e,l;function o(h,g){for(let m=0;ml==null?void 0:l.show(h,g),a=()=>l==null?void 0:l.show();function u(h){te[h?"unshift":"push"](()=>{l=h,t(1,l)})}function f(h){s=h,t(0,s)}const c=h=>{for(let g=0;g{o(h.detail.old,h.detail.new)};return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},[s,l,i,o,r,a,u,f,c,d]}class tT extends ve{constructor(e){super(),be(this,e,eT,x4,me,{collection:0})}}function Uc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Wc(n){let e,t,i,s,l,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent=`${n[6].label}`,l=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),o||(r=[K(e,"click",An(a)),K(e,"keydown",An(u))],o=!0)},p(f,c){n=f},d(f){f&&k(e),o=!1,$e(r)}}}function nT(n){let e,t=ge(n[2]),i=[];for(let s=0;s{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 lT extends ve{constructor(e){super(),be(this,e,sT,iT,me,{class:0})}}const oT=n=>({interactive:n&64,hasErrors:n&32}),Yc=n=>({interactive:n[6],hasErrors:n[5]}),rT=n=>({interactive:n&64,hasErrors:n&32}),Kc=n=>({interactive:n[6],hasErrors:n[5]}),aT=n=>({interactive:n&64,hasErrors:n&32}),Jc=n=>({interactive:n[6],hasErrors:n[5]});function Gc(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zc(n){let e,t,i,s;return{c(){e=v("span"),p(e,"class","marker marker-required")},m(l,o){w(l,e,o),i||(s=Te(t=je.call(null,e,n[4])),i=!0)},p(l,o){t&&At(t.update)&&o&16&&t.update.call(null,l[4])},d(l){l&&k(e),i=!1,s()}}}function uT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=n[0].required&&Zc(n);return{c(){e=v("div"),g&&g.c(),t=E(),i=v("div"),s=v("i"),o=E(),r=v("input"),p(e,"class","markers"),p(s,"class",l=V.getFieldTypeIcon(n[0].type)),p(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),Q(i,"txt-disabled",!n[6]),p(r,"type","text"),r.required=!0,r.disabled=a=!n[6],r.readOnly=u=n[0].id&&n[0].system,p(r,"spellcheck","false"),r.autofocus=f=!n[0].id,p(r,"placeholder","Field name"),r.value=c=n[0].name},m(m,_){w(m,e,_),g&&g.m(e,null),w(m,t,_),w(m,i,_),b(i,s),w(m,o,_),w(m,r,_),n[14](r),n[0].id||r.focus(),d||(h=K(r,"input",n[15]),d=!0)},p(m,_){m[0].required?g?g.p(m,_):(g=Zc(m),g.c(),g.m(e,null)):g&&(g.d(1),g=null),_&1&&l!==(l=V.getFieldTypeIcon(m[0].type))&&p(s,"class",l),_&64&&Q(i,"txt-disabled",!m[6]),_&64&&a!==(a=!m[6])&&(r.disabled=a),_&1&&u!==(u=m[0].id&&m[0].system)&&(r.readOnly=u),_&1&&f!==(f=!m[0].id)&&(r.autofocus=f),_&1&&c!==(c=m[0].name)&&r.value!==c&&(r.value=c)},d(m){m&&(k(e),k(t),k(i),k(o),k(r)),g&&g.d(),n[14](null),d=!1,h()}}}function fT(n){let e;return{c(){e=v("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function cT(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),Q(e,"btn-hint",!n[3]&&!n[5]),Q(e,"btn-danger",n[5])},m(o,r){w(o,e,r),b(e,t),s||(l=K(e,"click",n[11]),s=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&Q(e,"btn-hint",!o[3]&&!o[5]),r&40&&Q(e,"btn-danger",o[5])},d(o){o&&k(e),s=!1,l()}}}function dT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Te(je.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function Xc(n){let e,t,i,s,l,o,r,a,u,f,c;const d=n[13].options,h=Tt(d,n,n[18],Kc);l=new pe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[pT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[hT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}});const g=n[13].optionsFooter,m=Tt(g,n,n[18],Yc);let _=!n[0].toDelete&&Qc(n);return{c(){e=v("div"),t=v("div"),h&&h.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),z(r.$$.fragment),a=E(),m&&m.c(),u=E(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),j(l,s,null),b(s,o),j(r,s,null),b(s,a),m&&m.m(s,null),b(s,u),_&&_.m(s,null),c=!0},p(y,S){h&&h.p&&(!c||S&262240)&&$t(h,d,y,y[18],c?Ct(d,y[18],S,rT):Mt(y[18]),Kc);const C={};S&17039377&&(C.$$scope={dirty:S,ctx:y}),l.$set(C);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:y}),r.$set(T),m&&m.p&&(!c||S&262240)&&$t(m,g,y,y[18],c?Ct(g,y[18],S,oT):Mt(y[18]),Yc),y[0].toDelete?_&&(ue(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(y,S),S&1&&A(_,1)):(_=Qc(y),_.c(),A(_,1),_.m(s,null))},i(y){c||(A(h,y),A(l.$$.fragment,y),A(r.$$.fragment,y),A(m,y),A(_),y&&Qe(()=>{c&&(f||(f=qe(e,it,{duration:150},!0)),f.run(1))}),c=!0)},o(y){L(h,y),L(l.$$.fragment,y),L(r.$$.fragment,y),L(m,y),L(_),y&&(f||(f=qe(e,it,{duration:150},!1)),f.run(0)),c=!1},d(y){y&&k(e),h&&h.d(y),H(l),H(r),m&&m.d(y),_&&_.d(),y&&f&&f.end()}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),o=U(n[4]),r=E(),a=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[24])},m(h,g){w(h,e,g),e.checked=n[0].required,w(h,i,g),w(h,s,g),b(s,l),b(l,o),b(s,r),b(s,a),c||(d=[K(e,"change",n[16]),Te(u=je.call(null,a,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(n[0])}.`}))],c=!0)},p(h,g){g&16777216&&t!==(t=h[24])&&p(e,"id",t),g&1&&(e.checked=h[0].required),g&16&&se(o,h[4]),u&&At(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${V.zeroDefaultStr(h[0])}.`}),g&16777216&&f!==(f=h[24])&&p(s,"for",f)},d(h){h&&(k(e),k(i),k(s)),c=!1,$e(d)}}}function hT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Presentable",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[17]),Te(je.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],u=!0)},p(c,d){d&16777216&&t!==(t=c[24])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&16777216&&a!==(a=c[24])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Qc(n){let e,t,i,s,l,o,r,a,u;return a=new Ln({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[mT]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=E(),s=v("div"),l=v("button"),o=v("i"),r=E(),z(a.$$.fragment),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","m-l-auto txt-right")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),j(a,l,null),u=!0},p(f,c){const d={};c&262144&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){L(a.$$.fragment,f),u=!1},d(f){f&&k(e),H(a)}}}function mT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function gT(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Gc();s=new pe({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[uT]},$$scope:{ctx:n}}});const c=n[13].default,d=Tt(c,n,n[18],Jc),h=d||fT();function g(S,C){if(S[0].toDelete)return dT;if(S[6])return cT}let m=g(n),_=m&&m(n),y=n[6]&&n[3]&&Xc(n);return{c(){e=v("div"),t=v("div"),f&&f.c(),i=E(),z(s.$$.fragment),l=E(),h&&h.c(),o=E(),_&&_.c(),r=E(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[6]&&n[3]),Q(e,"deleted",n[0].toDelete)},m(S,C){w(S,e,C),b(e,t),f&&f.m(t,null),b(t,i),j(s,t,null),b(t,l),h&&h.m(t,null),b(t,o),_&&_.m(t,null),b(e,r),y&&y.m(e,null),u=!0},p(S,[C]){S[6]?f||(f=Gc(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};C&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),C&2&&(T.name="schema."+S[1]+".name"),C&262229&&(T.$$scope={dirty:C,ctx:S}),s.$set(T),d&&d.p&&(!u||C&262240)&&$t(d,c,S,S[18],u?Ct(c,S[18],C,aT):Mt(S[18]),Jc),m===(m=g(S))&&_?_.p(S,C):(_&&_.d(1),_=m&&m(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?y?(y.p(S,C),C&72&&A(y,1)):(y=Xc(S),y.c(),A(y,1),y.m(e,null)):y&&(ue(),L(y,1,1,()=>{y=null}),fe()),(!u||C&1)&&Q(e,"required",S[0].required),(!u||C&72)&&Q(e,"expanded",S[6]&&S[3]),(!u||C&1)&&Q(e,"deleted",S[0].toDelete)},i(S){u||(A(s.$$.fragment,S),A(h,S),A(y),S&&Qe(()=>{u&&(a||(a=qe(e,it,{duration:150},!0)),a.run(1))}),u=!0)},o(S){L(s.$$.fragment,S),L(h,S),L(y),S&&(a||(a=qe(e,it,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),H(s),h&&h.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Or=[];function _T(n,e,t){let i,s,l,o;Ke(n,$i,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+V.randomString(8),f=pt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:h=V.initSchemaField()}=e,g,m=!1;function _(){h.id?t(0,h.toDelete=!0,h):f("remove")}function y(){t(0,h.toDelete=!1,h),en({})}function S(P){return V.slugify(P)}function C(){t(3,m=!0),O()}function T(){t(3,m=!1)}function $(){m?T():C()}function O(){for(let P of Or)P.id!=u&&P.collapse()}Gt(()=>(Or.push({id:u,collapse:T}),h.onMountSelect&&(t(0,h.onMountSelect=!1,h),g==null||g.select()),()=>{V.removeByKey(Or,"id",u)}));function M(P){te[P?"unshift":"push"](()=>{g=P,t(2,g)})}const D=P=>{const N=h.name;t(0,h.name=S(P.target.value),h),P.target.value=h.name,f("rename",{oldName:N,newName:h.name})};function I(){h.required=this.checked,t(0,h)}function F(){h.presentable=this.checked,t(0,h)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,h=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&h.toDelete&&h.originalName&&h.name!==h.originalName&&t(0,h.name=h.originalName,h),n.$$.dirty&1&&!h.originalName&&h.name&&t(0,h.originalName=h.name,h),n.$$.dirty&1&&typeof h.toDelete>"u"&&t(0,h.toDelete=!1,h),n.$$.dirty&1&&h.required&&t(0,h.nullable=!1,h),n.$$.dirty&1&&t(6,i=!h.toDelete&&!(h.id&&h.system)),n.$$.dirty&4098&&t(5,s=!V.isEmpty(V.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,l=c[h==null?void 0:h.type]||"Nonempty")},[h,d,g,m,l,s,i,f,_,y,S,$,o,r,M,D,I,F,a]}class pi extends ve{constructor(e){super(),be(this,e,_T,gT,me,{key:1,field:0})}}function bT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.min),r||(a=K(l,"input",n[3]),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&&dt(l.value)!==u[0].options.min&&ae(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function vT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[0].options.max),a||(u=K(l,"input",n[4]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].options.max&&ae(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function yT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Regex pattern"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","text"),p(l,"id",o=n[9]),p(l,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.pattern),r||(a=K(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].options.pattern&&ae(l,u[0].options.pattern)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function kT(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[bT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[vT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[yT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),p(t,"class","col-sm-3"),p(l,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),b(e,a),j(u,a,null),f=!0},p(c,d){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&1537&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const m={};d&2&&(m.name="schema."+c[1]+".options.pattern"),d&1537&&(m.$$scope={dirty:d,ctx:c}),u.$set(m)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(o.$$.fragment,c),L(u.$$.fragment,c),f=!1},d(c){c&&k(e),H(i),H(o),H(u)}}}function wT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[kT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function ST(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=dt(this.value),t(0,l)}function a(){l.options.max=dt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(2,s=et(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]}class TT extends ve{constructor(e){super(),be(this,e,ST,wT,me,{field:0,key:1})}}function CT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.min),r||(a=K(l,"input",n[4]),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&&dt(l.value)!==u[0].options.min&&ae(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function $T(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"min",r=n[0].options.min)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[0].options.max),a||(u=K(l,"input",n[5]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].options.max&&ae(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function MT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[CT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[$T,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function OT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="No decimals",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[3]),Te(je.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&512&&a!==(a=c[9])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function ET(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[OT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.noDecimal"),s&1537&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function DT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[ET],options:[MT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function AT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.noDecimal=this.checked,t(0,l)}function a(){l.options.min=dt(this.value),t(0,l)}function u(){l.options.max=dt(this.value),t(0,l)}function f(h){l=h,t(0,l)}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(2,s=et(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]}class IT extends ve{constructor(e){super(),be(this,e,AT,DT,me,{field:0,key:1})}}function LT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function PT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=He(He({},e),Qt(f)),t(2,s=et(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class FT extends ve{constructor(e){super(),be(this,e,PT,LT,me,{field:0,key:1})}}function NT(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=V.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=He(He({},e),Qt(c)),t(5,l=et(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=V.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class Rs extends ve{constructor(e){super(),be(this,e,RT,NT,me,{value:0,separator:1,readonly:2,disabled:3})}}function qT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[3](_)}let m={id:n[8],disabled:!V.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(m.value=n[0].options.exceptDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.call(null,s,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]),y&1&&(S.disabled=!V.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[4](_)}let m={id:n[8]+".options.onlyDomains",disabled:!V.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(m.value=n[0].options.onlyDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.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&256&&l!==(l=_[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]+".options.onlyDomains"),y&1&&(S.disabled=!V.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function HT(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:[qT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[jT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function VT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[HT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function zT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(2,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class y1 extends ve{constructor(e){super(),be(this,e,zT,VT,me,{field:0,key:1})}}function BT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function UT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=He(He({},e),Qt(f)),t(2,s=et(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class WT extends ve{constructor(e){super(),be(this,e,UT,BT,me,{field:0,key:1})}}function YT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Strip urls domain",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[3]),Te(je.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function KT(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[YT,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.convertUrls"),s&769&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[4](r)}let o={$$slots:{optionsFooter:[KT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function GT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.options={convertUrls:!1},l)}function a(){l.options.convertUrls=this.checked,t(0,l)}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(2,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&V.isEmpty(l.options)&&r()},[l,o,s,a,u,f,c]}class ZT extends ve{constructor(e){super(),be(this,e,GT,JT,me,{field:0,key:1})}}var Er=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Ss={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},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%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},vn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Vn=function(n){return n===!0?1:0};function xc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function hn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ft(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function k1(n,e){if(e(n))return n;if(n.parentNode)return k1(n.parentNode,e)}function to(n,e){var t=ft("div","numInputWrapper"),i=ft("input","numInput "+n),s=ft("span","arrowUp"),l=ft("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Cn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Ar=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},XT={D:Ar,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Vn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Ar,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Ar,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},xi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ul={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ul.w(n,e,t)]},F:function(n,e,t){return Po(ul.n(n,e,t)-1,!1,e)},G:function(n,e,t){return vn(ul.h(n,e,t))},H:function(n){return vn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Vn(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return vn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return vn(n.getFullYear(),4)},d:function(n){return vn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return vn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return vn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},w1=function(n){var e=n.config,t=e===void 0?Ss:e,i=n.l10n,s=i===void 0?bl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return ul[c]&&h[d-1]!=="\\"?ul[c](r,f,t):c!=="\\"?c:""}).join("")}},pa=function(n){var e=n.config,t=e===void 0?Ss:e,i=n.l10n,s=i===void 0?bl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||Ss).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,m=[],_=0,y=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Lr(t.config);G.setHours(ne.hours,ne.minutes,ne.seconds,G.getMilliseconds()),t.selectedDates=[G],t.latestSelectedDateObj=G}Y!==void 0&&Y.type!=="blur"&&Ll(Y);var re=t._input.value;c(),nn(),t._input.value!==re&&t._debouncedChange()}function u(Y,G){return Y%12+12*Vn(G===t.l10n.amPM[1])}function f(Y){switch(Y%24){case 0:case 12:return 12;default:return Y%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Y=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,G=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Y=u(Y,t.amPM.textContent));var re=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&$n(t.latestSelectedDateObj,t.config.minDate,!0)===0,Me=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&$n(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Le=Ir(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Pe=Ir(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),De=Ir(Y,G,ne);if(De>Pe&&De=12)]),t.secondElement!==void 0&&(t.secondElement.value=vn(ne)))}function g(Y){var G=Cn(Y),ne=parseInt(G.value)+(Y.delta||0);(ne/1e3>1||Y.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&oe(ne)}function m(Y,G,ne,re){if(G instanceof Array)return G.forEach(function(Me){return m(Y,Me,ne,re)});if(Y instanceof Array)return Y.forEach(function(Me){return m(Me,G,ne,re)});Y.addEventListener(G,ne,re),t._handlers.push({remove:function(){return Y.removeEventListener(G,ne,re)}})}function _(){we("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(re){return m(re,"click",t[ne])})}),t.isMobile){Xn();return}var Y=xc(wt,50);if(t._debouncedChange=xc(_,tC),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Je(Cn(ne))}),m(t._input,"keydown",Xe),t.calendarContainer!==void 0&&m(t.calendarContainer,"keydown",Xe),!t.config.inline&&!t.config.static&&m(window,"resize",Y),window.ontouchstart!==void 0?m(window.document,"touchstart",ze):m(window.document,"mousedown",ze),m(window.document,"focus",ze,{capture:!0}),t.config.clickOpens===!0&&(m(t._input,"focus",t.open),m(t._input,"click",t.open)),t.daysContainer!==void 0&&(m(t.monthNav,"click",pn),m(t.monthNav,["keyup","increment"],g),m(t.daysContainer,"click",Ae)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var G=function(ne){return Cn(ne).select()};m(t.timeContainer,["increment"],a),m(t.timeContainer,"blur",a,{capture:!0}),m(t.timeContainer,"click",C),m([t.hourElement,t.minuteElement],["focus","click"],G),t.secondElement!==void 0&&m(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&m(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&m(t._input,"blur",_t)}function S(Y,G){var ne=Y!==void 0?t.parseDate(Y):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Y);var Me=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Me&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Le=ft("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Le,t.element),Le.appendChild(t.element),t.altInput&&Le.appendChild(t.altInput),Le.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(Y,G,ne,re){var Me=Ce(G,!0),Le=ft("span",Y,G.getDate().toString());return Le.dateObj=G,Le.$i=re,Le.setAttribute("aria-label",t.formatDate(G,t.config.ariaDateFormat)),Y.indexOf("hidden")===-1&&$n(G,t.now)===0&&(t.todayDateElem=Le,Le.classList.add("today"),Le.setAttribute("aria-current","date")),Me?(Le.tabIndex=-1,It(G)&&(Le.classList.add("selected"),t.selectedDateElem=Le,t.config.mode==="range"&&(hn(Le,"startRange",t.selectedDates[0]&&$n(G,t.selectedDates[0],!0)===0),hn(Le,"endRange",t.selectedDates[1]&&$n(G,t.selectedDates[1],!0)===0),Y==="nextMonthDay"&&Le.classList.add("inRange")))):Le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&tt(G)&&!It(G)&&Le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Y!=="prevMonthDay"&&re%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(G)+""),we("onDayCreate",Le),Le}function M(Y){Y.focus(),t.config.mode==="range"&&Je(Y)}function D(Y){for(var G=Y>0?0:t.config.showMonths-1,ne=Y>0?t.config.showMonths:-1,re=G;re!=ne;re+=Y)for(var Me=t.daysContainer.children[re],Le=Y>0?0:Me.children.length-1,Pe=Y>0?Me.children.length:-1,De=Le;De!=Pe;De+=Y){var Ye=Me.children[De];if(Ye.className.indexOf("hidden")===-1&&Ce(Ye.dateObj))return Ye}}function I(Y,G){for(var ne=Y.className.indexOf("Month")===-1?Y.dateObj.getMonth():t.currentMonth,re=G>0?t.config.showMonths:-1,Me=G>0?1:-1,Le=ne-t.currentMonth;Le!=re;Le+=Me)for(var Pe=t.daysContainer.children[Le],De=ne-t.currentMonth===Le?Y.$i+G:G<0?Pe.children.length-1:0,Ye=Pe.children.length,Re=De;Re>=0&&Re0?Ye:-1);Re+=Me){var Ue=Pe.children[Re];if(Ue.className.indexOf("hidden")===-1&&Ce(Ue.dateObj)&&Math.abs(Y.$i-Re)>=Math.abs(G))return M(Ue)}t.changeMonth(Me),F(D(Me),0)}function F(Y,G){var ne=l(),re=We(ne||document.body),Me=Y!==void 0?Y:re?ne:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:D(G>0?1:-1);Me===void 0?t._input.focus():re?I(Me,G):M(Me)}function P(Y,G){for(var ne=(new Date(Y,G,1).getDay()-t.l10n.firstDayOfWeek+7)%7,re=t.utils.getDaysInMonth((G-1+12)%12,Y),Me=t.utils.getDaysInMonth(G,Y),Le=window.document.createDocumentFragment(),Pe=t.config.showMonths>1,De=Pe?"prevMonthDay hidden":"prevMonthDay",Ye=Pe?"nextMonthDay hidden":"nextMonthDay",Re=re+1-ne,Ue=0;Re<=re;Re++,Ue++)Le.appendChild(O("flatpickr-day "+De,new Date(Y,G-1,Re),Re,Ue));for(Re=1;Re<=Me;Re++,Ue++)Le.appendChild(O("flatpickr-day",new Date(Y,G,Re),Re,Ue));for(var kt=Me+1;kt<=42-ne&&(t.config.showMonths===1||Ue%7!==0);kt++,Ue++)Le.appendChild(O("flatpickr-day "+Ye,new Date(Y,G+1,kt%Me),kt,Ue));var li=ft("div","dayContainer");return li.appendChild(Le),li}function N(){if(t.daysContainer!==void 0){eo(t.daysContainer),t.weekNumbers&&eo(t.weekNumbers);for(var Y=document.createDocumentFragment(),G=0;G1||t.config.monthSelectorType!=="dropdown")){var Y=function(re){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&ret.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var G=0;G<12;G++)if(Y(G)){var ne=ft("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,G).getMonth().toString(),ne.textContent=Po(G,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===G&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var Y=ft("div","flatpickr-month"),G=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ft("span","cur-month"):(t.monthsDropdownContainer=ft("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),m(t.monthsDropdownContainer,"change",function(Pe){var De=Cn(Pe),Ye=parseInt(De.value,10);t.changeMonth(Ye-t.currentMonth),we("onMonthChange")}),R(),ne=t.monthsDropdownContainer);var re=to("cur-year",{tabindex:"-1"}),Me=re.getElementsByTagName("input")[0];Me.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Me.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Me.setAttribute("max",t.config.maxDate.getFullYear().toString()),Me.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Le=ft("div","flatpickr-current-month");return Le.appendChild(ne),Le.appendChild(re),G.appendChild(Le),Y.appendChild(G),{container:Y,yearElement:Me,monthElement:ne}}function B(){eo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Y=t.config.showMonths;Y--;){var G=q();t.yearElements.push(G.yearElement),t.monthElements.push(G.monthElement),t.monthNav.appendChild(G.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ft("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ft("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ft("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Y){t.__hidePrevMonthArrow!==Y&&(hn(t.prevMonthNav,"flatpickr-disabled",Y),t.__hidePrevMonthArrow=Y)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Y){t.__hideNextMonthArrow!==Y&&(hn(t.nextMonthNav,"flatpickr-disabled",Y),t.__hideNextMonthArrow=Y)}}),t.currentYearElement=t.yearElements[0],an(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Y=Lr(t.config);t.timeContainer=ft("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var G=ft("span","flatpickr-time-separator",":"),ne=to("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var re=to("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=re.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Y.hours:f(Y.hours)),t.minuteElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Y.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(G),t.timeContainer.appendChild(re),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Me=to("flatpickr-second");t.secondElement=Me.getElementsByTagName("input")[0],t.secondElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Y.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ft("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Me)}return t.config.time_24hr||(t.amPM=ft("span","flatpickr-am-pm",t.l10n.amPM[Vn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function J(){t.weekdayContainer?eo(t.weekdayContainer):t.weekdayContainer=ft("div","flatpickr-weekdays");for(var Y=t.config.showMonths;Y--;){var G=ft("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(G)}return W(),t.weekdayContainer}function W(){if(t.weekdayContainer){var Y=t.l10n.firstDayOfWeek,G=ed(t.l10n.weekdays.shorthand);Y>0&&Y `+G.join("")+` - `}}function le(){t.calendarContainer.classList.add("hasWeeks");var Y=ft("div","flatpickr-weekwrapper");Y.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ft("div","flatpickr-weeks");return Y.appendChild(G),{weekWrapper:Y,weekNumbers:G}}function ee(Y,G){G===void 0&&(G=!0);var ne=G?Y:Y-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,we("onYearChange"),R()),N(),we("onMonthChange"),an())}function ie(Y,G){if(Y===void 0&&(Y=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Lr(t.config),re=ne.hours,Me=ne.minutes,Le=ne.seconds;h(re,Me,Le)}t.redraw(),Y&&we("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),we("onClose")}function Ne(){t.config!==void 0&&we("onDestroy");for(var Y=t._handlers.length;Y--;)t._handlers[Y].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 G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(ne){try{delete t[ne]}catch{}})}function Ve(Y){return t.calendarContainer.contains(Y)}function ze(Y){if(t.isOpen&&!t.config.inline){var G=Cn(Y),ne=Ve(G),re=G===t.input||G===t.altInput||t.element.contains(G)||Y.path&&Y.path.indexOf&&(~Y.path.indexOf(t.input)||~Y.path.indexOf(t.altInput)),Me=!re&&!ne&&!Ve(Y.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(G)});Me&&Le&&(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 oe(Y){if(!(!Y||t.config.minDate&&Yt.config.maxDate.getFullYear())){var G=Y,ne=t.currentYear!==G;t.currentYear=G||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)),ne&&(t.redraw(),we("onYearChange"),R())}}function Ce(Y,G){var ne;G===void 0&&(G=!0);var re=t.parseDate(Y,void 0,G);if(t.config.minDate&&re&&$n(re,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&re&&$n(re,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===void 0)return!1;for(var Me=!!t.config.enable,Le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Pe=0,De=void 0;Pe=De.from.getTime()&&re.getTime()<=De.to.getTime())return Me}return!Me}function We(Y){return t.daysContainer!==void 0?Y.className.indexOf("hidden")===-1&&Y.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Y):!1}function _t(Y){var G=Y.target===t._input,ne=t._input.value.trimEnd()!==Zt();G&&ne&&!(Y.relatedTarget&&Ve(Y.relatedTarget))&&t.setDate(t._input.value,!0,Y.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Xe(Y){var G=Cn(Y),ne=t.config.wrap?n.contains(G):G===t._input,re=t.config.allowInput,Me=t.isOpen&&(!re||!ne),Le=t.config.inline&&ne&&!re;if(Y.keyCode===13&&ne){if(re)return t.setDate(t._input.value,!0,G===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),G.blur();t.open()}else if(Ve(G)||Me||Le){var Pe=!!t.timeContainer&&t.timeContainer.contains(G);switch(Y.keyCode){case 13:Pe?(Y.preventDefault(),a(),Pn()):Ae(Y);break;case 27:Y.preventDefault(),Pn();break;case 8:case 46:ne&&!t.config.allowInput&&(Y.preventDefault(),t.clear());break;case 37:case 39:if(!Pe&&!ne){Y.preventDefault();var De=l();if(t.daysContainer!==void 0&&(re===!1||De&&We(De))){var Ye=Y.keyCode===39?1:-1;Y.ctrlKey?(Y.stopPropagation(),ee(Ye),F(D(1),0)):F(void 0,Ye)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Y.preventDefault();var Re=Y.keyCode===40?1:-1;t.daysContainer&&G.$i!==void 0||G===t.input||G===t.altInput?Y.ctrlKey?(Y.stopPropagation(),oe(t.currentYear-Re),F(D(1),0)):Pe||F(void 0,Re*7):G===t.currentYearElement?oe(t.currentYear-Re):t.config.enableTime&&(!Pe&&t.hourElement&&t.hourElement.focus(),a(Y),t._debouncedChange());break;case 9:if(Pe){var Ue=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Tn){return Tn}),kt=Ue.indexOf(G);if(kt!==-1){var li=Ue[kt+(Y.shiftKey?-1:1)];Y.preventDefault(),(li||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(G)&&Y.shiftKey&&(Y.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&G===t.amPM)switch(Y.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),nn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),nn();break}(ne||Ve(G))&&we("onKeyDown",Y)}function Je(Y,G){if(G===void 0&&(G="flatpickr-day"),!(t.selectedDates.length!==1||Y&&(!Y.classList.contains(G)||Y.classList.contains("flatpickr-disabled")))){for(var ne=Y?Y.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),re=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Me=Math.min(ne,t.selectedDates[0].getTime()),Le=Math.max(ne,t.selectedDates[0].getTime()),Pe=!1,De=0,Ye=0,Re=Me;ReMe&&ReDe)?De=Re:Re>re&&(!Ye||Re ."+G));Ue.forEach(function(kt){var li=kt.dateObj,Tn=li.getTime(),js=De>0&&Tn0&&Tn>Ye;if(js){kt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(cs){kt.classList.remove(cs)});return}else if(Pe&&!js)return;["startRange","inRange","endRange","notAllowed"].forEach(function(cs){kt.classList.remove(cs)}),Y!==void 0&&(Y.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),rene&&Tn===re&&kt.classList.add("endRange"),Tn>=De&&(Ye===0||Tn<=Ye)&&QT(Tn,re,ne)&&kt.classList.add("inRange"))})}}function wt(){t.isOpen&&!t.config.static&&!t.config.inline&&Ft()}function _e(Y,G){if(G===void 0&&(G=t._positionElement),t.isMobile===!0){if(Y){Y.preventDefault();var ne=Cn(Y);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),we("onOpen");return}else if(t._input.disabled||t.config.inline)return;var re=t.isOpen;t.isOpen=!0,re||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),we("onOpen"),Ft(G)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Y===void 0||!t.timeContainer.contains(Y.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ke(Y){return function(G){var ne=t.config["_"+Y+"Date"]=t.parseDate(G,t.config.dateFormat),re=t.config["_"+(Y==="min"?"max":"min")+"Date"];ne!==void 0&&(t[Y==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Me){return Ce(Me)}),!t.selectedDates.length&&Y==="min"&&d(ne),nn()),t.daysContainer&&(tn(),ne!==void 0?t.currentYearElement[Y]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(Y),t.currentYearElement.disabled=!!re&&ne!==void 0&&re.getFullYear()===ne.getFullYear())}}function Ge(){var Y=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=fn(fn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=G.parseDate,t.config.formatDate=G.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ue){t.config._enable=Nn(Ue)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ue){t.config._disable=Nn(Ue)}});var re=G.mode==="time";if(!G.dateFormat&&(G.enableTime||re)){var Me=Kt.defaultConfig.dateFormat||Ss.dateFormat;ne.dateFormat=G.noCalendar||re?"H:i"+(G.enableSeconds?":S":""):Me+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||re)&&!G.altFormat){var Le=Kt.defaultConfig.altFormat||Ss.altFormat;ne.altFormat=G.noCalendar||re?"h:i"+(G.enableSeconds?":S K":" K"):Le+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ke("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ke("max")});var Pe=function(Ue){return function(kt){t.config[Ue==="min"?"_minTime":"_maxTime"]=t.parseDate(kt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Pe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Pe("max")}),G.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,G);for(var De=0;De-1?t.config[Re]=Dr(Ye[Re]).map(o).concat(t.config[Re]):typeof G[Re]>"u"&&(t.config[Re]=Ye[Re])}G.altInputClass||(t.config.altInputClass=Oe().className+" "+t.config.altInputClass),we("onParseConfig")}function Oe(){return t.config.wrap?n.querySelector("[data-input]"):n}function ht(){typeof t.config.locale!="object"&&typeof Kt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=fn(fn({},Kt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Kt.l10ns[t.config.locale]:void 0),xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",xi.l="("+t.l10n.weekdays.longhand.join("|")+")",xi.M="("+t.l10n.months.shorthand.join("|")+")",xi.F="("+t.l10n.months.longhand.join("|")+")",xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Y=fn(fn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Y.time_24hr===void 0&&Kt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=w1(t),t.parseDate=pa({config:t.config,l10n:t.l10n})}function Ft(Y){if(typeof t.config.position=="function")return void t.config.position(t,Y);if(t.calendarContainer!==void 0){we("onPreCalendarPosition");var G=Y||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(j1,H1){return j1+H1.offsetHeight},0),re=t.calendarContainer.offsetWidth,Me=t.config.position.split(" "),Le=Me[0],Pe=Me.length>1?Me[1]:null,De=G.getBoundingClientRect(),Ye=window.innerHeight-De.bottom,Re=Le==="above"||Le!=="below"&&Yene,Ue=window.pageYOffset+De.top+(Re?-ne-2:G.offsetHeight+2);if(hn(t.calendarContainer,"arrowTop",!Re),hn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var kt=window.pageXOffset+De.left,li=!1,Tn=!1;Pe==="center"?(kt-=(re-De.width)/2,li=!0):Pe==="right"&&(kt-=re-De.width,Tn=!0),hn(t.calendarContainer,"arrowLeft",!li&&!Tn),hn(t.calendarContainer,"arrowCenter",li),hn(t.calendarContainer,"arrowRight",Tn);var js=window.document.body.offsetWidth-(window.pageXOffset+De.right),cs=kt+re>window.document.body.offsetWidth,I1=js+re>window.document.body.offsetWidth;if(hn(t.calendarContainer,"rightMost",cs),!t.config.static)if(t.calendarContainer.style.top=Ue+"px",!cs)t.calendarContainer.style.left=kt+"px",t.calendarContainer.style.right="auto";else if(!I1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=js+"px";else{var er=rn();if(er===void 0)return;var L1=window.document.body.offsetWidth,P1=Math.max(0,L1/2-re/2),F1=".flatpickr-calendar.centerMost:before",N1=".flatpickr-calendar.centerMost:after",R1=er.cssRules.length,q1="{left:"+De.left+"px;right:auto;}";hn(t.calendarContainer,"rightMost",!1),hn(t.calendarContainer,"centerMost",!0),er.insertRule(F1+","+N1+q1,R1),t.calendarContainer.style.left=P1+"px",t.calendarContainer.style.right="auto"}}}}function rn(){for(var Y=null,G=0;Gt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=re,t.config.mode==="single")t.selectedDates=[Me];else if(t.config.mode==="multiple"){var Pe=It(Me);Pe?t.selectedDates.splice(parseInt(Pe),1):t.selectedDates.push(Me)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Me,t.selectedDates.push(Me),$n(Me,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ue,kt){return Ue.getTime()-kt.getTime()}));if(c(),Le){var De=t.currentYear!==Me.getFullYear();t.currentYear=Me.getFullYear(),t.currentMonth=Me.getMonth(),De&&(we("onYearChange"),R()),we("onMonthChange")}if(an(),N(),nn(),!Le&&t.config.mode!=="range"&&t.config.showMonths===1?M(re):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ye=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ye||Re)&&Pn()}_()}}var St={locale:[ht,W],showMonths:[B,r,J],minDate:[S],maxDate:[S],positionElement:[Rn],clickOpens:[function(){t.config.clickOpens===!0?(m(t._input,"focus",t.open),m(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Fn(Y,G){if(Y!==null&&typeof Y=="object"){Object.assign(t.config,Y);for(var ne in Y)St[ne]!==void 0&&St[ne].forEach(function(re){return re()})}else t.config[Y]=G,St[Y]!==void 0?St[Y].forEach(function(re){return re()}):Er.indexOf(Y)>-1&&(t.config[Y]=Dr(G));t.redraw(),nn(!0)}function bn(Y,G){var ne=[];if(Y instanceof Array)ne=Y.map(function(re){return t.parseDate(re,G)});else if(Y instanceof Date||typeof Y=="number")ne=[t.parseDate(Y,G)];else if(typeof Y=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(Y,G)];break;case"multiple":ne=Y.split(t.config.conjunction).map(function(re){return t.parseDate(re,G)});break;case"range":ne=Y.split(t.l10n.rangeSeparator).map(function(re){return t.parseDate(re,G)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Y)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(re){return re instanceof Date&&Ce(re,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(re,Me){return re.getTime()-Me.getTime()})}function hi(Y,G,ne){if(G===void 0&&(G=!1),ne===void 0&&(ne=t.config.dateFormat),Y!==0&&!Y||Y instanceof Array&&Y.length===0)return t.clear(G);bn(Y,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,G),d(),t.selectedDates.length===0&&t.clear(!1),nn(G),G&&we("onChange")}function Nn(Y){return Y.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?t.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:t.parseDate(G.from,void 0),to:t.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function Zn(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Y=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Y&&bn(Y,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function mi(){if(t.input=Oe(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ft(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Rn()}function Rn(){t._positionElement=t.config.positionElement||t._input}function Xn(){var Y=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ft("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Y,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Y==="datetime-local"?"Y-m-d\\TH:i:S":Y==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}m(t.mobileInput,"change",function(G){t.setDate(Cn(G).value,!1,t.mobileFormatStr),we("onChange"),we("onClose")})}function ce(Y){if(t.isOpen===!0)return t.close();t.open(Y)}function we(Y,G){if(t.config!==void 0){var ne=t.config[Y];if(ne!==void 0&&ne.length>0)for(var re=0;ne[re]&&re=0&&$n(Y,t.selectedDates[1])<=0}function an(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Y,G){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+G),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[G].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),Y.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Zt(Y){var G=Y||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,G)}).filter(function(ne,re,Me){return t.config.mode!=="range"||t.config.enableTime||Me.indexOf(ne)===re}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function nn(Y){Y===void 0&&(Y=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Zt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Zt(t.config.altFormat)),Y!==!1&&we("onValueUpdate")}function pn(Y){var G=Cn(Y),ne=t.prevMonthNav.contains(G),re=t.nextMonthNav.contains(G);ne||re?ee(ne?-1:1):t.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):G.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Ll(Y){Y.preventDefault();var G=Y.type==="keydown",ne=Cn(Y),re=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]);var Me=parseFloat(re.getAttribute("min")),Le=parseFloat(re.getAttribute("max")),Pe=parseFloat(re.getAttribute("step")),De=parseInt(re.value,10),Ye=Y.delta||(G?Y.which===38?1:-1:0),Re=De+Pe*Ye;if(typeof re.value<"u"&&re.value.length===2){var Ue=re===t.hourElement,kt=re===t.minuteElement;ReLe&&(Re=re===t.hourElement?Re-Le-Vn(!t.amPM):Me,kt&&T(void 0,1,t.hourElement)),t.amPM&&Ue&&(Pe===1?Re+De===23:Math.abs(Re-De)>Pe)&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]),re.value=vn(Re)}}return s(),t}function Ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function oC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=et(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,h=!1,{input:g=void 0,flatpickr:m=void 0}=e;Gt(()=>{const T=f??g,$=y(d);return $.onReady.push((O,M,D)=>{a===void 0&&S(O,M,D),ln().then(()=>{t(8,h=!0)})}),t(3,m=Kt(T,Object.assign($,f?{wrap:!0}:{}))),()=>{m.destroy()}});const _=pt();function y(T={}){T=Object.assign({},T);for(const $ of r){const O=(M,D,I)=>{_(lC($),[M,D,I])};$ in T?(Array.isArray(T[$])||(T[$]=[T[$]]),T[$].push(O)):T[$]=[O]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,$,O){const M=td(O,T);!nd(a,M)&&(a||M)&&t(2,a=M),t(4,u=$)}function C(T){te[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=He(He({},e),Qt(T)),t(1,s=et(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,g=T.input),"flatpickr"in T&&t(3,m=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&m&&h&&(nd(a,td(m,m.selectedDates))||m.setDate(a,!0,c)),n.$$.dirty&392&&m&&h)for(const[T,$]of Object.entries(y(d)))m.set(T,$)},[g,s,a,m,u,f,c,d,h,o,l,C]}class lu extends ve{constructor(e){super(),be(this,e,oC,sC,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function rC(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=v("label"),t=U("Min date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&4&&(o=!0,g.value=d[2],ye(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.min,ye(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function aC(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=v("label"),t=U("Max date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&8&&(o=!0,g.value=d[3],ye(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.max,ye(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function uC(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[rC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[aC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&98309&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&98313&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function fC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[uC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?yt(s,[a&2&&{key:r[1]},a&32&&Pt(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function cC(n,e,t){var C,T;const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e,r=(C=l==null?void 0:l.options)==null?void 0:C.min,a=(T=l==null?void 0:l.options)==null?void 0:T.max;function u($,O){$.detail&&$.detail.length==3&&t(0,l.options[O]=$.detail[1],l)}function f($){r=$,t(2,r),t(0,l)}function c($){n.$$.not_equal(l.options.min,$)&&(l.options.min=$,t(0,l))}const d=$=>u($,"min");function h($){a=$,t(3,a),t(0,l)}function g($){n.$$.not_equal(l.options.max,$)&&(l.options.max=$,t(0,l))}const m=$=>u($,"max");function _($){l=$,t(0,l)}function y($){Fe.call(this,n,$)}function S($){Fe.call(this,n,$)}return n.$$set=$=>{e=He(He({},e),Qt($)),t(5,s=et(e,i)),"field"in $&&t(0,l=$.field),"key"in $&&t(1,o=$.key)},n.$$.update=()=>{var $,O,M,D;n.$$.dirty&5&&r!=(($=l==null?void 0:l.options)==null?void 0:$.min)&&t(2,r=(O=l==null?void 0:l.options)==null?void 0:O.min),n.$$.dirty&9&&a!=((M=l==null?void 0:l.options)==null?void 0:M.max)&&t(3,a=(D=l==null?void 0:l.options)==null?void 0:D.max)},[l,o,r,a,u,s,f,c,d,h,g,m,_,y,S]}class dC extends ve{constructor(e){super(),be(this,e,cC,fC,me,{field:0,key:1})}}const pC=n=>({}),id=n=>({});function sd(n,e,t){const i=n.slice();return i[47]=e[t],i}const hC=n=>({}),ld=n=>({});function od(n,e,t){const i=n.slice();return i[47]=e[t],i[51]=t,i}function rd(n){let e,t,i;return{c(){e=v("div"),t=U(n[2]),i=E(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),b(e,t),b(e,i)},p(s,l){l[0]&4&&se(t,s[2]),l[0]&96&&Q(e,"link-hint",!s[5]&&!s[6])},d(s){s&&k(e)}}}function mC(n){let e,t=n[47]+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=s[47]+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function gC(n){let e,t,i;const s=[{item:n[47]},n[10]];var l=n[9];function o(r,a){let u={};if(a!==void 0&&a[0]&1025)u=yt(s,[a[0]&1&&{item:r[47]},a[0]&1024&&Pt(r[10])]);else for(let f=0;f{V(u,1)}),fe()}l?(e=Dt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&1025?yt(s,[a[0]&1&&{item:r[47]},a[0]&1024&&Pt(r[10])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function ad(n){let e,t,i;function s(){return n[35](n[47])}return{c(){e=v("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Te(je.call(null,e,"Clear")),K(e,"click",An(xe(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function ud(n){let e,t,i,s,l,o;const r=[gC,mC],a=[];function u(c,d){return c[9]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[7])&&ad(n);return{c(){e=v("div"),i.c(),s=E(),f&&f.c(),l=E(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),b(e,s),f&&f.m(e,null),b(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(ue(),L(a[h],1,1,()=>{a[h]=null}),fe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[7]?f?f.p(c,d):(f=ad(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){L(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function fd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[19],$$slots:{default:[vC]},$$scope:{ctx:n}};return e=new Ln({props:i}),n[40](e),e.$on("show",n[25]),e.$on("hide",n[41]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&524288&&(o.trigger=s[19]),l[0]&3225866|l[1]&4096&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[40](null),V(e,s)}}}function cd(n){let e,t,i,s,l,o,r,a,u=n[16].length&&dd(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='',s=E(),l=v("input"),o=E(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(t,s),b(t,l),ae(l,n[16]),b(t,o),u&&u.m(t,null),l.focus(),r||(a=K(l,"input",n[37]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&65536&&l.value!==f[16]&&ae(l,f[16]),f[16].length?u?u.p(f,c):(u=dd(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function dd(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),b(e,t),i||(s=K(t,"click",An(xe(n[22]))),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function pd(n){let e,t=n[1]&&hd(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=hd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function hd(n){let e,t;return{c(){e=v("div"),t=U(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&2&&se(t,i[1])},d(i){i&&k(e)}}}function _C(n){let e=n[47]+"",t;return{c(){t=U(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&2097152&&e!==(e=i[47]+"")&&se(t,e)},i:x,o:x,d(i){i&&k(t)}}}function bC(n){let e,t,i;const s=[{item:n[47]},n[12]];var l=n[11];function o(r,a){let u={};if(a!==void 0&&a[0]&2101248)u=yt(s,[a[0]&2097152&&{item:r[47]},a[0]&4096&&Pt(r[12])]);else for(let f=0;f{V(u,1)}),fe()}l?(e=Dt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2101248?yt(s,[a[0]&2097152&&{item:r[47]},a[0]&4096&&Pt(r[12])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function md(n){let e,t,i,s,l,o,r;const a=[bC,_C],u=[];function f(h,g){return h[11]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[38](n[47],...h)}function d(...h){return n[39](n[47],...h)}return{c(){e=v("div"),i.c(),s=E(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[8]),Q(e,"selected",n[20](n[47]))},m(h,g){w(h,e,g),u[t].m(e,null),b(e,s),l=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(h,g){n=h;let m=t;t=f(n),t===m?u[t].p(n,g):(ue(),L(u[m],1,1,()=>{u[m]=null}),fe(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||g[0]&256)&&Q(e,"closable",n[8]),(!l||g[0]&3145728)&&Q(e,"selected",n[20](n[47]))},i(h){l||(A(i),l=!0)},o(h){L(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,$e(r)}}}function vC(n){let e,t,i,s,l,o=n[13]&&cd(n);const r=n[34].beforeOptions,a=Tt(r,n,n[43],ld);let u=ge(n[21]),f=[];for(let m=0;mL(f[m],1,1,()=>{f[m]=null});let d=null;u.length||(d=pd(n));const h=n[34].afterOptions,g=Tt(h,n,n[43],id);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=v("div");for(let m=0;mL(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=rd(n));let c=!n[5]&&!n[6]&&fd(n);return{c(){e=v("div"),t=v("div");for(let d=0;d{c=null}),fe()),(!o||h[0]&16384&&l!==(l="select "+d[14]))&&p(e,"class",l),(!o||h[0]&16400)&&Q(e,"multiple",d[4]),(!o||h[0]&16416)&&Q(e,"disabled",d[5]),(!o||h[0]&16448)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let h=0;hGe(Oe,ke))||[]}function ie(_e,ke){_e.preventDefault(),_&&d?B(ke):q(ke)}function Ee(_e,ke){(_e.code==="Enter"||_e.code==="Space")&&(ie(_e,ke),y&&J())}function Ne(){le(),setTimeout(()=>{const _e=P==null?void 0:P.querySelector(".dropdown-item.option.selected");_e&&(_e.focus(),_e.scrollIntoView({block:"nearest"}))},0)}function Ve(_e){_e.stopPropagation(),!g&&!h&&(I==null||I.toggle())}Gt(()=>{const _e=document.querySelectorAll(`label[for="${r}"]`);for(const ke of _e)ke.addEventListener("click",Ve);return()=>{for(const ke of _e)ke.removeEventListener("click",Ve)}});const ze=_e=>R(_e);function oe(_e){te[_e?"unshift":"push"](()=>{N=_e,t(19,N)})}function Ce(){F=this.value,t(16,F)}const We=(_e,ke)=>ie(ke,_e),_t=(_e,ke)=>Ee(ke,_e);function Xe(_e){te[_e?"unshift":"push"](()=>{I=_e,t(17,I)})}function Je(_e){Fe.call(this,n,_e)}function wt(_e){te[_e?"unshift":"push"](()=>{P=_e,t(18,P)})}return n.$$set=_e=>{"id"in _e&&t(26,r=_e.id),"noOptionsText"in _e&&t(1,a=_e.noOptionsText),"selectPlaceholder"in _e&&t(2,u=_e.selectPlaceholder),"searchPlaceholder"in _e&&t(3,f=_e.searchPlaceholder),"items"in _e&&t(27,c=_e.items),"multiple"in _e&&t(4,d=_e.multiple),"disabled"in _e&&t(5,h=_e.disabled),"readonly"in _e&&t(6,g=_e.readonly),"selected"in _e&&t(0,m=_e.selected),"toggle"in _e&&t(7,_=_e.toggle),"closable"in _e&&t(8,y=_e.closable),"labelComponent"in _e&&t(9,S=_e.labelComponent),"labelComponentProps"in _e&&t(10,C=_e.labelComponentProps),"optionComponent"in _e&&t(11,T=_e.optionComponent),"optionComponentProps"in _e&&t(12,$=_e.optionComponentProps),"searchable"in _e&&t(13,O=_e.searchable),"searchFunc"in _e&&t(28,M=_e.searchFunc),"class"in _e&&t(14,D=_e.class),"$$scope"in _e&&t(43,o=_e.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&134217728&&c&&(W(),le()),n.$$.dirty[0]&134283264&&t(21,i=ee(c,F)),n.$$.dirty[0]&1&&t(20,s=function(_e){const ke=j.toArray(m);return j.inArray(ke,_e)})},[m,a,u,f,d,h,g,_,y,S,C,T,$,O,D,R,F,I,P,N,s,i,le,ie,Ee,Ne,r,c,M,q,B,Z,X,J,l,ze,oe,Ce,We,_t,Xe,Je,wt,o]}class S1 extends ve{constructor(e){super(),be(this,e,wC,yC,me,{id:26,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:27,multiple:4,disabled:5,readonly:6,selected:0,toggle:7,closable:8,labelComponent:9,labelComponentProps:10,optionComponent:11,optionComponentProps:12,searchable:13,searchFunc:28,class:14,deselectItem:15,selectItem:29,toggleItem:30,reset:31,showDropdown:32,hideDropdown:33},null,[-1,-1])}get deselectItem(){return this.$$.ctx[15]}get selectItem(){return this.$$.ctx[29]}get toggleItem(){return this.$$.ctx[30]}get reset(){return this.$$.ctx[31]}get showDropdown(){return this.$$.ctx[32]}get hideDropdown(){return this.$$.ctx[33]}}function gd(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function SC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&gd(n);return{c(){l&&l.c(),e=E(),t=v("span"),s=U(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),b(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=gd(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(s,i)},i:x,o:x,d(o){o&&(k(e),k(t)),l&&l.d(o)}}}function TC(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,TC,SC,me,{item:0})}}const CC=n=>({}),bd=n=>({});function $C(n){let e;const t=n[8].afterOptions,i=Tt(t,n,n[12],bd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&$t(i,t,s,s[12],e?Ct(t,s[12],l,CC):Mt(s[12]),bd)},i(s){e||(A(i,s),e=!0)},o(s){L(i,s),e=!1},d(s){i&&i.d(s)}}}function MC(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[$C]},$$scope:{ctx:n}};for(let r=0;rhe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&62?yt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Pt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function OC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=et(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=_d}=e,{optionComponent:c=_d}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(C){C=j.toArray(C,!0);let T=[];for(let $ of C){const O=j.findByKey(r,d,$);O&&T.push(O)}C.length&&!T.length||t(0,u=a?T:T[0])}async function m(C){let T=j.toArray(C,!0).map($=>$[d]);r.length&&t(6,h=a?T:T[0])}function _(C){u=C,t(0,u)}function y(C){Fe.call(this,n,C)}function S(C){Fe.call(this,n,C)}return n.$$set=C=>{e=He(He({},e),Qt(C)),t(5,s=et(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&m(u)},[u,r,a,f,c,s,h,d,l,_,y,S,o]}class Bi extends ve{constructor(e){super(),be(this,e,OC,MC,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function EC(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Rs({props:a}),te.push(()=>he(t,"value",r)),{c(){e=v("div"),z(t.$$.fragment)},m(u,f){w(u,e,f),H(t,e,null),s=!0,l||(o=Te(je.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&16384&&(c.readonly=!u[14]),!i&&f&1&&(i=!0,c.value=u[0].options.values,ye(()=>i=!1)),t.$set(c)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){L(t.$$.fragment,u),s=!1},d(u){u&&k(e),V(t),l=!1,o()}}}function DC(n){let e,t,i;function s(o){n[8](o)}let l={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function AC(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[EC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[DC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16384&&(h.class="form-field required "+(c[14]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.values"),d&57345&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16384&&(g.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function vd(n){let e,t;return e=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[IC,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&40961&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function IC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[13]),p(l,"id",o=n[13]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.maxSelect),r||(a=K(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].options.maxSelect&&ae(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function LC(n){let e,t,i=!n[2]&&vd(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,l){s[2]?i&&(ue(),L(i,1,1,()=>{i=null}),fe()):i?(i.p(s,l),l&4&&A(i,1)):(i=vd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function PC(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[LC],default:[AC,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&18?yt(s,[a&2&&{key:r[1]},a&16&&Pt(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function FC(n,e,t){var y;const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((y=l.options)==null?void 0:y.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function c(){l.options.maxSelect=dt(this.value),t(0,l),t(5,u),t(2,a)}function d(S){n.$$.not_equal(l.options.values,S)&&(l.options.values=S,t(0,l),t(5,u),t(2,a))}function h(S){a=S,t(2,a)}function g(S){l=S,t(0,l),t(5,u),t(2,a)}function m(S){Fe.call(this,n,S)}function _(S){Fe.call(this,n,S)}return n.$$set=S=>{e=He(He({},e),Qt(S)),t(4,s=et(e,i)),"field"in S&&t(0,l=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,C;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((C=(S=l.options)==null?void 0:S.values)==null?void 0:C.length)||2,l)),n.$$.dirty&1&&j.isEmpty(l.options)&&f()},[l,o,a,r,s,u,c,d,h,g,m,_]}class NC extends ve{constructor(e){super(),be(this,e,FC,PC,me,{field:0,key:1})}}function RC(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qC(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M='"{"a":1,"b":2}"',D,I,F,P,N,R,q,B,Z,X,J,W,le;return{c(){e=v("div"),t=v("div"),i=v("div"),s=U("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=U(` and + `}}function le(){t.calendarContainer.classList.add("hasWeeks");var Y=ft("div","flatpickr-weekwrapper");Y.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ft("div","flatpickr-weeks");return Y.appendChild(G),{weekWrapper:Y,weekNumbers:G}}function ee(Y,G){G===void 0&&(G=!0);var ne=G?Y:Y-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,we("onYearChange"),R()),N(),we("onMonthChange"),an())}function ie(Y,G){if(Y===void 0&&(Y=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Lr(t.config),re=ne.hours,Me=ne.minutes,Le=ne.seconds;h(re,Me,Le)}t.redraw(),Y&&we("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),we("onClose")}function Ne(){t.config!==void 0&&we("onDestroy");for(var Y=t._handlers.length;Y--;)t._handlers[Y].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 G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(ne){try{delete t[ne]}catch{}})}function Ve(Y){return t.calendarContainer.contains(Y)}function ze(Y){if(t.isOpen&&!t.config.inline){var G=Cn(Y),ne=Ve(G),re=G===t.input||G===t.altInput||t.element.contains(G)||Y.path&&Y.path.indexOf&&(~Y.path.indexOf(t.input)||~Y.path.indexOf(t.altInput)),Me=!re&&!ne&&!Ve(Y.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(G)});Me&&Le&&(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 oe(Y){if(!(!Y||t.config.minDate&&Yt.config.maxDate.getFullYear())){var G=Y,ne=t.currentYear!==G;t.currentYear=G||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)),ne&&(t.redraw(),we("onYearChange"),R())}}function Ce(Y,G){var ne;G===void 0&&(G=!0);var re=t.parseDate(Y,void 0,G);if(t.config.minDate&&re&&$n(re,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&re&&$n(re,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===void 0)return!1;for(var Me=!!t.config.enable,Le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Pe=0,De=void 0;Pe=De.from.getTime()&&re.getTime()<=De.to.getTime())return Me}return!Me}function We(Y){return t.daysContainer!==void 0?Y.className.indexOf("hidden")===-1&&Y.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Y):!1}function _t(Y){var G=Y.target===t._input,ne=t._input.value.trimEnd()!==Zt();G&&ne&&!(Y.relatedTarget&&Ve(Y.relatedTarget))&&t.setDate(t._input.value,!0,Y.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Xe(Y){var G=Cn(Y),ne=t.config.wrap?n.contains(G):G===t._input,re=t.config.allowInput,Me=t.isOpen&&(!re||!ne),Le=t.config.inline&&ne&&!re;if(Y.keyCode===13&&ne){if(re)return t.setDate(t._input.value,!0,G===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),G.blur();t.open()}else if(Ve(G)||Me||Le){var Pe=!!t.timeContainer&&t.timeContainer.contains(G);switch(Y.keyCode){case 13:Pe?(Y.preventDefault(),a(),Pn()):Ae(Y);break;case 27:Y.preventDefault(),Pn();break;case 8:case 46:ne&&!t.config.allowInput&&(Y.preventDefault(),t.clear());break;case 37:case 39:if(!Pe&&!ne){Y.preventDefault();var De=l();if(t.daysContainer!==void 0&&(re===!1||De&&We(De))){var Ye=Y.keyCode===39?1:-1;Y.ctrlKey?(Y.stopPropagation(),ee(Ye),F(D(1),0)):F(void 0,Ye)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Y.preventDefault();var Re=Y.keyCode===40?1:-1;t.daysContainer&&G.$i!==void 0||G===t.input||G===t.altInput?Y.ctrlKey?(Y.stopPropagation(),oe(t.currentYear-Re),F(D(1),0)):Pe||F(void 0,Re*7):G===t.currentYearElement?oe(t.currentYear-Re):t.config.enableTime&&(!Pe&&t.hourElement&&t.hourElement.focus(),a(Y),t._debouncedChange());break;case 9:if(Pe){var Ue=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Tn){return Tn}),kt=Ue.indexOf(G);if(kt!==-1){var li=Ue[kt+(Y.shiftKey?-1:1)];Y.preventDefault(),(li||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(G)&&Y.shiftKey&&(Y.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&G===t.amPM)switch(Y.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),nn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),nn();break}(ne||Ve(G))&&we("onKeyDown",Y)}function Je(Y,G){if(G===void 0&&(G="flatpickr-day"),!(t.selectedDates.length!==1||Y&&(!Y.classList.contains(G)||Y.classList.contains("flatpickr-disabled")))){for(var ne=Y?Y.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),re=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Me=Math.min(ne,t.selectedDates[0].getTime()),Le=Math.max(ne,t.selectedDates[0].getTime()),Pe=!1,De=0,Ye=0,Re=Me;ReMe&&ReDe)?De=Re:Re>re&&(!Ye||Re ."+G));Ue.forEach(function(kt){var li=kt.dateObj,Tn=li.getTime(),js=De>0&&Tn0&&Tn>Ye;if(js){kt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(cs){kt.classList.remove(cs)});return}else if(Pe&&!js)return;["startRange","inRange","endRange","notAllowed"].forEach(function(cs){kt.classList.remove(cs)}),Y!==void 0&&(Y.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),rene&&Tn===re&&kt.classList.add("endRange"),Tn>=De&&(Ye===0||Tn<=Ye)&&QT(Tn,re,ne)&&kt.classList.add("inRange"))})}}function wt(){t.isOpen&&!t.config.static&&!t.config.inline&&Ft()}function _e(Y,G){if(G===void 0&&(G=t._positionElement),t.isMobile===!0){if(Y){Y.preventDefault();var ne=Cn(Y);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),we("onOpen");return}else if(t._input.disabled||t.config.inline)return;var re=t.isOpen;t.isOpen=!0,re||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),we("onOpen"),Ft(G)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Y===void 0||!t.timeContainer.contains(Y.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ke(Y){return function(G){var ne=t.config["_"+Y+"Date"]=t.parseDate(G,t.config.dateFormat),re=t.config["_"+(Y==="min"?"max":"min")+"Date"];ne!==void 0&&(t[Y==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Me){return Ce(Me)}),!t.selectedDates.length&&Y==="min"&&d(ne),nn()),t.daysContainer&&(tn(),ne!==void 0?t.currentYearElement[Y]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(Y),t.currentYearElement.disabled=!!re&&ne!==void 0&&re.getFullYear()===ne.getFullYear())}}function Ge(){var Y=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=fn(fn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=G.parseDate,t.config.formatDate=G.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ue){t.config._enable=Nn(Ue)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ue){t.config._disable=Nn(Ue)}});var re=G.mode==="time";if(!G.dateFormat&&(G.enableTime||re)){var Me=Kt.defaultConfig.dateFormat||Ss.dateFormat;ne.dateFormat=G.noCalendar||re?"H:i"+(G.enableSeconds?":S":""):Me+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||re)&&!G.altFormat){var Le=Kt.defaultConfig.altFormat||Ss.altFormat;ne.altFormat=G.noCalendar||re?"h:i"+(G.enableSeconds?":S K":" K"):Le+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ke("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ke("max")});var Pe=function(Ue){return function(kt){t.config[Ue==="min"?"_minTime":"_maxTime"]=t.parseDate(kt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Pe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Pe("max")}),G.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,G);for(var De=0;De-1?t.config[Re]=Dr(Ye[Re]).map(o).concat(t.config[Re]):typeof G[Re]>"u"&&(t.config[Re]=Ye[Re])}G.altInputClass||(t.config.altInputClass=Oe().className+" "+t.config.altInputClass),we("onParseConfig")}function Oe(){return t.config.wrap?n.querySelector("[data-input]"):n}function ht(){typeof t.config.locale!="object"&&typeof Kt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=fn(fn({},Kt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Kt.l10ns[t.config.locale]:void 0),xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",xi.l="("+t.l10n.weekdays.longhand.join("|")+")",xi.M="("+t.l10n.months.shorthand.join("|")+")",xi.F="("+t.l10n.months.longhand.join("|")+")",xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Y=fn(fn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Y.time_24hr===void 0&&Kt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=w1(t),t.parseDate=pa({config:t.config,l10n:t.l10n})}function Ft(Y){if(typeof t.config.position=="function")return void t.config.position(t,Y);if(t.calendarContainer!==void 0){we("onPreCalendarPosition");var G=Y||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(j1,H1){return j1+H1.offsetHeight},0),re=t.calendarContainer.offsetWidth,Me=t.config.position.split(" "),Le=Me[0],Pe=Me.length>1?Me[1]:null,De=G.getBoundingClientRect(),Ye=window.innerHeight-De.bottom,Re=Le==="above"||Le!=="below"&&Yene,Ue=window.pageYOffset+De.top+(Re?-ne-2:G.offsetHeight+2);if(hn(t.calendarContainer,"arrowTop",!Re),hn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var kt=window.pageXOffset+De.left,li=!1,Tn=!1;Pe==="center"?(kt-=(re-De.width)/2,li=!0):Pe==="right"&&(kt-=re-De.width,Tn=!0),hn(t.calendarContainer,"arrowLeft",!li&&!Tn),hn(t.calendarContainer,"arrowCenter",li),hn(t.calendarContainer,"arrowRight",Tn);var js=window.document.body.offsetWidth-(window.pageXOffset+De.right),cs=kt+re>window.document.body.offsetWidth,I1=js+re>window.document.body.offsetWidth;if(hn(t.calendarContainer,"rightMost",cs),!t.config.static)if(t.calendarContainer.style.top=Ue+"px",!cs)t.calendarContainer.style.left=kt+"px",t.calendarContainer.style.right="auto";else if(!I1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=js+"px";else{var er=rn();if(er===void 0)return;var L1=window.document.body.offsetWidth,P1=Math.max(0,L1/2-re/2),F1=".flatpickr-calendar.centerMost:before",N1=".flatpickr-calendar.centerMost:after",R1=er.cssRules.length,q1="{left:"+De.left+"px;right:auto;}";hn(t.calendarContainer,"rightMost",!1),hn(t.calendarContainer,"centerMost",!0),er.insertRule(F1+","+N1+q1,R1),t.calendarContainer.style.left=P1+"px",t.calendarContainer.style.right="auto"}}}}function rn(){for(var Y=null,G=0;Gt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=re,t.config.mode==="single")t.selectedDates=[Me];else if(t.config.mode==="multiple"){var Pe=It(Me);Pe?t.selectedDates.splice(parseInt(Pe),1):t.selectedDates.push(Me)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Me,t.selectedDates.push(Me),$n(Me,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ue,kt){return Ue.getTime()-kt.getTime()}));if(c(),Le){var De=t.currentYear!==Me.getFullYear();t.currentYear=Me.getFullYear(),t.currentMonth=Me.getMonth(),De&&(we("onYearChange"),R()),we("onMonthChange")}if(an(),N(),nn(),!Le&&t.config.mode!=="range"&&t.config.showMonths===1?M(re):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ye=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ye||Re)&&Pn()}_()}}var St={locale:[ht,W],showMonths:[B,r,J],minDate:[S],maxDate:[S],positionElement:[Rn],clickOpens:[function(){t.config.clickOpens===!0?(m(t._input,"focus",t.open),m(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Fn(Y,G){if(Y!==null&&typeof Y=="object"){Object.assign(t.config,Y);for(var ne in Y)St[ne]!==void 0&&St[ne].forEach(function(re){return re()})}else t.config[Y]=G,St[Y]!==void 0?St[Y].forEach(function(re){return re()}):Er.indexOf(Y)>-1&&(t.config[Y]=Dr(G));t.redraw(),nn(!0)}function bn(Y,G){var ne=[];if(Y instanceof Array)ne=Y.map(function(re){return t.parseDate(re,G)});else if(Y instanceof Date||typeof Y=="number")ne=[t.parseDate(Y,G)];else if(typeof Y=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(Y,G)];break;case"multiple":ne=Y.split(t.config.conjunction).map(function(re){return t.parseDate(re,G)});break;case"range":ne=Y.split(t.l10n.rangeSeparator).map(function(re){return t.parseDate(re,G)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Y)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(re){return re instanceof Date&&Ce(re,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(re,Me){return re.getTime()-Me.getTime()})}function hi(Y,G,ne){if(G===void 0&&(G=!1),ne===void 0&&(ne=t.config.dateFormat),Y!==0&&!Y||Y instanceof Array&&Y.length===0)return t.clear(G);bn(Y,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,G),d(),t.selectedDates.length===0&&t.clear(!1),nn(G),G&&we("onChange")}function Nn(Y){return Y.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?t.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:t.parseDate(G.from,void 0),to:t.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function Zn(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Y=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Y&&bn(Y,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function mi(){if(t.input=Oe(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ft(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Rn()}function Rn(){t._positionElement=t.config.positionElement||t._input}function Xn(){var Y=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ft("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Y,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Y==="datetime-local"?"Y-m-d\\TH:i:S":Y==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}m(t.mobileInput,"change",function(G){t.setDate(Cn(G).value,!1,t.mobileFormatStr),we("onChange"),we("onClose")})}function ce(Y){if(t.isOpen===!0)return t.close();t.open(Y)}function we(Y,G){if(t.config!==void 0){var ne=t.config[Y];if(ne!==void 0&&ne.length>0)for(var re=0;ne[re]&&re=0&&$n(Y,t.selectedDates[1])<=0}function an(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Y,G){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+G),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[G].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),Y.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Zt(Y){var G=Y||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,G)}).filter(function(ne,re,Me){return t.config.mode!=="range"||t.config.enableTime||Me.indexOf(ne)===re}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function nn(Y){Y===void 0&&(Y=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Zt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Zt(t.config.altFormat)),Y!==!1&&we("onValueUpdate")}function pn(Y){var G=Cn(Y),ne=t.prevMonthNav.contains(G),re=t.nextMonthNav.contains(G);ne||re?ee(ne?-1:1):t.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):G.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Ll(Y){Y.preventDefault();var G=Y.type==="keydown",ne=Cn(Y),re=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]);var Me=parseFloat(re.getAttribute("min")),Le=parseFloat(re.getAttribute("max")),Pe=parseFloat(re.getAttribute("step")),De=parseInt(re.value,10),Ye=Y.delta||(G?Y.which===38?1:-1:0),Re=De+Pe*Ye;if(typeof re.value<"u"&&re.value.length===2){var Ue=re===t.hourElement,kt=re===t.minuteElement;ReLe&&(Re=re===t.hourElement?Re-Le-Vn(!t.amPM):Me,kt&&T(void 0,1,t.hourElement)),t.amPM&&Ue&&(Pe===1?Re+De===23:Math.abs(Re-De)>Pe)&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]),re.value=vn(Re)}}return s(),t}function Ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function oC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=et(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,h=!1,{input:g=void 0,flatpickr:m=void 0}=e;Gt(()=>{const T=f??g,$=y(d);return $.onReady.push((O,M,D)=>{a===void 0&&S(O,M,D),ln().then(()=>{t(8,h=!0)})}),t(3,m=Kt(T,Object.assign($,f?{wrap:!0}:{}))),()=>{m.destroy()}});const _=pt();function y(T={}){T=Object.assign({},T);for(const $ of r){const O=(M,D,I)=>{_(lC($),[M,D,I])};$ in T?(Array.isArray(T[$])||(T[$]=[T[$]]),T[$].push(O)):T[$]=[O]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,$,O){const M=td(O,T);!nd(a,M)&&(a||M)&&t(2,a=M),t(4,u=$)}function C(T){te[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=He(He({},e),Qt(T)),t(1,s=et(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,g=T.input),"flatpickr"in T&&t(3,m=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&m&&h&&(nd(a,td(m,m.selectedDates))||m.setDate(a,!0,c)),n.$$.dirty&392&&m&&h)for(const[T,$]of Object.entries(y(d)))m.set(T,$)},[g,s,a,m,u,f,c,d,h,o,l,C]}class lu extends ve{constructor(e){super(),be(this,e,oC,sC,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function rC(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[15],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=v("label"),t=U("Min date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),j(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&4&&(o=!0,g.value=d[2],ye(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.min,ye(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),H(l,d)}}}function aC(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[15],options:V.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),l=new lu({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=v("label"),t=U("Max date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),j(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};h&32768&&(g.id=d[15]),!o&&h&8&&(o=!0,g.value=d[3],ye(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=d[0].options.max,ye(()=>r=!1)),l.$set(g)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),H(l,d)}}}function uC(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[rC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[aC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&98309&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&98313&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function fC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[uC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&34?yt(s,[a&2&&{key:r[1]},a&32&&Pt(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function cC(n,e,t){var C,T;const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e,r=(C=l==null?void 0:l.options)==null?void 0:C.min,a=(T=l==null?void 0:l.options)==null?void 0:T.max;function u($,O){$.detail&&$.detail.length==3&&t(0,l.options[O]=$.detail[1],l)}function f($){r=$,t(2,r),t(0,l)}function c($){n.$$.not_equal(l.options.min,$)&&(l.options.min=$,t(0,l))}const d=$=>u($,"min");function h($){a=$,t(3,a),t(0,l)}function g($){n.$$.not_equal(l.options.max,$)&&(l.options.max=$,t(0,l))}const m=$=>u($,"max");function _($){l=$,t(0,l)}function y($){Fe.call(this,n,$)}function S($){Fe.call(this,n,$)}return n.$$set=$=>{e=He(He({},e),Qt($)),t(5,s=et(e,i)),"field"in $&&t(0,l=$.field),"key"in $&&t(1,o=$.key)},n.$$.update=()=>{var $,O,M,D;n.$$.dirty&5&&r!=(($=l==null?void 0:l.options)==null?void 0:$.min)&&t(2,r=(O=l==null?void 0:l.options)==null?void 0:O.min),n.$$.dirty&9&&a!=((M=l==null?void 0:l.options)==null?void 0:M.max)&&t(3,a=(D=l==null?void 0:l.options)==null?void 0:D.max)},[l,o,r,a,u,s,f,c,d,h,g,m,_,y,S]}class dC extends ve{constructor(e){super(),be(this,e,cC,fC,me,{field:0,key:1})}}const pC=n=>({}),id=n=>({});function sd(n,e,t){const i=n.slice();return i[47]=e[t],i}const hC=n=>({}),ld=n=>({});function od(n,e,t){const i=n.slice();return i[47]=e[t],i[51]=t,i}function rd(n){let e,t,i;return{c(){e=v("div"),t=U(n[2]),i=E(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),b(e,t),b(e,i)},p(s,l){l[0]&4&&se(t,s[2]),l[0]&96&&Q(e,"link-hint",!s[5]&&!s[6])},d(s){s&&k(e)}}}function mC(n){let e,t=n[47]+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=s[47]+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function gC(n){let e,t,i;const s=[{item:n[47]},n[10]];var l=n[9];function o(r,a){let u={};if(a!==void 0&&a[0]&1025)u=yt(s,[a[0]&1&&{item:r[47]},a[0]&1024&&Pt(r[10])]);else for(let f=0;f{H(u,1)}),fe()}l?(e=Et(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&1025?yt(s,[a[0]&1&&{item:r[47]},a[0]&1024&&Pt(r[10])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function ad(n){let e,t,i;function s(){return n[35](n[47])}return{c(){e=v("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Te(je.call(null,e,"Clear")),K(e,"click",An(xe(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function ud(n){let e,t,i,s,l,o;const r=[gC,mC],a=[];function u(c,d){return c[9]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[7])&&ad(n);return{c(){e=v("div"),i.c(),s=E(),f&&f.c(),l=E(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),b(e,s),f&&f.m(e,null),b(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(ue(),L(a[h],1,1,()=>{a[h]=null}),fe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[7]?f?f.p(c,d):(f=ad(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){L(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function fd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[19],$$slots:{default:[vC]},$$scope:{ctx:n}};return e=new Ln({props:i}),n[40](e),e.$on("show",n[25]),e.$on("hide",n[41]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&524288&&(o.trigger=s[19]),l[0]&3225866|l[1]&4096&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[40](null),H(e,s)}}}function cd(n){let e,t,i,s,l,o,r,a,u=n[16].length&&dd(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='',s=E(),l=v("input"),o=E(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(t,s),b(t,l),ae(l,n[16]),b(t,o),u&&u.m(t,null),l.focus(),r||(a=K(l,"input",n[37]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&65536&&l.value!==f[16]&&ae(l,f[16]),f[16].length?u?u.p(f,c):(u=dd(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function dd(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),b(e,t),i||(s=K(t,"click",An(xe(n[22]))),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function pd(n){let e,t=n[1]&&hd(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=hd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function hd(n){let e,t;return{c(){e=v("div"),t=U(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&2&&se(t,i[1])},d(i){i&&k(e)}}}function _C(n){let e=n[47]+"",t;return{c(){t=U(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&2097152&&e!==(e=i[47]+"")&&se(t,e)},i:x,o:x,d(i){i&&k(t)}}}function bC(n){let e,t,i;const s=[{item:n[47]},n[12]];var l=n[11];function o(r,a){let u={};if(a!==void 0&&a[0]&2101248)u=yt(s,[a[0]&2097152&&{item:r[47]},a[0]&4096&&Pt(r[12])]);else for(let f=0;f{H(u,1)}),fe()}l?(e=Et(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2101248?yt(s,[a[0]&2097152&&{item:r[47]},a[0]&4096&&Pt(r[12])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function md(n){let e,t,i,s,l,o,r;const a=[bC,_C],u=[];function f(h,g){return h[11]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[38](n[47],...h)}function d(...h){return n[39](n[47],...h)}return{c(){e=v("div"),i.c(),s=E(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[8]),Q(e,"selected",n[20](n[47]))},m(h,g){w(h,e,g),u[t].m(e,null),b(e,s),l=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(h,g){n=h;let m=t;t=f(n),t===m?u[t].p(n,g):(ue(),L(u[m],1,1,()=>{u[m]=null}),fe(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||g[0]&256)&&Q(e,"closable",n[8]),(!l||g[0]&3145728)&&Q(e,"selected",n[20](n[47]))},i(h){l||(A(i),l=!0)},o(h){L(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,$e(r)}}}function vC(n){let e,t,i,s,l,o=n[13]&&cd(n);const r=n[34].beforeOptions,a=Tt(r,n,n[43],ld);let u=ge(n[21]),f=[];for(let m=0;mL(f[m],1,1,()=>{f[m]=null});let d=null;u.length||(d=pd(n));const h=n[34].afterOptions,g=Tt(h,n,n[43],id);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=v("div");for(let m=0;mL(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=rd(n));let c=!n[5]&&!n[6]&&fd(n);return{c(){e=v("div"),t=v("div");for(let d=0;d{c=null}),fe()),(!o||h[0]&16384&&l!==(l="select "+d[14]))&&p(e,"class",l),(!o||h[0]&16400)&&Q(e,"multiple",d[4]),(!o||h[0]&16416)&&Q(e,"disabled",d[5]),(!o||h[0]&16448)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let h=0;hGe(Oe,ke))||[]}function ie(_e,ke){_e.preventDefault(),_&&d?B(ke):q(ke)}function Ee(_e,ke){(_e.code==="Enter"||_e.code==="Space")&&(ie(_e,ke),y&&J())}function Ne(){le(),setTimeout(()=>{const _e=P==null?void 0:P.querySelector(".dropdown-item.option.selected");_e&&(_e.focus(),_e.scrollIntoView({block:"nearest"}))},0)}function Ve(_e){_e.stopPropagation(),!g&&!h&&(I==null||I.toggle())}Gt(()=>{const _e=document.querySelectorAll(`label[for="${r}"]`);for(const ke of _e)ke.addEventListener("click",Ve);return()=>{for(const ke of _e)ke.removeEventListener("click",Ve)}});const ze=_e=>R(_e);function oe(_e){te[_e?"unshift":"push"](()=>{N=_e,t(19,N)})}function Ce(){F=this.value,t(16,F)}const We=(_e,ke)=>ie(ke,_e),_t=(_e,ke)=>Ee(ke,_e);function Xe(_e){te[_e?"unshift":"push"](()=>{I=_e,t(17,I)})}function Je(_e){Fe.call(this,n,_e)}function wt(_e){te[_e?"unshift":"push"](()=>{P=_e,t(18,P)})}return n.$$set=_e=>{"id"in _e&&t(26,r=_e.id),"noOptionsText"in _e&&t(1,a=_e.noOptionsText),"selectPlaceholder"in _e&&t(2,u=_e.selectPlaceholder),"searchPlaceholder"in _e&&t(3,f=_e.searchPlaceholder),"items"in _e&&t(27,c=_e.items),"multiple"in _e&&t(4,d=_e.multiple),"disabled"in _e&&t(5,h=_e.disabled),"readonly"in _e&&t(6,g=_e.readonly),"selected"in _e&&t(0,m=_e.selected),"toggle"in _e&&t(7,_=_e.toggle),"closable"in _e&&t(8,y=_e.closable),"labelComponent"in _e&&t(9,S=_e.labelComponent),"labelComponentProps"in _e&&t(10,C=_e.labelComponentProps),"optionComponent"in _e&&t(11,T=_e.optionComponent),"optionComponentProps"in _e&&t(12,$=_e.optionComponentProps),"searchable"in _e&&t(13,O=_e.searchable),"searchFunc"in _e&&t(28,M=_e.searchFunc),"class"in _e&&t(14,D=_e.class),"$$scope"in _e&&t(43,o=_e.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&134217728&&c&&(W(),le()),n.$$.dirty[0]&134283264&&t(21,i=ee(c,F)),n.$$.dirty[0]&1&&t(20,s=function(_e){const ke=V.toArray(m);return V.inArray(ke,_e)})},[m,a,u,f,d,h,g,_,y,S,C,T,$,O,D,R,F,I,P,N,s,i,le,ie,Ee,Ne,r,c,M,q,B,Z,X,J,l,ze,oe,Ce,We,_t,Xe,Je,wt,o]}class S1 extends ve{constructor(e){super(),be(this,e,wC,yC,me,{id:26,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:27,multiple:4,disabled:5,readonly:6,selected:0,toggle:7,closable:8,labelComponent:9,labelComponentProps:10,optionComponent:11,optionComponentProps:12,searchable:13,searchFunc:28,class:14,deselectItem:15,selectItem:29,toggleItem:30,reset:31,showDropdown:32,hideDropdown:33},null,[-1,-1])}get deselectItem(){return this.$$.ctx[15]}get selectItem(){return this.$$.ctx[29]}get toggleItem(){return this.$$.ctx[30]}get reset(){return this.$$.ctx[31]}get showDropdown(){return this.$$.ctx[32]}get hideDropdown(){return this.$$.ctx[33]}}function gd(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function SC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&gd(n);return{c(){l&&l.c(),e=E(),t=v("span"),s=U(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),b(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=gd(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(s,i)},i:x,o:x,d(o){o&&(k(e),k(t)),l&&l.d(o)}}}function TC(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,TC,SC,me,{item:0})}}const CC=n=>({}),bd=n=>({});function $C(n){let e;const t=n[8].afterOptions,i=Tt(t,n,n[12],bd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&$t(i,t,s,s[12],e?Ct(t,s[12],l,CC):Mt(s[12]),bd)},i(s){e||(A(i,s),e=!0)},o(s){L(i,s),e=!1},d(s){i&&i.d(s)}}}function MC(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[$C]},$$scope:{ctx:n}};for(let r=0;rhe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&62?yt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Pt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function OC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=et(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=_d}=e,{optionComponent:c=_d}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(C){C=V.toArray(C,!0);let T=[];for(let $ of C){const O=V.findByKey(r,d,$);O&&T.push(O)}C.length&&!T.length||t(0,u=a?T:T[0])}async function m(C){let T=V.toArray(C,!0).map($=>$[d]);r.length&&t(6,h=a?T:T[0])}function _(C){u=C,t(0,u)}function y(C){Fe.call(this,n,C)}function S(C){Fe.call(this,n,C)}return n.$$set=C=>{e=He(He({},e),Qt(C)),t(5,s=et(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&m(u)},[u,r,a,f,c,s,h,d,l,_,y,S,o]}class Bi extends ve{constructor(e){super(),be(this,e,OC,MC,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function EC(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Rs({props:a}),te.push(()=>he(t,"value",r)),{c(){e=v("div"),z(t.$$.fragment)},m(u,f){w(u,e,f),j(t,e,null),s=!0,l||(o=Te(je.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&16384&&(c.readonly=!u[14]),!i&&f&1&&(i=!0,c.value=u[0].options.values,ye(()=>i=!1)),t.$set(c)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){L(t.$$.fragment,u),s=!1},d(u){u&&k(e),H(t),l=!1,o()}}}function DC(n){let e,t,i;function s(o){n[8](o)}let l={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function AC(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[EC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[DC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),j(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),j(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16384&&(h.class="form-field required "+(c[14]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.values"),d&57345&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16384&&(g.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),H(i,c),H(r,c)}}}function vd(n){let e,t;return e=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[IC,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&40961&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[13]),p(l,"id",o=n[13]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.maxSelect),r||(a=K(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].options.maxSelect&&ae(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function LC(n){let e,t,i=!n[2]&&vd(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,l){s[2]?i&&(ue(),L(i,1,1,()=>{i=null}),fe()):i?(i.p(s,l),l&4&&A(i,1)):(i=vd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function PC(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[LC],default:[AC,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&18?yt(s,[a&2&&{key:r[1]},a&16&&Pt(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function FC(n,e,t){var y;const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((y=l.options)==null?void 0:y.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function c(){l.options.maxSelect=dt(this.value),t(0,l),t(5,u),t(2,a)}function d(S){n.$$.not_equal(l.options.values,S)&&(l.options.values=S,t(0,l),t(5,u),t(2,a))}function h(S){a=S,t(2,a)}function g(S){l=S,t(0,l),t(5,u),t(2,a)}function m(S){Fe.call(this,n,S)}function _(S){Fe.call(this,n,S)}return n.$$set=S=>{e=He(He({},e),Qt(S)),t(4,s=et(e,i)),"field"in S&&t(0,l=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,C;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((C=(S=l.options)==null?void 0:S.values)==null?void 0:C.length)||2,l)),n.$$.dirty&1&&V.isEmpty(l.options)&&f()},[l,o,a,r,s,u,c,d,h,g,m,_]}class NC extends ve{constructor(e){super(),be(this,e,FC,PC,me,{field:0,key:1})}}function RC(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qC(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M='"{"a":1,"b":2}"',D,I,F,P,N,R,q,B,Z,X,J,W,le;return{c(){e=v("div"),t=v("div"),i=v("div"),s=U("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=U(` and `),r=v("code"),r.textContent="multipart/form-data",a=U(` requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=U(` field is a `),c=v("strong"),c.textContent="plain string",d=U(`: `),h=v("ul"),g=v("li"),g.innerHTML=""true" is converted to the json true",m=E(),_=v("li"),_.innerHTML=""false" is converted to the json false",y=E(),S=v("li"),S.innerHTML=""null" is converted to the json null",C=E(),T=v("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",$=E(),O=v("li"),D=U(M),I=U(" is converted to the json "),F=v("code"),F.textContent='{"a":1,"b":2}',P=E(),N=v("li"),N.textContent="numeric strings are converted to json number",R=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",B=E(),Z=v("li"),Z.textContent="any other string (empty string too) is double quoted",X=U(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),J=v("code"),J.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,ie){w(ee,e,ie),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,h),b(h,g),b(h,m),b(h,_),b(h,y),b(h,S),b(h,C),b(h,T),b(h,$),b(h,O),b(O,D),b(O,I),b(O,F),b(h,P),b(h,N),b(h,R),b(h,q),b(h,B),b(h,Z),b(i,X),b(i,J),le=!0},i(ee){le||(ee&&Qe(()=>{le&&(W||(W=qe(e,it,{duration:150},!0)),W.run(1))}),le=!0)},o(ee){ee&&(W||(W=qe(e,it,{duration:150},!1)),W.run(0)),le=!1},d(ee){ee&&k(e),ee&&W&&W.end()}}}function jC(n){let e,t,i,s,l,o,r;function a(d,h){return d[2]?qC:RC}let u=a(n),f=u(n),c=n[2]&&yd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=Se(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,h){w(d,e,h),b(e,t),b(e,i),f.m(e,null),w(d,s,h),c&&c.m(d,h),w(d,l,h),o||(r=K(e,"click",n[4]),o=!0)},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?h&4&&A(c,1):(c=yd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ue(),L(c,1,1,()=>{c=null}),fe())},d(d){d&&(k(e),k(s),k(l)),f.d(),c&&c.d(d),o=!1,r()}}}function HC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[jC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&10?yt(s,[a&2&&{key:r[1]},a&8&&Pt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function VC(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(3,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class zC extends ve{constructor(e){super(),be(this,e,VC,HC,me,{field:0,key:1})}}function BC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=E(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&(k(e),k(s),k(l))}}}function UC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class kd extends ve{constructor(e){super(),be(this,e,UC,BC,me,{item:0})}}const WC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function YC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function KC(n){let e,t,i,s,l,o;return i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[YC,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&8388608&&(u.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s),k(l)),V(i,r)}}}function JC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=v("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=v("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=v("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[9]),K(i,"click",n[10]),K(l,"click",n[11]),K(r,"click",n[12])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function GC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C;function T(O){n[8](O)}let $={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:kd,optionComponent:kd};return n[0].options.mimeTypes!==void 0&&($.keyOfSelected=n[0].options.mimeTypes),r=new Bi({props:$}),te.push(()=>he(r,"keyOfSelected",T)),_=new Ln({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[JC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",h=E(),g=v("i"),m=E(),z(_.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(d,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,M){w(O,e,M),b(e,t),b(e,i),b(e,s),w(O,o,M),H(r,O,M),w(O,u,M),w(O,f,M),b(f,c),b(c,d),b(c,h),b(c,g),b(c,m),H(_,c,null),y=!0,S||(C=Te(je.call(null,s,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,M){(!y||M&4194304&&l!==(l=O[22]))&&p(e,"for",l);const D={};M&4194304&&(D.id=O[22]),M&8&&(D.items=O[3]),!a&&M&1&&(a=!0,D.keyOfSelected=O[0].options.mimeTypes,ye(()=>a=!1)),r.$set(D);const I={};M&16777217&&(I.$$scope={dirty:M,ctx:O}),_.$set(I)},i(O){y||(A(r.$$.fragment,O),A(_.$$.fragment,O),y=!0)},o(O){L(r.$$.fragment,O),L(_.$$.fragment,O),y=!1},d(O){O&&(k(e),k(o),k(u),k(f)),V(r,O),V(_),S=!1,C()}}}function ZC(n){let e;return{c(){e=v("ul"),e.innerHTML=`
  • WxH + data inside an object, eg.`),J=v("code"),J.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,ie){w(ee,e,ie),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,h),b(h,g),b(h,m),b(h,_),b(h,y),b(h,S),b(h,C),b(h,T),b(h,$),b(h,O),b(O,D),b(O,I),b(O,F),b(h,P),b(h,N),b(h,R),b(h,q),b(h,B),b(h,Z),b(i,X),b(i,J),le=!0},i(ee){le||(ee&&Qe(()=>{le&&(W||(W=qe(e,it,{duration:150},!0)),W.run(1))}),le=!0)},o(ee){ee&&(W||(W=qe(e,it,{duration:150},!1)),W.run(0)),le=!1},d(ee){ee&&k(e),ee&&W&&W.end()}}}function jC(n){let e,t,i,s,l,o,r;function a(d,h){return d[2]?qC:RC}let u=a(n),f=u(n),c=n[2]&&yd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=Se(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,h){w(d,e,h),b(e,t),b(e,i),f.m(e,null),w(d,s,h),c&&c.m(d,h),w(d,l,h),o||(r=K(e,"click",n[4]),o=!0)},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?h&4&&A(c,1):(c=yd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ue(),L(c,1,1,()=>{c=null}),fe())},d(d){d&&(k(e),k(s),k(l)),f.d(),c&&c.d(d),o=!1,r()}}}function HC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[jC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?yt(s,[a&2&&{key:r[1]},a&8&&Pt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function VC(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(3,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class zC extends ve{constructor(e){super(),be(this,e,VC,HC,me,{field:0,key:1})}}function BC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=E(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&(k(e),k(s),k(l))}}}function UC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class kd extends ve{constructor(e){super(),be(this,e,UC,BC,me,{item:0})}}const WC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function YC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KC(n){let e,t,i,s,l,o;return i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[YC,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),j(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&8388608&&(u.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s),k(l)),H(i,r)}}}function JC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=v("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=v("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=v("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[9]),K(i,"click",n[10]),K(l,"click",n[11]),K(r,"click",n[12])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function GC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C;function T(O){n[8](O)}let $={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:kd,optionComponent:kd};return n[0].options.mimeTypes!==void 0&&($.keyOfSelected=n[0].options.mimeTypes),r=new Bi({props:$}),te.push(()=>he(r,"keyOfSelected",T)),_=new Ln({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[JC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",h=E(),g=v("i"),m=E(),z(_.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(d,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,M){w(O,e,M),b(e,t),b(e,i),b(e,s),w(O,o,M),j(r,O,M),w(O,u,M),w(O,f,M),b(f,c),b(c,d),b(c,h),b(c,g),b(c,m),j(_,c,null),y=!0,S||(C=Te(je.call(null,s,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,M){(!y||M&4194304&&l!==(l=O[22]))&&p(e,"for",l);const D={};M&4194304&&(D.id=O[22]),M&8&&(D.items=O[3]),!a&&M&1&&(a=!0,D.keyOfSelected=O[0].options.mimeTypes,ye(()=>a=!1)),r.$set(D);const I={};M&16777217&&(I.$$scope={dirty:M,ctx:O}),_.$set(I)},i(O){y||(A(r.$$.fragment,O),A(_.$$.fragment,O),y=!0)},o(O){L(r.$$.fragment,O),L(_.$$.fragment,O),y=!1},d(O){O&&(k(e),k(o),k(u),k(f)),H(r,O),H(_),S=!1,C()}}}function ZC(n){let e;return{c(){e=v("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function XC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;function O(D){n[13](D)}let M={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(M.value=n[0].options.thumbs),r=new Rs({props:M}),te.push(()=>he(r,"value",O)),S=new Ln({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[ZC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),h=v("button"),g=v("span"),g.textContent="Supported formats",m=E(),_=v("i"),y=E(),z(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,I){w(D,e,I),b(e,t),b(e,i),b(e,s),w(D,o,I),H(r,D,I),w(D,u,I),w(D,f,I),b(f,c),b(f,d),b(f,h),b(h,g),b(h,m),b(h,_),b(h,y),H(S,h,null),C=!0,T||($=Te(je.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(D,I){(!C||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const F={};I&4194304&&(F.id=D[22]),!a&&I&1&&(a=!0,F.value=D[0].options.thumbs,ye(()=>a=!1)),r.$set(F);const P={};I&16777216&&(P.$$scope={dirty:I,ctx:D}),S.$set(P)},i(D){C||(A(r.$$.fragment,D),A(S.$$.fragment,D),C=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),C=!1},d(D){D&&(k(e),k(o),k(u),k(f)),V(r,D),V(S),T=!1,$()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&dt(l.value)!==c[0].options.maxSize&&ae(l,c[0].options.maxSize)},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function wd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[xC,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function xC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.maxSelect),r||(a=K(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].options.maxSelect&&ae(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function e$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[GC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[XC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[QC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&wd(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),d=E(),g&&g.c(),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(m,_){w(m,e,_),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,a),b(e,u),H(f,u,null),b(e,d),g&&g.m(e,null),h=!0},p(m,_){const y={};_&2&&(y.name="schema."+m[1]+".options.mimeTypes"),_&20971529&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.name="schema."+m[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:m}),o.$set(S),(!h||_&4&&r!==(r=m[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const C={};_&2&&(C.name="schema."+m[1]+".options.maxSize"),_&20971521&&(C.$$scope={dirty:_,ctx:m}),f.$set(C),(!h||_&4&&c!==(c=m[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),m[2]?g&&(ue(),L(g,1,1,()=>{g=null}),fe()):g?(g.p(m,_),_&4&&A(g,1)):(g=wd(m),g.c(),A(g,1),g.m(e,null))},i(m){h||(A(i.$$.fragment,m),A(o.$$.fragment,m),A(f.$$.fragment,m),A(g),h=!0)},o(m){L(i.$$.fragment,m),L(o.$$.fragment,m),L(f.$$.fragment,m),L(g),h=!1},d(m){m&&k(e),V(i),V(o),V(f),g&&g.d()}}}function t$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Protected",r=E(),a=v("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"class","txt"),p(s,"for",o=n[22]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,s,d),b(s,l),w(c,r,d),w(c,a,d),u||(f=K(e,"change",n[7]),u=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(s,"for",o)},d(c){c&&(k(e),k(i),k(s),k(r),k(a)),u=!1,f()}}}function n$(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[t$,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.protected"),s&20971521&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function i$(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{optionsFooter:[n$],options:[e$],default:[KC,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?yt(s,[a&2&&{key:r[1]},a&32&&Pt(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function s$(n,e,t){var F;const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=WC.slice(),u=((F=l.options)==null?void 0:F.maxSelect)<=1,f=u;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(l.options.mimeTypes))return;const P=[];for(const N of l.options.mimeTypes)a.find(R=>R.mimeType===N)||P.push({mimeType:N});P.length&&t(3,a=a.concat(P))}function h(){l.options.protected=this.checked,t(0,l),t(6,f),t(2,u)}function g(P){n.$$.not_equal(l.options.mimeTypes,P)&&(l.options.mimeTypes=P,t(0,l),t(6,f),t(2,u))}const m=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},_=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},y=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},S=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function C(P){n.$$.not_equal(l.options.thumbs,P)&&(l.options.thumbs=P,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=dt(this.value),t(0,l),t(6,f),t(2,u)}function $(){l.options.maxSelect=dt(this.value),t(0,l),t(6,f),t(2,u)}function O(P){u=P,t(2,u)}function M(P){l=P,t(0,l),t(6,f),t(2,u)}function D(P){Fe.call(this,n,P)}function I(P){Fe.call(this,n,P)}return n.$$set=P=>{e=He(He({},e),Qt(P)),t(5,s=et(e,i)),"field"in P&&t(0,l=P.field),"key"in P&&t(1,o=P.key)},n.$$.update=()=>{var P,N;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((N=(P=l.options)==null?void 0:P.values)==null?void 0:N.length)||99,l)),n.$$.dirty&1&&(j.isEmpty(l.options)?c():d())},[l,o,u,a,r,s,f,h,g,m,_,y,S,C,T,$,O,M,D,I]}class l$ extends ve{constructor(e){super(),be(this,e,s$,i$,me,{field:0,key:1})}}function o$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=E(),i=v("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=K(i,"click",n[14]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function r$(n){let e,t,i;function s(o){n[15](o)}let l={id:n[23],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[24]||n[0].id,$$slots:{afterOptions:[o$]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&16777217&&(a.readonly=!o[24]||o[0].id),r&33554440&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function a$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function u$(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field required "+(n[24]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[r$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[a$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16777216&&(h.class="form-field required "+(c[24]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&58720297&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16777216&&(g.class="form-field form-field-single-multiple-select "+(c[24]?"":"readonly")),d&58720260&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function Sd(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[f$,({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:[c$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),i=E(),s=v("div"),z(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),H(t,e,null),w(r,i,a),w(r,s,a),H(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&41943041&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&41943041&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(s)),V(t),V(l)}}}function f$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min select"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.minSelect),r||(a=K(l,"input",n[11]),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&&dt(l.value)!==u[0].options.minSelect&&ae(l,u[0].options.minSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function c$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("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].options.minSelect||2)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[0].options.maxSelect),a||(u=K(l,"input",n[12]),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].options.minSelect||2)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].options.maxSelect&&ae(l,f[0].options.maxSelect)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function d$(n){let e,t,i,s,l,o,r,a,u,f,c,d;function h(m){n[13](m)}let g={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new Bi({props:g}),te.push(()=>he(a,"keyOfSelected",h)),{c(){e=v("label"),t=v("span"),t.textContent="Cascade delete",i=E(),s=v("i"),r=E(),z(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(m,_){var y,S;w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,r,_),H(a,m,_),f=!0,c||(d=Te(l=je.call(null,s,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + (eg. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function XC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;function O(D){n[13](D)}let M={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(M.value=n[0].options.thumbs),r=new Rs({props:M}),te.push(()=>he(r,"value",O)),S=new Ln({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[ZC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),h=v("button"),g=v("span"),g.textContent="Supported formats",m=E(),_=v("i"),y=E(),z(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,I){w(D,e,I),b(e,t),b(e,i),b(e,s),w(D,o,I),j(r,D,I),w(D,u,I),w(D,f,I),b(f,c),b(f,d),b(f,h),b(h,g),b(h,m),b(h,_),b(h,y),j(S,h,null),C=!0,T||($=Te(je.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(D,I){(!C||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const F={};I&4194304&&(F.id=D[22]),!a&&I&1&&(a=!0,F.value=D[0].options.thumbs,ye(()=>a=!1)),r.$set(F);const P={};I&16777216&&(P.$$scope={dirty:I,ctx:D}),S.$set(P)},i(D){C||(A(r.$$.fragment,D),A(S.$$.fragment,D),C=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),C=!1},d(D){D&&(k(e),k(o),k(u),k(f)),H(r,D),H(S),T=!1,$()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&dt(l.value)!==c[0].options.maxSize&&ae(l,c[0].options.maxSize)},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function wd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[xC,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function xC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.maxSelect),r||(a=K(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].options.maxSelect&&ae(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function e$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[GC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[XC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[QC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&wd(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),d=E(),g&&g.c(),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(m,_){w(m,e,_),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,a),b(e,u),j(f,u,null),b(e,d),g&&g.m(e,null),h=!0},p(m,_){const y={};_&2&&(y.name="schema."+m[1]+".options.mimeTypes"),_&20971529&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.name="schema."+m[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:m}),o.$set(S),(!h||_&4&&r!==(r=m[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const C={};_&2&&(C.name="schema."+m[1]+".options.maxSize"),_&20971521&&(C.$$scope={dirty:_,ctx:m}),f.$set(C),(!h||_&4&&c!==(c=m[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),m[2]?g&&(ue(),L(g,1,1,()=>{g=null}),fe()):g?(g.p(m,_),_&4&&A(g,1)):(g=wd(m),g.c(),A(g,1),g.m(e,null))},i(m){h||(A(i.$$.fragment,m),A(o.$$.fragment,m),A(f.$$.fragment,m),A(g),h=!0)},o(m){L(i.$$.fragment,m),L(o.$$.fragment,m),L(f.$$.fragment,m),L(g),h=!1},d(m){m&&k(e),H(i),H(o),H(f),g&&g.d()}}}function t$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Protected",r=E(),a=v("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"class","txt"),p(s,"for",o=n[22]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,s,d),b(s,l),w(c,r,d),w(c,a,d),u||(f=K(e,"change",n[7]),u=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(s,"for",o)},d(c){c&&(k(e),k(i),k(s),k(r),k(a)),u=!1,f()}}}function n$(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[t$,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.protected"),s&20971521&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function i$(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{optionsFooter:[n$],options:[e$],default:[KC,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&34?yt(s,[a&2&&{key:r[1]},a&32&&Pt(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function s$(n,e,t){var F;const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=WC.slice(),u=((F=l.options)==null?void 0:F.maxSelect)<=1,f=u;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function d(){if(V.isEmpty(l.options.mimeTypes))return;const P=[];for(const N of l.options.mimeTypes)a.find(R=>R.mimeType===N)||P.push({mimeType:N});P.length&&t(3,a=a.concat(P))}function h(){l.options.protected=this.checked,t(0,l),t(6,f),t(2,u)}function g(P){n.$$.not_equal(l.options.mimeTypes,P)&&(l.options.mimeTypes=P,t(0,l),t(6,f),t(2,u))}const m=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},_=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},y=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},S=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function C(P){n.$$.not_equal(l.options.thumbs,P)&&(l.options.thumbs=P,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=dt(this.value),t(0,l),t(6,f),t(2,u)}function $(){l.options.maxSelect=dt(this.value),t(0,l),t(6,f),t(2,u)}function O(P){u=P,t(2,u)}function M(P){l=P,t(0,l),t(6,f),t(2,u)}function D(P){Fe.call(this,n,P)}function I(P){Fe.call(this,n,P)}return n.$$set=P=>{e=He(He({},e),Qt(P)),t(5,s=et(e,i)),"field"in P&&t(0,l=P.field),"key"in P&&t(1,o=P.key)},n.$$.update=()=>{var P,N;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((N=(P=l.options)==null?void 0:P.values)==null?void 0:N.length)||99,l)),n.$$.dirty&1&&(V.isEmpty(l.options)?c():d())},[l,o,u,a,r,s,f,h,g,m,_,y,S,C,T,$,O,M,D,I]}class l$ extends ve{constructor(e){super(),be(this,e,s$,i$,me,{field:0,key:1})}}function o$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=E(),i=v("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=K(i,"click",n[14]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function r$(n){let e,t,i;function s(o){n[15](o)}let l={id:n[23],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[24]||n[0].id,$$slots:{afterOptions:[o$]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&16777217&&(a.readonly=!o[24]||o[0].id),r&33554440&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function a$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function u$(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field required "+(n[24]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[r$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[a$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),j(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),j(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16777216&&(h.class="form-field required "+(c[24]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&58720297&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&16777216&&(g.class="form-field form-field-single-multiple-select "+(c[24]?"":"readonly")),d&58720260&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),H(i,c),H(r,c)}}}function Sd(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[f$,({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:[c$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),i=E(),s=v("div"),z(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),j(t,e,null),w(r,i,a),w(r,s,a),j(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&41943041&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&41943041&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(s)),H(t),H(l)}}}function f$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min select"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.minSelect),r||(a=K(l,"input",n[11]),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&&dt(l.value)!==u[0].options.minSelect&&ae(l,u[0].options.minSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function c$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("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].options.minSelect||2)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[0].options.maxSelect),a||(u=K(l,"input",n[12]),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].options.minSelect||2)&&p(l,"min",r),c&1&&dt(l.value)!==f[0].options.maxSelect&&ae(l,f[0].options.maxSelect)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function d$(n){let e,t,i,s,l,o,r,a,u,f,c,d;function h(m){n[13](m)}let g={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new Bi({props:g}),te.push(()=>he(a,"keyOfSelected",h)),{c(){e=v("label"),t=v("span"),t.textContent="Cascade delete",i=E(),s=v("i"),r=E(),z(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(m,_){var y,S;w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,r,_),j(a,m,_),f=!0,c||(d=Te(l=je.call(null,s,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"})),c=!0)},p(m,_){var S,C;l&&Et(l.update)&&_&20&&l.update.call(null,{text:[`Whether on ${((S=m[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,m[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((C=m[4])==null?void 0:C.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` +`),position:"top"})),c=!0)},p(m,_){var S,C;l&&At(l.update)&&_&20&&l.update.call(null,{text:[`Whether on ${((S=m[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,m[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((C=m[4])==null?void 0:C.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!f||_&8388608&&o!==(o=m[23]))&&p(e,"for",o);const y={};_&8388608&&(y.id=m[23]),!u&&_&1&&(u=!0,y.keyOfSelected=m[0].options.cascadeDelete,ye(()=>u=!1)),a.$set(y)},i(m){f||(A(a.$$.fragment,m),f=!0)},o(m){L(a.$$.fragment,m),f=!1},d(m){m&&(k(e),k(r)),V(a,m),c=!1,d()}}}function p$(n){let e,t,i,s,l,o=!n[2]&&Sd(n);return s=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[d$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),o&&o.c(),t=E(),i=v("div"),z(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),b(e,t),b(e,i),H(s,i,null),l=!0},p(r,a){r[2]?o&&(ue(),L(o,1,1,()=>{o=null}),fe()):o?(o.p(r,a),a&4&&A(o,1)):(o=Sd(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(A(o),A(s.$$.fragment,r),l=!0)},o(r){L(o),L(s.$$.fragment,r),l=!1},d(r){r&&k(e),o&&o.d(),V(s)}}}function h$(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[p$],default:[u$,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fhe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return s=new ou({props:u}),n[20](s),s.$on("save",n[21]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,c){H(e,f,c),w(f,i,c),H(s,f,c),l=!0},p(f,[c]){const d=c&258?yt(o,[c&2&&{key:f[1]},c&256&&Pt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ye(()=>t=!1)),e.$set(d);const h={};s.$set(h)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){f&&k(i),V(e,f),n[20](null),V(s,f)}}}function m$(n,e,t){var P;let i,s;const l=["field","key"];let o=et(e,l),r;Ke(n,ii,N=>t(10,r=N));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,h=((P=a.options)==null?void 0:P.maxSelect)==1,g=h;function m(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,h=!0),t(9,g=h)}function _(){a.options.minSelect=dt(this.value),t(0,a),t(9,g),t(2,h)}function y(){a.options.maxSelect=dt(this.value),t(0,a),t(9,g),t(2,h)}function S(N){n.$$.not_equal(a.options.cascadeDelete,N)&&(a.options.cascadeDelete=N,t(0,a),t(9,g),t(2,h))}const C=()=>d==null?void 0:d.show();function T(N){n.$$.not_equal(a.options.collectionId,N)&&(a.options.collectionId=N,t(0,a),t(9,g),t(2,h))}function $(N){h=N,t(2,h)}function O(N){a=N,t(0,a),t(9,g),t(2,h)}function M(N){Fe.call(this,n,N)}function D(N){Fe.call(this,n,N)}function I(N){te[N?"unshift":"push"](()=>{d=N,t(3,d)})}const F=N=>{var R,q;(q=(R=N==null?void 0:N.detail)==null?void 0:R.collection)!=null&&q.id&&N.detail.collection.type!="view"&&t(0,a.options.collectionId=N.detail.collection.id,a)};return n.$$set=N=>{e=He(He({},e),Qt(N)),t(8,o=et(e,l)),"field"in N&&t(0,a=N.field),"key"in N&&t(1,u=N.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(N=>N.type!="view")),n.$$.dirty&516&&g!=h&&(t(9,g=h),h?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&m(),n.$$.dirty&1025&&t(4,s=r.find(N=>N.id==a.options.collectionId)||null)},[a,u,h,d,s,i,f,c,o,g,r,_,y,S,C,T,$,O,M,D,I,F]}class g$ extends ve{constructor(e){super(),be(this,e,m$,h$,me,{field:0,key:1})}}const _$=n=>({dragging:n&4,dragover:n&8}),Td=n=>({dragging:n[2],dragover:n[3]});function b$(n){let e,t,i,s,l;const o=n[10].default,r=Tt(o,n,n[9],Td);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[K(e,"dragover",xe(n[11])),K(e,"dragleave",xe(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&$t(r,o,a,a[9],i?Ct(o,a[9],u,_$):Mt(a[9]),Td),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&Q(e,"dragging",a[2]),(!i||u&8)&&Q(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function v$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function h(T,$){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:$,group:a})),l("drag",T)}}function g(T,$){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const M=O.index<<0;M<$?(r.splice($+1,0,r[M]),r.splice(M,1)):(r.splice($,0,r[M]),r.splice(M+1,1)),t(6,r),l("sort",{oldIndex:M,newIndex:$,list:r})}const m=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=T=>h(T,o),C=T=>g(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,s=T.$$scope)},[o,u,c,d,h,g,r,a,f,s,i,m,_,y,S,C]}class Il extends ve{constructor(e){super(),be(this,e,v$,b$,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Cd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function $d(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, +`),position:"top"}),(!f||_&8388608&&o!==(o=m[23]))&&p(e,"for",o);const y={};_&8388608&&(y.id=m[23]),!u&&_&1&&(u=!0,y.keyOfSelected=m[0].options.cascadeDelete,ye(()=>u=!1)),a.$set(y)},i(m){f||(A(a.$$.fragment,m),f=!0)},o(m){L(a.$$.fragment,m),f=!1},d(m){m&&(k(e),k(r)),H(a,m),c=!1,d()}}}function p$(n){let e,t,i,s,l,o=!n[2]&&Sd(n);return s=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[d$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),o&&o.c(),t=E(),i=v("div"),z(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),b(e,t),b(e,i),j(s,i,null),l=!0},p(r,a){r[2]?o&&(ue(),L(o,1,1,()=>{o=null}),fe()):o?(o.p(r,a),a&4&&A(o,1)):(o=Sd(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(A(o),A(s.$$.fragment,r),l=!0)},o(r){L(o),L(s.$$.fragment,r),l=!1},d(r){r&&k(e),o&&o.d(),H(s)}}}function h$(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[p$],default:[u$,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fhe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return s=new ou({props:u}),n[20](s),s.$on("save",n[21]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,c){j(e,f,c),w(f,i,c),j(s,f,c),l=!0},p(f,[c]){const d=c&258?yt(o,[c&2&&{key:f[1]},c&256&&Pt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ye(()=>t=!1)),e.$set(d);const h={};s.$set(h)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){f&&k(i),H(e,f),n[20](null),H(s,f)}}}function m$(n,e,t){var P;let i,s;const l=["field","key"];let o=et(e,l),r;Ke(n,ii,N=>t(10,r=N));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,h=((P=a.options)==null?void 0:P.maxSelect)==1,g=h;function m(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,h=!0),t(9,g=h)}function _(){a.options.minSelect=dt(this.value),t(0,a),t(9,g),t(2,h)}function y(){a.options.maxSelect=dt(this.value),t(0,a),t(9,g),t(2,h)}function S(N){n.$$.not_equal(a.options.cascadeDelete,N)&&(a.options.cascadeDelete=N,t(0,a),t(9,g),t(2,h))}const C=()=>d==null?void 0:d.show();function T(N){n.$$.not_equal(a.options.collectionId,N)&&(a.options.collectionId=N,t(0,a),t(9,g),t(2,h))}function $(N){h=N,t(2,h)}function O(N){a=N,t(0,a),t(9,g),t(2,h)}function M(N){Fe.call(this,n,N)}function D(N){Fe.call(this,n,N)}function I(N){te[N?"unshift":"push"](()=>{d=N,t(3,d)})}const F=N=>{var R,q;(q=(R=N==null?void 0:N.detail)==null?void 0:R.collection)!=null&&q.id&&N.detail.collection.type!="view"&&t(0,a.options.collectionId=N.detail.collection.id,a)};return n.$$set=N=>{e=He(He({},e),Qt(N)),t(8,o=et(e,l)),"field"in N&&t(0,a=N.field),"key"in N&&t(1,u=N.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(N=>N.type!="view")),n.$$.dirty&516&&g!=h&&(t(9,g=h),h?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&V.isEmpty(a.options)&&m(),n.$$.dirty&1025&&t(4,s=r.find(N=>N.id==a.options.collectionId)||null)},[a,u,h,d,s,i,f,c,o,g,r,_,y,S,C,T,$,O,M,D,I,F]}class g$ extends ve{constructor(e){super(),be(this,e,m$,h$,me,{field:0,key:1})}}const _$=n=>({dragging:n&4,dragover:n&8}),Td=n=>({dragging:n[2],dragover:n[3]});function b$(n){let e,t,i,s,l;const o=n[10].default,r=Tt(o,n,n[9],Td);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[K(e,"dragover",xe(n[11])),K(e,"dragleave",xe(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&$t(r,o,a,a[9],i?Ct(o,a[9],u,_$):Mt(a[9]),Td),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&Q(e,"dragging",a[2]),(!i||u&8)&&Q(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function v$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function h(T,$){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:$,group:a})),l("drag",T)}}function g(T,$){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const M=O.index<<0;M<$?(r.splice($+1,0,r[M]),r.splice(M,1)):(r.splice($,0,r[M]),r.splice(M+1,1)),t(6,r),l("sort",{oldIndex:M,newIndex:$,list:r})}const m=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=T=>h(T,o),C=T=>g(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,s=T.$$scope)},[o,u,c,d,h,g,r,a,f,s,i,m,_,y,S,C]}class Il extends ve{constructor(e){super(),be(this,e,v$,b$,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Cd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function $d(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, `),t=v("code"),t.textContent="username",i=U(` , `),s=v("code"),s.textContent="email",l=U(` , `),o=v("code"),o.textContent="emailVisibility",r=U(` , - `),a=v("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){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r),k(a))}}}function y$(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=Dt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&z(e.$$.fragment),i=E()},m(u,f){e&&H(e,u,f),w(u,i,f),s=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){ue();const c=e;L(c.$$.fragment,1,0,()=>{V(c,1)}),fe()}r?(e=Dt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],ye(()=>t=!1)),e.$set(c)}},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){u&&k(i),e&&V(e,u)}}}function Md(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[y$]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Il({props:r}),te.push(()=>he(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function k$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$,O,M=n[0].type==="auth"&&$d(),D=ge(n[0].schema);const I=N=>N[17];for(let N=0;Nhe(T,"collection",F)),{c(){e=v("div"),t=v("p"),i=U(`System fields: + `),a=v("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){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r),k(a))}}}function y$(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=Et(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&z(e.$$.fragment),i=E()},m(u,f){e&&j(e,u,f),w(u,i,f),s=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){ue();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),fe()}r?(e=Et(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],ye(()=>t=!1)),e.$set(c)}},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){u&&k(i),e&&H(e,u)}}}function Md(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[y$]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Il({props:r}),te.push(()=>he(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function k$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$,O,M=n[0].type==="auth"&&$d(),D=ge(n[0].schema);const I=N=>N[17];for(let N=0;Nhe(T,"collection",F)),{c(){e=v("div"),t=v("p"),i=U(`System fields: `),s=v("code"),s.textContent="id",l=U(` , `),o=v("code"),o.textContent="created",r=U(` , `),a=v("code"),a.textContent="updated",u=E(),M&&M.c(),f=U(` - .`),c=E(),d=v("div");for(let N=0;N$=!1)),T.$set(q)},i(N){if(!O){for(let R=0;RO.name===T))}function f(T){return i.findIndex($=>$===T)}function c(T,$){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||T===$||!$||t(0,s.indexes=s.indexes.map(M=>j.replaceIndexColumn(M,T,$)),s)}function d(T,$,O,M){O[M]=T,t(0,s)}const h=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function m(T){n.$$.not_equal(s.schema,T)&&(s.schema=T,t(0,s))}const _=T=>{if(!T.detail)return;const $=T.detail.target;$.style.opacity=0,setTimeout(()=>{var O;(O=$==null?void 0:$.style)==null||O.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage($,0,0)},y=()=>{en({})},S=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,c,d,h,g,m,_,y,S,C]}class S$ extends ve{constructor(e){super(),be(this,e,w$,k$,me,{collection:0})}}const T$=n=>({isAdminOnly:n&512}),Od=n=>({isAdminOnly:n[9]}),C$=n=>({isAdminOnly:n&512}),Ed=n=>({isAdminOnly:n[9]}),$$=n=>({isAdminOnly:n&512}),Dd=n=>({isAdminOnly:n[9]});function M$(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[E$,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function O$(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Ad(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Id(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=K(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function E$(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,h,g,m,_,y,S;const C=n[12].beforeLabel,T=Tt(C,n,n[15],Dd),$=n[12].afterLabel,O=Tt($,n,n[15],Ed);let M=!n[9]&&Ad(n);function D(q){n[14](q)}var I=n[7];function F(q,B){let Z={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(Z.value=q[0]),{props:Z}}I&&(h=Dt(I,F(n)),n[13](h),te.push(()=>he(h,"value",D)));let P=n[9]&&Id(n);const N=n[12].default,R=Tt(N,n,n[15],Od);return{c(){e=v("div"),t=v("label"),T&&T.c(),i=E(),s=v("span"),l=U(n[2]),o=E(),a=U(r),u=E(),O&&O.c(),f=E(),M&&M.c(),d=E(),h&&z(h.$$.fragment),m=E(),P&&P.c(),_=E(),y=v("div"),R&&R.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,B){w(q,e,B),b(e,t),T&&T.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),O&&O.m(t,null),b(t,f),M&&M.m(t,null),b(e,d),h&&H(h,e,null),b(e,m),P&&P.m(e,null),w(q,_,B),w(q,y,B),R&&R.m(y,null),S=!0},p(q,B){if(T&&T.p&&(!S||B&33280)&&$t(T,C,q,q[15],S?Ct(C,q[15],B,$$):Mt(q[15]),Dd),(!S||B&4)&&se(l,q[2]),(!S||B&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||B&512)&&Q(s,"txt-hint",q[9]),O&&O.p&&(!S||B&33280)&&$t(O,$,q,q[15],S?Ct($,q[15],B,C$):Mt(q[15]),Ed),q[9]?M&&(M.d(1),M=null):M?M.p(q,B):(M=Ad(q),M.c(),M.m(t,null)),(!S||B&262144&&c!==(c=q[18]))&&p(t,"for",c),B&128&&I!==(I=q[7])){if(h){ue();const Z=h;L(Z.$$.fragment,1,0,()=>{V(Z,1)}),fe()}I?(h=Dt(I,F(q)),q[13](h),te.push(()=>he(h,"value",D)),z(h.$$.fragment),A(h.$$.fragment,1),H(h,e,m)):h=null}else if(I){const Z={};B&262144&&(Z.id=q[18]),B&2&&(Z.baseCollection=q[1]),B&512&&(Z.disabled=q[9]),B&544&&(Z.placeholder=q[9]?"":q[5]),!g&&B&1&&(g=!0,Z.value=q[0],ye(()=>g=!1)),h.$set(Z)}q[9]?P?(P.p(q,B),B&512&&A(P,1)):(P=Id(q),P.c(),A(P,1),P.m(e,null)):P&&(ue(),L(P,1,1,()=>{P=null}),fe()),R&&R.p&&(!S||B&33280)&&$t(R,N,q,q[15],S?Ct(N,q[15],B,T$):Mt(q[15]),Od)},i(q){S||(A(T,q),A(O,q),h&&A(h.$$.fragment,q),A(P),A(R,q),S=!0)},o(q){L(T,q),L(O,q),h&&L(h.$$.fragment,q),L(P),L(R,q),S=!1},d(q){q&&(k(e),k(_),k(y)),T&&T.d(q),O&&O.d(q),M&&M.d(),n[13](null),h&&V(h),P&&P.d(),R&&R.d(q)}}}function D$(n){let e,t,i,s;const l=[O$,M$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}let Ld;function A$(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,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,h=null,g=Ld,m=!1;_();async function _(){g||m||(t(8,m=!0),t(7,g=(await rt(()=>import("./FilterAutocompleteInput-5c53fc35.js"),["./FilterAutocompleteInput-5c53fc35.js","./index-808c8630.js"],import.meta.url)).default),Ld=g,t(8,m=!1))}async function y(){t(0,r=h||""),await ln(),d==null||d.focus()}async function S(){h=r,t(0,r=null)}function C($){te[$?"unshift":"push"](()=>{d=$,t(6,d)})}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),"placeholder"in $&&t(5,c=$.placeholder),"$$scope"in $&&t(15,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,g,m,i,y,S,s,C,T,l]}class Cs extends ve{constructor(e){super(),be(this,e,A$,D$,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Pd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Fd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I=ge(n[2]),F=[];for(let P=0;P@request
    filter:",c=E(),d=v("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",h=E(),g=v("hr"),m=E(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=E(),S=v("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",C=E(),T=v("hr"),$=E(),O=v("p"),O.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,N){w(P,e,N),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R{D&&(M||(M=qe(e,it,{duration:150},!0)),M.run(1))}),D=!0)},o(P){P&&(M||(M=qe(e,it,{duration:150},!1)),M.run(0)),D=!1},d(P){P&&k(e),gt(F,P),P&&M&&M.end()}}}function Nd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function Rd(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],$$slots:{afterLabel:[I$,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cs({props:c}),te.push(()=>he(e,"rule",f));function d(_){n[7](_)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Cs({props:h}),te.push(()=>he(s,"rule",d));function g(_){n[8](_)}let m={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(m.rule=n[0].deleteRule),r=new Cs({props:m}),te.push(()=>he(r,"rule",g)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(_,y){H(e,_,y),w(_,i,y),H(s,_,y),w(_,o,y),H(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&17408&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,ye(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!l&&y&1&&(l=!0,C.rule=_[0].updateRule,ye(()=>l=!1)),s.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){L(e.$$.fragment,_),L(s.$$.fragment,_),L(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),V(e,_),V(s,_),V(r,_)}}}function qd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Te(je.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function I$(n){let e,t=!n[10]&&qd();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=qd(),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function jd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[L$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Cs({props:l}),te.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function L$(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. + .`),c=E(),d=v("div");for(let N=0;N$=!1)),T.$set(q)},i(N){if(!O){for(let R=0;RO.name===T))}function f(T){return i.findIndex($=>$===T)}function c(T,$){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||T===$||!$||t(0,s.indexes=s.indexes.map(M=>V.replaceIndexColumn(M,T,$)),s)}function d(T,$,O,M){O[M]=T,t(0,s)}const h=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function m(T){n.$$.not_equal(s.schema,T)&&(s.schema=T,t(0,s))}const _=T=>{if(!T.detail)return;const $=T.detail.target;$.style.opacity=0,setTimeout(()=>{var O;(O=$==null?void 0:$.style)==null||O.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage($,0,0)},y=()=>{en({})},S=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,c,d,h,g,m,_,y,S,C]}class S$ extends ve{constructor(e){super(),be(this,e,w$,k$,me,{collection:0})}}const T$=n=>({isAdminOnly:n&512}),Od=n=>({isAdminOnly:n[9]}),C$=n=>({isAdminOnly:n&512}),Ed=n=>({isAdminOnly:n[9]}),$$=n=>({isAdminOnly:n&512}),Dd=n=>({isAdminOnly:n[9]});function M$(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[E$,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function O$(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Ad(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Id(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=K(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function E$(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,h,g,m,_,y,S;const C=n[12].beforeLabel,T=Tt(C,n,n[15],Dd),$=n[12].afterLabel,O=Tt($,n,n[15],Ed);let M=!n[9]&&Ad(n);function D(q){n[14](q)}var I=n[7];function F(q,B){let Z={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(Z.value=q[0]),{props:Z}}I&&(h=Et(I,F(n)),n[13](h),te.push(()=>he(h,"value",D)));let P=n[9]&&Id(n);const N=n[12].default,R=Tt(N,n,n[15],Od);return{c(){e=v("div"),t=v("label"),T&&T.c(),i=E(),s=v("span"),l=U(n[2]),o=E(),a=U(r),u=E(),O&&O.c(),f=E(),M&&M.c(),d=E(),h&&z(h.$$.fragment),m=E(),P&&P.c(),_=E(),y=v("div"),R&&R.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,B){w(q,e,B),b(e,t),T&&T.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),O&&O.m(t,null),b(t,f),M&&M.m(t,null),b(e,d),h&&j(h,e,null),b(e,m),P&&P.m(e,null),w(q,_,B),w(q,y,B),R&&R.m(y,null),S=!0},p(q,B){if(T&&T.p&&(!S||B&33280)&&$t(T,C,q,q[15],S?Ct(C,q[15],B,$$):Mt(q[15]),Dd),(!S||B&4)&&se(l,q[2]),(!S||B&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||B&512)&&Q(s,"txt-hint",q[9]),O&&O.p&&(!S||B&33280)&&$t(O,$,q,q[15],S?Ct($,q[15],B,C$):Mt(q[15]),Ed),q[9]?M&&(M.d(1),M=null):M?M.p(q,B):(M=Ad(q),M.c(),M.m(t,null)),(!S||B&262144&&c!==(c=q[18]))&&p(t,"for",c),B&128&&I!==(I=q[7])){if(h){ue();const Z=h;L(Z.$$.fragment,1,0,()=>{H(Z,1)}),fe()}I?(h=Et(I,F(q)),q[13](h),te.push(()=>he(h,"value",D)),z(h.$$.fragment),A(h.$$.fragment,1),j(h,e,m)):h=null}else if(I){const Z={};B&262144&&(Z.id=q[18]),B&2&&(Z.baseCollection=q[1]),B&512&&(Z.disabled=q[9]),B&544&&(Z.placeholder=q[9]?"":q[5]),!g&&B&1&&(g=!0,Z.value=q[0],ye(()=>g=!1)),h.$set(Z)}q[9]?P?(P.p(q,B),B&512&&A(P,1)):(P=Id(q),P.c(),A(P,1),P.m(e,null)):P&&(ue(),L(P,1,1,()=>{P=null}),fe()),R&&R.p&&(!S||B&33280)&&$t(R,N,q,q[15],S?Ct(N,q[15],B,T$):Mt(q[15]),Od)},i(q){S||(A(T,q),A(O,q),h&&A(h.$$.fragment,q),A(P),A(R,q),S=!0)},o(q){L(T,q),L(O,q),h&&L(h.$$.fragment,q),L(P),L(R,q),S=!1},d(q){q&&(k(e),k(_),k(y)),T&&T.d(q),O&&O.d(q),M&&M.d(),n[13](null),h&&H(h),P&&P.d(),R&&R.d(q)}}}function D$(n){let e,t,i,s;const l=[O$,M$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}let Ld;function A$(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,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,h=null,g=Ld,m=!1;_();async function _(){g||m||(t(8,m=!0),t(7,g=(await rt(()=>import("./FilterAutocompleteInput-cff6df53.js"),["./FilterAutocompleteInput-cff6df53.js","./index-9cd23da9.js"],import.meta.url)).default),Ld=g,t(8,m=!1))}async function y(){t(0,r=h||""),await ln(),d==null||d.focus()}async function S(){h=r,t(0,r=null)}function C($){te[$?"unshift":"push"](()=>{d=$,t(6,d)})}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),"placeholder"in $&&t(5,c=$.placeholder),"$$scope"in $&&t(15,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,g,m,i,y,S,s,C,T,l]}class Cs extends ve{constructor(e){super(),be(this,e,A$,D$,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Pd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Fd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I=ge(n[2]),F=[];for(let P=0;P@request filter:",c=E(),d=v("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",h=E(),g=v("hr"),m=E(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=E(),S=v("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",C=E(),T=v("hr"),$=E(),O=v("p"),O.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,N){w(P,e,N),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R{D&&(M||(M=qe(e,it,{duration:150},!0)),M.run(1))}),D=!0)},o(P){P&&(M||(M=qe(e,it,{duration:150},!1)),M.run(0)),D=!1},d(P){P&&k(e),gt(F,P),P&&M&&M.end()}}}function Nd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function Rd(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],$$slots:{afterLabel:[I$,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cs({props:c}),te.push(()=>he(e,"rule",f));function d(_){n[7](_)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Cs({props:h}),te.push(()=>he(s,"rule",d));function g(_){n[8](_)}let m={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(m.rule=n[0].deleteRule),r=new Cs({props:m}),te.push(()=>he(r,"rule",g)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(_,y){j(e,_,y),w(_,i,y),j(s,_,y),w(_,o,y),j(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&17408&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,ye(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!l&&y&1&&(l=!0,C.rule=_[0].updateRule,ye(()=>l=!1)),s.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){L(e.$$.fragment,_),L(s.$$.fragment,_),L(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),H(e,_),H(s,_),H(r,_)}}}function qd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Te(je.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function I$(n){let e,t=!n[10]&&qd();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=qd(),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function jd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[L$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Cs({props:l}),te.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function L$(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=E(),i=v("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&(k(e),k(t),k(i))}}}function P$(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,h,g,m,_,y,S,C,T,$=n[1]&&Fd(n);function O(q){n[4](q)}let M={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(M.rule=n[0].listRule),f=new Cs({props:M}),te.push(()=>he(f,"rule",O));function D(q){n[5](q)}let I={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(I.rule=n[0].viewRule),h=new Cs({props:I}),te.push(()=>he(h,"rule",D));let F=((N=n[0])==null?void 0:N.type)!=="view"&&Rd(n),P=((R=n[0])==null?void 0:R.type)==="auth"&&jd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,s=E(),l=v("button"),r=U(o),a=E(),$&&$.c(),u=E(),z(f.$$.fragment),d=E(),z(h.$$.fragment),m=E(),F&&F.c(),_=E(),P&&P.c(),y=Se(),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-sm handle")},m(q,B){w(q,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),$&&$.m(e,null),w(q,u,B),H(f,q,B),w(q,d,B),H(h,q,B),w(q,m,B),F&&F.m(q,B),w(q,_,B),P&&P.m(q,B),w(q,y,B),S=!0,C||(T=K(l,"click",n[3]),C=!0)},p(q,[B]){var J,W;(!S||B&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?$?($.p(q,B),B&2&&A($,1)):($=Fd(q),$.c(),A($,1),$.m(e,null)):$&&(ue(),L($,1,1,()=>{$=null}),fe());const Z={};B&1&&(Z.collection=q[0]),!c&&B&1&&(c=!0,Z.rule=q[0].listRule,ye(()=>c=!1)),f.$set(Z);const X={};B&1&&(X.collection=q[0]),!g&&B&1&&(g=!0,X.rule=q[0].viewRule,ye(()=>g=!1)),h.$set(X),((J=q[0])==null?void 0:J.type)!=="view"?F?(F.p(q,B),B&1&&A(F,1)):(F=Rd(q),F.c(),A(F,1),F.m(_.parentNode,_)):F&&(ue(),L(F,1,1,()=>{F=null}),fe()),((W=q[0])==null?void 0:W.type)==="auth"?P?(P.p(q,B),B&1&&A(P,1)):(P=jd(q),P.c(),A(P,1),P.m(y.parentNode,y)):P&&(ue(),L(P,1,1,()=>{P=null}),fe())},i(q){S||(A($),A(f.$$.fragment,q),A(h.$$.fragment,q),A(F),A(P),S=!0)},o(q){L($),L(f.$$.fragment,q),L(h.$$.fragment,q),L(F),L(P),S=!1},d(q){q&&(k(e),k(u),k(d),k(m),k(_),k(y)),$&&$.d(),V(f,q),V(h,q),F&&F.d(q),P&&P.d(q),C=!1,T()}}}function F$(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function c(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function d(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class N$ extends ve{constructor(e){super(),be(this,e,F$,P$,me,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[9]=e[t],i}function R$(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{V(f,1)}),fe()}o?(e=Dt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function q$(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Vd(n){let e,t,i=ge(n[3]),s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. + .`,s=E(),l=v("button"),r=U(o),a=E(),$&&$.c(),u=E(),z(f.$$.fragment),d=E(),z(h.$$.fragment),m=E(),F&&F.c(),_=E(),P&&P.c(),y=Se(),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-sm handle")},m(q,B){w(q,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),$&&$.m(e,null),w(q,u,B),j(f,q,B),w(q,d,B),j(h,q,B),w(q,m,B),F&&F.m(q,B),w(q,_,B),P&&P.m(q,B),w(q,y,B),S=!0,C||(T=K(l,"click",n[3]),C=!0)},p(q,[B]){var J,W;(!S||B&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?$?($.p(q,B),B&2&&A($,1)):($=Fd(q),$.c(),A($,1),$.m(e,null)):$&&(ue(),L($,1,1,()=>{$=null}),fe());const Z={};B&1&&(Z.collection=q[0]),!c&&B&1&&(c=!0,Z.rule=q[0].listRule,ye(()=>c=!1)),f.$set(Z);const X={};B&1&&(X.collection=q[0]),!g&&B&1&&(g=!0,X.rule=q[0].viewRule,ye(()=>g=!1)),h.$set(X),((J=q[0])==null?void 0:J.type)!=="view"?F?(F.p(q,B),B&1&&A(F,1)):(F=Rd(q),F.c(),A(F,1),F.m(_.parentNode,_)):F&&(ue(),L(F,1,1,()=>{F=null}),fe()),((W=q[0])==null?void 0:W.type)==="auth"?P?(P.p(q,B),B&1&&A(P,1)):(P=jd(q),P.c(),A(P,1),P.m(y.parentNode,y)):P&&(ue(),L(P,1,1,()=>{P=null}),fe())},i(q){S||(A($),A(f.$$.fragment,q),A(h.$$.fragment,q),A(F),A(P),S=!0)},o(q){L($),L(f.$$.fragment,q),L(h.$$.fragment,q),L(F),L(P),S=!1},d(q){q&&(k(e),k(u),k(d),k(m),k(_),k(y)),$&&$.d(),H(f,q),H(h,q),F&&F.d(q),P&&P.d(q),C=!1,T()}}}function F$(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function c(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function d(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=V.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class N$ extends ve{constructor(e){super(),be(this,e,F$,P$,me,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[9]=e[t],i}function R$(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Et(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}o?(e=Et(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function q$(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Vd(n){let e,t,i=ge(n[3]),s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,u=E(),m&&m.c(),f=Se(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),h[l].m(_,y),w(_,r,y),w(_,a,y),w(_,u,y),m&&m.m(_,y),w(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=g(_),l===S?h[l].p(_,y):(ue(),L(h[S],1,1,()=>{h[S]=null}),fe(),o=h[l],o?o.p(_,y):(o=h[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?m?m.p(_,y):(m=Vd(_),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},i(_){c||(A(o),c=!0)},o(_){L(o),c=!1},d(_){_&&(k(e),k(s),k(r),k(a),k(u),k(f)),h[l].d(_),m&&m.d(_)}}}function H$(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[j$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function V$(n,e,t){let i;Ke(n,$i,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const h=j.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);j.removeByValue(h,"id"),j.removeByValue(h,"created"),j.removeByValue(h,"updated");for(let m in d)for(let _ in d[m]){const y=d[m][_].message,S=h[m]||m;r.push(j.sentenize(S+": "+y))}}Gt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-0c1b2f4c.js"),["./CodeEditor-0c1b2f4c.js","./index-808c8630.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 z$ extends ve{constructor(e){super(),be(this,e,V$,H$,me,{collection:0})}}const B$=n=>({active:n&1}),Bd=n=>({active:n[0]});function Ud(n){let e,t,i;const s=n[15].default,l=Tt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&$t(l,s,o,o[14],i?Ct(s,o[14],r,null):Mt(o[14]),null)},i(o){i||(A(l,o),o&&Qe(()=>{i&&(t||(t=qe(e,it,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,it,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function U$(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Tt(a,n,n[14],Bd);let f=n[0]&&Ud(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(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",xe(n[17])),K(t,"drop",xe(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",xe(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&$t(u,a,c,c[14],l?Ct(a,c[14],d,B$):Mt(c[14]),Bd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Ud(c),f.c(),A(f,1),f.m(e,null)):f&&(ue(),L(f,1,1,()=>{f=null}),fe()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){L(u,c),L(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,$e(r)}}}function W$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function g(){return!!f}function m(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():m()}function S(){if(d&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of F)P.click()}}Gt(()=>()=>clearTimeout(r));function C(F){Fe.call(this,n,F)}const T=()=>c&&y(),$=F=>{u&&(t(7,h=!1),S(),l("drop",F))},O=F=>u&&l("dragstart",F),M=F=>{u&&(t(7,h=!0),l("dragenter",F))},D=F=>{u&&(t(7,h=!1),l("dragleave",F))};function I(F){te[F?"unshift":"push"](()=>{o=F,t(6,o)})}return n.$$set=F=>{"class"in F&&t(1,a=F.class),"draggable"in F&&t(2,u=F.draggable),"active"in F&&t(0,f=F.active),"interactive"in F&&t(3,c=F.interactive),"single"in F&&t(9,d=F.single),"$$scope"in F&&t(14,s=F.$$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,S,o,h,l,d,g,m,_,r,s,i,C,T,$,O,M,D,I]}class uo extends ve{constructor(e){super(),be(this,e,W$,U$,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function Y$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(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&&(k(e),k(i),k(s)),r=!1,a()}}}function K$(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[Y$,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function J$(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function G$(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Z$(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowUsernameAuth?G$:J$}let a=r(n),u=a(n),f=n[3]&&Wd();return{c(){e=v("div"),e.innerHTML=' Username/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=Se(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[3]?f?d&8&&A(f,1):(f=Wd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function X$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(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&&(k(e),k(i),k(s)),r=!1,a()}}}function Yd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[Q$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[x$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(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){w(u,e,f),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(j.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 "+(j.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&&Qe(()=>{a&&(r||(r=qe(e,it,{duration:150},!0)),r.run(1))}),a=!0)},o(u){L(i.$$.fragment,u),L(o.$$.fragment,u),u&&(r||(r=qe(e,it,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),V(i),V(o),u&&r&&r.end()}}}function Q$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[7](_)}let m={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(m.value=n[0].options.exceptEmailDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("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(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.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]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function x$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[8](_)}let m={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(m.value=n[0].options.onlyEmailDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("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(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.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]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function eM(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[X$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Yd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(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=Yd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function tM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function iM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?nM:tM}let a=r(n),u=a(n),f=n[2]&&Kd();return{c(){e=v("div"),e.innerHTML=' Email/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=Se(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Kd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function sM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(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&&(k(e),k(i),k(s)),r=!1,a()}}}function Jd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(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&&k(e),s&&t&&t.end()}}}function lM(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[sM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Jd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(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=Jd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function oM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Gd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function aM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?rM:oM}let a=r(n),u=a(n),f=n[1]&&Gd();return{c(){e=v("div"),e.innerHTML=' OAuth2',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=Se(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&A(f,1):(f=Gd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function uM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.minPasswordLength),r||(a=K(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&&dt(l.value)!==u[0].options.minPasswordLength&&ae(l,u[0].options.minPasswordLength)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function fM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("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){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),Te(je.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&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function cM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return s=new uo({props:{single:!0,$$slots:{header:[Z$],default:[K$]},$$scope:{ctx:n}}}),o=new uo({props:{single:!0,$$slots:{header:[iM],default:[eM]},$$scope:{ctx:n}}}),a=new uo({props:{single:!0,$$slots:{header:[aM],default:[lM]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[uM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[fM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",h=E(),z(g.$$.fragment),m=E(),z(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,C){w(S,e,C),w(S,t,C),w(S,i,C),H(s,i,null),b(i,l),H(o,i,null),b(i,r),H(a,i,null),w(S,u,C),w(S,f,C),w(S,c,C),w(S,d,C),w(S,h,C),H(g,S,C),w(S,m,C),H(_,S,C),y=!0},p(S,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:S}),s.$set(T);const $={};C&8197&&($.$$scope={dirty:C,ctx:S}),o.$set($);const O={};C&8195&&(O.$$scope={dirty:C,ctx:S}),a.$set(O);const M={};C&12289&&(M.$$scope={dirty:C,ctx:S}),g.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),_.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(g.$$.fragment,S),L(_.$$.fragment,S),y=!1},d(S){S&&(k(e),k(t),k(i),k(u),k(f),k(c),k(d),k(h),k(m)),V(s),V(o),V(a),V(g,S),V(_,S)}}}function dM(n,e,t){let i,s,l,o;Ke(n,$i,m=>t(4,o=m));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(m){n.$$.not_equal(r.options.exceptEmailDomains,m)&&(r.options.exceptEmailDomains=m,t(0,r))}function c(m){n.$$.not_equal(r.options.onlyEmailDomains,m)&&(r.options.onlyEmailDomains=m,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=dt(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=m=>{"collection"in m&&t(0,r=m.collection)},n.$$.update=()=>{var m,_,y,S;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((m=o==null?void 0:o.options)==null?void 0:m.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,g]}class pM extends ve{constructor(e){super(),be(this,e,dM,cM,me,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[18]=e[t],i}function xd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ep(n){let e,t,i,s,l=n[3]&&tp(n),o=!n[4]&&np(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=tp(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=np(r),o.c(),o.m(i,null))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(),o&&o.d()}}}function tp(n){var h,g;let e,t,i,s,l=((h=n[1])==null?void 0:h.name)+"",o,r,a,u,f,c=((g=n[2])==null?void 0:g.name)+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed collection + MAX(balance) as maxBalance).`,u=E(),m&&m.c(),f=Se(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),h[l].m(_,y),w(_,r,y),w(_,a,y),w(_,u,y),m&&m.m(_,y),w(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=g(_),l===S?h[l].p(_,y):(ue(),L(h[S],1,1,()=>{h[S]=null}),fe(),o=h[l],o?o.p(_,y):(o=h[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?m?m.p(_,y):(m=Vd(_),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},i(_){c||(A(o),c=!0)},o(_){L(o),c=!1},d(_){_&&(k(e),k(s),k(r),k(a),k(u),k(f)),h[l].d(_),m&&m.d(_)}}}function H$(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[j$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function V$(n,e,t){let i;Ke(n,$i,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=V.getNestedVal(c,"schema",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const h=V.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);V.removeByValue(h,"id"),V.removeByValue(h,"created"),V.removeByValue(h,"updated");for(let m in d)for(let _ in d[m]){const y=d[m][_].message,S=h[m]||m;r.push(V.sentenize(S+": "+y))}}Gt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-73c7d443.js"),["./CodeEditor-73c7d443.js","./index-9cd23da9.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 z$ extends ve{constructor(e){super(),be(this,e,V$,H$,me,{collection:0})}}const B$=n=>({active:n&1}),Bd=n=>({active:n[0]});function Ud(n){let e,t,i;const s=n[15].default,l=Tt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&$t(l,s,o,o[14],i?Ct(s,o[14],r,null):Mt(o[14]),null)},i(o){i||(A(l,o),o&&Qe(()=>{i&&(t||(t=qe(e,it,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,it,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function U$(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Tt(a,n,n[14],Bd);let f=n[0]&&Ud(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(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",xe(n[17])),K(t,"drop",xe(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",xe(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&$t(u,a,c,c[14],l?Ct(a,c[14],d,B$):Mt(c[14]),Bd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Ud(c),f.c(),A(f,1),f.m(e,null)):f&&(ue(),L(f,1,1,()=>{f=null}),fe()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){L(u,c),L(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,$e(r)}}}function W$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function g(){return!!f}function m(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():m()}function S(){if(d&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of F)P.click()}}Gt(()=>()=>clearTimeout(r));function C(F){Fe.call(this,n,F)}const T=()=>c&&y(),$=F=>{u&&(t(7,h=!1),S(),l("drop",F))},O=F=>u&&l("dragstart",F),M=F=>{u&&(t(7,h=!0),l("dragenter",F))},D=F=>{u&&(t(7,h=!1),l("dragleave",F))};function I(F){te[F?"unshift":"push"](()=>{o=F,t(6,o)})}return n.$$set=F=>{"class"in F&&t(1,a=F.class),"draggable"in F&&t(2,u=F.draggable),"active"in F&&t(0,f=F.active),"interactive"in F&&t(3,c=F.interactive),"single"in F&&t(9,d=F.single),"$$scope"in F&&t(14,s=F.$$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,S,o,h,l,d,g,m,_,r,s,i,C,T,$,O,M,D,I]}class uo extends ve{constructor(e){super(),be(this,e,W$,U$,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function Y$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(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&&(k(e),k(i),k(s)),r=!1,a()}}}function K$(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[Y$,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function J$(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function G$(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Z$(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowUsernameAuth?G$:J$}let a=r(n),u=a(n),f=n[3]&&Wd();return{c(){e=v("div"),e.innerHTML=' Username/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=Se(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[3]?f?d&8&&A(f,1):(f=Wd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function X$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(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&&(k(e),k(i),k(s)),r=!1,a()}}}function Yd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(V.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[Q$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(V.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[x$,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(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){w(u,e,f),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(V.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 "+(V.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&&Qe(()=>{a&&(r||(r=qe(e,it,{duration:150},!0)),r.run(1))}),a=!0)},o(u){L(i.$$.fragment,u),L(o.$$.fragment,u),u&&(r||(r=qe(e,it,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),H(i),H(o),u&&r&&r.end()}}}function Q$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[7](_)}let m={id:n[12],disabled:!V.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(m.value=n[0].options.exceptEmailDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("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(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.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]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!V.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function x$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[8](_)}let m={id:n[12],disabled:!V.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(m.value=n[0].options.onlyEmailDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("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(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.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]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!V.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function eM(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[X$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Yd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(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=Yd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),H(e,o),l&&l.d(o)}}}function tM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function iM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?nM:tM}let a=r(n),u=a(n),f=n[2]&&Kd();return{c(){e=v("div"),e.innerHTML=' Email/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=Se(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Kd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function sM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(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&&(k(e),k(i),k(s)),r=!1,a()}}}function Jd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(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&&k(e),s&&t&&t.end()}}}function lM(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[sM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Jd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(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=Jd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),H(e,o),l&&l.d(o)}}}function oM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Gd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function aM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?rM:oM}let a=r(n),u=a(n),f=n[1]&&Gd();return{c(){e=v("div"),e.innerHTML=' OAuth2',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=Se(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&A(f,1):(f=Gd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function uM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.minPasswordLength),r||(a=K(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&&dt(l.value)!==u[0].options.minPasswordLength&&ae(l,u[0].options.minPasswordLength)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function fM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("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){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),Te(je.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&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function cM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return s=new uo({props:{single:!0,$$slots:{header:[Z$],default:[K$]},$$scope:{ctx:n}}}),o=new uo({props:{single:!0,$$slots:{header:[iM],default:[eM]},$$scope:{ctx:n}}}),a=new uo({props:{single:!0,$$slots:{header:[aM],default:[lM]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[uM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[fM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",h=E(),z(g.$$.fragment),m=E(),z(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,C){w(S,e,C),w(S,t,C),w(S,i,C),j(s,i,null),b(i,l),j(o,i,null),b(i,r),j(a,i,null),w(S,u,C),w(S,f,C),w(S,c,C),w(S,d,C),w(S,h,C),j(g,S,C),w(S,m,C),j(_,S,C),y=!0},p(S,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:S}),s.$set(T);const $={};C&8197&&($.$$scope={dirty:C,ctx:S}),o.$set($);const O={};C&8195&&(O.$$scope={dirty:C,ctx:S}),a.$set(O);const M={};C&12289&&(M.$$scope={dirty:C,ctx:S}),g.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),_.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(g.$$.fragment,S),L(_.$$.fragment,S),y=!1},d(S){S&&(k(e),k(t),k(i),k(u),k(f),k(c),k(d),k(h),k(m)),H(s),H(o),H(a),H(g,S),H(_,S)}}}function dM(n,e,t){let i,s,l,o;Ke(n,$i,m=>t(4,o=m));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(m){n.$$.not_equal(r.options.exceptEmailDomains,m)&&(r.options.exceptEmailDomains=m,t(0,r))}function c(m){n.$$.not_equal(r.options.onlyEmailDomains,m)&&(r.options.onlyEmailDomains=m,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=dt(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=m=>{"collection"in m&&t(0,r=m.collection)},n.$$.update=()=>{var m,_,y,S;n.$$.dirty&1&&r.type==="auth"&&V.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!V.isEmpty((m=o==null?void 0:o.options)==null?void 0:m.allowEmailAuth)||!V.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!V.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!V.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,g]}class pM extends ve{constructor(e){super(),be(this,e,dM,cM,me,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[18]=e[t],i}function xd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ep(n){let e,t,i,s,l=n[3]&&tp(n),o=!n[4]&&np(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=tp(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=np(r),o.c(),o.m(i,null))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(),o&&o.d()}}}function tp(n){var h,g;let e,t,i,s,l=((h=n[1])==null?void 0:h.name)+"",o,r,a,u,f,c=((g=n[2])==null?void 0:g.name)+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed collection `),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(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,_){w(m,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(m,_){var y,S;_&2&&l!==(l=((y=m[1])==null?void 0:y.name)+"")&&se(o,l),_&4&&c!==(c=((S=m[2])==null?void 0:S.name)+"")&&se(d,c)},d(m){m&&k(e)}}}function np(n){let e,t,i,s=ge(n[6]),l=[];for(let f=0;f',i=E(),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=E(),u&&u.c(),r=E(),f&&f.c(),a=Se(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=xd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=ep(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function mM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function gM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Cancel',t=E(),i=v("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[K(e,"click",n[12]),K(i,"click",n[13])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function _M(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[gM],header:[mM],default:[hM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),V(e,s)}}}function bM(n,e,t){let i,s,l,o,r,a;const u=pt();let f,c,d;async function h($,O){t(1,c=$),t(2,d=O),await ln(),i||l.length||o.length||r.length?f==null||f.show():m()}function g(){f==null||f.hide()}function m(){g(),u("confirm")}const _=()=>g(),y=()=>m();function S($){te[$?"unshift":"push"](()=>{f=$,t(5,f)})}function C($){Fe.call(this,n,$)}function T($){Fe.call(this,n,$)}return n.$$.update=()=>{var $,O,M;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=(($=d==null?void 0:d.schema)==null?void 0:$.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>{var F,P,N;const I=(F=c==null?void 0:c.schema)==null?void 0:F.find(R=>R.id==D.id);return I?((P=I.options)==null?void 0:P.maxSelect)!=1&&((N=D.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[g,c,d,i,s,f,r,o,l,a,m,h,_,y,S,C,T]}class vM extends ve{constructor(e){super(),be(this,e,bM,_M,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function op(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function yM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new S$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function kM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new z$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function rp(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new N$({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function ap(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new pM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===As)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function wM(n){let e,t,i,s,l,o,r;const a=[kM,yM],u=[];function f(h,g){return h[14]?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===vl&&rp(n),d=n[15]&&ap(n);return{c(){e=v("div"),t=v("div"),s.c(),l=E(),c&&c.c(),o=E(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===Fi),p(e,"class","tabs-content svelte-12y0yzb")},m(h,g){w(h,e,g),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(h,g){let m=i;i=f(h),i===m?u[i].p(h,g):(ue(),L(u[m],1,1,()=>{u[m]=null}),fe(),s=u[i],s?s.p(h,g):(s=u[i]=a[i](h),s.c()),A(s,1),s.m(t,null)),(!r||g[0]&8)&&Q(t,"active",h[3]===Fi),h[3]===vl?c?(c.p(h,g),g[0]&8&&A(c,1)):(c=rp(h),c.c(),A(c,1),c.m(e,o)):c&&(ue(),L(c,1,1,()=>{c=null}),fe()),h[15]?d?(d.p(h,g),g[0]&32768&&A(d,1)):(d=ap(h),d.c(),A(d,1),d.m(e,null)):d&&(ue(),L(d,1,1,()=>{d=null}),fe())},i(h){r||(A(s),A(c),A(d),r=!0)},o(h){L(s),L(c),L(d),r=!1},d(h){h&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function up(n){let e,t,i,s,l,o,r;return o=new Ln({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[SM]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),i=v("button"),s=v("i"),l=E(),z(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),b(i,s),b(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&4194304&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),V(o)}}}function SM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=' Duplicate',t=E(),i=v("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[K(e,"click",n[26]),K(i,"click",An(xe(n[27])))],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function fp(n){let e,t,i,s;return i=new Ln({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[TM]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),z(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&(k(e),k(t)),V(i,l)}}}function cp(n){let e,t,i,s,l,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" collection"),u=E(),p(t,"class",i=wi(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(h,g){w(h,e,g),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(h,g){n=h,g[0]&64&&i!==(i=wi(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),g[0]&64&&o!==(o=n[50]+"")&&se(r,o),g[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(h){h&&k(e),f=!1,c()}}}function TM(n){let e,t=ge(Object.entries(n[6])),i=[];for(let s=0;s{P=null}),fe()):P?(P.p(R,q),q[0]&4&&A(P,1)):(P=fp(R),P.c(),A(P,1),P.m(d,null)),(!D||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!D||q[0]&4&&$!==($=!!R[2].id))&&(d.disabled=$),R[2].system?N||(N=dp(),N.c(),N.m(M.parentNode,M)):N&&(N.d(1),N=null)},i(R){D||(A(P),D=!0)},o(R){L(P),D=!1},d(R){R&&(k(e),k(s),k(l),k(f),k(c),k(O),k(M)),P&&P.d(),N&&N.d(R),I=!1,F()}}}function pp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Te(t=je.call(null,e,n[11])),l=!0)},p(r,a){t&&Et(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Qe(()=>{s&&(i||(i=qe(e,Jt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Jt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function hp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function mp(n){var a,u,f;let e,t,i,s=!j.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&&gp();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=E(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(c,d){w(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=K(e,"click",n[33]),l=!0)},p(c,d){var h,g,m;d[0]&32&&(s=!j.isEmpty((h=c[5])==null?void 0:h.options)&&!((m=(g=c[5])==null?void 0:g.options)!=null&&m.manageRule)),s?r?d[0]&32&&A(r,1):(r=gp(),r.c(),A(r,1),r.m(e,null)):r&&(ue(),L(r,1,1,()=>{r=null}),fe()),d[0]&8&&Q(e,"active",c[3]===As)},d(c){c&&k(e),r&&r.d(),l=!1,o()}}}function gp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function $M(n){var B,Z,X,J,W,le,ee;let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,h,g=n[14]?"Query":"Fields",m,_,y=!j.isEmpty(n[11]),S,C,T,$,O=!j.isEmpty((B=n[5])==null?void 0:B.listRule)||!j.isEmpty((Z=n[5])==null?void 0:Z.viewRule)||!j.isEmpty((X=n[5])==null?void 0:X.createRule)||!j.isEmpty((J=n[5])==null?void 0:J.updateRule)||!j.isEmpty((W=n[5])==null?void 0:W.deleteRule)||!j.isEmpty((ee=(le=n[5])==null?void 0:le.options)==null?void 0:ee.manageRule),M,D,I,F,P=!!n[2].id&&!n[2].system&&up(n);r=new pe({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[CM,({uniqueId:ie})=>({48:ie}),({uniqueId:ie})=>[0,ie?131072:0]]},$$scope:{ctx:n}}});let N=y&&pp(n),R=O&&hp(),q=n[15]&&mp(n);return{c(){e=v("h4"),i=U(t),s=E(),P&&P.c(),l=E(),o=v("form"),z(r.$$.fragment),a=E(),u=v("input"),f=E(),c=v("div"),d=v("button"),h=v("span"),m=U(g),_=E(),N&&N.c(),S=E(),C=v("button"),T=v("span"),T.textContent="API Rules",$=E(),R&&R.c(),M=E(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===Fi),p(T,"class","txt"),p(C,"type","button"),p(C,"class","tab-item"),Q(C,"active",n[3]===vl),p(c,"class","tabs-header stretched")},m(ie,Ee){w(ie,e,Ee),b(e,i),w(ie,s,Ee),P&&P.m(ie,Ee),w(ie,l,Ee),w(ie,o,Ee),H(r,o,null),b(o,a),b(o,u),w(ie,f,Ee),w(ie,c,Ee),b(c,d),b(d,h),b(h,m),b(d,_),N&&N.m(d,null),b(c,S),b(c,C),b(C,T),b(C,$),R&&R.m(C,null),b(c,M),q&&q.m(c,null),D=!0,I||(F=[K(o,"submit",xe(n[30])),K(d,"click",n[31]),K(C,"click",n[32])],I=!0)},p(ie,Ee){var Ve,ze,oe,Ce,We,_t,Xe;(!D||Ee[0]&4)&&t!==(t=ie[2].id?"Edit collection":"New collection")&&se(i,t),ie[2].id&&!ie[2].system?P?(P.p(ie,Ee),Ee[0]&4&&A(P,1)):(P=up(ie),P.c(),A(P,1),P.m(l.parentNode,l)):P&&(ue(),L(P,1,1,()=>{P=null}),fe());const Ne={};Ee[0]&8192&&(Ne.class="form-field collection-field-name required m-b-0 "+(ie[13]?"disabled":"")),Ee[0]&41028|Ee[1]&4325376&&(Ne.$$scope={dirty:Ee,ctx:ie}),r.$set(Ne),(!D||Ee[0]&16384)&&g!==(g=ie[14]?"Query":"Fields")&&se(m,g),Ee[0]&2048&&(y=!j.isEmpty(ie[11])),y?N?(N.p(ie,Ee),Ee[0]&2048&&A(N,1)):(N=pp(ie),N.c(),A(N,1),N.m(d,null)):N&&(ue(),L(N,1,1,()=>{N=null}),fe()),(!D||Ee[0]&8)&&Q(d,"active",ie[3]===Fi),Ee[0]&32&&(O=!j.isEmpty((Ve=ie[5])==null?void 0:Ve.listRule)||!j.isEmpty((ze=ie[5])==null?void 0:ze.viewRule)||!j.isEmpty((oe=ie[5])==null?void 0:oe.createRule)||!j.isEmpty((Ce=ie[5])==null?void 0:Ce.updateRule)||!j.isEmpty((We=ie[5])==null?void 0:We.deleteRule)||!j.isEmpty((Xe=(_t=ie[5])==null?void 0:_t.options)==null?void 0:Xe.manageRule)),O?R?Ee[0]&32&&A(R,1):(R=hp(),R.c(),A(R,1),R.m(C,null)):R&&(ue(),L(R,1,1,()=>{R=null}),fe()),(!D||Ee[0]&8)&&Q(C,"active",ie[3]===vl),ie[15]?q?q.p(ie,Ee):(q=mp(ie),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(ie){D||(A(P),A(r.$$.fragment,ie),A(N),A(R),D=!0)},o(ie){L(P),L(r.$$.fragment,ie),L(N),L(R),D=!1},d(ie){ie&&(k(e),k(s),k(l),k(o),k(f),k(c)),P&&P.d(ie),V(r),N&&N.d(),R&&R.d(),q&&q.d(),I=!1,$e(F)}}}function MM(n){let e,t,i,s,l,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=[K(e,"click",n[24]),K(s,"click",n[25])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function OM(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[MM],header:[$M],default:[wM]},$$scope:{ctx:n}};e=new on({props:l}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new vM({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[39](null),V(e,r),n[42](null),V(i,r)}}}const Fi="schema",vl="api_rules",As="options",EM="base",_p="auth",bp="view";function Pr(n){return JSON.stringify(n)}function DM(n,e,t){let i,s,l,o,r,a;Ke(n,$i,ke=>t(5,a=ke));const u={};u[EM]="Base",u[bp]="View",u[_p]="Auth";const f=pt();let c,d,h=null,g=j.initCollection(),m=!1,_=!1,y=Fi,S=Pr(g),C="";function T(ke){t(3,y=ke)}function $(ke){return M(ke),t(10,_=!0),T(Fi),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}async function M(ke){en({}),typeof ke<"u"?(t(22,h=ke),t(2,g=structuredClone(ke))):(t(22,h=null),t(2,g=j.initCollection())),t(2,g.schema=g.schema||[],g),t(2,g.originalName=g.name||"",g),await ln(),t(23,S=Pr(g))}function D(){g.id?d==null||d.show(h,g):I()}function I(){if(m)return;t(9,m=!0);const ke=F();let Ge;g.id?Ge=de.collections.update(g.id,ke):Ge=de.collections.create(ke),Ge.then(Oe=>{Aa(),Ny(Oe),t(10,_=!1),O(),jt(g.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!g.id,collection:Oe})}).catch(Oe=>{de.error(Oe)}).finally(()=>{t(9,m=!1)})}function F(){const ke=Object.assign({},g);ke.schema=ke.schema.slice(0);for(let Ge=ke.schema.length-1;Ge>=0;Ge--)ke.schema[Ge].toDelete&&ke.schema.splice(Ge,1);return ke}function P(){h!=null&&h.id&&mn(`Do you really want to delete collection "${h.name}" and all its records?`,()=>de.collections.delete(h.id).then(()=>{O(),jt(`Successfully deleted collection "${h.name}".`),f("delete",h),Ry(h)}).catch(ke=>{de.error(ke)}))}function N(ke){t(2,g.type=ke,g),ci("schema")}function R(){o?mn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ke=h?structuredClone(h):null;if(ke){if(ke.id="",ke.created="",ke.updated="",ke.name+="_duplicate",!j.isEmpty(ke.schema))for(const Ge of ke.schema)Ge.id="";if(!j.isEmpty(ke.indexes))for(let Ge=0;GeO(),Z=()=>D(),X=()=>R(),J=()=>P(),W=ke=>{t(2,g.name=j.slugify(ke.target.value),g),ke.target.value=g.name},le=ke=>N(ke),ee=()=>{r&&D()},ie=()=>T(Fi),Ee=()=>T(vl),Ne=()=>T(As);function Ve(ke){g=ke,t(2,g),t(22,h)}function ze(ke){g=ke,t(2,g),t(22,h)}function oe(ke){g=ke,t(2,g),t(22,h)}function Ce(ke){g=ke,t(2,g),t(22,h)}const We=()=>o&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),O()}),!1):!0;function _t(ke){te[ke?"unshift":"push"](()=>{c=ke,t(7,c)})}function Xe(ke){Fe.call(this,n,ke)}function Je(ke){Fe.call(this,n,ke)}function wt(ke){te[ke?"unshift":"push"](()=>{d=ke,t(8,d)})}const _e=()=>I();return n.$$.update=()=>{var ke,Ge;n.$$.dirty[0]&4&&g.type==="view"&&(t(2,g.createRule=null,g),t(2,g.updateRule=null,g),t(2,g.deleteRule=null,g),t(2,g.indexes=[],g)),n.$$.dirty[0]&4194308&&g.name&&(h==null?void 0:h.name)!=g.name&&g.indexes.length>0&&t(2,g.indexes=(ke=g.indexes)==null?void 0:ke.map(Oe=>j.replaceIndexTableName(Oe,g.name)),g),n.$$.dirty[0]&4&&t(15,i=g.type===_p),n.$$.dirty[0]&4&&t(14,s=g.type===bp),n.$$.dirty[0]&32&&(a.schema||(Ge=a.options)!=null&&Ge.query?t(11,C=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,C="")),n.$$.dirty[0]&4&&t(13,l=!!g.id&&g.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Pr(g)),n.$$.dirty[0]&20&&t(12,r=!g.id||o),n.$$.dirty[0]&12&&y===As&&g.type!=="auth"&&T(Fi)},[T,O,g,y,o,a,u,c,d,m,_,C,r,l,s,i,D,I,P,N,R,$,h,S,B,Z,X,J,W,le,ee,ie,Ee,Ne,Ve,ze,oe,Ce,We,_t,Xe,Je,wt,_e]}class ou extends ve{constructor(e){super(),be(this,e,DM,OM,me,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function vp(n,e,t){const i=n.slice();return i[15]=e[t],i}function yp(n){let e,t=n[1].length&&kp();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=kp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function kp(n){let e;return{c(){e=v("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wp(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,c,d,h;return{key:n,first:null,c(){var g;t=v("a"),i=v("i"),l=E(),o=v("span"),a=U(r),u=E(),p(i,"class",s=j.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",f="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),p(t,"title",c=e[15].name),Q(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id),this.first=t},m(g,m){w(g,t,m),b(t,i),b(t,l),b(t,o),b(o,a),b(t,u),d||(h=Te(un.call(null,t)),d=!0)},p(g,m){var _;e=g,m&8&&s!==(s=j.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),m&8&&r!==(r=e[15].name+"")&&se(a,r),m&8&&f!==(f="/collections?collectionId="+e[15].id)&&p(t,"href",f),m&8&&c!==(c=e[15].name)&&p(t,"title",c),m&40&&Q(t,"active",((_=e[5])==null?void 0:_.id)===e[15].id)},d(g){g&&k(t),d=!1,h()}}}function Sp(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),b(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function AM(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,m,_,y,S,C,T=ge(n[3]);const $=I=>I[15].id;for(let I=0;I',o=E(),r=v("input"),a=E(),u=v("hr"),f=E(),c=v("div");for(let I=0;I20),p(e,"class","page-sidebar collection-sidebar")},m(I,F){w(I,e,F),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),ae(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let P=0;P20),I[7]?M&&(M.d(1),M=null):M?M.p(I,F):(M=Sp(I),M.c(),M.m(e,null));const P={};_.$set(P)},i(I){y||(A(_.$$.fragment,I),y=!0)},o(I){L(_.$$.fragment,I),y=!1},d(I){I&&(k(e),k(m));for(let F=0;F{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function LM(n,e,t){let i,s,l,o,r,a,u;Ke(n,Ti,S=>t(5,o=S)),Ke(n,ii,S=>t(9,r=S)),Ke(n,vo,S=>t(6,a=S)),Ke(n,Ms,S=>t(7,u=S));let f,c="";function d(S){sn(Ti,o=S,o)}const h=()=>t(0,c="");function g(){c=this.value,t(0,c)}const m=()=>f==null?void 0:f.show();function _(S){te[S?"unshift":"push"](()=>{f=S,t(2,f)})}const y=S=>{var C;(C=S.detail)!=null&&C.isNew&&S.detail.collection&&d(S.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&IM(),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(S=>S.id==c||S.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,h,g,m,_,y]}class PM extends ve{constructor(e){super(),be(this,e,LM,AM,me,{})}}function Tp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Cp(n){n[18]=n[19].default}function $p(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Mp(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Mp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),c&&c.c(),s=E(),l=v("button"),r=U(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(h,g){w(h,t,g),c&&c.m(h,g),w(h,s,g),w(h,l,g),b(l,r),b(l,a),u||(f=K(l,"click",d),u=!0)},p(h,g){e=h,g&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Mp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),g&8&&o!==(o=e[15].label+"")&&se(r,o),g&40&&Q(l,"active",e[5]===e[14])},d(h){h&&(k(t),k(s),k(l)),c&&c.d(h),u=!1,f()}}}function Ep(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:RM,then:NM,catch:FM,value:19,blocks:[,,,]};return du(t=n[15].component,s),{c(){e=Se(),s.block.c()},m(l,o){w(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)&&du(t,s)||l0(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];L(r)}i=!1},d(l){l&&k(e),s.block.d(l),s.token=null,s=null}}}function FM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function NM(n){Cp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){H(e,s,l),w(s,t,l),i=!0},p(s,l){Cp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){L(e.$$.fragment,s),i=!1},d(s){s&&k(t),V(e,s)}}}function RM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function Dp(n,e){let t,i,s,l=e[5]===e[14]&&Ep(e);return{key:n,first:null,c(){t=Se(),l&&l.c(),i=Se(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Ep(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&(k(t),k(i)),l&&l.d(o)}}}function qM(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=ge(Object.entries(n[3]));const d=m=>m[14];for(let m=0;mm[14];for(let m=0;mClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function HM(n){let e,t,i={class:"docs-panel",$$slots:{footer:[jM],default:[qM]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function VM(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-fa4c012b.js"),["./ListApiDocs-fa4c012b.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-f8b0e458.js"),["./ViewApiDocs-f8b0e458.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-77256c2f.js"),["./CreateApiDocs-77256c2f.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-9077f7d5.js"),["./UpdateApiDocs-9077f7d5.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-2b517a5d.js"),["./DeleteApiDocs-2b517a5d.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-286d9a62.js"),["./RealtimeApiDocs-286d9a62.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-773628cb.js"),["./AuthWithPasswordDocs-773628cb.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-47895201.js"),["./AuthWithOAuth2Docs-47895201.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-52184593.js"),["./AuthRefreshDocs-52184593.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-adb376ea.js"),["./RequestVerificationDocs-adb376ea.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-755c037a.js"),["./ConfirmVerificationDocs-755c037a.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-7b10f4ab.js"),["./RequestPasswordResetDocs-7b10f4ab.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-587b11b5.js"),["./ConfirmPasswordResetDocs-587b11b5.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-7a88b05d.js"),["./RequestEmailChangeDocs-7a88b05d.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-3b92aaf9.js"),["./ConfirmEmailChangeDocs-3b92aaf9.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-a7e62d57.js"),["./AuthMethodsDocs-a7e62d57.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-474c78a3.js"),["./ListExternalAuthsDocs-474c78a3.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ddcce9e6.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-0a775f45.js"),["./UnlinkExternalAuthDocs-0a775f45.js","./SdkTabs-08de669b.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),h=y=>c(y);function g(y){te[y?"unshift":"push"](()=>{l=y,t(4,l)})}function m(y){Fe.call(this,n,y)}function _(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,h,g,m,_]}class zM extends ve{constructor(e){super(),be(this,e,VM,HM,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function BM(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(l,o){w(l,e,o),i||(s=Te(t=je.call(null,e,{text:n[0].join(` -`),position:"left"})),i=!0)},p(l,[o]){t&&Et(t.update)&&o&1&&t.update.call(null,{text:l[0].join(` -`),position:"left"})},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}const Ap="yyyy-MM-dd HH:mm:ss.SSS";function UM(n,e,t){let{model:i}=e,s=[];function l(){t(0,s=[]),i.created&&s.push("Created: "+j.formatToLocalDate(i.created,Ap)+" Local"),i.updated&&s.push("Updated: "+j.formatToLocalDate(i.updated,Ap)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&l()},[s,i]}class T1 extends ve{constructor(e){super(),be(this,e,UM,BM,me,{model:1})}}function WM(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),s||(l=[Te(i=je.call(null,e,n[2]?"":"Copy")),K(e,"click",An(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Et(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function YM(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Gt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class qs extends ve{constructor(e){super(),be(this,e,YM,WM,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function KM(n){let e,t,i,s,l,o,r,a,u,f;return l=new qs({props:{value:n[1]}}),{c(){e=v("div"),t=v("span"),i=U(n[1]),s=E(),z(l.$$.fragment),o=E(),r=v("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),b(e,t),b(t,i),n[6](t),b(e,s),H(l,e,null),b(e,o),b(e,r),a=!0,u||(f=[Te(je.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const h={};d&2&&(h.value=c[1]),l.$set(h)},i(c){a||(A(l.$$.fragment,c),a=!0)},o(c){L(l.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),V(l),u=!1,$e(f)}}}function JM(n){let e,t,i,s,l,o,r,a,u,f;function c(h){n[7](h)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[KM]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Ln({props:d}),te.push(()=>he(s,"active",c)),s.$on("show",n[4]),{c(){e=v("button"),t=v("i"),i=E(),z(s.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(h,g){w(h,e,g),b(e,t),b(e,i),H(s,e,null),a=!0,u||(f=Te(r=je.call(null,e,n[3]?"":"Generate")),u=!0)},p(h,[g]){const m={};g&518&&(m.$$scope={dirty:g,ctx:h}),!l&&g&8&&(l=!0,m.active=h[3],ye(()=>l=!1)),s.$set(m),(!a||g&1&&o!==(o="btn btn-circle "+h[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Et(r.update)&&g&8&&r.update.call(null,h[3]?"":"Generate")},i(h){a||(A(s.$$.fragment,h),a=!0)},o(h){L(s.$$.fragment,h),a=!1},d(h){h&&k(e),V(s),u=!1,f()}}}function GM(n,e,t){const i=pt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(l)),i("generate",o),await ln(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class C1 extends ve{constructor(e){super(),be(this,e,GM,JM,me,{class:0,length:5})}}function ZM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Username",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(h,g){w(h,e,g),b(e,t),b(e,i),b(e,s),w(h,o,g),w(h,r,g),ae(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(h,g){g&8192&&l!==(l=h[13])&&p(e,"for",l),g&4&&a!==(a=!h[2])&&p(r,"requried",a),g&4&&u!==(u=h[2]?"Leave empty to auto generate...":h[4])&&p(r,"placeholder",u),g&8192&&f!==(f=h[13])&&p(r,"id",f),g&1&&r.value!==h[0].username&&ae(r,h[0].username)},d(h){h&&(k(e),k(o),k(r)),c=!1,d()}}}function XM(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,h,g,m,_,y,S,C;return{c(){var T;e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("div"),a=v("button"),u=v("span"),f=U("Public: "),d=U(c),g=E(),m=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",h="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(m,"type","email"),m.autofocus=n[2],p(m,"autocomplete","off"),p(m,"id",_=n[13]),m.required=y=(T=n[1].options)==null?void 0:T.requireEmail,p(m,"class","svelte-1751a4d")},m(T,$){w(T,e,$),b(e,t),b(e,i),b(e,s),w(T,o,$),w(T,r,$),b(r,a),b(a,u),b(u,f),b(u,d),w(T,g,$),w(T,m,$),ae(m,n[0].email),n[2]&&m.focus(),S||(C=[Te(je.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",n[6]),K(m,"input",n[7])],S=!0)},p(T,$){var O;$&8192&&l!==(l=T[13])&&p(e,"for",l),$&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&se(d,c),$&1&&h!==(h="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",h),$&4&&(m.autofocus=T[2]),$&8192&&_!==(_=T[13])&&p(m,"id",_),$&2&&y!==(y=(O=T[1].options)==null?void 0:O.requireEmail)&&(m.required=y),$&1&&m.value!==T[0].email&&ae(m,T[0].email)},d(T){T&&(k(e),k(o),k(r),k(g),k(m)),S=!1,$e(C)}}}function Ip(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[QM,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Lp(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[xM,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[e5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&24577&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!u||c&8)&&Q(t,"p-t-xs",f[3])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Qe(()=>{u&&(a||(a=qe(e,it,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(e,it,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function xM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new C1({props:{length:15}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),ae(r,n[0].password),w(m,u,_),w(m,f,_),H(c,f,null),d=!0,h||(g=K(r,"input",n[9]),h=!0)},p(m,_){(!d||_&8192&&l!==(l=m[13]))&&p(e,"for",l),(!d||_&8192&&a!==(a=m[13]))&&p(r,"id",a),_&1&&r.value!==m[0].password&&ae(r,m[0].password)},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){L(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,g()}}}function e5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[0].passwordConfirm),u||(f=K(r,"input",n[10]),u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ae(r,c[0].passwordConfirm)},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function t5(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),b(s,l),r||(a=[K(e,"change",n[11]),K(e,"change",xe(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function n5(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new pe({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[ZM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[XM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&Ip(n),m=(n[2]||n[3])&&Lp(n);return d=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[t5,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),g&&g.c(),u=E(),m&&m.c(),f=E(),c=v("div"),z(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),g&&g.m(a,null),b(a,u),m&&m.m(a,null),b(e,f),b(e,c),H(d,c,null),h=!0},p(y,[S]){var O;const C={};S&4&&(C.class="form-field "+(y[2]?"":"required")),S&24581&&(C.$$scope={dirty:S,ctx:y}),i.$set(C);const T={};S&2&&(T.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:y}),o.$set(T),y[2]?g&&(ue(),L(g,1,1,()=>{g=null}),fe()):g?(g.p(y,S),S&4&&A(g,1)):(g=Ip(y),g.c(),A(g,1),g.m(a,u)),y[2]||y[3]?m?(m.p(y,S),S&12&&A(m,1)):(m=Lp(y),m.c(),A(m,1),m.m(a,null)):m&&(ue(),L(m,1,1,()=>{m=null}),fe());const $={};S&24581&&($.$$scope={dirty:S,ctx:y}),d.$set($)},i(y){h||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(g),A(m),A(d.$$.fragment,y),h=!0)},o(y){L(i.$$.fragment,y),L(o.$$.fragment,y),L(g),L(m),L(d.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),V(o),g&&g.d(),m&&m.d(),V(d)}}}function i5(n,e,t){let{record:i}=e,{collection:s}=e,{isNew:l=!i.id}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function h(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function g(){i.verified=this.checked,t(0,i),t(3,r)}const m=_=>{l||mn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!_.target.checked,i)})};return n.$$set=_=>{"record"in _&&t(0,i=_.record),"collection"in _&&t(1,s=_.collection),"isNew"in _&&t(2,l=_.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),ci("password"),ci("passwordConfirm")))},[i,s,l,r,o,a,u,f,c,d,h,g,m]}class s5 extends ve{constructor(e){super(),be(this,e,i5,n5,me,{record:0,collection:1,isNew:2})}}function l5(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)&&!(h!=null&&h.isComposing)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Gt(()=>(u(),()=>clearTimeout(a)));function c(h){te[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(3,s=et(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class r5 extends ve{constructor(e){super(),be(this,e,o5,l5,me,{value:0,maxHeight:4})}}function a5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(m){n[2](m)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new r5({props:g}),te.push(()=>he(f,"value",h)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),H(f,m,_),d=!0},p(m,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(m[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=m[1].name+"")&&se(r,o),(!d||_&8&&a!==(a=m[3]))&&p(e,"for",a);const y={};_&8&&(y.id=m[3]),_&2&&(y.required=m[1].required),!c&&_&1&&(c=!0,y.value=m[0],ye(()=>c=!1)),f.$set(y)},i(m){d||(A(f.$$.fragment,m),d=!0)},o(m){L(f.$$.fragment,m),d=!1},d(m){m&&(k(e),k(u)),V(f,m)}}}function u5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[a5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function f5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class c5 extends ve{constructor(e){super(),be(this,e,f5,u5,me,{field:1,value:0})}}function d5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_;return{c(){var y,S;e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),w(y,f,S),ae(f,n[0]),m||(_=K(f,"input",n[2]),m=!0)},p(y,S){var C,T;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&se(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(f,"min",h),S&2&&g!==(g=(T=y[1].options)==null?void 0:T.max)&&p(f,"max",g),S&1&&dt(f.value)!==y[0]&&ae(f,y[0])},d(y){y&&(k(e),k(u),k(f)),m=!1,_()}}}function p5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[d5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function h5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=dt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class m5 extends ve{constructor(e){super(),be(this,e,h5,p5,me,{field:1,value:0})}}function g5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=E(),s=v("label"),o=U(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),b(s,o),a||(u=K(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&se(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&(k(e),k(i),k(s)),a=!1,u()}}}function _5(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[g5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function b5(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class v5 extends ve{constructor(e){super(),be(this,e,b5,_5,me,{field:1,value:0})}}function y5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),ae(f,n[0]),h||(g=K(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=j.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&se(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&ae(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function k5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[y5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function w5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class S5 extends ve{constructor(e){super(),be(this,e,w5,k5,me,{field:1,value:0})}}function T5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),ae(f,n[0]),h||(g=K(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=j.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&se(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&ae(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function C5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[T5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class M5 extends ve{constructor(e){super(),be(this,e,$5,C5,me,{field:1,value:0})}}function Pp(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),b(e,t),i||(s=[Te(je.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:x,d(l){l&&k(e),i=!1,$e(s)}}}function O5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_=n[0]&&!n[1].required&&Pp(n);function y(T){n[6](T)}function S(T){n[7](T)}let C={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(C.value=n[2]),n[0]!==void 0&&(C.formattedValue=n[0]),d=new lu({props:C}),te.push(()=>he(d,"value",y)),te.push(()=>he(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" (UTC)"),f=E(),_&&_.c(),c=E(),z(d.$$.fragment),p(t,"class",i=wi(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(T,$){w(T,e,$),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),w(T,f,$),_&&_.m(T,$),w(T,c,$),H(d,T,$),m=!0},p(T,$){(!m||$&2&&i!==(i=wi(j.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!m||$&2)&&o!==(o=T[1].name+"")&&se(r,o),(!m||$&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,$):(_=Pp(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const O={};$&256&&(O.id=T[8]),!h&&$&4&&(h=!0,O.value=T[2],ye(()=>h=!1)),!g&&$&1&&(g=!0,O.formattedValue=T[0],ye(()=>g=!1)),d.$set(O)},i(T){m||(A(d.$$.fragment,T),m=!0)},o(T){L(d.$$.fragment,T),m=!1},d(T){T&&(k(e),k(f),k(c)),_&&_.d(T),V(d,T)}}}function E5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[O5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D5(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class A5 extends ve{constructor(e){super(),be(this,e,D5,E5,me,{field:1,value:0})}}function Fp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=U("Select up to "),s=U(i),l=U(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(s,i)},d(o){o&&k(e)}}}function I5(n){var S,C,T,$,O,M;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function m(D){n[3](D)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((C=n[1].options)==null?void 0:C.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((O=($=n[1].options)==null?void 0:$.values)==null?void 0:O.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new S1({props:_}),te.push(()=>he(f,"selected",m));let y=((M=n[1].options)==null?void 0:M.maxSelect)>1&&Fp(n);return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),d=E(),y&&y.c(),h=Se(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,I){w(D,e,I),b(e,t),b(e,s),b(e,l),b(l,r),w(D,u,I),H(f,D,I),w(D,d,I),y&&y.m(D,I),w(D,h,I),g=!0},p(D,I){var P,N,R,q,B,Z;(!g||I&2&&i!==(i=j.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!g||I&2)&&o!==(o=D[1].name+"")&&se(r,o),(!g||I&16&&a!==(a=D[4]))&&p(e,"for",a);const F={};I&16&&(F.id=D[4]),I&6&&(F.toggle=!D[1].required||D[2]),I&4&&(F.multiple=D[2]),I&7&&(F.closable=!D[2]||((P=D[0])==null?void 0:P.length)>=((N=D[1].options)==null?void 0:N.maxSelect)),I&2&&(F.items=(R=D[1].options)==null?void 0:R.values),I&2&&(F.searchable=((B=(q=D[1].options)==null?void 0:q.values)==null?void 0:B.length)>5),!c&&I&1&&(c=!0,F.selected=D[0],ye(()=>c=!1)),f.$set(F),((Z=D[1].options)==null?void 0:Z.maxSelect)>1?y?y.p(D,I):(y=Fp(D),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(D){g||(A(f.$$.fragment,D),g=!0)},o(D){L(f.$$.fragment,D),g=!1},d(D){D&&(k(e),k(u),k(d),k(h)),V(f,D),y&&y.d(D)}}}function L5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function P5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class F5 extends ve{constructor(e){super(),be(this,e,P5,L5,me,{field:1,value:0})}}function N5(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function R5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function q5(n){let e;return{c(){e=v("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function j5(n){let e,t,i;var s=n[3];function l(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return s&&(e=Dt(s,l(n)),e.$on("change",n[5])),{c(){e&&z(e.$$.fragment),t=Se()},m(o,r){e&&H(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&s!==(s=o[3])){if(e){ue();const a=e;L(a.$$.fragment,1,0,()=>{V(a,1)}),fe()}s?(e=Dt(s,l(o)),e.$on("change",o[5]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&A(e.$$.fragment,o),i=!0)},o(o){e&&L(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&V(e,o)}}}function H5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_,y,S;function C(I,F){return I[4]?R5:N5}let T=C(n),$=T(n);const O=[j5,q5],M=[];function D(I,F){return I[3]?0:1}return h=D(n),g=M[h]=O[h](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),a=E(),u=v("span"),$.c(),d=E(),g.c(),m=Se(),p(t,"class",i=wi(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(l,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(I,F){w(I,e,F),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),$.m(u,null),w(I,d,F),M[h].m(I,F),w(I,m,F),_=!0,y||(S=Te(f=je.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(I,F){(!_||F&2&&i!==(i=wi(j.getFieldTypeIcon(I[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||F&2)&&o!==(o=I[1].name+"")&&se(r,o),T!==(T=C(I))&&($.d(1),$=T(I),$&&($.c(),$.m(u,null))),f&&Et(f.update)&&F&16&&f.update.call(null,{position:"left",text:I[4]?"Valid JSON":"Invalid JSON"}),(!_||F&64&&c!==(c=I[6]))&&p(e,"for",c);let P=h;h=D(I),h===P?M[h].p(I,F):(ue(),L(M[P],1,1,()=>{M[P]=null}),fe(),g=M[h],g?g.p(I,F):(g=M[h]=O[h](I),g.c()),A(g,1),g.m(m.parentNode,m))},i(I){_||(A(g),_=!0)},o(I){L(g),_=!1},d(I){I&&(k(e),k(d),k(m)),$.d(),M[h].d(I),y=!1,S()}}}function V5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[H5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&223&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Np(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function z5(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function B5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e,o,r=Np(l);Gt(async()=>{try{t(3,o=(await rt(()=>import("./CodeEditor-0c1b2f4c.js"),["./CodeEditor-0c1b2f4c.js","./index-808c8630.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,l=r.trim())};return n.$$set=u=>{"field"in u&&t(1,s=u.field),"value"in u&&t(0,l=u.value)},n.$$.update=()=>{n.$$.dirty&5&&l!==(r==null?void 0:r.trim())&&(t(2,r=Np(l)),t(0,l=r)),n.$$.dirty&4&&t(4,i=z5(r))},[l,s,r,o,i,a]}class U5 extends ve{constructor(e){super(),be(this,e,B5,V5,me,{field:1,value:0})}}function W5(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function Y5(n){let e,t,i;return{c(){e=v("img"),p(e,"draggable",!1),_n(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!_n(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function K5(n){let e;function t(l,o){return l[2]?Y5:W5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function J5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){j.hasImageExtension(s==null?void 0:s.name)?j.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class G5 extends ve{constructor(e){super(),be(this,e,J5,K5,me,{file:0,size:1})}}function Rp(n){let e;function t(l,o){return l[4]==="image"?X5:Z5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function Z5(n){let e,t;return{c(){e=v("object"),t=U("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&k(e)}}}function X5(n){let e,t,i;return{c(){e=v("img"),_n(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!_n(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function Q5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Rp(n);return{c(){i&&i.c(),t=Se()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Rp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&k(t),i&&i.d(l)}}}function x5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=K(e,"click",xe(n[0])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function e6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=U(n[2]),i=E(),s=v("i"),l=E(),o=v("div"),r=E(),a=v("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=K(a,"click",n[0]),u=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(l),k(o),k(r),k(a)),u=!1,f()}}}function t6(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[e6],header:[x5],default:[Q5]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),V(e,s)}}}function n6(n,e,t){let i,s,l,o,r="";function a(h){h!==""&&(t(1,r=h),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(h){te[h?"unshift":"push"](()=>{o=h,t(3,o)})}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=j.getFileType(s))},[u,r,s,o,l,a,i,f,c,d]}class i6 extends ve{constructor(e){super(),be(this,e,n6,t6,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function s6(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?a6:u[3]==="video"||u[3]==="audio"?r6:o6}let r=o(n),a=r(n);return{c(){e=v("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){w(u,e,f),a.m(e,null),s||(l=K(e,"click",An(n[11])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&k(e),a.d(),s=!1,l()}}}function l6(n){let e,t;return{c(){e=v("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function o6(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function r6(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function a6(n){let e,t,i,s,l;return{c(){e=v("img"),p(e,"draggable",!1),_n(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),s||(l=K(e,"error",n[8]),s=!0)},p(o,r){r&32&&!_n(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&k(e),s=!1,l()}}}function u6(n){let e,t,i;function s(a,u){return a[2]?l6:s6}let l=s(n),o=l(n),r={};return t=new i6({props:r}),n[12](t),{c(){o.c(),e=E(),z(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),H(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){L(t.$$.fragment,a),i=!1},d(a){a&&k(e),o.d(a),n[12](null),V(t,a)}}}function f6(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!1;h();async function h(){t(2,d=!0);try{t(10,c=await de.getAdminFileToken(l.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function g(){t(5,u="")}const m=y=>{s&&(y.preventDefault(),a==null||a.show(f))};function _(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,l=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":de.files.getUrl(l,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":de.files.getUrl(l,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,s,g,l,c,m,_]}class ru extends ve{constructor(e){super(),be(this,e,f6,u6,me,{record:9,filename:0,size:1})}}function qp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function jp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const s=i[2].includes(i[34]);return i[35]=s,i}function c6(n){let e,t,i;function s(){return n[17](n[34])}return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Te(je.call(null,e,"Remove file")),K(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function d6(n){let e,t,i;function s(){return n[16](n[34])}return{c(){e=v("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=K(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function p6(n){let e,t,i,s,l,o,r=n[34]+"",a,u,f,c,d,h;i=new ru({props:{record:n[3],filename:n[34]}});function g(y,S){return y[35]?d6:c6}let m=g(n),_=m(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("a"),a=U(r),c=E(),d=v("div"),_.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=de.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(l,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(o,a),b(e,c),b(e,d),_.m(d,null),h=!0},p(y,S){const C={};S[0]&8&&(C.record=y[3]),S[0]&32&&(C.filename=y[34]),i.$set(C),(!h||S[0]&36)&&Q(t,"fade",y[35]),(!h||S[0]&32)&&r!==(r=y[34]+"")&&se(a,r),(!h||S[0]&1064&&u!==(u=de.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!h||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),m===(m=g(y))&&_?_.p(y,S):(_.d(1),_=m(y),_&&(_.c(),_.m(d,null))),(!h||S[1]&2)&&Q(e,"dragging",y[32]),(!h||S[1]&4)&&Q(e,"dragover",y[33])},i(y){h||(A(i.$$.fragment,y),h=!0)},o(y){L(i.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),_.d()}}}function Hp(n,e){let t,i,s,l;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[p6,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Il({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function h6(n){let e,t,i,s,l,o,r,a,u=n[29].name+"",f,c,d,h,g,m,_;i=new G5({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=v("div"),t=v("figure"),z(i.$$.fragment),s=E(),l=v("div"),o=v("small"),o.textContent="New",r=E(),a=v("span"),f=U(u),d=E(),h=v("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[29].name),p(h,"type","button"),p(h,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,C){w(S,e,C),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(l,r),b(l,a),b(a,f),b(e,d),b(e,h),g=!0,m||(_=[Te(je.call(null,h,"Remove file")),K(h,"click",y)],m=!0)},p(S,C){n=S;const T={};C[0]&2&&(T.file=n[29]),i.$set(T),(!g||C[0]&2)&&u!==(u=n[29].name+"")&&se(f,u),(!g||C[0]&2&&c!==(c=n[29].name))&&p(l,"title",c),(!g||C[1]&2)&&Q(e,"dragging",n[32]),(!g||C[1]&4)&&Q(e,"dragover",n[33])},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){L(i.$$.fragment,S),g=!1},d(S){S&&k(e),V(i),m=!1,$e(_)}}}function Vp(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[h6,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Il({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function m6(n){let e,t,i,s,l,o=n[4].name+"",r,a,u,f,c=[],d=new Map,h,g=[],m=new Map,_,y,S,C,T,$,O,M,D,I,F,P,N=ge(n[5]);const R=Z=>Z[34]+Z[3].id;for(let Z=0;ZZ[29].name+Z[31];for(let Z=0;ZCancel',t=E(),i=v("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[K(e,"click",n[12]),K(i,"click",n[13])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function _M(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[gM],header:[mM],default:[hM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),H(e,s)}}}function bM(n,e,t){let i,s,l,o,r,a;const u=pt();let f,c,d;async function h($,O){t(1,c=$),t(2,d=O),await ln(),i||l.length||o.length||r.length?f==null||f.show():m()}function g(){f==null||f.hide()}function m(){g(),u("confirm")}const _=()=>g(),y=()=>m();function S($){te[$?"unshift":"push"](()=>{f=$,t(5,f)})}function C($){Fe.call(this,n,$)}function T($){Fe.call(this,n,$)}return n.$$.update=()=>{var $,O,M;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=(($=d==null?void 0:d.schema)==null?void 0:$.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>{var F,P,N;const I=(F=c==null?void 0:c.schema)==null?void 0:F.find(R=>R.id==D.id);return I?((P=I.options)==null?void 0:P.maxSelect)!=1&&((N=D.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[g,c,d,i,s,f,r,o,l,a,m,h,_,y,S,C,T]}class vM extends ve{constructor(e){super(),be(this,e,bM,_M,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function op(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function yM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new S$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function kM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new z$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function rp(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new N$({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function ap(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new pM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===As)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function wM(n){let e,t,i,s,l,o,r;const a=[kM,yM],u=[];function f(h,g){return h[14]?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===vl&&rp(n),d=n[15]&&ap(n);return{c(){e=v("div"),t=v("div"),s.c(),l=E(),c&&c.c(),o=E(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===Fi),p(e,"class","tabs-content svelte-12y0yzb")},m(h,g){w(h,e,g),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(h,g){let m=i;i=f(h),i===m?u[i].p(h,g):(ue(),L(u[m],1,1,()=>{u[m]=null}),fe(),s=u[i],s?s.p(h,g):(s=u[i]=a[i](h),s.c()),A(s,1),s.m(t,null)),(!r||g[0]&8)&&Q(t,"active",h[3]===Fi),h[3]===vl?c?(c.p(h,g),g[0]&8&&A(c,1)):(c=rp(h),c.c(),A(c,1),c.m(e,o)):c&&(ue(),L(c,1,1,()=>{c=null}),fe()),h[15]?d?(d.p(h,g),g[0]&32768&&A(d,1)):(d=ap(h),d.c(),A(d,1),d.m(e,null)):d&&(ue(),L(d,1,1,()=>{d=null}),fe())},i(h){r||(A(s),A(c),A(d),r=!0)},o(h){L(s),L(c),L(d),r=!1},d(h){h&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function up(n){let e,t,i,s,l,o,r;return o=new Ln({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[SM]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),i=v("button"),s=v("i"),l=E(),z(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),b(i,s),b(i,l),j(o,i,null),r=!0},p(a,u){const f={};u[1]&4194304&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),H(o)}}}function SM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=' Duplicate',t=E(),i=v("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[K(e,"click",n[26]),K(i,"click",An(xe(n[27])))],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function fp(n){let e,t,i,s;return i=new Ln({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[TM]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),z(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&(k(e),k(t)),H(i,l)}}}function cp(n){let e,t,i,s,l,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" collection"),u=E(),p(t,"class",i=wi(V.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(h,g){w(h,e,g),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(h,g){n=h,g[0]&64&&i!==(i=wi(V.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),g[0]&64&&o!==(o=n[50]+"")&&se(r,o),g[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(h){h&&k(e),f=!1,c()}}}function TM(n){let e,t=ge(Object.entries(n[6])),i=[];for(let s=0;s{P=null}),fe()):P?(P.p(R,q),q[0]&4&&A(P,1)):(P=fp(R),P.c(),A(P,1),P.m(d,null)),(!D||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!D||q[0]&4&&$!==($=!!R[2].id))&&(d.disabled=$),R[2].system?N||(N=dp(),N.c(),N.m(M.parentNode,M)):N&&(N.d(1),N=null)},i(R){D||(A(P),D=!0)},o(R){L(P),D=!1},d(R){R&&(k(e),k(s),k(l),k(f),k(c),k(O),k(M)),P&&P.d(),N&&N.d(R),I=!1,F()}}}function pp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Te(t=je.call(null,e,n[11])),l=!0)},p(r,a){t&&At(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Qe(()=>{s&&(i||(i=qe(e,Jt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Jt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function hp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function mp(n){var a,u,f;let e,t,i,s=!V.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&&gp();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=E(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(c,d){w(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=K(e,"click",n[33]),l=!0)},p(c,d){var h,g,m;d[0]&32&&(s=!V.isEmpty((h=c[5])==null?void 0:h.options)&&!((m=(g=c[5])==null?void 0:g.options)!=null&&m.manageRule)),s?r?d[0]&32&&A(r,1):(r=gp(),r.c(),A(r,1),r.m(e,null)):r&&(ue(),L(r,1,1,()=>{r=null}),fe()),d[0]&8&&Q(e,"active",c[3]===As)},d(c){c&&k(e),r&&r.d(),l=!1,o()}}}function gp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function $M(n){var B,Z,X,J,W,le,ee;let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,h,g=n[14]?"Query":"Fields",m,_,y=!V.isEmpty(n[11]),S,C,T,$,O=!V.isEmpty((B=n[5])==null?void 0:B.listRule)||!V.isEmpty((Z=n[5])==null?void 0:Z.viewRule)||!V.isEmpty((X=n[5])==null?void 0:X.createRule)||!V.isEmpty((J=n[5])==null?void 0:J.updateRule)||!V.isEmpty((W=n[5])==null?void 0:W.deleteRule)||!V.isEmpty((ee=(le=n[5])==null?void 0:le.options)==null?void 0:ee.manageRule),M,D,I,F,P=!!n[2].id&&!n[2].system&&up(n);r=new pe({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[CM,({uniqueId:ie})=>({48:ie}),({uniqueId:ie})=>[0,ie?131072:0]]},$$scope:{ctx:n}}});let N=y&&pp(n),R=O&&hp(),q=n[15]&&mp(n);return{c(){e=v("h4"),i=U(t),s=E(),P&&P.c(),l=E(),o=v("form"),z(r.$$.fragment),a=E(),u=v("input"),f=E(),c=v("div"),d=v("button"),h=v("span"),m=U(g),_=E(),N&&N.c(),S=E(),C=v("button"),T=v("span"),T.textContent="API Rules",$=E(),R&&R.c(),M=E(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===Fi),p(T,"class","txt"),p(C,"type","button"),p(C,"class","tab-item"),Q(C,"active",n[3]===vl),p(c,"class","tabs-header stretched")},m(ie,Ee){w(ie,e,Ee),b(e,i),w(ie,s,Ee),P&&P.m(ie,Ee),w(ie,l,Ee),w(ie,o,Ee),j(r,o,null),b(o,a),b(o,u),w(ie,f,Ee),w(ie,c,Ee),b(c,d),b(d,h),b(h,m),b(d,_),N&&N.m(d,null),b(c,S),b(c,C),b(C,T),b(C,$),R&&R.m(C,null),b(c,M),q&&q.m(c,null),D=!0,I||(F=[K(o,"submit",xe(n[30])),K(d,"click",n[31]),K(C,"click",n[32])],I=!0)},p(ie,Ee){var Ve,ze,oe,Ce,We,_t,Xe;(!D||Ee[0]&4)&&t!==(t=ie[2].id?"Edit collection":"New collection")&&se(i,t),ie[2].id&&!ie[2].system?P?(P.p(ie,Ee),Ee[0]&4&&A(P,1)):(P=up(ie),P.c(),A(P,1),P.m(l.parentNode,l)):P&&(ue(),L(P,1,1,()=>{P=null}),fe());const Ne={};Ee[0]&8192&&(Ne.class="form-field collection-field-name required m-b-0 "+(ie[13]?"disabled":"")),Ee[0]&41028|Ee[1]&4325376&&(Ne.$$scope={dirty:Ee,ctx:ie}),r.$set(Ne),(!D||Ee[0]&16384)&&g!==(g=ie[14]?"Query":"Fields")&&se(m,g),Ee[0]&2048&&(y=!V.isEmpty(ie[11])),y?N?(N.p(ie,Ee),Ee[0]&2048&&A(N,1)):(N=pp(ie),N.c(),A(N,1),N.m(d,null)):N&&(ue(),L(N,1,1,()=>{N=null}),fe()),(!D||Ee[0]&8)&&Q(d,"active",ie[3]===Fi),Ee[0]&32&&(O=!V.isEmpty((Ve=ie[5])==null?void 0:Ve.listRule)||!V.isEmpty((ze=ie[5])==null?void 0:ze.viewRule)||!V.isEmpty((oe=ie[5])==null?void 0:oe.createRule)||!V.isEmpty((Ce=ie[5])==null?void 0:Ce.updateRule)||!V.isEmpty((We=ie[5])==null?void 0:We.deleteRule)||!V.isEmpty((Xe=(_t=ie[5])==null?void 0:_t.options)==null?void 0:Xe.manageRule)),O?R?Ee[0]&32&&A(R,1):(R=hp(),R.c(),A(R,1),R.m(C,null)):R&&(ue(),L(R,1,1,()=>{R=null}),fe()),(!D||Ee[0]&8)&&Q(C,"active",ie[3]===vl),ie[15]?q?q.p(ie,Ee):(q=mp(ie),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(ie){D||(A(P),A(r.$$.fragment,ie),A(N),A(R),D=!0)},o(ie){L(P),L(r.$$.fragment,ie),L(N),L(R),D=!1},d(ie){ie&&(k(e),k(s),k(l),k(o),k(f),k(c)),P&&P.d(ie),H(r),N&&N.d(),R&&R.d(),q&&q.d(),I=!1,$e(F)}}}function MM(n){let e,t,i,s,l,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=[K(e,"click",n[24]),K(s,"click",n[25])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function OM(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[MM],header:[$M],default:[wM]},$$scope:{ctx:n}};e=new on({props:l}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new vM({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[39](null),H(e,r),n[42](null),H(i,r)}}}const Fi="schema",vl="api_rules",As="options",EM="base",_p="auth",bp="view";function Pr(n){return JSON.stringify(n)}function DM(n,e,t){let i,s,l,o,r,a;Ke(n,$i,ke=>t(5,a=ke));const u={};u[EM]="Base",u[bp]="View",u[_p]="Auth";const f=pt();let c,d,h=null,g=V.initCollection(),m=!1,_=!1,y=Fi,S=Pr(g),C="";function T(ke){t(3,y=ke)}function $(ke){return M(ke),t(10,_=!0),T(Fi),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}async function M(ke){en({}),typeof ke<"u"?(t(22,h=ke),t(2,g=structuredClone(ke))):(t(22,h=null),t(2,g=V.initCollection())),t(2,g.schema=g.schema||[],g),t(2,g.originalName=g.name||"",g),await ln(),t(23,S=Pr(g))}function D(){g.id?d==null||d.show(h,g):I()}function I(){if(m)return;t(9,m=!0);const ke=F();let Ge;g.id?Ge=de.collections.update(g.id,ke):Ge=de.collections.create(ke),Ge.then(Oe=>{Aa(),Ny(Oe),t(10,_=!1),O(),jt(g.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!g.id,collection:Oe})}).catch(Oe=>{de.error(Oe)}).finally(()=>{t(9,m=!1)})}function F(){const ke=Object.assign({},g);ke.schema=ke.schema.slice(0);for(let Ge=ke.schema.length-1;Ge>=0;Ge--)ke.schema[Ge].toDelete&&ke.schema.splice(Ge,1);return ke}function P(){h!=null&&h.id&&mn(`Do you really want to delete collection "${h.name}" and all its records?`,()=>de.collections.delete(h.id).then(()=>{O(),jt(`Successfully deleted collection "${h.name}".`),f("delete",h),Ry(h)}).catch(ke=>{de.error(ke)}))}function N(ke){t(2,g.type=ke,g),ci("schema")}function R(){o?mn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ke=h?structuredClone(h):null;if(ke){if(ke.id="",ke.created="",ke.updated="",ke.name+="_duplicate",!V.isEmpty(ke.schema))for(const Ge of ke.schema)Ge.id="";if(!V.isEmpty(ke.indexes))for(let Ge=0;GeO(),Z=()=>D(),X=()=>R(),J=()=>P(),W=ke=>{t(2,g.name=V.slugify(ke.target.value),g),ke.target.value=g.name},le=ke=>N(ke),ee=()=>{r&&D()},ie=()=>T(Fi),Ee=()=>T(vl),Ne=()=>T(As);function Ve(ke){g=ke,t(2,g),t(22,h)}function ze(ke){g=ke,t(2,g),t(22,h)}function oe(ke){g=ke,t(2,g),t(22,h)}function Ce(ke){g=ke,t(2,g),t(22,h)}const We=()=>o&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),O()}),!1):!0;function _t(ke){te[ke?"unshift":"push"](()=>{c=ke,t(7,c)})}function Xe(ke){Fe.call(this,n,ke)}function Je(ke){Fe.call(this,n,ke)}function wt(ke){te[ke?"unshift":"push"](()=>{d=ke,t(8,d)})}const _e=()=>I();return n.$$.update=()=>{var ke,Ge;n.$$.dirty[0]&4&&g.type==="view"&&(t(2,g.createRule=null,g),t(2,g.updateRule=null,g),t(2,g.deleteRule=null,g),t(2,g.indexes=[],g)),n.$$.dirty[0]&4194308&&g.name&&(h==null?void 0:h.name)!=g.name&&g.indexes.length>0&&t(2,g.indexes=(ke=g.indexes)==null?void 0:ke.map(Oe=>V.replaceIndexTableName(Oe,g.name)),g),n.$$.dirty[0]&4&&t(15,i=g.type===_p),n.$$.dirty[0]&4&&t(14,s=g.type===bp),n.$$.dirty[0]&32&&(a.schema||(Ge=a.options)!=null&&Ge.query?t(11,C=V.getNestedVal(a,"schema.message")||"Has errors"):t(11,C="")),n.$$.dirty[0]&4&&t(13,l=!!g.id&&g.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Pr(g)),n.$$.dirty[0]&20&&t(12,r=!g.id||o),n.$$.dirty[0]&12&&y===As&&g.type!=="auth"&&T(Fi)},[T,O,g,y,o,a,u,c,d,m,_,C,r,l,s,i,D,I,P,N,R,$,h,S,B,Z,X,J,W,le,ee,ie,Ee,Ne,Ve,ze,oe,Ce,We,_t,Xe,Je,wt,_e]}class ou extends ve{constructor(e){super(),be(this,e,DM,OM,me,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function vp(n,e,t){const i=n.slice();return i[15]=e[t],i}function yp(n){let e,t=n[1].length&&kp();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=kp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function kp(n){let e;return{c(){e=v("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wp(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,c,d,h;return{key:n,first:null,c(){var g;t=v("a"),i=v("i"),l=E(),o=v("span"),a=U(r),u=E(),p(i,"class",s=V.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",f="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),p(t,"title",c=e[15].name),Q(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id),this.first=t},m(g,m){w(g,t,m),b(t,i),b(t,l),b(t,o),b(o,a),b(t,u),d||(h=Te(un.call(null,t)),d=!0)},p(g,m){var _;e=g,m&8&&s!==(s=V.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),m&8&&r!==(r=e[15].name+"")&&se(a,r),m&8&&f!==(f="/collections?collectionId="+e[15].id)&&p(t,"href",f),m&8&&c!==(c=e[15].name)&&p(t,"title",c),m&40&&Q(t,"active",((_=e[5])==null?void 0:_.id)===e[15].id)},d(g){g&&k(t),d=!1,h()}}}function Sp(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),b(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function AM(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,m,_,y,S,C,T=ge(n[3]);const $=I=>I[15].id;for(let I=0;I',o=E(),r=v("input"),a=E(),u=v("hr"),f=E(),c=v("div");for(let I=0;I20),p(e,"class","page-sidebar collection-sidebar")},m(I,F){w(I,e,F),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),ae(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let P=0;P20),I[7]?M&&(M.d(1),M=null):M?M.p(I,F):(M=Sp(I),M.c(),M.m(e,null));const P={};_.$set(P)},i(I){y||(A(_.$$.fragment,I),y=!0)},o(I){L(_.$$.fragment,I),y=!1},d(I){I&&(k(e),k(m));for(let F=0;F{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function LM(n,e,t){let i,s,l,o,r,a,u;Ke(n,Ti,S=>t(5,o=S)),Ke(n,ii,S=>t(9,r=S)),Ke(n,vo,S=>t(6,a=S)),Ke(n,Ms,S=>t(7,u=S));let f,c="";function d(S){sn(Ti,o=S,o)}const h=()=>t(0,c="");function g(){c=this.value,t(0,c)}const m=()=>f==null?void 0:f.show();function _(S){te[S?"unshift":"push"](()=>{f=S,t(2,f)})}const y=S=>{var C;(C=S.detail)!=null&&C.isNew&&S.detail.collection&&d(S.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&IM(),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(S=>S.id==c||S.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,h,g,m,_,y]}class PM extends ve{constructor(e){super(),be(this,e,LM,AM,me,{})}}function Tp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Cp(n){n[18]=n[19].default}function $p(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Mp(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Mp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),c&&c.c(),s=E(),l=v("button"),r=U(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(h,g){w(h,t,g),c&&c.m(h,g),w(h,s,g),w(h,l,g),b(l,r),b(l,a),u||(f=K(l,"click",d),u=!0)},p(h,g){e=h,g&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Mp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),g&8&&o!==(o=e[15].label+"")&&se(r,o),g&40&&Q(l,"active",e[5]===e[14])},d(h){h&&(k(t),k(s),k(l)),c&&c.d(h),u=!1,f()}}}function Ep(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:RM,then:NM,catch:FM,value:19,blocks:[,,,]};return du(t=n[15].component,s),{c(){e=Se(),s.block.c()},m(l,o){w(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)&&du(t,s)||l0(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];L(r)}i=!1},d(l){l&&k(e),s.block.d(l),s.token=null,s=null}}}function FM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function NM(n){Cp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){j(e,s,l),w(s,t,l),i=!0},p(s,l){Cp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){L(e.$$.fragment,s),i=!1},d(s){s&&k(t),H(e,s)}}}function RM(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function Dp(n,e){let t,i,s,l=e[5]===e[14]&&Ep(e);return{key:n,first:null,c(){t=Se(),l&&l.c(),i=Se(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Ep(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&(k(t),k(i)),l&&l.d(o)}}}function qM(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=ge(Object.entries(n[3]));const d=m=>m[14];for(let m=0;mm[14];for(let m=0;mClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function HM(n){let e,t,i={class:"docs-panel",$$slots:{footer:[jM],default:[qM]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function VM(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-00164b6a.js"),["./ListApiDocs-00164b6a.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-8138d595.js"),["./ViewApiDocs-8138d595.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-c095c404.js"),["./CreateApiDocs-c095c404.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-70cf4d12.js"),["./UpdateApiDocs-70cf4d12.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-ffcdcabf.js"),["./DeleteApiDocs-ffcdcabf.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-5e8eb48d.js"),["./RealtimeApiDocs-5e8eb48d.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-edf28f39.js"),["./AuthWithPasswordDocs-edf28f39.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-82293e93.js"),["./AuthWithOAuth2Docs-82293e93.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-f65b5244.js"),["./AuthRefreshDocs-f65b5244.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-7ffbd86b.js"),["./RequestVerificationDocs-7ffbd86b.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-0837f663.js"),["./ConfirmVerificationDocs-0837f663.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-d0ffa20e.js"),["./RequestPasswordResetDocs-d0ffa20e.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-e2ce0748.js"),["./ConfirmPasswordResetDocs-e2ce0748.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-cc78294d.js"),["./RequestEmailChangeDocs-cc78294d.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-b51b3632.js"),["./ConfirmEmailChangeDocs-b51b3632.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-e774430d.js"),["./AuthMethodsDocs-e774430d.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-17872c67.js"),["./ListExternalAuthsDocs-17872c67.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-153e53dc.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-c1b416b8.js"),["./UnlinkExternalAuthDocs-c1b416b8.js","./SdkTabs-32d3aea6.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),h=y=>c(y);function g(y){te[y?"unshift":"push"](()=>{l=y,t(4,l)})}function m(y){Fe.call(this,n,y)}function _(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,h,g,m,_]}class zM extends ve{constructor(e){super(),be(this,e,VM,HM,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function BM(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(l,o){w(l,e,o),i||(s=Te(t=je.call(null,e,{text:n[0].join(` +`),position:"left"})),i=!0)},p(l,[o]){t&&At(t.update)&&o&1&&t.update.call(null,{text:l[0].join(` +`),position:"left"})},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}const Ap="yyyy-MM-dd HH:mm:ss.SSS";function UM(n,e,t){let{model:i}=e,s=[];function l(){t(0,s=[]),i.created&&s.push("Created: "+V.formatToLocalDate(i.created,Ap)+" Local"),i.updated&&s.push("Updated: "+V.formatToLocalDate(i.updated,Ap)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&l()},[s,i]}class T1 extends ve{constructor(e){super(),be(this,e,UM,BM,me,{model:1})}}function WM(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),s||(l=[Te(i=je.call(null,e,n[2]?"":"Copy")),K(e,"click",An(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&At(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function YM(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(V.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Gt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class qs extends ve{constructor(e){super(),be(this,e,YM,WM,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function KM(n){let e,t,i,s,l,o,r,a,u,f;return l=new qs({props:{value:n[1]}}),{c(){e=v("div"),t=v("span"),i=U(n[1]),s=E(),z(l.$$.fragment),o=E(),r=v("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),b(e,t),b(t,i),n[6](t),b(e,s),j(l,e,null),b(e,o),b(e,r),a=!0,u||(f=[Te(je.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const h={};d&2&&(h.value=c[1]),l.$set(h)},i(c){a||(A(l.$$.fragment,c),a=!0)},o(c){L(l.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),H(l),u=!1,$e(f)}}}function JM(n){let e,t,i,s,l,o,r,a,u,f;function c(h){n[7](h)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[KM]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Ln({props:d}),te.push(()=>he(s,"active",c)),s.$on("show",n[4]),{c(){e=v("button"),t=v("i"),i=E(),z(s.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(h,g){w(h,e,g),b(e,t),b(e,i),j(s,e,null),a=!0,u||(f=Te(r=je.call(null,e,n[3]?"":"Generate")),u=!0)},p(h,[g]){const m={};g&518&&(m.$$scope={dirty:g,ctx:h}),!l&&g&8&&(l=!0,m.active=h[3],ye(()=>l=!1)),s.$set(m),(!a||g&1&&o!==(o="btn btn-circle "+h[0]+" svelte-1md8247"))&&p(e,"class",o),r&&At(r.update)&&g&8&&r.update.call(null,h[3]?"":"Generate")},i(h){a||(A(s.$$.fragment,h),a=!0)},o(h){L(s.$$.fragment,h),a=!1},d(h){h&&k(e),H(s),u=!1,f()}}}function GM(n,e,t){const i=pt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=V.randomSecret(l)),i("generate",o),await ln(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class C1 extends ve{constructor(e){super(),be(this,e,GM,JM,me,{class:0,length:5})}}function ZM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Username",o=E(),r=v("input"),p(t,"class",V.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(h,g){w(h,e,g),b(e,t),b(e,i),b(e,s),w(h,o,g),w(h,r,g),ae(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(h,g){g&8192&&l!==(l=h[13])&&p(e,"for",l),g&4&&a!==(a=!h[2])&&p(r,"requried",a),g&4&&u!==(u=h[2]?"Leave empty to auto generate...":h[4])&&p(r,"placeholder",u),g&8192&&f!==(f=h[13])&&p(r,"id",f),g&1&&r.value!==h[0].username&&ae(r,h[0].username)},d(h){h&&(k(e),k(o),k(r)),c=!1,d()}}}function XM(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,h,g,m,_,y,S,C;return{c(){var T;e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("div"),a=v("button"),u=v("span"),f=U("Public: "),d=U(c),g=E(),m=v("input"),p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",h="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(m,"type","email"),m.autofocus=n[2],p(m,"autocomplete","off"),p(m,"id",_=n[13]),m.required=y=(T=n[1].options)==null?void 0:T.requireEmail,p(m,"class","svelte-1751a4d")},m(T,$){w(T,e,$),b(e,t),b(e,i),b(e,s),w(T,o,$),w(T,r,$),b(r,a),b(a,u),b(u,f),b(u,d),w(T,g,$),w(T,m,$),ae(m,n[0].email),n[2]&&m.focus(),S||(C=[Te(je.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",n[6]),K(m,"input",n[7])],S=!0)},p(T,$){var O;$&8192&&l!==(l=T[13])&&p(e,"for",l),$&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&se(d,c),$&1&&h!==(h="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",h),$&4&&(m.autofocus=T[2]),$&8192&&_!==(_=T[13])&&p(m,"id",_),$&2&&y!==(y=(O=T[1].options)==null?void 0:O.requireEmail)&&(m.required=y),$&1&&m.value!==T[0].email&&ae(m,T[0].email)},d(T){T&&(k(e),k(o),k(r),k(g),k(m)),S=!1,$e(C)}}}function Ip(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[QM,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function QM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Lp(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[xM,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[e5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&24577&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!u||c&8)&&Q(t,"p-t-xs",f[3])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Qe(()=>{u&&(a||(a=qe(e,it,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(e,it,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function xM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new C1({props:{length:15}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),ae(r,n[0].password),w(m,u,_),w(m,f,_),j(c,f,null),d=!0,h||(g=K(r,"input",n[9]),h=!0)},p(m,_){(!d||_&8192&&l!==(l=m[13]))&&p(e,"for",l),(!d||_&8192&&a!==(a=m[13]))&&p(r,"id",a),_&1&&r.value!==m[0].password&&ae(r,m[0].password)},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){L(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),H(c),h=!1,g()}}}function e5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[0].passwordConfirm),u||(f=K(r,"input",n[10]),u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ae(r,c[0].passwordConfirm)},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function t5(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),b(s,l),r||(a=[K(e,"change",n[11]),K(e,"change",xe(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function n5(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new pe({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[ZM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[XM,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&Ip(n),m=(n[2]||n[3])&&Lp(n);return d=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[t5,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),g&&g.c(),u=E(),m&&m.c(),f=E(),c=v("div"),z(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),b(e,a),g&&g.m(a,null),b(a,u),m&&m.m(a,null),b(e,f),b(e,c),j(d,c,null),h=!0},p(y,[S]){var O;const C={};S&4&&(C.class="form-field "+(y[2]?"":"required")),S&24581&&(C.$$scope={dirty:S,ctx:y}),i.$set(C);const T={};S&2&&(T.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:y}),o.$set(T),y[2]?g&&(ue(),L(g,1,1,()=>{g=null}),fe()):g?(g.p(y,S),S&4&&A(g,1)):(g=Ip(y),g.c(),A(g,1),g.m(a,u)),y[2]||y[3]?m?(m.p(y,S),S&12&&A(m,1)):(m=Lp(y),m.c(),A(m,1),m.m(a,null)):m&&(ue(),L(m,1,1,()=>{m=null}),fe());const $={};S&24581&&($.$$scope={dirty:S,ctx:y}),d.$set($)},i(y){h||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(g),A(m),A(d.$$.fragment,y),h=!0)},o(y){L(i.$$.fragment,y),L(o.$$.fragment,y),L(g),L(m),L(d.$$.fragment,y),h=!1},d(y){y&&k(e),H(i),H(o),g&&g.d(),m&&m.d(),H(d)}}}function i5(n,e,t){let{record:i}=e,{collection:s}=e,{isNew:l=!i.id}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function h(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function g(){i.verified=this.checked,t(0,i),t(3,r)}const m=_=>{l||mn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!_.target.checked,i)})};return n.$$set=_=>{"record"in _&&t(0,i=_.record),"collection"in _&&t(1,s=_.collection),"isNew"in _&&t(2,l=_.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),ci("password"),ci("passwordConfirm")))},[i,s,l,r,o,a,u,f,c,d,h,g,m]}class s5 extends ve{constructor(e){super(),be(this,e,i5,n5,me,{record:0,collection:1,isNew:2})}}function l5(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)&&!(h!=null&&h.isComposing)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Gt(()=>(u(),()=>clearTimeout(a)));function c(h){te[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(3,s=et(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class r5 extends ve{constructor(e){super(),be(this,e,o5,l5,me,{value:0,maxHeight:4})}}function a5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(m){n[2](m)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new r5({props:g}),te.push(()=>he(f,"value",h)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),j(f,m,_),d=!0},p(m,_){(!d||_&2&&i!==(i=V.getFieldTypeIcon(m[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=m[1].name+"")&&se(r,o),(!d||_&8&&a!==(a=m[3]))&&p(e,"for",a);const y={};_&8&&(y.id=m[3]),_&2&&(y.required=m[1].required),!c&&_&1&&(c=!0,y.value=m[0],ye(()=>c=!1)),f.$set(y)},i(m){d||(A(f.$$.fragment,m),d=!0)},o(m){L(f.$$.fragment,m),d=!1},d(m){m&&(k(e),k(u)),H(f,m)}}}function u5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[a5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class c5 extends ve{constructor(e){super(),be(this,e,f5,u5,me,{field:1,value:0})}}function d5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_;return{c(){var y,S;e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),w(y,f,S),ae(f,n[0]),m||(_=K(f,"input",n[2]),m=!0)},p(y,S){var C,T;S&2&&i!==(i=V.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&se(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(f,"min",h),S&2&&g!==(g=(T=y[1].options)==null?void 0:T.max)&&p(f,"max",g),S&1&&dt(f.value)!==y[0]&&ae(f,y[0])},d(y){y&&(k(e),k(u),k(f)),m=!1,_()}}}function p5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[d5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function h5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=dt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class m5 extends ve{constructor(e){super(),be(this,e,h5,p5,me,{field:1,value:0})}}function g5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=E(),s=v("label"),o=U(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),b(s,o),a||(u=K(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&se(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&(k(e),k(i),k(s)),a=!1,u()}}}function _5(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[g5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function b5(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class v5 extends ve{constructor(e){super(),be(this,e,b5,_5,me,{field:1,value:0})}}function y5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),ae(f,n[0]),h||(g=K(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=V.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&se(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&ae(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function k5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[y5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function w5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class S5 extends ve{constructor(e){super(),be(this,e,w5,k5,me,{field:1,value:0})}}function T5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("input"),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),w(m,f,_),ae(f,n[0]),h||(g=K(f,"input",n[2]),h=!0)},p(m,_){_&2&&i!==(i=V.getFieldTypeIcon(m[1].type))&&p(t,"class",i),_&2&&o!==(o=m[1].name+"")&&se(r,o),_&8&&a!==(a=m[3])&&p(e,"for",a),_&8&&c!==(c=m[3])&&p(f,"id",c),_&2&&d!==(d=m[1].required)&&(f.required=d),_&1&&f.value!==m[0]&&ae(f,m[0])},d(m){m&&(k(e),k(u),k(f)),h=!1,g()}}}function C5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[T5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class M5 extends ve{constructor(e){super(),be(this,e,$5,C5,me,{field:1,value:0})}}function Pp(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),b(e,t),i||(s=[Te(je.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:x,d(l){l&&k(e),i=!1,$e(s)}}}function O5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_=n[0]&&!n[1].required&&Pp(n);function y(T){n[6](T)}function S(T){n[7](T)}let C={id:n[8],options:V.defaultFlatpickrOptions()};return n[2]!==void 0&&(C.value=n[2]),n[0]!==void 0&&(C.formattedValue=n[0]),d=new lu({props:C}),te.push(()=>he(d,"value",y)),te.push(()=>he(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" (UTC)"),f=E(),_&&_.c(),c=E(),z(d.$$.fragment),p(t,"class",i=wi(V.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(T,$){w(T,e,$),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),w(T,f,$),_&&_.m(T,$),w(T,c,$),j(d,T,$),m=!0},p(T,$){(!m||$&2&&i!==(i=wi(V.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!m||$&2)&&o!==(o=T[1].name+"")&&se(r,o),(!m||$&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,$):(_=Pp(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const O={};$&256&&(O.id=T[8]),!h&&$&4&&(h=!0,O.value=T[2],ye(()=>h=!1)),!g&&$&1&&(g=!0,O.formattedValue=T[0],ye(()=>g=!1)),d.$set(O)},i(T){m||(A(d.$$.fragment,T),m=!0)},o(T){L(d.$$.fragment,T),m=!1},d(T){T&&(k(e),k(f),k(c)),_&&_.d(T),H(d,T)}}}function E5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[O5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function D5(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class A5 extends ve{constructor(e){super(),be(this,e,D5,E5,me,{field:1,value:0})}}function Fp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=U("Select up to "),s=U(i),l=U(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(s,i)},d(o){o&&k(e)}}}function I5(n){var S,C,T,$,O,M;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function m(D){n[3](D)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((C=n[1].options)==null?void 0:C.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((O=($=n[1].options)==null?void 0:$.values)==null?void 0:O.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new S1({props:_}),te.push(()=>he(f,"selected",m));let y=((M=n[1].options)==null?void 0:M.maxSelect)>1&&Fp(n);return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),d=E(),y&&y.c(),h=Se(),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,I){w(D,e,I),b(e,t),b(e,s),b(e,l),b(l,r),w(D,u,I),j(f,D,I),w(D,d,I),y&&y.m(D,I),w(D,h,I),g=!0},p(D,I){var P,N,R,q,B,Z;(!g||I&2&&i!==(i=V.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!g||I&2)&&o!==(o=D[1].name+"")&&se(r,o),(!g||I&16&&a!==(a=D[4]))&&p(e,"for",a);const F={};I&16&&(F.id=D[4]),I&6&&(F.toggle=!D[1].required||D[2]),I&4&&(F.multiple=D[2]),I&7&&(F.closable=!D[2]||((P=D[0])==null?void 0:P.length)>=((N=D[1].options)==null?void 0:N.maxSelect)),I&2&&(F.items=(R=D[1].options)==null?void 0:R.values),I&2&&(F.searchable=((B=(q=D[1].options)==null?void 0:q.values)==null?void 0:B.length)>5),!c&&I&1&&(c=!0,F.selected=D[0],ye(()=>c=!1)),f.$set(F),((Z=D[1].options)==null?void 0:Z.maxSelect)>1?y?y.p(D,I):(y=Fp(D),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(D){g||(A(f.$$.fragment,D),g=!0)},o(D){L(f.$$.fragment,D),g=!1},d(D){D&&(k(e),k(u),k(d),k(h)),H(f,D),y&&y.d(D)}}}function L5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function P5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class F5 extends ve{constructor(e){super(),be(this,e,P5,L5,me,{field:1,value:0})}}function N5(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function R5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function q5(n){let e;return{c(){e=v("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function j5(n){let e,t,i;var s=n[3];function l(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return s&&(e=Et(s,l(n)),e.$on("change",n[5])),{c(){e&&z(e.$$.fragment),t=Se()},m(o,r){e&&j(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&s!==(s=o[3])){if(e){ue();const a=e;L(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}s?(e=Et(s,l(o)),e.$on("change",o[5]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,t.parentNode,t)):e=null}else if(s){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&A(e.$$.fragment,o),i=!0)},o(o){e&&L(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&H(e,o)}}}function H5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,m,_,y,S;function C(I,F){return I[4]?R5:N5}let T=C(n),$=T(n);const O=[j5,q5],M=[];function D(I,F){return I[3]?0:1}return h=D(n),g=M[h]=O[h](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),a=E(),u=v("span"),$.c(),d=E(),g.c(),m=Se(),p(t,"class",i=wi(V.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(l,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(I,F){w(I,e,F),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),$.m(u,null),w(I,d,F),M[h].m(I,F),w(I,m,F),_=!0,y||(S=Te(f=je.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(I,F){(!_||F&2&&i!==(i=wi(V.getFieldTypeIcon(I[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||F&2)&&o!==(o=I[1].name+"")&&se(r,o),T!==(T=C(I))&&($.d(1),$=T(I),$&&($.c(),$.m(u,null))),f&&At(f.update)&&F&16&&f.update.call(null,{position:"left",text:I[4]?"Valid JSON":"Invalid JSON"}),(!_||F&64&&c!==(c=I[6]))&&p(e,"for",c);let P=h;h=D(I),h===P?M[h].p(I,F):(ue(),L(M[P],1,1,()=>{M[P]=null}),fe(),g=M[h],g?g.p(I,F):(g=M[h]=O[h](I),g.c()),A(g,1),g.m(m.parentNode,m))},i(I){_||(A(g),_=!0)},o(I){L(g),_=!1},d(I){I&&(k(e),k(d),k(m)),$.d(),M[h].d(I),y=!1,S()}}}function V5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[H5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&223&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Np(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function z5(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function B5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e,o,r=Np(l);Gt(async()=>{try{t(3,o=(await rt(()=>import("./CodeEditor-73c7d443.js"),["./CodeEditor-73c7d443.js","./index-9cd23da9.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,l=r.trim())};return n.$$set=u=>{"field"in u&&t(1,s=u.field),"value"in u&&t(0,l=u.value)},n.$$.update=()=>{n.$$.dirty&5&&l!==(r==null?void 0:r.trim())&&(t(2,r=Np(l)),t(0,l=r)),n.$$.dirty&4&&t(4,i=z5(r))},[l,s,r,o,i,a]}class U5 extends ve{constructor(e){super(),be(this,e,B5,V5,me,{field:1,value:0})}}function W5(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function Y5(n){let e,t,i;return{c(){e=v("img"),p(e,"draggable",!1),_n(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!_n(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function K5(n){let e;function t(l,o){return l[2]?Y5:W5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function J5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){V.hasImageExtension(s==null?void 0:s.name)?V.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class G5 extends ve{constructor(e){super(),be(this,e,J5,K5,me,{file:0,size:1})}}function Rp(n){let e;function t(l,o){return l[4]==="image"?X5:Z5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function Z5(n){let e,t;return{c(){e=v("object"),t=U("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&k(e)}}}function X5(n){let e,t,i;return{c(){e=v("img"),_n(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!_n(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function Q5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Rp(n);return{c(){i&&i.c(),t=Se()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Rp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&k(t),i&&i.d(l)}}}function x5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=K(e,"click",xe(n[0])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function e6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=U(n[2]),i=E(),s=v("i"),l=E(),o=v("div"),r=E(),a=v("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=K(a,"click",n[0]),u=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(l),k(o),k(r),k(a)),u=!1,f()}}}function t6(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[e6],header:[x5],default:[Q5]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function n6(n,e,t){let i,s,l,o,r="";function a(h){h!==""&&(t(1,r=h),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(h){te[h?"unshift":"push"](()=>{o=h,t(3,o)})}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=V.getFileType(s))},[u,r,s,o,l,a,i,f,c,d]}class i6 extends ve{constructor(e){super(),be(this,e,n6,t6,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function s6(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?a6:u[3]==="video"||u[3]==="audio"?r6:o6}let r=o(n),a=r(n);return{c(){e=v("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){w(u,e,f),a.m(e,null),s||(l=K(e,"click",An(n[11])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&k(e),a.d(),s=!1,l()}}}function l6(n){let e,t;return{c(){e=v("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function o6(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function r6(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function a6(n){let e,t,i,s,l;return{c(){e=v("img"),p(e,"draggable",!1),_n(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),s||(l=K(e,"error",n[8]),s=!0)},p(o,r){r&32&&!_n(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&k(e),s=!1,l()}}}function u6(n){let e,t,i;function s(a,u){return a[2]?l6:s6}let l=s(n),o=l(n),r={};return t=new i6({props:r}),n[12](t),{c(){o.c(),e=E(),z(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),j(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){L(t.$$.fragment,a),i=!1},d(a){a&&k(e),o.d(a),n[12](null),H(t,a)}}}function f6(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!1;h();async function h(){t(2,d=!0);try{t(10,c=await de.getAdminFileToken(l.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function g(){t(5,u="")}const m=y=>{s&&(y.preventDefault(),a==null||a.show(f))};function _(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,l=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=V.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":de.files.getUrl(l,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":de.files.getUrl(l,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,s,g,l,c,m,_]}class ru extends ve{constructor(e){super(),be(this,e,f6,u6,me,{record:9,filename:0,size:1})}}function qp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function jp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const s=i[2].includes(i[34]);return i[35]=s,i}function c6(n){let e,t,i;function s(){return n[17](n[34])}return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Te(je.call(null,e,"Remove file")),K(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function d6(n){let e,t,i;function s(){return n[16](n[34])}return{c(){e=v("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=K(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function p6(n){let e,t,i,s,l,o,r=n[34]+"",a,u,f,c,d,h;i=new ru({props:{record:n[3],filename:n[34]}});function g(y,S){return y[35]?d6:c6}let m=g(n),_=m(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("a"),a=U(r),c=E(),d=v("div"),_.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=de.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(l,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(y,S){w(y,e,S),b(e,t),j(i,t,null),b(e,s),b(e,l),b(l,o),b(o,a),b(e,c),b(e,d),_.m(d,null),h=!0},p(y,S){const C={};S[0]&8&&(C.record=y[3]),S[0]&32&&(C.filename=y[34]),i.$set(C),(!h||S[0]&36)&&Q(t,"fade",y[35]),(!h||S[0]&32)&&r!==(r=y[34]+"")&&se(a,r),(!h||S[0]&1064&&u!==(u=de.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!h||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),m===(m=g(y))&&_?_.p(y,S):(_.d(1),_=m(y),_&&(_.c(),_.m(d,null))),(!h||S[1]&2)&&Q(e,"dragging",y[32]),(!h||S[1]&4)&&Q(e,"dragover",y[33])},i(y){h||(A(i.$$.fragment,y),h=!0)},o(y){L(i.$$.fragment,y),h=!1},d(y){y&&k(e),H(i),_.d()}}}function Hp(n,e){let t,i,s,l;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[p6,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Il({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function h6(n){let e,t,i,s,l,o,r,a,u=n[29].name+"",f,c,d,h,g,m,_;i=new G5({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=v("div"),t=v("figure"),z(i.$$.fragment),s=E(),l=v("div"),o=v("small"),o.textContent="New",r=E(),a=v("span"),f=U(u),d=E(),h=v("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[29].name),p(h,"type","button"),p(h,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,C){w(S,e,C),b(e,t),j(i,t,null),b(e,s),b(e,l),b(l,o),b(l,r),b(l,a),b(a,f),b(e,d),b(e,h),g=!0,m||(_=[Te(je.call(null,h,"Remove file")),K(h,"click",y)],m=!0)},p(S,C){n=S;const T={};C[0]&2&&(T.file=n[29]),i.$set(T),(!g||C[0]&2)&&u!==(u=n[29].name+"")&&se(f,u),(!g||C[0]&2&&c!==(c=n[29].name))&&p(l,"title",c),(!g||C[1]&2)&&Q(e,"dragging",n[32]),(!g||C[1]&4)&&Q(e,"dragover",n[33])},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){L(i.$$.fragment,S),g=!1},d(S){S&&k(e),H(i),m=!1,$e(_)}}}function Vp(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[h6,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Il({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function m6(n){let e,t,i,s,l,o=n[4].name+"",r,a,u,f,c=[],d=new Map,h,g=[],m=new Map,_,y,S,C,T,$,O,M,D,I,F,P,N=ge(n[5]);const R=Z=>Z[34]+Z[3].id;for(let Z=0;ZZ[29].name+Z[31];for(let Z=0;Z({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(t,e,null),i=!0,s||(l=[K(e,"dragover",xe(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + `,name:n[4].name,$$slots:{default:[m6,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),j(t,e,null),i=!0,s||(l=[K(e,"dragover",xe(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=` form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),V(t),s=!1,$e(l)}}}function _6(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,h=!1,g="";function m(B){j.removeByValue(f,B),t(2,f)}function _(B){j.pushUnique(f,B),t(2,f)}function y(B){j.isEmpty(u[B])||u.splice(B,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function C(B){var X,J;B.preventDefault(),t(9,h=!1);const Z=((X=B.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Z.length)){for(const W of Z){const le=s.length+u.length-f.length;if(((J=r.options)==null?void 0:J.maxSelect)<=le)break;u.push(W)}t(1,u)}}Gt(async()=>{t(10,g=await de.getAdminFileToken(o.collectionId))});const T=B=>m(B),$=B=>_(B);function O(B){a=B,t(0,a),t(6,i),t(4,r)}const M=B=>y(B);function D(B){u=B,t(1,u)}function I(B){te[B?"unshift":"push"](()=>{c=B,t(7,c)})}const F=()=>{for(let B of c.files)u.push(B);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function N(B){te[B?"unshift":"push"](()=>{d=B,t(8,d)})}const R=()=>{t(9,h=!0)},q=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"field"in B&&t(4,r=B.field),"value"in B&&t(0,a=B.value),"uploadedFiles"in B&&t(1,u=B.uploadedFiles),"deletedFileNames"in B&&t(2,f=B.deletedFileNames)},n.$$.update=()=>{var B,Z;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=j.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((B=r.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=j.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,h,g,l,m,_,y,C,T,$,O,M,D,I,F,P,N,R,q]}class b6 extends ve{constructor(e){super(),be(this,e,_6,g6,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function zp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function v6(n,e){e=zp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=zp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Bp(n,e,t){const i=n.slice();i[5]=e[t];const s=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=s,i}function Up(n,e,t){const i=n.slice();return i[9]=e[t],i}function Wp(n){let e,t;return e=new ru({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&5&&(l.filename=i[9]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yp(n){let e=!j.isEmpty(n[9]),t,i,s=e&&Wp(n);return{c(){s&&s.c(),t=Se()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&5&&(e=!j.isEmpty(l[9])),e?s?(s.p(l,o),o&5&&A(s,1)):(s=Wp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(ue(),L(s,1,1,()=>{s=null}),fe())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){l&&k(t),s&&s.d(l)}}}function Kp(n){let e,t,i=ge(n[6]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oL(h[m],1,1,()=>{h[m]=null});return{c(){e=v("div"),t=v("i"),s=E();for(let m=0;mt(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,u,f,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,s=((u=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:u.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,l=((c=(f=i==null?void 0:i.schema)==null?void 0:f.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,l,s,i,o]}class xo extends ve{constructor(e){super(),be(this,e,k6,y6,me,{record:0})}}function Jp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Gp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[9](i[49]);return i[6]=s,i}function Zp(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Xp(n){let e,t=!n[13]&&Qp(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[13]?t&&(t.d(1),t=null):t?t.p(i,s):(t=Qp(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function Qp(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&xp(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=xp(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function xp(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[35]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function w6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function S6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function eh(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),b(e,t),i||(s=[Te(je.call(null,t,"Edit")),K(t,"keydown",An(n[27])),K(t,"click",An(l))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,$e(s)}}}function th(n,e){let t,i,s,l,o,r,a,u;function f(_,y){return _[6]?S6:w6}let c=f(e),d=c(e);l=new xo({props:{record:e[49]}});let h=!e[11]&&eh(e);function g(){return e[33](e[49])}function m(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=v("div"),d.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),h&&h.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,y){w(_,t,y),d.m(t,null),b(t,i),b(t,s),H(l,s,null),b(t,o),h&&h.m(t,null),r=!0,a||(u=[K(t,"click",g),K(t,"keydown",m)],a=!0)},p(_,y){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),l.$set(S),e[11]?h&&(h.d(1),h=null):h?h.p(e,y):(h=eh(e),h.c(),h.m(t,null)),(!r||y[0]&768)&&Q(t,"selected",e[6]),(!r||y[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(l.$$.fragment,_),r=!0)},o(_){L(l.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),V(l),h&&h.d(),a=!1,$e(u)}}}function nh(n){let e;return{c(){e=v("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ih(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[4]),o=U(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(l,r[4])},d(r){r&&(k(e),k(i),k(s),k(l),k(o))}}}function T6(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function C6(n){let e,t,i=ge(n[6]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o',l=E(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){w(f,e,c),H(t,e,null),b(e,i),b(e,s),w(f,l,c),o=!0,r||(a=K(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){L(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(l)),V(t),r=!1,a()}}}function sh(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[$6,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new Il({props:l}),te.push(()=>he(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M6(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,h,g,m,_,y,S,C;t=new Wo({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&Zp(n),$=ge(n[8]);const O=R=>R[49].id;for(let R=0;R<$.length;R+=1){let q=Gp(n,$,R),B=O(q);r.set(B,o[R]=th(B,q))}let M=null;$.length||(M=Xp(n));let D=n[13]&&nh(),I=n[4]>1&&ih(n);const F=[C6,T6],P=[];function N(R,q){return R[6].length?0:1}return g=N(n),m=P[g]=F[g](n),{c(){e=v("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=v("div");for(let R=0;R1?I?I.p(R,q):(I=ih(R),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let Z=g;g=N(R),g===Z?P[g].p(R,q):(ue(),L(P[Z],1,1,()=>{P[Z]=null}),fe(),m=P[g],m?m.p(R,q):(m=P[g]=F[g](R),m.c()),A(m,1),m.m(_.parentNode,_))},i(R){if(!y){A(t.$$.fragment,R);for(let q=0;q<$.length;q+=1)A(o[q]);A(m),y=!0}},o(R){L(t.$$.fragment,R);for(let q=0;qCancel',t=E(),i=v("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function D6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[E6],header:[O6],default:[M6]},$$scope:{ctx:n}};for(let a=0;at(26,h=Oe));const g=pt(),m="picker_"+j.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",$=[],O=[],M=1,D=0,I=!1,F=!1;function P(){return t(2,T=""),t(8,$=[]),t(6,O=[]),R(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function R(){const Oe=j.toArray(_);if(!s||!Oe.length)return;t(24,F=!0);let ht=[];const Ft=Oe.slice(),rn=[];for(;Ft.length>0;){const xt=[];for(const tn of Ft.splice(0,no))xt.push(`id="${tn}"`);rn.push(de.collection(s).getFullList(no,{filter:xt.join("||"),$autoCancel:!1}))}try{await Promise.all(rn).then(xt=>{ht=ht.concat(...xt)}),t(6,O=[]);for(const xt of Oe){const tn=j.findByKey(ht,"id",xt);tn&&O.push(tn)}T.trim()||t(8,$=j.filterDuplicatesByKey(O.concat($))),t(24,F=!1)}catch(xt){xt.isAbort||(de.error(xt),t(24,F=!1))}}async function q(Oe=!1){if(s){t(3,I=!0),Oe&&(T.trim()?t(8,$=[]):t(8,$=j.toArray(O).slice()));try{const ht=Oe?1:M+1,Ft=j.getAllCollectionIdentifiers(l),rn=await de.collection(s).getList(ht,no,{filter:j.normalizeSearchFilter(T,Ft),sort:o?"":"-created",skipTotal:1,$cancelKey:m+"loadList"});t(8,$=j.filterDuplicatesByKey($.concat(rn.items))),M=rn.page,t(23,D=rn.items.length),t(3,I=!1)}catch(ht){ht.isAbort||(de.error(ht),t(3,I=!1))}}}function B(Oe){i==1?t(6,O=[Oe]):u&&(j.pushOrReplaceByKey(O,Oe),t(6,O))}function Z(Oe){j.removeByKey(O,"id",Oe.id),t(6,O)}function X(Oe){f(Oe)?Z(Oe):B(Oe)}function J(){var Oe;i!=1?t(20,_=O.map(ht=>ht.id)):t(20,_=((Oe=O==null?void 0:O[0])==null?void 0:Oe.id)||""),g("save",O),N()}function W(Oe){Fe.call(this,n,Oe)}const le=()=>N(),ee=()=>J(),ie=Oe=>t(2,T=Oe.detail),Ee=()=>C==null?void 0:C.show(),Ne=Oe=>C==null?void 0:C.show(Oe),Ve=Oe=>X(Oe),ze=(Oe,ht)=>{(ht.code==="Enter"||ht.code==="Space")&&(ht.preventDefault(),ht.stopPropagation(),X(Oe))},oe=()=>t(2,T=""),Ce=()=>{a&&!I&&q()},We=Oe=>Z(Oe);function _t(Oe){O=Oe,t(6,O)}function Xe(Oe){te[Oe?"unshift":"push"](()=>{S=Oe,t(1,S)})}function Je(Oe){Fe.call(this,n,Oe)}function wt(Oe){Fe.call(this,n,Oe)}function _e(Oe){te[Oe?"unshift":"push"](()=>{C=Oe,t(7,C)})}const ke=Oe=>{j.removeByKey($,"id",Oe.detail.record.id),$.unshift(Oe.detail.record),t(8,$),B(Oe.detail.record)},Ge=Oe=>{j.removeByKey($,"id",Oe.detail.id),t(8,$),Z(Oe.detail)};return n.$$set=Oe=>{e=He(He({},e),Qt(Oe)),t(19,d=et(e,c)),"value"in Oe&&t(20,_=Oe.value),"field"in Oe&&t(21,y=Oe.field)},n.$$.update=()=>{var Oe,ht;n.$$.dirty[0]&2097152&&t(4,i=((Oe=y==null?void 0:y.options)==null?void 0:Oe.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(ht=y==null?void 0:y.options)==null?void 0:ht.collectionId),n.$$.dirty[0]&100663296&&t(5,l=h.find(Ft=>Ft.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(l==null?void 0:l.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=I||F),n.$$.dirty[0]&8388608&&t(12,a=D==no),n.$$.dirty[0]&80&&t(10,u=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,f=function(Ft){return j.findByKey(O,"id",Ft.id)})},[N,S,T,I,i,l,O,C,$,f,u,o,a,r,q,B,Z,X,J,d,_,y,P,D,F,s,h,W,le,ee,ie,Ee,Ne,Ve,ze,oe,Ce,We,_t,Xe,Je,wt,_e,ke,Ge]}class I6 extends ve{constructor(e){super(),be(this,e,A6,D6,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function lh(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function oh(n,e,t){const i=n.slice();return i[26]=e[t],i}function rh(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(l,o){w(l,e,o),i||(s=Te(t=je.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(l,o){t&&Et(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+l[6].join(", ")})},d(l){l&&k(e),i=!1,s()}}}function ah(n){let e,t=n[5]&&uh(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=uh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function uh(n){let e,t=ge(j.toArray(n[0]).slice(0,10)),i=[];for(let s=0;s ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function L6(n){let e,t,i,s,l,o,r,a,u,f;i=new xo({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='',r=E(),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"),Q(e,"dragging",n[24]),Q(e,"dragover",n[25])},m(d,h){w(d,e,h),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),w(d,r,h),a=!0,u||(f=[Te(je.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(d,h){n=d;const g={};h&16&&(g.record=n[21]),i.$set(g),(!a||h&16777216)&&Q(e,"dragging",n[24]),(!a||h&33554432)&&Q(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){L(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),V(i),u=!1,$e(f)}}}function ch(n,e){let t,i,s,l;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[L6,({dragging:a,dragover:u})=>({24:a,25:u}),({dragging:a,dragover:u})=>(a?16777216:0)|(u?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Il({props:r}),te.push(()=>he(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[23]),u&128&&(f.disabled=!e[7]),u&587202576&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function P6(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$=n[6].length&&rh(n),O=ge(n[4]);const M=I=>I[21].id;for(let I=0;I Open picker',p(t,"class",i=wi(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(I,F){w(I,e,F),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),$&&$.m(e,null),w(I,f,F),w(I,c,F),b(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[15](e);let o={value:n[0],field:n[2]};return i=new I6({props:o}),n[16](i),i.$on("save",n[17]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(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&537919735&&(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){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const dh=100;function N6(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const M=j.toArray(l);return t(4,a=a.filter(D=>M.includes(D.id))),M.length!=a.length}async function h(){var F,P;const M=j.toArray(l);if(t(4,a=[]),t(6,c=[]),!((F=s==null?void 0:s.options)!=null&&F.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const D=M.slice(),I=[];for(;D.length>0;){const N=[];for(const R of D.splice(0,dh))N.push(`id="${R}"`);I.push(de.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(dh,{filter:N.join("||"),$autoCancel:!1}))}try{let N=[];await Promise.all(I).then(R=>{N=N.concat(...R)});for(const R of M){const q=j.findByKey(N,"id",R);q?a.push(q):c.push(R)}t(4,a),m()}catch(N){de.error(N)}t(5,u=!1)}function g(M){j.removeByKey(a,"id",M.id),t(4,a),m()}function m(){var M;i?t(0,l=a.map(D=>D.id)):t(0,l=((M=a[0])==null?void 0:M.id)||"")}Is(()=>{clearTimeout(f)});const _=M=>g(M);function y(M){a=M,t(4,a)}const S=()=>{m()},C=()=>o==null?void 0:o.show();function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){te[M?"unshift":"push"](()=>{o=M,t(1,o)})}const O=M=>{var D;t(4,a=M.detail||[]),t(0,l=i?a.map(I=>I.id):((D=a[0])==null?void 0:D.id)||"")};return n.$$set=M=>{"field"in M&&t(2,s=M.field),"value"in M&&t(0,l=M.value),"picker"in M&&t(1,o=M.picker)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(7,i=((M=s.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(h,0)))},[l,o,s,r,a,u,c,i,g,m,f,_,y,S,C,T,$,O]}class R6 extends ve{constructor(e){super(),be(this,e,N6,F6,me,{field:2,value:0,picker:1})}}const q6=["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"],j6=(n,e)=>{q6.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function H6(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),jr(e,"visibility","hidden")},m(t,i){w(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[18](null)}}}function V6(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[17](null)}}}function z6(n){let e;function t(l,o){return l[1]?V6:H6}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){w(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:x,o:x,d(l){l&&k(e),s.d(),n[19](null)}}}const $1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),B6=()=>{let n={listeners:[],scriptId:$1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let U6=B6();function W6(n,e,t){var i;let{id:s=$1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:h=""}=e,{cssClass:g="tinymce-wrapper"}=e,m,_,y,S=d,C=o;const T=pt(),$=()=>{const P=(()=>typeof window<"u"?window:global)();return P&&P.tinymce?P.tinymce:null},O=()=>{const F=Object.assign(Object.assign({},f),{target:_,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:P=>{t(14,y=P),P.on("init",()=>{P.setContent(d),P.on(c,()=>{t(15,S=P.getContent()),S!==d&&(t(5,d=S),t(6,h=P.getContent({format:"text"})))})}),j6(P,T),typeof f.setup=="function"&&f.setup(P)}});t(4,_.style.visibility="",_),$().init(F)};Gt(()=>{if($()!==null)O();else{const F=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;U6.load(m.ownerDocument,F,()=>{O()})}}),Is(()=>{var F;y&&((F=$())===null||F===void 0||F.remove(y))});function M(F){te[F?"unshift":"push"](()=>{_=F,t(4,_)})}function D(F){te[F?"unshift":"push"](()=>{_=F,t(4,_)})}function I(F){te[F?"unshift":"push"](()=>{m=F,t(3,m)})}return n.$$set=F=>{"id"in F&&t(0,s=F.id),"inline"in F&&t(1,l=F.inline),"disabled"in F&&t(7,o=F.disabled),"apiKey"in F&&t(8,r=F.apiKey),"channel"in F&&t(9,a=F.channel),"scriptSrc"in F&&t(10,u=F.scriptSrc),"conf"in F&&t(11,f=F.conf),"modelEvents"in F&&t(12,c=F.modelEvents),"value"in F&&t(5,d=F.value),"text"in F&&t(6,h=F.text),"cssClass"in F&&t(2,g=F.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&S!==d&&(y.setContent(d),t(6,h=y.getContent({format:"text"}))),y&&o!==C&&(t(16,C=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,g,m,_,d,h,o,r,a,u,f,c,i,y,S,C,M,D,I]}class au extends ve{constructor(e){super(),be(this,e,W6,z6,me,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function Y6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(m){n[3](m)}let g={id:n[4],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:n[2]};return n[0]!==void 0&&(g.value=n[0]),f=new au({props:g}),te.push(()=>he(f,"value",h)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),H(f,m,_),d=!0},p(m,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(m[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=m[1].name+"")&&se(r,o),(!d||_&16&&a!==(a=m[4]))&&p(e,"for",a);const y={};_&16&&(y.id=m[4]),_&4&&(y.conf=m[2]),!c&&_&1&&(c=!0,y.value=m[0],ye(()=>c=!1)),f.$set(y)},i(m){d||(A(f.$$.fragment,m),d=!0)},o(m){L(f.$$.fragment,m),d=!1},d(m){m&&(k(e),k(u)),V(f,m)}}}function K6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y6,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function J6(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(r=s.options)==null?void 0:r.convertUrls,relative_urls:!1}))},[l,s,i,o]}class G6 extends ve{constructor(e){super(),be(this,e,J6,K6,me,{field:1,value:0})}}function Z6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].authUrl),r||(a=K(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].authUrl&&ae(l,u[0].authUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function X6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].tokenUrl),r||(a=K(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&ae(l,u[0].tokenUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Q6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].userApiUrl),r||(a=K(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&ae(l,u[0].userApiUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function x6(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[Z6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[X6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[Q6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),H(i,u,f),w(u,s,f),H(l,u,f),w(u,o,f),H(r,u,f),a=!0},p(u,[f]){const c={};f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const h={};f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){L(i.$$.fragment,u),L(l.$$.fragment,u),L(r.$$.fragment,u),a=!1},d(u){u&&(k(e),k(t),k(s),k(o)),V(i,u),V(l,u),V(r,u)}}}function eO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class ph extends ve{constructor(e){super(),be(this,e,eO,x6,me,{key:1,config:0})}}function tO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[2]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&ae(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function nO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[3]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&ae(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function iO(n){let e,t,i,s,l,o;return i=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[tO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[nO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s)),V(i,r),V(l,r)}}}function sO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class lO extends ve{constructor(e){super(),be(this,e,sO,iO,me,{key:1,config:0})}}function oO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[2]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&ae(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function rO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[3]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&ae(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function aO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].userApiUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[4]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].userApiUrl&&ae(l,d[0].userApiUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function uO(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[oO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[rO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[aO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),H(i,u,f),w(u,s,f),H(l,u,f),w(u,o,f),H(r,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.class="form-field "+(u[0].enabled?"required":"")),f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(u[0].enabled?"required":"")),f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const h={};f&1&&(h.class="form-field "+(u[0].enabled?"required":"")),f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){L(i.$$.fragment,u),L(l.$$.fragment,u),L(r.$$.fragment,u),a=!1},d(u){u&&(k(e),k(t),k(s),k(o)),V(i,u),V(l,u),V(r,u)}}}function fO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Fr extends ve{constructor(e){super(),be(this,e,fO,uO,me,{key:1,config:0})}}function cO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(l,"input",n[12]),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&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function dO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Team ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[3]),r||(a=K(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&8&&l.value!==u[3]&&ae(l,u[3])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function pO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Key ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[4]),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&ae(l,u[4])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function hO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",fo),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[6]),u||(f=[Te(je.call(null,s,{text:`Max ${fo} seconds (~${fo/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&ae(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function mO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Private key"),s=E(),l=v("textarea"),r=E(),a=v("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- + `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),s=!1,$e(l)}}}function _6(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,h=!1,g="";function m(B){V.removeByValue(f,B),t(2,f)}function _(B){V.pushUnique(f,B),t(2,f)}function y(B){V.isEmpty(u[B])||u.splice(B,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function C(B){var X,J;B.preventDefault(),t(9,h=!1);const Z=((X=B.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Z.length)){for(const W of Z){const le=s.length+u.length-f.length;if(((J=r.options)==null?void 0:J.maxSelect)<=le)break;u.push(W)}t(1,u)}}Gt(async()=>{t(10,g=await de.getAdminFileToken(o.collectionId))});const T=B=>m(B),$=B=>_(B);function O(B){a=B,t(0,a),t(6,i),t(4,r)}const M=B=>y(B);function D(B){u=B,t(1,u)}function I(B){te[B?"unshift":"push"](()=>{c=B,t(7,c)})}const F=()=>{for(let B of c.files)u.push(B);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function N(B){te[B?"unshift":"push"](()=>{d=B,t(8,d)})}const R=()=>{t(9,h=!0)},q=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"field"in B&&t(4,r=B.field),"value"in B&&t(0,a=B.value),"uploadedFiles"in B&&t(1,u=B.uploadedFiles),"deletedFileNames"in B&&t(2,f=B.deletedFileNames)},n.$$.update=()=>{var B,Z;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((B=r.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=V.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,h,g,l,m,_,y,C,T,$,O,M,D,I,F,P,N,R,q]}class b6 extends ve{constructor(e){super(),be(this,e,_6,g6,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function zp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function v6(n,e){e=zp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=zp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Bp(n,e,t){const i=n.slice();i[5]=e[t];const s=V.toArray(i[0][i[5]]).slice(0,5);return i[6]=s,i}function Up(n,e,t){const i=n.slice();return i[9]=e[t],i}function Wp(n){let e,t;return e=new ru({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&5&&(l.filename=i[9]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Yp(n){let e=!V.isEmpty(n[9]),t,i,s=e&&Wp(n);return{c(){s&&s.c(),t=Se()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&5&&(e=!V.isEmpty(l[9])),e?s?(s.p(l,o),o&5&&A(s,1)):(s=Wp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(ue(),L(s,1,1,()=>{s=null}),fe())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){l&&k(t),s&&s.d(l)}}}function Kp(n){let e,t,i=ge(n[6]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oL(h[m],1,1,()=>{h[m]=null});return{c(){e=v("div"),t=v("i"),s=E();for(let m=0;mt(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,u,f,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,s=((u=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:u.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,l=((c=(f=i==null?void 0:i.schema)==null?void 0:f.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,l,s,i,o]}class xo extends ve{constructor(e){super(),be(this,e,k6,y6,me,{record:0})}}function Jp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Gp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[9](i[49]);return i[6]=s,i}function Zp(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Xp(n){let e,t=!n[13]&&Qp(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[13]?t&&(t.d(1),t=null):t?t.p(i,s):(t=Qp(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function Qp(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&xp(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=xp(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function xp(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[35]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function w6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function S6(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function eh(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),b(e,t),i||(s=[Te(je.call(null,t,"Edit")),K(t,"keydown",An(n[27])),K(t,"click",An(l))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,$e(s)}}}function th(n,e){let t,i,s,l,o,r,a,u;function f(_,y){return _[6]?S6:w6}let c=f(e),d=c(e);l=new xo({props:{record:e[49]}});let h=!e[11]&&eh(e);function g(){return e[33](e[49])}function m(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=v("div"),d.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),h&&h.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,y){w(_,t,y),d.m(t,null),b(t,i),b(t,s),j(l,s,null),b(t,o),h&&h.m(t,null),r=!0,a||(u=[K(t,"click",g),K(t,"keydown",m)],a=!0)},p(_,y){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),l.$set(S),e[11]?h&&(h.d(1),h=null):h?h.p(e,y):(h=eh(e),h.c(),h.m(t,null)),(!r||y[0]&768)&&Q(t,"selected",e[6]),(!r||y[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(l.$$.fragment,_),r=!0)},o(_){L(l.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),H(l),h&&h.d(),a=!1,$e(u)}}}function nh(n){let e;return{c(){e=v("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ih(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[4]),o=U(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(l,r[4])},d(r){r&&(k(e),k(i),k(s),k(l),k(o))}}}function T6(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function C6(n){let e,t,i=ge(n[6]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o',l=E(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){w(f,e,c),j(t,e,null),b(e,i),b(e,s),w(f,l,c),o=!0,r||(a=K(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){L(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(l)),H(t),r=!1,a()}}}function sh(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[$6,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new Il({props:l}),te.push(()=>he(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function M6(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,h,g,m,_,y,S,C;t=new Wo({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&Zp(n),$=ge(n[8]);const O=R=>R[49].id;for(let R=0;R<$.length;R+=1){let q=Gp(n,$,R),B=O(q);r.set(B,o[R]=th(B,q))}let M=null;$.length||(M=Xp(n));let D=n[13]&&nh(),I=n[4]>1&&ih(n);const F=[C6,T6],P=[];function N(R,q){return R[6].length?0:1}return g=N(n),m=P[g]=F[g](n),{c(){e=v("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=v("div");for(let R=0;R1?I?I.p(R,q):(I=ih(R),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let Z=g;g=N(R),g===Z?P[g].p(R,q):(ue(),L(P[Z],1,1,()=>{P[Z]=null}),fe(),m=P[g],m?m.p(R,q):(m=P[g]=F[g](R),m.c()),A(m,1),m.m(_.parentNode,_))},i(R){if(!y){A(t.$$.fragment,R);for(let q=0;q<$.length;q+=1)A(o[q]);A(m),y=!0}},o(R){L(t.$$.fragment,R);for(let q=0;qCancel',t=E(),i=v("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function D6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[E6],header:[O6],default:[M6]},$$scope:{ctx:n}};for(let a=0;at(26,h=Oe));const g=pt(),m="picker_"+V.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",$=[],O=[],M=1,D=0,I=!1,F=!1;function P(){return t(2,T=""),t(8,$=[]),t(6,O=[]),R(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function R(){const Oe=V.toArray(_);if(!s||!Oe.length)return;t(24,F=!0);let ht=[];const Ft=Oe.slice(),rn=[];for(;Ft.length>0;){const xt=[];for(const tn of Ft.splice(0,no))xt.push(`id="${tn}"`);rn.push(de.collection(s).getFullList(no,{filter:xt.join("||"),$autoCancel:!1}))}try{await Promise.all(rn).then(xt=>{ht=ht.concat(...xt)}),t(6,O=[]);for(const xt of Oe){const tn=V.findByKey(ht,"id",xt);tn&&O.push(tn)}T.trim()||t(8,$=V.filterDuplicatesByKey(O.concat($))),t(24,F=!1)}catch(xt){xt.isAbort||(de.error(xt),t(24,F=!1))}}async function q(Oe=!1){if(s){t(3,I=!0),Oe&&(T.trim()?t(8,$=[]):t(8,$=V.toArray(O).slice()));try{const ht=Oe?1:M+1,Ft=V.getAllCollectionIdentifiers(l),rn=await de.collection(s).getList(ht,no,{filter:V.normalizeSearchFilter(T,Ft),sort:o?"":"-created",skipTotal:1,$cancelKey:m+"loadList"});t(8,$=V.filterDuplicatesByKey($.concat(rn.items))),M=rn.page,t(23,D=rn.items.length),t(3,I=!1)}catch(ht){ht.isAbort||(de.error(ht),t(3,I=!1))}}}function B(Oe){i==1?t(6,O=[Oe]):u&&(V.pushOrReplaceByKey(O,Oe),t(6,O))}function Z(Oe){V.removeByKey(O,"id",Oe.id),t(6,O)}function X(Oe){f(Oe)?Z(Oe):B(Oe)}function J(){var Oe;i!=1?t(20,_=O.map(ht=>ht.id)):t(20,_=((Oe=O==null?void 0:O[0])==null?void 0:Oe.id)||""),g("save",O),N()}function W(Oe){Fe.call(this,n,Oe)}const le=()=>N(),ee=()=>J(),ie=Oe=>t(2,T=Oe.detail),Ee=()=>C==null?void 0:C.show(),Ne=Oe=>C==null?void 0:C.show(Oe),Ve=Oe=>X(Oe),ze=(Oe,ht)=>{(ht.code==="Enter"||ht.code==="Space")&&(ht.preventDefault(),ht.stopPropagation(),X(Oe))},oe=()=>t(2,T=""),Ce=()=>{a&&!I&&q()},We=Oe=>Z(Oe);function _t(Oe){O=Oe,t(6,O)}function Xe(Oe){te[Oe?"unshift":"push"](()=>{S=Oe,t(1,S)})}function Je(Oe){Fe.call(this,n,Oe)}function wt(Oe){Fe.call(this,n,Oe)}function _e(Oe){te[Oe?"unshift":"push"](()=>{C=Oe,t(7,C)})}const ke=Oe=>{V.removeByKey($,"id",Oe.detail.record.id),$.unshift(Oe.detail.record),t(8,$),B(Oe.detail.record)},Ge=Oe=>{V.removeByKey($,"id",Oe.detail.id),t(8,$),Z(Oe.detail)};return n.$$set=Oe=>{e=He(He({},e),Qt(Oe)),t(19,d=et(e,c)),"value"in Oe&&t(20,_=Oe.value),"field"in Oe&&t(21,y=Oe.field)},n.$$.update=()=>{var Oe,ht;n.$$.dirty[0]&2097152&&t(4,i=((Oe=y==null?void 0:y.options)==null?void 0:Oe.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(ht=y==null?void 0:y.options)==null?void 0:ht.collectionId),n.$$.dirty[0]&100663296&&t(5,l=h.find(Ft=>Ft.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(l==null?void 0:l.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=I||F),n.$$.dirty[0]&8388608&&t(12,a=D==no),n.$$.dirty[0]&80&&t(10,u=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,f=function(Ft){return V.findByKey(O,"id",Ft.id)})},[N,S,T,I,i,l,O,C,$,f,u,o,a,r,q,B,Z,X,J,d,_,y,P,D,F,s,h,W,le,ee,ie,Ee,Ne,Ve,ze,oe,Ce,We,_t,Xe,Je,wt,_e,ke,Ge]}class I6 extends ve{constructor(e){super(),be(this,e,A6,D6,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function lh(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function oh(n,e,t){const i=n.slice();return i[26]=e[t],i}function rh(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(l,o){w(l,e,o),i||(s=Te(t=je.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(l,o){t&&At(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+l[6].join(", ")})},d(l){l&&k(e),i=!1,s()}}}function ah(n){let e,t=n[5]&&uh(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=uh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function uh(n){let e,t=ge(V.toArray(n[0]).slice(0,10)),i=[];for(let s=0;s ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function L6(n){let e,t,i,s,l,o,r,a,u,f;i=new xo({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='',r=E(),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"),Q(e,"dragging",n[24]),Q(e,"dragover",n[25])},m(d,h){w(d,e,h),b(e,t),j(i,t,null),b(e,s),b(e,l),b(l,o),w(d,r,h),a=!0,u||(f=[Te(je.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(d,h){n=d;const g={};h&16&&(g.record=n[21]),i.$set(g),(!a||h&16777216)&&Q(e,"dragging",n[24]),(!a||h&33554432)&&Q(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){L(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),H(i),u=!1,$e(f)}}}function ch(n,e){let t,i,s,l;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[L6,({dragging:a,dragover:u})=>({24:a,25:u}),({dragging:a,dragover:u})=>(a?16777216:0)|(u?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Il({props:r}),te.push(()=>he(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[23]),u&128&&(f.disabled=!e[7]),u&587202576&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function P6(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$=n[6].length&&rh(n),O=ge(n[4]);const M=I=>I[21].id;for(let I=0;I Open picker',p(t,"class",i=wi(V.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(I,F){w(I,e,F),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),$&&$.m(e,null),w(I,f,F),w(I,c,F),b(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[15](e);let o={value:n[0],field:n[2]};return i=new I6({props:o}),n[16](i),i.$on("save",n[17]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(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&537919735&&(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){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const dh=100;function N6(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const M=V.toArray(l);return t(4,a=a.filter(D=>M.includes(D.id))),M.length!=a.length}async function h(){var F,P;const M=V.toArray(l);if(t(4,a=[]),t(6,c=[]),!((F=s==null?void 0:s.options)!=null&&F.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const D=M.slice(),I=[];for(;D.length>0;){const N=[];for(const R of D.splice(0,dh))N.push(`id="${R}"`);I.push(de.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(dh,{filter:N.join("||"),$autoCancel:!1}))}try{let N=[];await Promise.all(I).then(R=>{N=N.concat(...R)});for(const R of M){const q=V.findByKey(N,"id",R);q?a.push(q):c.push(R)}t(4,a),m()}catch(N){de.error(N)}t(5,u=!1)}function g(M){V.removeByKey(a,"id",M.id),t(4,a),m()}function m(){var M;i?t(0,l=a.map(D=>D.id)):t(0,l=((M=a[0])==null?void 0:M.id)||"")}Is(()=>{clearTimeout(f)});const _=M=>g(M);function y(M){a=M,t(4,a)}const S=()=>{m()},C=()=>o==null?void 0:o.show();function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){te[M?"unshift":"push"](()=>{o=M,t(1,o)})}const O=M=>{var D;t(4,a=M.detail||[]),t(0,l=i?a.map(I=>I.id):((D=a[0])==null?void 0:D.id)||"")};return n.$$set=M=>{"field"in M&&t(2,s=M.field),"value"in M&&t(0,l=M.value),"picker"in M&&t(1,o=M.picker)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(7,i=((M=s.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(h,0)))},[l,o,s,r,a,u,c,i,g,m,f,_,y,S,C,T,$,O]}class R6 extends ve{constructor(e){super(),be(this,e,N6,F6,me,{field:2,value:0,picker:1})}}const q6=["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"],j6=(n,e)=>{q6.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function H6(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),jr(e,"visibility","hidden")},m(t,i){w(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[18](null)}}}function V6(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[17](null)}}}function z6(n){let e;function t(l,o){return l[1]?V6:H6}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){w(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:x,o:x,d(l){l&&k(e),s.d(),n[19](null)}}}const $1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),B6=()=>{let n={listeners:[],scriptId:$1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let U6=B6();function W6(n,e,t){var i;let{id:s=$1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:h=""}=e,{cssClass:g="tinymce-wrapper"}=e,m,_,y,S=d,C=o;const T=pt(),$=()=>{const P=(()=>typeof window<"u"?window:global)();return P&&P.tinymce?P.tinymce:null},O=()=>{const F=Object.assign(Object.assign({},f),{target:_,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:P=>{t(14,y=P),P.on("init",()=>{P.setContent(d),P.on(c,()=>{t(15,S=P.getContent()),S!==d&&(t(5,d=S),t(6,h=P.getContent({format:"text"})))})}),j6(P,T),typeof f.setup=="function"&&f.setup(P)}});t(4,_.style.visibility="",_),$().init(F)};Gt(()=>{if($()!==null)O();else{const F=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;U6.load(m.ownerDocument,F,()=>{O()})}}),Is(()=>{var F;y&&((F=$())===null||F===void 0||F.remove(y))});function M(F){te[F?"unshift":"push"](()=>{_=F,t(4,_)})}function D(F){te[F?"unshift":"push"](()=>{_=F,t(4,_)})}function I(F){te[F?"unshift":"push"](()=>{m=F,t(3,m)})}return n.$$set=F=>{"id"in F&&t(0,s=F.id),"inline"in F&&t(1,l=F.inline),"disabled"in F&&t(7,o=F.disabled),"apiKey"in F&&t(8,r=F.apiKey),"channel"in F&&t(9,a=F.channel),"scriptSrc"in F&&t(10,u=F.scriptSrc),"conf"in F&&t(11,f=F.conf),"modelEvents"in F&&t(12,c=F.modelEvents),"value"in F&&t(5,d=F.value),"text"in F&&t(6,h=F.text),"cssClass"in F&&t(2,g=F.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&S!==d&&(y.setContent(d),t(6,h=y.getContent({format:"text"}))),y&&o!==C&&(t(16,C=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,g,m,_,d,h,o,r,a,u,f,c,i,y,S,C,M,D,I]}class au extends ve{constructor(e){super(),be(this,e,W6,z6,me,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function Y6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(m){n[3](m)}let g={id:n[4],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:n[2]};return n[0]!==void 0&&(g.value=n[0]),f=new au({props:g}),te.push(()=>he(f,"value",h)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),z(f.$$.fragment),p(t,"class",i=V.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(m,u,_),j(f,m,_),d=!0},p(m,_){(!d||_&2&&i!==(i=V.getFieldTypeIcon(m[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=m[1].name+"")&&se(r,o),(!d||_&16&&a!==(a=m[4]))&&p(e,"for",a);const y={};_&16&&(y.id=m[4]),_&4&&(y.conf=m[2]),!c&&_&1&&(c=!0,y.value=m[0],ye(()=>c=!1)),f.$set(y)},i(m){d||(A(f.$$.fragment,m),d=!0)},o(m){L(f.$$.fragment,m),d=!1},d(m){m&&(k(e),k(u)),H(f,m)}}}function K6(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y6,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function J6(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=Object.assign(V.defaultEditorOptions(),{convert_urls:(r=s.options)==null?void 0:r.convertUrls,relative_urls:!1}))},[l,s,i,o]}class G6 extends ve{constructor(e){super(),be(this,e,J6,K6,me,{field:1,value:0})}}function Z6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].authUrl),r||(a=K(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].authUrl&&ae(l,u[0].authUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function X6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].tokenUrl),r||(a=K(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&ae(l,u[0].tokenUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Q6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].userApiUrl),r||(a=K(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&ae(l,u[0].userApiUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function x6(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[Z6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[X6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[Q6,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),j(i,u,f),w(u,s,f),j(l,u,f),w(u,o,f),j(r,u,f),a=!0},p(u,[f]){const c={};f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const h={};f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){L(i.$$.fragment,u),L(l.$$.fragment,u),L(r.$$.fragment,u),a=!1},d(u){u&&(k(e),k(t),k(s),k(o)),H(i,u),H(l,u),H(r,u)}}}function eO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class ph extends ve{constructor(e){super(),be(this,e,eO,x6,me,{key:1,config:0})}}function tO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[2]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&ae(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function nO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[3]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&ae(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function iO(n){let e,t,i,s,l,o;return i=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[tO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[nO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),j(i,r,a),w(r,s,a),j(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s)),H(i,r),H(l,r)}}}function sO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class lO extends ve{constructor(e){super(),be(this,e,sO,iO,me,{key:1,config:0})}}function oO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[2]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&ae(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function rO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[3]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&ae(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function aO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("User API URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0].userApiUrl),w(d,a,h),w(d,u,h),f||(c=K(l,"input",n[4]),f=!0)},p(d,h){h&32&&i!==(i=d[5])&&p(e,"for",i),h&32&&o!==(o=d[5])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].userApiUrl&&ae(l,d[0].userApiUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function uO(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[oO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[rO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[aO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),p(e,"class","section-title")},m(u,f){w(u,e,f),w(u,t,f),j(i,u,f),w(u,s,f),j(l,u,f),w(u,o,f),j(r,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.class="form-field "+(u[0].enabled?"required":"")),f&2&&(c.name=u[1]+".authUrl"),f&97&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(u[0].enabled?"required":"")),f&2&&(d.name=u[1]+".tokenUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),l.$set(d);const h={};f&1&&(h.class="form-field "+(u[0].enabled?"required":"")),f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){L(i.$$.fragment,u),L(l.$$.fragment,u),L(r.$$.fragment,u),a=!1},d(u){u&&(k(e),k(t),k(s),k(o)),H(i,u),H(l,u),H(r,u)}}}function fO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Fr extends ve{constructor(e){super(),be(this,e,fO,uO,me,{key:1,config:0})}}function cO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(l,"input",n[12]),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&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function dO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Team ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[3]),r||(a=K(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&8&&l.value!==u[3]&&ae(l,u[3])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function pO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Key ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[4]),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&ae(l,u[4])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function hO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",fo),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[6]),u||(f=[Te(je.call(null,s,{text:`Max ${fo} seconds (~${fo/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&ae(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function mO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Private key"),s=E(),l=v("textarea"),r=E(),a=v("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[5]),w(c,r,d),w(c,a,d),u||(f=K(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&&ae(l,c[5])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[cO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[dO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[pO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[hO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[mO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),z(m.$$.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(C,T){w(C,e,T),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(t,g),H(m,t,null),_=!0,y||(S=K(e,"submit",xe(n[17])),y=!0)},p(C,T){const $={};T&25165828&&($.$$scope={dirty:T,ctx:C}),s.$set($);const O={};T&25165832&&(O.$$scope={dirty:T,ctx:C}),r.$set(O);const M={};T&25165840&&(M.$$scope={dirty:T,ctx:C}),f.$set(M);const D={};T&25165888&&(D.$$scope={dirty:T,ctx:C}),h.$set(D);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:C}),m.$set(I)},i(C){_||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(h.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){L(s.$$.fragment,C),L(r.$$.fragment,C),L(f.$$.fragment,C),L(h.$$.fragment,C),L(m.$$.fragment,C),_=!1},d(C){C&&k(e),V(s),V(r),V(f),V(h),V(m),y=!1,S()}}}function _O(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function bO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("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){w(c,e,d),b(e,t),w(c,i,d),w(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&&(k(e),k(i),k(s)),u=!1,f()}}}function vO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[bO],header:[_O],default:[gO]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){H(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){L(e.$$.fragment,s),t=!1},d(s){n[19](null),V(e,s)}}}const fo=15777e3;function yO(n,e,t){let i;const s=pt(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function h(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,c=F.duration||fo),en({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function m(){t(7,d=!0);try{const F=await de.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),jt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){de.error(F)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function C(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const $=()=>m(),O=()=>!d;function M(F){te[F?"unshift":"push"](()=>{o=F,t(1,o)})}function D(F){Fe.call(this,n,F)}function I(F){Fe.call(this,n,F)}return t(8,i=!0),[g,o,r,a,u,f,c,d,i,l,m,h,_,y,S,C,T,$,O,M,D,I]}class kO extends ve{constructor(e){super(),be(this,e,yO,vO,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function wO(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new kO({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=E(),s=v("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,h){w(d,e,h),b(e,t),b(e,i),b(e,s),w(d,o,h),H(r,d,h),a=!0,u||(f=K(e,"click",n[3]),u=!0)},p(d,[h]){(!a||h&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const g={};r.$set(g)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){L(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),V(r,d),u=!1,f()}}}function SO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class TO extends ve{constructor(e){super(),be(this,e,SO,wO,me,{key:1,config:0})}}const co=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:TO},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:lO},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:ph},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:ph},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr}];function hh(n,e,t){const i=n.slice();return i[9]=e[t],i}function CO(n){let e;return{c(){e=v("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $O(n){let e,t=ge(n[1]),i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function mh(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",h,g,m,_,y,S;function C(){return n[6](n[9])}return{c(){var T;e=v("div"),t=v("figure"),i=v("img"),l=E(),o=v("span"),a=U(r),u=E(),f=v("div"),c=U("ID: "),h=U(d),g=E(),m=v("button"),m.innerHTML='',_=E(),_n(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(m,"type","button"),p(m,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(e,l),b(e,o),b(o,a),b(e,u),b(e,f),b(f,c),b(f,h),b(e,g),b(e,m),b(e,_),y||(S=K(m,"click",C),y=!0)},p(T,$){var O;n=T,$&2&&!_n(i.src,s="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",s),$&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),$&2&&d!==(d=n[9].providerId+"")&&se(h,d)},d(T){T&&k(e),y=!1,S()}}}function OO(n){let e;function t(l,o){var r;return l[2]?MO:(r=l[0])!=null&&r.id&&l[1].length?$O:CO}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function EO(n,e,t){const i=pt();let{record:s}=e,l=[],o=!1;function r(d){return co.find(h=>h.key==d+"Auth")||{}}function a(d){var h;return((h=r(d))==null?void 0:h.title)||j.sentenize(d,!1)}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await de.collection(s.collectionId).listExternalAuths(s.id))}catch(d){de.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||mn(`Do you really want to unlink the ${a(d)} provider?`,()=>de.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{jt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(h=>{de.error(h)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class DO extends ve{constructor(e){super(),be(this,e,EO,OO,me,{record:0})}}function gh(n,e,t){const i=n.slice();return i[67]=e[t],i[68]=e,i[69]=t,i}function _h(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`The record has previous unsaved changes. - `),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),h=!0,g||(m=[K(r,"click",n[37]),Te(je.call(null,u,"Discard draft")),K(u,"click",xe(n[38]))],g=!0)},p:x,i(_){h||(d&&d.end(1),h=!0)},o(_){_&&(d=va(e,it,{duration:150})),h=!1},d(_){_&&k(e),_&&d&&d.end(),g=!1,$e(m)}}}function bh(n){let e,t,i;return t=new T1({props:{model:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.model=s[3]),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function AO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_=!n[6]&&bh(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),_&&_.c(),u=E(),f=v("input"),p(t,"class",wi(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[70]),p(f,"type","text"),p(f,"id",c=n[70]),p(f,"placeholder","Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=d=!n[6]},m(y,S){w(y,e,S),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(y,a,S),_&&_.m(y,S),w(y,u,S),w(y,f,S),ae(f,n[3].id),h=!0,g||(m=K(f,"input",n[39]),g=!0)},p(y,S){(!h||S[2]&256&&r!==(r=y[70]))&&p(e,"for",r),y[6]?_&&(ue(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(y,S),S[0]&64&&A(_,1)):(_=bh(y),_.c(),A(_,1),_.m(u.parentNode,u)),(!h||S[2]&256&&c!==(c=y[70]))&&p(f,"id",c),(!h||S[0]&64&&d!==(d=!y[6]))&&(f.readOnly=d),S[0]&8&&f.value!==y[3].id&&ae(f,y[3].id)},i(y){h||(A(_),h=!0)},o(y){L(_),h=!1},d(y){y&&(k(e),k(a),k(u),k(f)),_&&_.d(y),g=!1,m()}}}function vh(n){var u,f;let e,t,i,s,l;function o(c){n[40](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new s5({props:r}),te.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&yh();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var g,m;const h={};d[0]&64&&(h.isNew=c[6]),d[0]&1&&(h.collection=c[0]),!t&&d[0]&8&&(t=!0,h.record=c[3],ye(()=>t=!1)),e.$set(h),(m=(g=c[0])==null?void 0:g.schema)!=null&&m.length?a||(a=yh(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){c&&(k(i),k(s)),V(e,c),a&&a.d(c)}}}function yh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function IO(n){let e,t,i;function s(o){n[53](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new R6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function LO(n){let e,t,i,s,l;function o(f){n[50](f,n[67])}function r(f){n[51](f,n[67])}function a(f){n[52](f,n[67])}let u={field:n[67],record:n[3]};return n[3][n[67].name]!==void 0&&(u.value=n[3][n[67].name]),n[4][n[67].name]!==void 0&&(u.uploadedFiles=n[4][n[67].name]),n[5][n[67].name]!==void 0&&(u.deletedFileNames=n[5][n[67].name]),e=new b6({props:u}),te.push(()=>he(e,"value",o)),te.push(()=>he(e,"uploadedFiles",r)),te.push(()=>he(e,"deletedFileNames",a)),{c(){z(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[67]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[67].name],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[67].name],ye(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[67].name],ye(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function PO(n){let e,t,i;function s(o){n[49](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new U5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FO(n){let e,t,i;function s(o){n[48](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new F5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function NO(n){let e,t,i;function s(o){n[47](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new A5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function RO(n){let e,t,i;function s(o){n[46](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new G6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function qO(n){let e,t,i;function s(o){n[45](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new M5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function jO(n){let e,t,i;function s(o){n[44](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new S5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function HO(n){let e,t,i;function s(o){n[43](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new v5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function VO(n){let e,t,i;function s(o){n[42](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new m5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zO(n){let e,t,i;function s(o){n[41](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new c5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function kh(n,e){let t,i,s,l,o;const r=[zO,VO,HO,jO,qO,RO,NO,FO,PO,LO,IO],a=[];function u(f,c){return f[67].type==="text"?0:f[67].type==="number"?1:f[67].type==="bool"?2:f[67].type==="email"?3:f[67].type==="url"?4:f[67].type==="editor"?5:f[67].type==="date"?6:f[67].type==="select"?7:f[67].type==="json"?8:f[67].type==="file"?9:f[67].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Se(),s&&s.c(),l=Se(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(ue(),L(a[d],1,1,()=>{a[d]=null}),fe()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){L(s),o=!1},d(f){f&&(k(t),k(l)),~i&&a[i].d(f)}}}function wh(n){let e,t,i;return t=new DO({props:{record:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[12]===yl)},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&4096)&&Q(e,"active",s[12]===yl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function BO(n){var S;let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,h=!n[7]&&n[9]&&_h(n);s=new pe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[AO,({uniqueId:C})=>({70:C}),({uniqueId:C})=>[0,0,C?256:0]]},$$scope:{ctx:n}}});let g=n[13]&&vh(n),m=ge(((S=n[0])==null?void 0:S.schema)||[]);const _=C=>C[67].name;for(let C=0;C{h=null}),fe());const $={};T[0]&64&&($.class="form-field "+(C[6]?"":"readonly")),T[0]&72|T[2]&768&&($.$$scope={dirty:T,ctx:C}),s.$set($),C[13]?g?(g.p(C,T),T[0]&8192&&A(g,1)):(g=vh(C),g.c(),A(g,1),g.m(t,o)):g&&(ue(),L(g,1,1,()=>{g=null}),fe()),T[0]&57&&(m=ge(((O=C[0])==null?void 0:O.schema)||[]),ue(),r=vt(r,T,_,1,C,m,a,t,Ut,kh,null,gh),fe()),(!f||T[0]&4096)&&Q(t,"active",C[12]===ss),C[13]&&!C[6]?y?(y.p(C,T),T[0]&8256&&A(y,1)):(y=wh(C),y.c(),A(y,1),y.m(e,null)):y&&(ue(),L(y,1,1,()=>{y=null}),fe())},i(C){if(!f){A(h),A(s.$$.fragment,C),A(g);for(let T=0;T Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ch(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function UO(n){let e,t,i,s,l,o,r,a=n[13]&&!n[2].verified&&n[2].email&&Th(n),u=n[13]&&n[2].email&&Ch(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=' Duplicate',s=E(),l=v("button"),l.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[K(i,"click",n[33]),K(l,"click",An(xe(n[34])))],o=!0)},p(f,c){f[13]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Th(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[13]&&f[2].email?u?u.p(f,c):(u=Ch(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(k(e),k(t),k(i),k(s),k(l)),a&&a.d(f),u&&u.d(f),o=!1,$e(r)}}}function $h(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[12]===ss),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[12]===yl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[K(t,"click",n[35]),K(s,"click",n[36])],l=!0)},p(r,a){a[0]&4096&&Q(t,"active",r[12]===ss),a[0]&4096&&Q(s,"active",r[12]===yl)},d(r){r&&k(e),l=!1,$e(o)}}}function WO(n){var m;let e,t=n[6]?"New":"Edit",i,s,l,o=((m=n[0])==null?void 0:m.name)+"",r,a,u,f,c,d,h=!n[6]&&Sh(n),g=n[13]&&!n[6]&&$h(n);return{c(){e=v("h4"),i=U(t),s=E(),l=v("strong"),r=U(o),a=U(" record"),u=E(),h&&h.c(),f=E(),g&&g.c(),c=Se(),p(e,"class","panel-title svelte-qc5ngu")},m(_,y){w(_,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),w(_,u,y),h&&h.m(_,y),w(_,f,y),g&&g.m(_,y),w(_,c,y),d=!0},p(_,y){var S;(!d||y[0]&64)&&t!==(t=_[6]?"New":"Edit")&&se(i,t),(!d||y[0]&1)&&o!==(o=((S=_[0])==null?void 0:S.name)+"")&&se(r,o),_[6]?h&&(ue(),L(h,1,1,()=>{h=null}),fe()):h?(h.p(_,y),y[0]&64&&A(h,1)):(h=Sh(_),h.c(),A(h,1),h.m(f.parentNode,f)),_[13]&&!_[6]?g?g.p(_,y):(g=$h(_),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null)},i(_){d||(A(h),d=!0)},o(_){L(h),d=!1},d(_){_&&(k(e),k(u),k(f),k(c)),h&&h.d(_),g&&g.d(_)}}}function YO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[10],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[16]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[14]||n[10],Q(s,"btn-loading",n[10])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=K(e,"click",n[30]),u=!0)},p(c,d){d[0]&1024&&(e.disabled=c[10]),d[0]&64&&o!==(o=c[6]?"Create":"Save changes")&&se(r,o),d[0]&17408&&a!==(a=!c[14]||c[10])&&(s.disabled=a),d[0]&1024&&Q(s,"btn-loading",c[10])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function KO(n){let e,t,i={class:` +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[5]),w(c,r,d),w(c,a,d),u||(f=K(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&&ae(l,c[5])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[cO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[dO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[pO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[hO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[mO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),z(m.$$.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(C,T){w(C,e,T),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),b(t,a),b(t,u),j(f,u,null),b(t,c),b(t,d),j(h,d,null),b(t,g),j(m,t,null),_=!0,y||(S=K(e,"submit",xe(n[17])),y=!0)},p(C,T){const $={};T&25165828&&($.$$scope={dirty:T,ctx:C}),s.$set($);const O={};T&25165832&&(O.$$scope={dirty:T,ctx:C}),r.$set(O);const M={};T&25165840&&(M.$$scope={dirty:T,ctx:C}),f.$set(M);const D={};T&25165888&&(D.$$scope={dirty:T,ctx:C}),h.$set(D);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:C}),m.$set(I)},i(C){_||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(h.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){L(s.$$.fragment,C),L(r.$$.fragment,C),L(f.$$.fragment,C),L(h.$$.fragment,C),L(m.$$.fragment,C),_=!1},d(C){C&&k(e),H(s),H(r),H(f),H(h),H(m),y=!1,S()}}}function _O(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function bO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("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){w(c,e,d),b(e,t),w(c,i,d),w(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&&(k(e),k(i),k(s)),u=!1,f()}}}function vO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[bO],header:[_O],default:[gO]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){j(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){L(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const fo=15777e3;function yO(n,e,t){let i;const s=pt(),l="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function h(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,c=F.duration||fo),en({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function m(){t(7,d=!0);try{const F=await de.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),jt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){de.error(F)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function C(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const $=()=>m(),O=()=>!d;function M(F){te[F?"unshift":"push"](()=>{o=F,t(1,o)})}function D(F){Fe.call(this,n,F)}function I(F){Fe.call(this,n,F)}return t(8,i=!0),[g,o,r,a,u,f,c,d,i,l,m,h,_,y,S,C,T,$,O,M,D,I]}class kO extends ve{constructor(e){super(),be(this,e,yO,vO,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function wO(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new kO({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=E(),s=v("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,h){w(d,e,h),b(e,t),b(e,i),b(e,s),w(d,o,h),j(r,d,h),a=!0,u||(f=K(e,"click",n[3]),u=!0)},p(d,[h]){(!a||h&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const g={};r.$set(g)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){L(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),H(r,d),u=!1,f()}}}function SO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class TO extends ve{constructor(e){super(),be(this,e,SO,wO,me,{key:1,config:0})}}const co=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:TO},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:lO},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:ph},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:ph},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Fr}];function hh(n,e,t){const i=n.slice();return i[9]=e[t],i}function CO(n){let e;return{c(){e=v("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $O(n){let e,t=ge(n[1]),i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function mh(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",h,g,m,_,y,S;function C(){return n[6](n[9])}return{c(){var T;e=v("div"),t=v("figure"),i=v("img"),l=E(),o=v("span"),a=U(r),u=E(),f=v("div"),c=U("ID: "),h=U(d),g=E(),m=v("button"),m.innerHTML='',_=E(),_n(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(m,"type","button"),p(m,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(e,l),b(e,o),b(o,a),b(e,u),b(e,f),b(f,c),b(f,h),b(e,g),b(e,m),b(e,_),y||(S=K(m,"click",C),y=!0)},p(T,$){var O;n=T,$&2&&!_n(i.src,s="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",s),$&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),$&2&&d!==(d=n[9].providerId+"")&&se(h,d)},d(T){T&&k(e),y=!1,S()}}}function OO(n){let e;function t(l,o){var r;return l[2]?MO:(r=l[0])!=null&&r.id&&l[1].length?$O:CO}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function EO(n,e,t){const i=pt();let{record:s}=e,l=[],o=!1;function r(d){return co.find(h=>h.key==d+"Auth")||{}}function a(d){var h;return((h=r(d))==null?void 0:h.title)||V.sentenize(d,!1)}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await de.collection(s.collectionId).listExternalAuths(s.id))}catch(d){de.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||mn(`Do you really want to unlink the ${a(d)} provider?`,()=>de.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{jt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(h=>{de.error(h)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class DO extends ve{constructor(e){super(),be(this,e,EO,OO,me,{record:0})}}function gh(n,e,t){const i=n.slice();return i[67]=e[t],i[68]=e,i[69]=t,i}function _h(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`The record has previous unsaved changes. + `),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),h=!0,g||(m=[K(r,"click",n[37]),Te(je.call(null,u,"Discard draft")),K(u,"click",xe(n[38]))],g=!0)},p:x,i(_){h||(d&&d.end(1),h=!0)},o(_){_&&(d=va(e,it,{duration:150})),h=!1},d(_){_&&k(e),_&&d&&d.end(),g=!1,$e(m)}}}function bh(n){let e,t,i;return t=new T1({props:{model:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.model=s[3]),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function AO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_=!n[6]&&bh(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),_&&_.c(),u=E(),f=v("input"),p(t,"class",wi(V.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[70]),p(f,"type","text"),p(f,"id",c=n[70]),p(f,"placeholder","Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=d=!n[6]},m(y,S){w(y,e,S),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(y,a,S),_&&_.m(y,S),w(y,u,S),w(y,f,S),ae(f,n[3].id),h=!0,g||(m=K(f,"input",n[39]),g=!0)},p(y,S){(!h||S[2]&256&&r!==(r=y[70]))&&p(e,"for",r),y[6]?_&&(ue(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(y,S),S[0]&64&&A(_,1)):(_=bh(y),_.c(),A(_,1),_.m(u.parentNode,u)),(!h||S[2]&256&&c!==(c=y[70]))&&p(f,"id",c),(!h||S[0]&64&&d!==(d=!y[6]))&&(f.readOnly=d),S[0]&8&&f.value!==y[3].id&&ae(f,y[3].id)},i(y){h||(A(_),h=!0)},o(y){L(_),h=!1},d(y){y&&(k(e),k(a),k(u),k(f)),_&&_.d(y),g=!1,m()}}}function vh(n){var u,f;let e,t,i,s,l;function o(c){n[40](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new s5({props:r}),te.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&yh();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(c,d){j(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var g,m;const h={};d[0]&64&&(h.isNew=c[6]),d[0]&1&&(h.collection=c[0]),!t&&d[0]&8&&(t=!0,h.record=c[3],ye(()=>t=!1)),e.$set(h),(m=(g=c[0])==null?void 0:g.schema)!=null&&m.length?a||(a=yh(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){c&&(k(i),k(s)),H(e,c),a&&a.d(c)}}}function yh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function IO(n){let e,t,i;function s(o){n[53](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new R6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function LO(n){let e,t,i,s,l;function o(f){n[50](f,n[67])}function r(f){n[51](f,n[67])}function a(f){n[52](f,n[67])}let u={field:n[67],record:n[3]};return n[3][n[67].name]!==void 0&&(u.value=n[3][n[67].name]),n[4][n[67].name]!==void 0&&(u.uploadedFiles=n[4][n[67].name]),n[5][n[67].name]!==void 0&&(u.deletedFileNames=n[5][n[67].name]),e=new b6({props:u}),te.push(()=>he(e,"value",o)),te.push(()=>he(e,"uploadedFiles",r)),te.push(()=>he(e,"deletedFileNames",a)),{c(){z(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[67]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[67].name],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[67].name],ye(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[67].name],ye(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function PO(n){let e,t,i;function s(o){n[49](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new U5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function FO(n){let e,t,i;function s(o){n[48](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new F5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function NO(n){let e,t,i;function s(o){n[47](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new A5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function RO(n){let e,t,i;function s(o){n[46](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new G6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function qO(n){let e,t,i;function s(o){n[45](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new M5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jO(n){let e,t,i;function s(o){n[44](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new S5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function HO(n){let e,t,i;function s(o){n[43](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new v5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VO(n){let e,t,i;function s(o){n[42](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new m5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function zO(n){let e,t,i;function s(o){n[41](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new c5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function kh(n,e){let t,i,s,l,o;const r=[zO,VO,HO,jO,qO,RO,NO,FO,PO,LO,IO],a=[];function u(f,c){return f[67].type==="text"?0:f[67].type==="number"?1:f[67].type==="bool"?2:f[67].type==="email"?3:f[67].type==="url"?4:f[67].type==="editor"?5:f[67].type==="date"?6:f[67].type==="select"?7:f[67].type==="json"?8:f[67].type==="file"?9:f[67].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Se(),s&&s.c(),l=Se(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(ue(),L(a[d],1,1,()=>{a[d]=null}),fe()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){L(s),o=!1},d(f){f&&(k(t),k(l)),~i&&a[i].d(f)}}}function wh(n){let e,t,i;return t=new DO({props:{record:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[12]===yl)},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&4096)&&Q(e,"active",s[12]===yl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function BO(n){var S;let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,h=!n[7]&&n[9]&&_h(n);s=new pe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[AO,({uniqueId:C})=>({70:C}),({uniqueId:C})=>[0,0,C?256:0]]},$$scope:{ctx:n}}});let g=n[13]&&vh(n),m=ge(((S=n[0])==null?void 0:S.schema)||[]);const _=C=>C[67].name;for(let C=0;C{h=null}),fe());const $={};T[0]&64&&($.class="form-field "+(C[6]?"":"readonly")),T[0]&72|T[2]&768&&($.$$scope={dirty:T,ctx:C}),s.$set($),C[13]?g?(g.p(C,T),T[0]&8192&&A(g,1)):(g=vh(C),g.c(),A(g,1),g.m(t,o)):g&&(ue(),L(g,1,1,()=>{g=null}),fe()),T[0]&57&&(m=ge(((O=C[0])==null?void 0:O.schema)||[]),ue(),r=vt(r,T,_,1,C,m,a,t,Ut,kh,null,gh),fe()),(!f||T[0]&4096)&&Q(t,"active",C[12]===ss),C[13]&&!C[6]?y?(y.p(C,T),T[0]&8256&&A(y,1)):(y=wh(C),y.c(),A(y,1),y.m(e,null)):y&&(ue(),L(y,1,1,()=>{y=null}),fe())},i(C){if(!f){A(h),A(s.$$.fragment,C),A(g);for(let T=0;T Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ch(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function UO(n){let e,t,i,s,l,o,r,a=n[13]&&!n[2].verified&&n[2].email&&Th(n),u=n[13]&&n[2].email&&Ch(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=' Duplicate',s=E(),l=v("button"),l.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[K(i,"click",n[33]),K(l,"click",An(xe(n[34])))],o=!0)},p(f,c){f[13]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Th(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[13]&&f[2].email?u?u.p(f,c):(u=Ch(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(k(e),k(t),k(i),k(s),k(l)),a&&a.d(f),u&&u.d(f),o=!1,$e(r)}}}function $h(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[12]===ss),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[12]===yl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[K(t,"click",n[35]),K(s,"click",n[36])],l=!0)},p(r,a){a[0]&4096&&Q(t,"active",r[12]===ss),a[0]&4096&&Q(s,"active",r[12]===yl)},d(r){r&&k(e),l=!1,$e(o)}}}function WO(n){var m;let e,t=n[6]?"New":"Edit",i,s,l,o=((m=n[0])==null?void 0:m.name)+"",r,a,u,f,c,d,h=!n[6]&&Sh(n),g=n[13]&&!n[6]&&$h(n);return{c(){e=v("h4"),i=U(t),s=E(),l=v("strong"),r=U(o),a=U(" record"),u=E(),h&&h.c(),f=E(),g&&g.c(),c=Se(),p(e,"class","panel-title svelte-qc5ngu")},m(_,y){w(_,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),w(_,u,y),h&&h.m(_,y),w(_,f,y),g&&g.m(_,y),w(_,c,y),d=!0},p(_,y){var S;(!d||y[0]&64)&&t!==(t=_[6]?"New":"Edit")&&se(i,t),(!d||y[0]&1)&&o!==(o=((S=_[0])==null?void 0:S.name)+"")&&se(r,o),_[6]?h&&(ue(),L(h,1,1,()=>{h=null}),fe()):h?(h.p(_,y),y[0]&64&&A(h,1)):(h=Sh(_),h.c(),A(h,1),h.m(f.parentNode,f)),_[13]&&!_[6]?g?g.p(_,y):(g=$h(_),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null)},i(_){d||(A(h),d=!0)},o(_){L(h),d=!1},d(_){_&&(k(e),k(u),k(f),k(c)),h&&h.d(_),g&&g.d(_)}}}function YO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[10],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[16]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[14]||n[10],Q(s,"btn-loading",n[10])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=K(e,"click",n[30]),u=!0)},p(c,d){d[0]&1024&&(e.disabled=c[10]),d[0]&64&&o!==(o=c[6]?"Create":"Save changes")&&se(r,o),d[0]&17408&&a!==(a=!c[14]||c[10])&&(s.disabled=a),d[0]&1024&&Q(s,"btn-loading",c[10])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function KO(n){let e,t,i={class:` record-panel `+(n[15]?"overlay-panel-xl":"overlay-panel-lg")+` `+(n[13]&&!n[6]?"colored-header":"")+` - `,beforeHide:n[54],$$slots:{footer:[YO],header:[WO],default:[BO]},$$scope:{ctx:n}};return e=new on({props:i}),n[55](e),e.$on("hide",n[56]),e.$on("show",n[57]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&41024&&(o.class=` + `,beforeHide:n[54],$$slots:{footer:[YO],header:[WO],default:[BO]},$$scope:{ctx:n}};return e=new on({props:i}),n[55](e),e.$on("hide",n[56]),e.$on("show",n[57]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&41024&&(o.class=` record-panel `+(s[15]?"overlay-panel-xl":"overlay-panel-lg")+` `+(s[13]&&!s[6]?"colored-header":"")+` - `),l[0]&2176&&(o.beforeHide=s[54]),l[0]&30461|l[2]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[55](null),V(e,s)}}}const ss="form",yl="providers";function JO(n,e,t){let i,s,l,o,r;const a=pt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d=null,h=null,g=null,m=!1,_=!1,y={},S={},C=JSON.stringify(null),T=C,$=ss,O=!0,M=!1;function D(ce){return F(ce),t(11,_=!0),t(12,$=ss),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}async function F(ce){t(28,M=!1),en({}),t(2,d=ce||{}),t(3,h=structuredClone(d)),t(4,y={}),t(5,S={}),await ln(),t(9,g=R()),!g||Z(h,g)?t(9,g=null):(delete g.password,delete g.passwordConfirm),t(26,C=JSON.stringify(h)),t(28,M=!0)}async function P(ce){var Ze,It;en({}),t(2,d=ce||{}),t(4,y={}),t(5,S={});const we=((It=(Ze=f==null?void 0:f.schema)==null?void 0:Ze.filter(tt=>tt.type!="file"))==null?void 0:It.map(tt=>tt.name))||[];for(let tt in ce)we.includes(tt)||t(3,h[tt]=ce[tt],h);await ln(),t(26,C=JSON.stringify(h)),X()}function N(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function R(ce){try{const we=window.localStorage.getItem(N());if(we)return JSON.parse(we)}catch{}return ce}function q(ce){try{window.localStorage.setItem(N(),ce)}catch(we){console.warn("updateDraft failure:",we)}}function B(){g&&(t(3,h=g),t(9,g=null))}function Z(ce,we){var an;const Ze=structuredClone(ce||{}),It=structuredClone(we||{}),tt=(an=f==null?void 0:f.schema)==null?void 0:an.filter(Zt=>Zt.type==="file");for(let Zt of tt)delete Ze[Zt.name],delete It[Zt.name];return delete Ze.password,delete Ze.passwordConfirm,delete It.password,delete It.passwordConfirm,JSON.stringify(Ze)==JSON.stringify(It)}function X(){t(9,g=null),window.localStorage.removeItem(N())}async function J(ce=!0){if(!(m||!r||!(f!=null&&f.id))){t(10,m=!0);try{const we=le();let Ze;O?Ze=await de.collection(f.id).create(we):Ze=await de.collection(f.id).update(h.id,we),jt(O?"Successfully created record.":"Successfully updated record."),X(),ce?(t(11,_=!1),I()):P(Ze),a("save",{isNew:O,record:Ze})}catch(we){de.error(we)}t(10,m=!1)}}function W(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>de.collection(d.collectionId).delete(d.id).then(()=>{I(),jt("Successfully deleted record."),a("delete",d)}).catch(ce=>{de.error(ce)}))}function le(){const ce=structuredClone(h||{}),we=new FormData,Ze={id:ce.id},It={};for(const tt of(f==null?void 0:f.schema)||[])Ze[tt.name]=!0,tt.type=="json"&&(It[tt.name]=!0);i&&(Ze.username=!0,Ze.email=!0,Ze.emailVisibility=!0,Ze.password=!0,Ze.passwordConfirm=!0,Ze.verified=!0);for(const tt in ce)if(Ze[tt]){if(typeof ce[tt]>"u"&&(ce[tt]=null),It[tt]&&ce[tt]!=="")try{JSON.parse(ce[tt])}catch(an){const Zt={};throw Zt[tt]={code:"invalid_json",message:an.toString()},new Kn({status:400,response:{data:Zt}})}j.addValueToFormData(we,tt,ce[tt])}for(const tt in y){const an=j.toArray(y[tt]);for(const Zt of an)we.append(tt,Zt)}for(const tt in S){const an=j.toArray(S[tt]);for(const Zt of an)we.append(tt+"."+Zt,"")}return we}function ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>de.collection(f.id).requestVerification(d.email).then(()=>{jt(`Successfully sent verification email to ${d.email}.`)}).catch(ce=>{de.error(ce)}))}function ie(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>de.collection(f.id).requestPasswordReset(d.email).then(()=>{jt(`Successfully sent password reset email to ${d.email}.`)}).catch(ce=>{de.error(ce)}))}function Ee(){o?mn("You have unsaved changes. Do you really want to discard them?",()=>{Ne()}):Ne()}async function Ne(){let ce=d?structuredClone(d):null;if(ce){ce.id="",ce.created="",ce.updated="";const we=(f==null?void 0:f.schema)||[];for(const Ze of we)Ze.type==="file"&&delete ce[Ze.name]}X(),D(ce),await ln(),t(26,C="")}function Ve(ce){(ce.ctrlKey||ce.metaKey)&&ce.code=="KeyS"&&(ce.preventDefault(),ce.stopPropagation(),J(!1))}const ze=()=>I(),oe=()=>ee(),Ce=()=>ie(),We=()=>Ee(),_t=()=>W(),Xe=()=>t(12,$=ss),Je=()=>t(12,$=yl),wt=()=>B(),_e=()=>X();function ke(){h.id=this.value,t(3,h)}function Ge(ce){h=ce,t(3,h)}function Oe(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function ht(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Ft(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function rn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function xt(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function tn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Pn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Ae(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function St(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Fn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function bn(ce,we){n.$$.not_equal(y[we.name],ce)&&(y[we.name]=ce,t(4,y))}function hi(ce,we){n.$$.not_equal(S[we.name],ce)&&(S[we.name]=ce,t(5,S))}function Nn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}const Zn=()=>o&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,_=!1),I()}),!1):(en({}),X(),!0);function mi(ce){te[ce?"unshift":"push"](()=>{c=ce,t(8,c)})}function Rn(ce){Fe.call(this,n,ce)}function Xn(ce){Fe.call(this,n,ce)}return n.$$set=ce=>{"collection"in ce&&t(0,f=ce.collection)},n.$$.update=()=>{var ce;n.$$.dirty[0]&1&&t(13,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(15,s=!!((ce=f==null?void 0:f.schema)!=null&&ce.find(we=>we.type==="editor"))),n.$$.dirty[0]&48&&t(29,l=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(27,T=JSON.stringify(h)),n.$$.dirty[0]&738197504&&t(7,o=l||C!=T),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&192&&t(14,r=O||o),n.$$.dirty[0]&402653184&&M&&q(T)},[f,I,d,h,y,S,O,o,c,g,m,_,$,i,r,s,u,B,X,J,W,ee,ie,Ee,Ve,D,C,T,M,l,ze,oe,Ce,We,_t,Xe,Je,wt,_e,ke,Ge,Oe,ht,Ft,rn,xt,tn,Pn,Ae,St,Fn,bn,hi,Nn,Zn,mi,Rn,Xn]}class M1 extends ve{constructor(e){super(),be(this,e,JO,KO,me,{collection:0,show:25,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[1]}}function Mh(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Oh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Dh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function GO(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function ZO(n){var l,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(l=e[0])==null?void 0:l.expand)==null?void 0:o[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function XO(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function QO(n){let e,t;return{c(){e=v("div"),t=U(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function xO(n){let e,t=j.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=j.truncate(n[3]))},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&8&&t!==(t=j.truncate(l[3])+"")&&se(i,t),o&8&&s!==(s=j.truncate(l[3]))&&p(e,"title",s)},i:x,o:x,d(l){l&&k(e)}}}function eE(n){let e,t=[],i=new Map,s,l,o=ge(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&Ih();return{c(){var u;e=v("div");for(let f=0;fu[17]?a||(a=Ih(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!l||f&2)&&Q(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!l){for(let f=0;fn[11]&&Fh();return{c(){e=v("div"),i.c(),s=E(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),b(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(ue(),L(r[d],1,1,()=>{r[d]=null}),fe(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Fh(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function nE(n){let e,t=[],i=new Map,s=ge(j.toArray(n[3]));const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function lE(n){let e,t=j.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=U(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),b(e,i),s||(l=[Te(je.call(null,e,"Open in new tab")),K(e,"click",An(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function oE(n){let e,t;return{c(){e=v("span"),t=U(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function rE(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function aE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function uE(n){let e,t,i,s;const l=[mE,hE],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Ah(n,e){let t,i,s;return i=new ru({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Ih(n){let e;return{c(){e=U("...")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fE(n){let e,t=ge(n[9].slice(0,n[11])),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&Rh(n);return{c(){e=v("span"),i=U(t),s=E(),r&&r.c(),l=Se(),p(e,"class","txt")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=Rh(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(ue(),L(r,1,1,()=>{r=null}),fe())},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&(k(e),k(s),k(l)),r&&r.d(a)}}}function mE(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=j.truncate(s[5])+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function Rh(n){let e,t;return e=new qs({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function gE(n){let e,t,i,s,l;const o=[uE,aE,rE,oE,lE,sE,iE,nE,tE,eE,xO,QO],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?XO(f):c===8?ZO(f):c===9?GO(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=Se()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(ue(),L(r[d],1,1,()=>{r[d]=null}),fe(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){f&&k(s),r[t].d(f)}}}function _E(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Fe.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[l.name])},[s,l,o,i,r]}class O1 extends ve{constructor(e){super(),be(this,e,_E,gE,me,{record:0,field:1,short:2})}}function qh(n,e,t){const i=n.slice();return i[10]=e[t],i}function jh(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new O1({props:{field:n[10],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=U(i),l=E(),o=v("td"),z(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),b(e,t),b(t,s),b(e,l),b(e,o),H(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&se(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){L(r.$$.fragment,u),a=!1},d(u){u&&k(e),V(r)}}}function Hh(n){let e,t,i,s,l,o;return l=new Ci({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function Vh(n){let e,t,i,s,l,o;return l=new Ci({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function bE(n){var O;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,h,g,m,_;a=new qs({props:{value:n[3].id}});let y=ge((O=n[0])==null?void 0:O.schema),S=[];for(let M=0;ML(S[M],1,1,()=>{S[M]=null});let T=n[3].created&&Hh(n),$=n[3].updated&&Vh(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=E(),o=v("td"),r=v("div"),z(a.$$.fragment),u=E(),f=v("span"),d=U(c),h=E();for(let M=0;M{T=null}),fe()),M[3].updated?$?($.p(M,D),D&8&&A($,1)):($=Vh(M),$.c(),A($,1),$.m(t,null)):$&&(ue(),L($,1,1,()=>{$=null}),fe())},i(M){if(!_){A(a.$$.fragment,M);for(let D=0;DClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[6]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function kE(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[yE],header:[vE],default:[bE]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),V(e,s)}}}function wE(n,e,t){let i,{collection:s}=e,l,o={};function r(h){return t(3,o=h),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(h){te[h?"unshift":"push"](()=>{l=h,t(2,l)})}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{var h;n.$$.dirty&1&&t(4,i=!!((h=s==null?void 0:s.schema)!=null&&h.find(g=>g.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class SE extends ve{constructor(e){super(),be(this,e,wE,kE,me,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function zh(n,e,t){const i=n.slice();return i[61]=e[t],i}function Bh(n,e,t){const i=n.slice();return i[64]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[64]=e[t],i}function Wh(n,e,t){const i=n.slice();return i[57]=e[t],i}function Yh(n){let e;function t(l,o){return l[13]?CE:TE}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&k(e),s.d()}}}function TE(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=E(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),o||(r=K(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&k(e),o=!1,r()}}}function CE(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Kh(n){let e,t,i;function s(o){n[32](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[$E]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $E(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Jh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l,o=e&&Gh(n),r=i&&Zh(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=Se()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,s,u),l=!0},p(a,u){u[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,u),u[0]&32&&A(o,1)):(o=Gh(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(ue(),L(o,1,1,()=>{o=null}),fe()),u[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=Zh(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(ue(),L(r,1,1,()=>{r=null}),fe())},i(a){l||(A(o),A(r),l=!0)},o(a){L(o),L(r),l=!1},d(a){a&&(k(t),k(s)),o&&o.d(a),r&&r.d(a)}}}function Gh(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[ME]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ME(n){let e;return{c(){e=v("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Zh(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[OE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function OE(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function EE(n){let e,t,i,s,l,o=n[64].name+"",r;return{c(){e=v("div"),t=v("i"),s=E(),l=v("span"),r=U(o),p(t,"class",i=j.getFieldTypeIcon(n[64].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),b(l,r)},p(a,u){u[0]&524288&&i!==(i=j.getFieldTypeIcon(a[64].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[64].name+"")&&se(r,o)},d(a){a&&k(e)}}}function Xh(n,e){let t,i,s,l;function o(a){e[35](a)}let r={class:"col-type-"+e[64].type+" col-field-"+e[64].name,name:e[64].name,$$slots:{default:[EE]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new cn({props:r}),te.push(()=>he(i,"sort",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[64].type+" col-field-"+e[64].name),u[0]&524288&&(f.name=e[64].name),u[0]&524288|u[2]&128&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function Qh(n){let e,t,i;function s(o){n[36](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[DE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function DE(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function xh(n){let e,t,i;function s(o){n[37](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[AE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function AE(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function em(n){let e;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[38](e)},p:x,d(t){t&&k(e),n[38](null)}}}function tm(n){let e;function t(l,o){return l[13]?LE:IE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function IE(n){let e,t,i,s;function l(a,u){var f;if((f=a[1])!=null&&f.length)return FE;if(!a[10])return PE}let o=l(n),r=o&&o(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=E(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),r&&r.m(t,null)},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&k(e),r&&r.d()}}}function LE(n){let e;return{c(){e=v("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[43]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function FE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[42]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function nm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[39](n[61])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[61].id),i.checked=l=n[4][n[61].id],p(r,"for",a="checkbox_"+n[61].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,h){w(d,e,h),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[K(i,"change",c),K(t,"click",An(n[29]))],u=!0)},p(d,h){n=d,h[0]&8&&s!==(s="checkbox_"+n[61].id)&&p(i,"id",s),h[0]&24&&l!==(l=n[4][n[61].id])&&(i.checked=l),h[0]&8&&a!==(a="checkbox_"+n[61].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,$e(f)}}}function im(n){let e,t,i,s,l,o,r=n[61].id+"",a,u,f;s=new qs({props:{value:n[61].id}});let c=n[9]&&sm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),a=U(r),u=E(),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,h){w(d,e,h),b(e,t),b(t,i),H(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,h){const g={};h[0]&8&&(g.value=d[61].id),s.$set(g),(!f||h[0]&8)&&r!==(r=d[61].id+"")&&se(a,r),d[9]?c?c.p(d,h):(c=sm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){L(s.$$.fragment,d),f=!1},d(d){d&&k(e),V(s),c&&c.d()}}}function sm(n){let e;function t(l,o){return l[61].verified?RE:NE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(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){l&&k(e),s.d(l)}}}function NE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Te(je.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function RE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=Te(je.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function lm(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l=e&&om(n),o=i&&rm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=Se()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?l?l.p(r,a):(l=om(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=rm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){r&&(k(t),k(s)),l&&l.d(r),o&&o.d(r)}}}function om(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[61].username)),t?jE:qE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(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&&k(e),l.d()}}}function qE(n){let e,t=n[61].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[61].username)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[61].username+"")&&se(i,t),o[0]&8&&s!==(s=l[61].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function jE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[61].email)),t?VE:HE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(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&&k(e),l.d()}}}function HE(n){let e,t=n[61].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[61].email)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[61].email+"")&&se(i,t),o[0]&8&&s!==(s=l[61].email)&&p(e,"title",s)},d(l){l&&k(e)}}}function VE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function am(n,e){let t,i,s,l;return i=new O1({props:{short:!0,record:e[61],field:e[64]}}),{key:n,first:null,c(){t=v("td"),z(i.$$.fragment),p(t,"class",s="col-type-"+e[64].type+" col-field-"+e[64].name),this.first=t},m(o,r){w(o,t,r),H(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[61]),r[0]&524288&&(a.field=e[64]),i.$set(a),(!l||r[0]&524288&&s!==(s="col-type-"+e[64].type+" col-field-"+e[64].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function um(n){let e,t,i;return t=new Ci({props:{date:n[61].created}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[61].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function fm(n){let e,t,i;return t=new Ci({props:{date:n[61].updated}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[61].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function cm(n,e){let t,i,s=!e[5].includes("@id"),l,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),h,g,m,_,y,S=!e[10]&&nm(e),C=s&&im(e),T=e[9]&&lm(e),$=ge(e[19]);const O=P=>P[64].name;for(let P=0;P<$.length;P+=1){let N=Bh(e,$,P),R=O(N);a.set(R,r[P]=am(R,N))}let M=f&&um(e),D=d&&fm(e);function I(){return e[40](e[61])}function F(...P){return e[41](e[61],...P)}return{key:n,first:null,c(){t=v("tr"),S&&S.c(),i=E(),C&&C.c(),l=E(),T&&T.c(),o=E();for(let P=0;P',p(g,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(P,N){w(P,t,N),S&&S.m(t,null),b(t,i),C&&C.m(t,null),b(t,l),T&&T.m(t,null),b(t,o);for(let R=0;R{C=null}),fe()),e[9]?T?T.p(e,N):(T=lm(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),N[0]&524296&&($=ge(e[19]),ue(),r=vt(r,N,O,1,e,$,a,t,Ut,am,u,Bh),fe()),N[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?M?(M.p(e,N),N[0]&288&&A(M,1)):(M=um(e),M.c(),A(M,1),M.m(t,c)):M&&(ue(),L(M,1,1,()=>{M=null}),fe()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?D?(D.p(e,N),N[0]&160&&A(D,1)):(D=fm(e),D.c(),A(D,1),D.m(t,h)):D&&(ue(),L(D,1,1,()=>{D=null}),fe())},i(P){if(!m){A(C);for(let N=0;N<$.length;N+=1)A(r[N]);A(M),A(D),m=!0}},o(P){L(C);for(let N=0;NJ[64].name;for(let J=0;JJ[10]?J[61]:J[61].id;for(let J=0;J{M=null}),fe()),J[9]?D?(D.p(J,W),W[0]&512&&A(D,1)):(D=Jh(J),D.c(),A(D,1),D.m(i,r)):D&&(ue(),L(D,1,1,()=>{D=null}),fe()),W[0]&524289&&(I=ge(J[19]),ue(),a=vt(a,W,F,1,J,I,u,i,Ut,Xh,f,Uh),fe()),W[0]&288&&(c=J[8]&&!J[5].includes("@created")),c?P?(P.p(J,W),W[0]&288&&A(P,1)):(P=Qh(J),P.c(),A(P,1),P.m(i,d)):P&&(ue(),L(P,1,1,()=>{P=null}),fe()),W[0]&160&&(h=J[7]&&!J[5].includes("@updated")),h?N?(N.p(J,W),W[0]&160&&A(N,1)):(N=xh(J),N.c(),A(N,1),N.m(i,g)):N&&(ue(),L(N,1,1,()=>{N=null}),fe()),J[16].length?R?R.p(J,W):(R=em(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null),W[0]&9971642&&(q=ge(J[3]),ue(),S=vt(S,W,B,1,J,q,C,y,Ut,cm,T,zh),fe(),!q.length&&Z?Z.p(J,W):q.length?Z&&(Z.d(1),Z=null):(Z=tm(J),Z.c(),Z.m(y,T))),J[3].length&&J[18]?X?X.p(J,W):(X=dm(J),X.c(),X.m(y,null)):X&&(X.d(1),X=null),(!$||W[0]&8192)&&Q(e,"table-loading",J[13])},i(J){if(!$){A(M),A(D);for(let W=0;W({60:l}),({uniqueId:l})=>[0,l?536870912:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&65568|o[1]&536870912|o[2]&128&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function UE(n){let e,t,i=[],s=new Map,l,o,r=ge(n[16]);const a=u=>u[57].id+u[57].name;for(let u=0;u{i=null}),fe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function mm(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,m,_,y,S;return{c(){e=v("div"),t=v("div"),i=U("Selected "),s=v("strong"),l=U(n[6]),o=E(),a=U(r),u=E(),f=v("button"),f.innerHTML='Reset',c=E(),d=v("div"),h=E(),g=v("button"),g.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-transparent btn-danger"),Q(g,"btn-loading",n[14]),Q(g,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(s,l),b(t,o),b(t,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,h),b(e,g),_=!0,y||(S=[K(f,"click",n[46]),K(g,"click",n[47])],y=!0)},p(C,T){(!_||T[0]&64)&&se(l,C[6]),(!_||T[0]&64)&&r!==(r=C[6]===1?"record":"records")&&se(a,r),(!_||T[0]&16384)&&Q(f,"btn-disabled",C[14]),(!_||T[0]&16384)&&Q(g,"btn-loading",C[14]),(!_||T[0]&16384)&&Q(g,"btn-disabled",C[14])},i(C){_||(C&&Qe(()=>{_&&(m||(m=qe(e,di,{duration:150,y:5},!0)),m.run(1))}),_=!0)},o(C){C&&(m||(m=qe(e,di,{duration:150,y:5},!1)),m.run(0)),_=!1},d(C){C&&k(e),C&&m&&m.end(),y=!1,$e(S)}}}function YE(n){let e,t,i,s,l={class:"table-wrapper",$$slots:{before:[WE],default:[zE]},$$scope:{ctx:n}};e=new Fa({props:l}),n[45](e);let o=n[6]&&mm(n);return{c(){z(e.$$.fragment),t=E(),o&&o.c(),i=Se()},m(r,a){H(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!0},p(r,a){const u={};a[0]&1030075|a[2]&128&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&A(o,1)):(o=mm(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(ue(),L(o,1,1,()=>{o=null}),fe())},i(r){s||(A(e.$$.fragment,r),A(o),s=!0)},o(r){L(e.$$.fragment,r),L(o),s=!1},d(r){r&&(k(t),k(i)),n[45](null),V(e,r),o&&o.d(r)}}}const KE=/^([\+\-])?(\w+)$/,gm=45;function JE(n,e,t){let i,s,l,o,r,a,u,f,c,d,h,g;Ke(n,ii,Ae=>t(51,g=Ae));const m=pt();let{collection:_}=e,{sort:y=""}=e,{filter:S=""}=e,C,T=[],$=1,O=0,M={},D=!0,I=!1,F=0,P,N=[],R=[];function q(){_!=null&&_.id&&localStorage.setItem((_==null?void 0:_.id)+"@hiddenCollumns",JSON.stringify(N))}function B(){if(t(5,N=[]),!!(_!=null&&_.id))try{const Ae=localStorage.getItem(_.id+"@hiddenCollumns");Ae&&t(5,N=JSON.parse(Ae)||[])}catch{}}async function Z(){const Ae=$;for(let St=1;St<=Ae;St++)(St===1||u)&&await X(St,!1)}async function X(Ae=1,St=!0){var mi,Rn,Xn;if(!(_!=null&&_.id))return;t(13,D=!0);let Fn=y;const bn=Fn.match(KE),hi=bn?r.find(ce=>ce.name===bn[2]):null;if(bn&&hi){const ce=((Xn=(Rn=(mi=g==null?void 0:g.find(Ze=>{var It;return Ze.id==((It=hi.options)==null?void 0:It.collectionId)}))==null?void 0:mi.schema)==null?void 0:Rn.filter(Ze=>Ze.presentable))==null?void 0:Xn.map(Ze=>Ze.name))||[],we=[];for(const Ze of ce)we.push((bn[1]||"")+bn[2]+"."+Ze);we.length>0&&(Fn=we.join(","))}const Nn=j.getAllCollectionIdentifiers(_),Zn=o.map(ce=>ce.name+":excerpt(200)").concat(r.map(ce=>"expand."+ce.name+".*:excerpt(200)"));return Zn.length&&Zn.unshift("*"),de.collection(_.id).getList(Ae,gm,{sort:Fn,skipTotal:1,filter:j.normalizeSearchFilter(S,Nn),expand:r.map(ce=>ce.name).join(","),requestKey:"records_list"}).then(async ce=>{var we;if(Ae<=1&&J(),t(13,D=!1),t(12,$=ce.page),t(27,O=ce.items.length),m("load",T.concat(ce.items)),St){const Ze=++F;for(;(we=ce.items)!=null&&we.length&&F==Ze;)t(3,T=T.concat(ce.items.splice(0,15))),await j.yieldToMain()}else t(3,T=T.concat(ce.items))}).catch(ce=>{ce!=null&&ce.isAbort||(t(13,D=!1),console.warn(ce),J(),de.error(ce,(ce==null?void 0:ce.status)!=400))})}function J(){C==null||C.resetVerticalScroll(),t(3,T=[]),t(12,$=1),t(27,O=0),t(4,M={})}function W(){c?le():ee()}function le(){t(4,M={})}function ee(){for(const Ae of T)t(4,M[Ae.id]=Ae,M);t(4,M)}function ie(Ae){M[Ae.id]?delete M[Ae.id]:t(4,M[Ae.id]=Ae,M),t(4,M)}function Ee(){mn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,Ne)}async function Ne(){if(I||!f||!(_!=null&&_.id))return;let Ae=[];for(const St of Object.keys(M))Ae.push(de.collection(_.id).delete(St));return t(14,I=!0),Promise.all(Ae).then(()=>{jt(`Successfully deleted the selected ${f===1?"record":"records"}.`),m("delete",M),le()}).catch(St=>{de.error(St)}).finally(()=>(t(14,I=!1),Z()))}function Ve(Ae){Fe.call(this,n,Ae)}const ze=(Ae,St)=>{St.target.checked?j.removeByValue(N,Ae.id):j.pushUnique(N,Ae.id),t(5,N)},oe=()=>W();function Ce(Ae){y=Ae,t(0,y)}function We(Ae){y=Ae,t(0,y)}function _t(Ae){y=Ae,t(0,y)}function Xe(Ae){y=Ae,t(0,y)}function Je(Ae){y=Ae,t(0,y)}function wt(Ae){y=Ae,t(0,y)}function _e(Ae){te[Ae?"unshift":"push"](()=>{P=Ae,t(15,P)})}const ke=Ae=>ie(Ae),Ge=Ae=>m("select",Ae),Oe=(Ae,St)=>{St.code==="Enter"&&(St.preventDefault(),m("select",Ae))},ht=()=>t(1,S=""),Ft=()=>m("new"),rn=()=>X($+1);function xt(Ae){te[Ae?"unshift":"push"](()=>{C=Ae,t(11,C)})}const tn=()=>le(),Pn=()=>Ee();return n.$$set=Ae=>{"collection"in Ae&&t(25,_=Ae.collection),"sort"in Ae&&t(0,y=Ae.sort),"filter"in Ae&&t(1,S=Ae.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(B(),J()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,s=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(28,l=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&268435456&&(o=l.filter(Ae=>Ae.type==="editor")),n.$$.dirty[0]&268435456&&(r=l.filter(Ae=>Ae.type==="relation")),n.$$.dirty[0]&268435488&&t(19,a=l.filter(Ae=>!N.includes(Ae.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&y!==-1&&S!==-1&&X(1),n.$$.dirty[0]&134217728&&t(18,u=O>=gm),n.$$.dirty[0]&16&&t(6,f=Object.keys(M).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&N!==-1&&q(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,h=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&268436352&&t(16,R=[].concat(s?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],l.map(Ae=>({id:Ae.id,name:Ae.name})),d?{id:"@created",name:"created"}:[],h?{id:"@updated",name:"updated"}:[]))},[y,S,X,T,M,N,f,h,d,s,i,C,$,D,I,P,R,c,u,a,m,W,le,ie,Ee,_,Z,O,l,Ve,ze,oe,Ce,We,_t,Xe,Je,wt,_e,ke,Ge,Oe,ht,Ft,rn,xt,tn,Pn]}class GE extends ve{constructor(e){super(),be(this,e,JE,YE,me,{collection:25,sort:0,filter:1,reloadLoadedPages:26,load:2},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[26]}get load(){return this.$$.ctx[2]}}function ZE(n){let e,t,i,s,l=(n[2]?"...":n[0])+"",o,r;return{c(){e=v("div"),t=v("span"),t.textContent="Total found:",i=E(),s=v("span"),o=U(l),p(t,"class","txt"),p(s,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),b(e,t),b(e,i),b(e,s),b(s,o)},p(a,[u]){u&5&&l!==(l=(a[2]?"...":a[0])+"")&&se(o,l),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:x,o:x,d(a){a&&k(e)}}}function XE(n,e,t){const i=pt();let{collection:s}=e,{filter:l=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(s!=null&&s.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(s),c=await de.collection(s.id).getList(1,1,{filter:j.normalizeSearchFilter(l,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,s=f.collection),"filter"in f&&t(4,l=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&s!=null&&s.id&&l!==-1&&u()},[o,r,a,s,l,u]}class QE extends ve{constructor(e){super(),be(this,e,XE,ZE,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function xE(n){let e,t,i,s;return e=new PM({}),i=new Sn({props:{class:"flex-content",$$slots:{footer:[iD],default:[nD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&6135|o[1]&512&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function eD(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[oD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&4112|s[1]&512&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function tD(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[rD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[1]&512&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _m(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Te(je.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[19])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function bm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[22]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function nD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F,P=!n[12]&&_m(n);c=new Yo({}),c.$on("refresh",n[20]);let N=n[2].type!=="view"&&bm(n);y=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[23]);function R(Z){n[25](Z)}function q(Z){n[26](Z)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),$=new GE({props:B}),n[24]($),te.push(()=>he($,"filter",R)),te.push(()=>he($,"sort",q)),$.$on("select",n[27]),$.$on("delete",n[28]),$.$on("new",n[29]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=U(o),a=E(),u=v("div"),P&&P.c(),f=E(),z(c.$$.fragment),d=E(),h=v("div"),g=v("button"),g.innerHTML=' API Preview',m=E(),N&&N.c(),_=E(),z(y.$$.fragment),S=E(),C=v("div"),T=E(),z($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(h,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-sm")},m(Z,X){w(Z,e,X),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),P&&P.m(u,null),b(u,f),H(c,u,null),b(e,d),b(e,h),b(h,g),b(h,m),N&&N.m(h,null),w(Z,_,X),H(y,Z,X),w(Z,S,X),w(Z,C,X),w(Z,T,X),H($,Z,X),D=!0,I||(F=K(g,"click",n[21]),I=!0)},p(Z,X){(!D||X[0]&4)&&o!==(o=Z[2].name+"")&&se(r,o),Z[12]?P&&(P.d(1),P=null):P?P.p(Z,X):(P=_m(Z),P.c(),P.m(u,f)),Z[2].type!=="view"?N?N.p(Z,X):(N=bm(Z),N.c(),N.m(h,null)):N&&(N.d(1),N=null);const J={};X[0]&1&&(J.value=Z[0]),X[0]&4&&(J.autocompleteCollection=Z[2]),y.$set(J);const W={};X[0]&4&&(W.collection=Z[2]),!O&&X[0]&1&&(O=!0,W.filter=Z[0],ye(()=>O=!1)),!M&&X[0]&2&&(M=!0,W.sort=Z[1],ye(()=>M=!1)),$.$set(W)},i(Z){D||(A(c.$$.fragment,Z),A(y.$$.fragment,Z),A($.$$.fragment,Z),D=!0)},o(Z){L(c.$$.fragment,Z),L(y.$$.fragment,Z),L($.$$.fragment,Z),D=!1},d(Z){Z&&(k(e),k(_),k(S),k(C),k(T)),P&&P.d(),V(c),N&&N.d(),V(y,Z),n[24](null),V($,Z),I=!1,F()}}}function iD(n){let e,t,i;function s(o){n[18](o)}let l={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(l.totalCount=n[10]),e=new QE({props:l}),n[17](e),te.push(()=>he(e,"totalCount",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){n[17](null),V(e,o)}}}function sD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=K(i,"click",n[16]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function lD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oD(n){let e,t,i;function s(r,a){return r[12]?lD:sD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='',i=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(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&&k(e),o.d()}}}function rD(n){let e;return{c(){e=v("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[tD,eD,xE],h=[];function g(C,T){return C[3]&&!C[11].length?0:C[11].length?2:1}e=g(n),t=h[e]=d[e](n);let m={};s=new ou({props:m}),n[30](s);let _={};o=new zM({props:_}),n[31](o);let y={collection:n[2]};a=new M1({props:y}),n[32](a),a.$on("save",n[33]),a.$on("delete",n[34]);let S={collection:n[2]};return f=new SE({props:S}),n[35](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(C,T){h[e].m(C,T),w(C,i,T),H(s,C,T),w(C,l,T),H(o,C,T),w(C,r,T),H(a,C,T),w(C,u,T),H(f,C,T),c=!0},p(C,T){let $=e;e=g(C),e===$?h[e].p(C,T):(ue(),L(h[$],1,1,()=>{h[$]=null}),fe(),t=h[e],t?t.p(C,T):(t=h[e]=d[e](C),t.c()),A(t,1),t.m(i.parentNode,i));const O={};s.$set(O);const M={};o.$set(M);const D={};T[0]&4&&(D.collection=C[2]),a.$set(D);const I={};T[0]&4&&(I.collection=C[2]),f.$set(I)},i(C){c||(A(t),A(s.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),A(f.$$.fragment,C),c=!0)},o(C){L(t),L(s.$$.fragment,C),L(o.$$.fragment,C),L(a.$$.fragment,C),L(f.$$.fragment,C),c=!1},d(C){C&&(k(i),k(l),k(r),k(u)),h[e].d(C),n[30](null),V(s,C),n[31](null),V(o,C),n[32](null),V(a,C),n[35](null),V(f,C)}}}function uD(n,e,t){let i,s,l,o,r,a,u;Ke(n,Ti,oe=>t(2,s=oe)),Ke(n,At,oe=>t(36,l=oe)),Ke(n,vo,oe=>t(3,o=oe)),Ke(n,ya,oe=>t(15,r=oe)),Ke(n,ii,oe=>t(11,a=oe)),Ke(n,Ms,oe=>t(12,u=oe));const f=new URLSearchParams(r);let c,d,h,g,m,_,y=f.get("filter")||"",S=f.get("sort")||"-created",C=f.get("collectionId")||(s==null?void 0:s.id),T=0;function $(){t(13,C=s==null?void 0:s.id),t(0,y=""),t(1,S="-created"),O()}async function O(){if(!S)return;const oe=j.getAllCollectionIdentifiers(s),Ce=S.split(",").map(We=>We.startsWith("+")||We.startsWith("-")?We.substring(1):We);Ce.filter(We=>oe.includes(We)).length!=Ce.length&&(oe.includes("created")?t(1,S="-created"):t(1,S=""))}qy(C);const M=()=>c==null?void 0:c.show();function D(oe){te[oe?"unshift":"push"](()=>{_=oe,t(9,_)})}function I(oe){T=oe,t(10,T)}const F=()=>c==null?void 0:c.show(s),P=()=>m==null?void 0:m.load(),N=()=>d==null?void 0:d.show(s),R=()=>h==null?void 0:h.show(),q=oe=>t(0,y=oe.detail);function B(oe){te[oe?"unshift":"push"](()=>{m=oe,t(8,m)})}function Z(oe){y=oe,t(0,y)}function X(oe){S=oe,t(1,S)}const J=oe=>{s.type==="view"?g.show(oe==null?void 0:oe.detail):h==null||h.show(oe==null?void 0:oe.detail)},W=()=>{_==null||_.reload()},le=()=>h==null?void 0:h.show();function ee(oe){te[oe?"unshift":"push"](()=>{c=oe,t(4,c)})}function ie(oe){te[oe?"unshift":"push"](()=>{d=oe,t(5,d)})}function Ee(oe){te[oe?"unshift":"push"](()=>{h=oe,t(6,h)})}const Ne=oe=>{var Ce;m==null||m.reloadLoadedPages(),(Ce=oe.detail)!=null&&Ce.isNew&&t(10,T++,T)},Ve=()=>{m==null||m.reloadLoadedPages(),t(10,T--,T)};function ze(oe){te[oe?"unshift":"push"](()=>{g=oe,t(7,g)})}return n.$$.update=()=>{if(n.$$.dirty[0]&32768&&t(14,i=new URLSearchParams(r)),n.$$.dirty[0]&24584&&!o&&i.get("collectionId")&&i.get("collectionId")!=C&&Fy(i.get("collectionId")),n.$$.dirty[0]&8196&&s!=null&&s.id&&C!=s.id&&$(),n.$$.dirty[0]&4&&s!=null&&s.id&&O(),n.$$.dirty[0]&7&&(S||y||s!=null&&s.id)){const oe=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:y,sort:S}).toString();Hi("/collections?"+oe)}n.$$.dirty[0]&4&&sn(At,l=(s==null?void 0:s.name)||"Collections",l)},[y,S,s,o,c,d,h,g,m,_,T,a,u,C,i,r,M,D,I,F,P,N,R,q,B,Z,X,J,W,le,ee,ie,Ee,Ne,Ve,ze]}class fD extends ve{constructor(e){super(),be(this,e,uD,aD,me,{},null,[-1,-1])}}function cD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=E(),l=v("a"),l.innerHTML=' Application',o=E(),r=v("a"),r.innerHTML=' Mail settings',a=E(),u=v("a"),u.innerHTML=' Files storage',f=E(),c=v("a"),c.innerHTML=' Backups',d=E(),h=v("div"),h.innerHTML='Sync',g=E(),m=v("a"),m.innerHTML=' Export collections',_=E(),y=v("a"),y.innerHTML=' Import collections',S=E(),C=v("div"),C.textContent="Authentication",T=E(),$=v("a"),$.innerHTML=' Auth providers',O=E(),M=v("a"),M.innerHTML=' Token options',D=E(),I=v("a"),I.innerHTML=' Admins',p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(h,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p(C,"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(I,"href","/settings/admins"),p(I,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(N,R){w(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),b(t,f),b(t,c),b(t,d),b(t,h),b(t,g),b(t,m),b(t,_),b(t,y),b(t,S),b(t,C),b(t,T),b(t,$),b(t,O),b(t,M),b(t,D),b(t,I),F||(P=[Te(zn.call(null,l,{path:"/settings"})),Te(un.call(null,l)),Te(zn.call(null,r,{path:"/settings/mail/?.*"})),Te(un.call(null,r)),Te(zn.call(null,u,{path:"/settings/storage/?.*"})),Te(un.call(null,u)),Te(zn.call(null,c,{path:"/settings/backups/?.*"})),Te(un.call(null,c)),Te(zn.call(null,m,{path:"/settings/export-collections/?.*"})),Te(un.call(null,m)),Te(zn.call(null,y,{path:"/settings/import-collections/?.*"})),Te(un.call(null,y)),Te(zn.call(null,$,{path:"/settings/auth-providers/?.*"})),Te(un.call(null,$)),Te(zn.call(null,M,{path:"/settings/tokens/?.*"})),Te(un.call(null,M)),Te(zn.call(null,I,{path:"/settings/admins/?.*"})),Te(un.call(null,I))],F=!0)},p:x,i:x,o:x,d(N){N&&k(e),F=!1,$e(P)}}}class Oi extends ve{constructor(e){super(),be(this,e,null,cD,me,{})}}function vm(n,e,t){const i=n.slice();return i[31]=e[t],i}function ym(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[dD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function dD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return a=new T1({props:{model:n[1]}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),z(a.$$.fragment),u=E(),f=v("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"class","form-field-addon"),p(f,"type","text"),p(f,"id",c=n[30]),f.value=d=n[1].id,f.readOnly=!0},m(g,m){w(g,e,m),b(e,t),b(e,i),b(e,s),w(g,o,m),w(g,r,m),H(a,r,null),w(g,u,m),w(g,f,m),h=!0},p(g,m){(!h||m[0]&1073741824&&l!==(l=g[30]))&&p(e,"for",l);const _={};m[0]&2&&(_.model=g[1]),a.$set(_),(!h||m[0]&1073741824&&c!==(c=g[30]))&&p(f,"id",c),(!h||m[0]&2&&d!==(d=g[1].id)&&f.value!==d)&&(f.value=d)},i(g){h||(A(a.$$.fragment,g),h=!0)},o(g){L(a.$$.fragment,g),h=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),V(a)}}}function km(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=E(),_n(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){w(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[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function pD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[3]),u||(f=K(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&ae(r,c[3])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function wm(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[hD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function hD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Sm(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[mD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(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){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742848|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Qe(()=>{u&&(a||(a=qe(t,it,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(t,it,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new C1({}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),ae(r,n[9]),w(m,u,_),w(m,f,_),H(c,f,null),d=!0,h||(g=K(r,"input",n[21]),h=!0)},p(m,_){(!d||_[0]&1073741824&&l!==(l=m[30]))&&p(e,"for",l),(!d||_[0]&1073741824&&a!==(a=m[30]))&&p(r,"id",a),_[0]&512&&r.value!==m[9]&&ae(r,m[9])},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){L(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,g()}}}function gD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[10]),u||(f=K(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&ae(r,c[10])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function _D(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&ym(n),m=ge([0,1,2,3,4,5,6,7,8,9]),_=[];for(let C=0;C<10;C+=1)_[C]=km(vm(n,m,C));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[pD,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&wm(n),S=(n[5]||n[4])&&Sm(n);return{c(){e=v("form"),g&&g.c(),t=E(),i=v("div"),s=v("p"),s.textContent="Avatar",l=E(),o=v("div");for(let C=0;C<10;C+=1)_[C].c();r=E(),z(a.$$.fragment),u=E(),y&&y.c(),f=E(),S&&S.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(C,T){w(C,e,T),g&&g.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let $=0;$<10;$+=1)_[$]&&_[$].m(o,null);b(e,r),H(a,e,null),b(e,u),y&&y.m(e,null),b(e,f),S&&S.m(e,null),c=!0,d||(h=K(e,"submit",xe(n[13])),d=!0)},p(C,T){if(C[5]?g&&(ue(),L(g,1,1,()=>{g=null}),fe()):g?(g.p(C,T),T[0]&32&&A(g,1)):(g=ym(C),g.c(),A(g,1),g.m(e,t)),T[0]&4){m=ge([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const M=vm(C,m,O);_[O]?_[O].p(M,T):(_[O]=km(M),_[O].c(),_[O].m(o,null))}for(;O<10;O+=1)_[O].d(1)}const $={};T[0]&1073741832|T[1]&8&&($.$$scope={dirty:T,ctx:C}),a.$set($),C[5]?y&&(ue(),L(y,1,1,()=>{y=null}),fe()):y?(y.p(C,T),T[0]&32&&A(y,1)):(y=wm(C),y.c(),A(y,1),y.m(e,f)),C[5]||C[4]?S?(S.p(C,T),T[0]&48&&A(S,1)):(S=Sm(C),S.c(),A(S,1),S.m(e,null)):S&&(ue(),L(S,1,1,()=>{S=null}),fe())},i(C){c||(A(g),A(a.$$.fragment,C),A(y),A(S),c=!0)},o(C){L(g),L(a.$$.fragment,C),L(y),L(S),c=!1},d(C){C&&k(e),g&&g.d(),gt(_,C),V(a),y&&y.d(),S&&S.d(),d=!1,h()}}}function bD(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&32&&t!==(t=s[5]?"New admin":"Edit admin")&&se(i,t)},d(s){s&&k(e)}}}function Tm(n){let e,t,i,s,l,o,r,a,u;return o=new Ln({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[vD]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=E(),s=v("i"),l=E(),z(o.$$.fragment),r=E(),a=v("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),H(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){L(o.$$.fragment,f),u=!1},d(f){f&&(k(e),k(r),k(a)),V(o)}}}function vD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function yD(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,h=!n[5]&&Tm(n);return{c(){h&&h.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(g,m){h&&h.m(g,m),w(g,e,m),w(g,t,m),b(t,i),w(g,s,m),w(g,l,m),b(l,o),b(o,a),f=!0,c||(d=K(t,"click",n[17]),c=!0)},p(g,m){g[5]?h&&(ue(),L(h,1,1,()=>{h=null}),fe()):h?(h.p(g,m),m[0]&32&&A(h,1)):(h=Tm(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||m[0]&128)&&(t.disabled=g[7]),(!f||m[0]&32)&&r!==(r=g[5]?"Create":"Save changes")&&se(a,r),(!f||m[0]&2176&&u!==(u=!g[11]||g[7]))&&(l.disabled=u),(!f||m[0]&128)&&Q(l,"btn-loading",g[7])},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){g&&(k(e),k(t),k(s),k(l)),h&&h.d(g),c=!1,d()}}}function kD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[yD],header:[bD],default:[_D]},$$scope:{ctx:n}};return e=new on({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function wD(n,e,t){let i,s;const l=pt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",h="",g="",m=!1;function _(X){return S(X),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),C()}function C(){t(4,m=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,h=""),t(10,g=""),en({})}function T(){if(u||!s)return;t(7,u=!0);const X={email:d,avatar:c};(i||m)&&(X.password=h,X.passwordConfirm=g);let J;i?J=de.admins.create(X):J=de.admins.update(a.id,X),J.then(async W=>{var le;t(8,f=!1),y(),jt(i?"Successfully created admin.":"Successfully updated admin."),((le=de.authStore.model)==null?void 0:le.id)===W.id&&de.authStore.save(de.authStore.token,W),l("save",W)}).catch(W=>{de.error(W)}).finally(()=>{t(7,u=!1)})}function $(){a!=null&&a.id&&mn("Do you really want to delete the selected admin?",()=>de.admins.delete(a.id).then(()=>{t(8,f=!1),y(),jt("Successfully deleted admin."),l("delete",a)}).catch(X=>{de.error(X)}))}const O=()=>$(),M=()=>y(),D=X=>t(2,c=X);function I(){d=this.value,t(3,d)}function F(){m=this.checked,t(4,m)}function P(){h=this.value,t(9,h)}function N(){g=this.value,t(10,g)}const R=()=>s&&f?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function B(X){Fe.call(this,n,X)}function Z(X){Fe.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||m||d!==a.email||c!==a.avatar)},[y,a,c,d,m,i,r,u,f,h,g,s,o,T,$,_,O,M,D,I,F,P,N,R,q,B,Z]}class SD extends ve{constructor(e){super(),be(this,e,wD,kD,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Cm(n,e,t){const i=n.slice();return i[24]=e[t],i}function TD(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function CD(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $D(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function MD(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $m(n){let e;function t(l,o){return l[5]?ED:OD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function OD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Mm(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(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[1])!=null&&f.length?o?o.p(a,u):(o=Mm(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function ED(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Mm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Om(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Em(n,e){let t,i,s,l,o,r,a,u,f,c,d,h=e[24].id+"",g,m,_,y,S,C=e[24].email+"",T,$,O,M,D,I,F,P,N,R,q,B,Z,X;f=new qs({props:{value:e[24].id}});let J=e[24].id===e[7].id&&Om();D=new Ci({props:{date:e[24].created}}),P=new Ci({props:{date:e[24].updated}});function W(){return e[15](e[24])}function le(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),z(f.$$.fragment),c=E(),d=v("span"),g=U(h),m=E(),J&&J.c(),_=E(),y=v("td"),S=v("span"),T=U(C),O=E(),M=v("td"),z(D.$$.fragment),I=E(),F=v("td"),z(P.$$.fragment),N=E(),R=v("td"),R.innerHTML='',q=E(),_n(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(S,"class","txt txt-ellipsis"),p(S,"title",$=e[24].email),p(y,"class","col-type-email col-field-email"),p(M,"class","col-type-date col-field-created"),p(F,"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(ee,ie){w(ee,t,ie),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),H(f,u,null),b(u,c),b(u,d),b(d,g),b(a,m),J&&J.m(a,null),b(t,_),b(t,y),b(y,S),b(S,T),b(t,O),b(t,M),H(D,M,null),b(t,I),b(t,F),H(P,F,null),b(t,N),b(t,R),b(t,q),B=!0,Z||(X=[K(t,"click",W),K(t,"keydown",le)],Z=!0)},p(ee,ie){e=ee,(!B||ie&16&&!_n(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Ee={};ie&16&&(Ee.value=e[24].id),f.$set(Ee),(!B||ie&16)&&h!==(h=e[24].id+"")&&se(g,h),e[24].id===e[7].id?J||(J=Om(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!B||ie&16)&&C!==(C=e[24].email+"")&&se(T,C),(!B||ie&16&&$!==($=e[24].email))&&p(S,"title",$);const Ne={};ie&16&&(Ne.date=e[24].created),D.$set(Ne);const Ve={};ie&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){B||(A(f.$$.fragment,ee),A(D.$$.fragment,ee),A(P.$$.fragment,ee),B=!0)},o(ee){L(f.$$.fragment,ee),L(D.$$.fragment,ee),L(P.$$.fragment,ee),B=!1},d(ee){ee&&k(t),V(f),J&&J.d(),V(D),V(P),Z=!1,$e(X)}}}function DD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$=[],O=new Map,M;function D(W){n[11](W)}let I={class:"col-type-text",name:"id",$$slots:{default:[TD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new cn({props:I}),te.push(()=>he(o,"sort",D));function F(W){n[12](W)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[CD]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new cn({props:P}),te.push(()=>he(u,"sort",F));function N(W){n[13](W)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[$D]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new cn({props:R}),te.push(()=>he(d,"sort",N));function q(W){n[14](W)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[MD]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),m=new cn({props:B}),te.push(()=>he(m,"sort",q));let Z=ge(n[4]);const X=W=>W[24].id;for(let W=0;Wr=!1)),o.$set(ee);const ie={};le&134217728&&(ie.$$scope={dirty:le,ctx:W}),!f&&le&4&&(f=!0,ie.sort=W[2],ye(()=>f=!1)),u.$set(ie);const Ee={};le&134217728&&(Ee.$$scope={dirty:le,ctx:W}),!h&&le&4&&(h=!0,Ee.sort=W[2],ye(()=>h=!1)),d.$set(Ee);const Ne={};le&134217728&&(Ne.$$scope={dirty:le,ctx:W}),!_&&le&4&&(_=!0,Ne.sort=W[2],ye(()=>_=!1)),m.$set(Ne),le&186&&(Z=ge(W[4]),ue(),$=vt($,le,X,1,W,Z,O,T,Ut,Em,null,Cm),fe(),!Z.length&&J?J.p(W,le):Z.length?J&&(J.d(1),J=null):(J=$m(W),J.c(),J.m(T,null))),(!M||le&32)&&Q(e,"table-loading",W[5])},i(W){if(!M){A(o.$$.fragment,W),A(u.$$.fragment,W),A(d.$$.fragment,W),A(m.$$.fragment,W);for(let le=0;le New admin',g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=E(),z(C.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(M,D){w(M,e,D),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),H(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),b(d,h),w(M,g,D),H(m,M,D),w(M,_,D),w(M,y,D),w(M,S,D),H(C,M,D),T=!0,$||(O=K(h,"click",n[9]),$=!0)},p(M,D){(!T||D&64)&&se(o,M[6]);const I={};D&2&&(I.value=M[1]),m.$set(I);const F={};D&134217918&&(F.$$scope={dirty:D,ctx:M}),C.$set(F)},i(M){T||(A(a.$$.fragment,M),A(m.$$.fragment,M),A(C.$$.fragment,M),T=!0)},o(M){L(a.$$.fragment,M),L(m.$$.fragment,M),L(C.$$.fragment,M),T=!1},d(M){M&&(k(e),k(g),k(_),k(y),k(S)),V(a),V(m,M),V(C,M),$=!1,O()}}}function ID(n){let e,t,i=n[4].length+"",s;return{c(){e=v("div"),t=U("Total found: "),s=U(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(l,o){w(l,e,o),b(e,t),b(e,s)},p(l,o){o&16&&i!==(i=l[4].length+"")&&se(s,i)},d(l){l&&k(e)}}}function LD(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{footer:[ID],default:[AD]},$$scope:{ctx:n}}});let r={};return l=new SD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[18](null),V(l,a)}}}function PD(n,e,t){let i,s,l;Ke(n,ya,P=>t(21,i=P)),Ke(n,At,P=>t(6,s=P)),Ke(n,La,P=>t(7,l=P)),sn(At,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const P=j.normalizeSearchFilter(f,["id","email","created","updated"]);return de.admins.getFullList(100,{sort:c||"-created",filter:P}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),h(),de.error(N,(N==null?void 0:N.status)!=400))})}function h(){t(4,a=[])}const g=()=>d(),m=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function y(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function C(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const $=P=>r==null?void 0:r.show(P),O=(P,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(P))},M=()=>t(1,f="");function D(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const I=()=>d(),F=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();Hi("/settings/admins?"+P),d()}},[d,f,c,r,a,u,s,l,g,m,_,y,S,C,T,$,O,M,D,I,F]}class FD extends ve{constructor(e){super(),be(this,e,PD,LD,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function ND(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0]),l.focus(),r||(a=K(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]&&ae(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("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,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[1]),w(d,r,h),w(d,a,h),b(a,u),f||(c=[K(l,"input",n[5]),Te(un.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&ae(l,d[1])},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),f=!1,$e(c)}}}function qD(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:[ND,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[RD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=v("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),b(e,a),u=!0,f||(c=K(e,"submit",xe(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const m={};h&770&&(m.$$scope={dirty:h,ctx:d}),o.$set(m),(!u||h&4)&&Q(a,"btn-disabled",d[2]),(!u||h&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function jD(n){let e,t;return e=new _b({props:{$$slots:{default:[qD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function HD(n,e,t){let i;Ke(n,ya,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),de.admins.authWithPassword(l,o).then(()=>{Aa(),Hi("/")}).catch(()=>{ls("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 VD extends ve{constructor(e){super(),be(this,e,HD,jD,me,{})}}function zD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[UD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[WD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[YD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[KD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}});let O=n[3]&&Dm(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),O&&O.c(),m=E(),_=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(_,"type","submit"),p(_,"class","btn btn-expanded"),_.disabled=S=!n[3]||n[2],Q(_,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),H(a,e,null),b(e,u),H(f,e,null),b(e,c),b(e,d),b(d,h),b(d,g),O&&O.m(d,null),b(d,m),b(d,_),b(_,y),C=!0,T||($=K(_,"click",n[13]),T=!0)},p(M,D){const I={};D&1572865&&(I.$$scope={dirty:D,ctx:M}),i.$set(I);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:M}),o.$set(F);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:M}),a.$set(P);const N={};D&1572865&&(N.$$scope={dirty:D,ctx:M}),f.$set(N),M[3]?O?O.p(M,D):(O=Dm(M),O.c(),O.m(d,m)):O&&(O.d(1),O=null),(!C||D&12&&S!==(S=!M[3]||M[2]))&&(_.disabled=S),(!C||D&4)&&Q(_,"btn-loading",M[2])},i(M){C||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(a.$$.fragment,M),A(f.$$.fragment,M),C=!0)},o(M){L(i.$$.fragment,M),L(o.$$.fragment,M),L(a.$$.fragment,M),L(f.$$.fragment,M),C=!1},d(M){M&&k(e),V(i),V(o),V(a),V(f),O&&O.d(),T=!1,$()}}}function BD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function UD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.appName),r||(a=K(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&&ae(l,u[0].meta.appName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function WD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application URL"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.appUrl),r||(a=K(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&&ae(l,u[0].meta.appUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function YD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Logs max days retention"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].logs.maxDays),r||(a=K(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&&dt(l.value)!==u[0].logs.maxDays&&ae(l,u[0].logs.maxDays)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function KD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),Te(je.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Dm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=K(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function JD(n){let e,t,i,s,l,o,r,a,u;const f=[BD,zD],c=[];function d(h,g){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML='',t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),b(i,s),c[l].m(s,null),r=!0,a||(u=K(s,"submit",xe(n[4])),a=!0)},p(h,g){let m=l;l=d(h),l===m?c[l].p(h,g):(ue(),L(c[m],1,1,()=>{c[m]=null}),fe(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&(k(e),k(t),k(i)),c[l].d(),a=!1,u()}}}function GD(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[JD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function ZD(n,e,t){let i,s,l,o;Ke(n,Ms,O=>t(14,s=O)),Ke(n,ko,O=>t(15,l=O)),Ke(n,At,O=>t(16,o=O)),sn(At,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const O=await de.settings.update(j.filterRedactedProps(a));g(O),jt("Successfully saved application settings.")}catch(O){de.error(O)}t(2,f=!1)}}function g(O={}){var M,D;sn(ko,l=(M=O==null?void 0:O.meta)==null?void 0:M.appName,l),sn(Ms,s=!!((D=O==null?void 0:O.meta)!=null&&D.hideControls),s),t(0,a={meta:(O==null?void 0:O.meta)||{},logs:(O==null?void 0:O.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function m(){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 S(){a.logs.maxDays=dt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>m(),$=()=>h();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,h,m,r,c,_,y,S,C,T,$]}class XD extends ve{constructor(e){super(),be(this,e,ZD,GD,me,{})}}function QD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),fi(s,a)},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Te(je.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){fi(s,a=yt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(k(e),k(i),k(s)),l=!1,$e(o)}}}function eA(n){let e;function t(l,o){return l[3]?xD:QD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function tA(n,e,t){const i=["value","mask"];let s=et(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ln(),r==null||r.focus()}const f=()=>u();function c(h){te[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(5,s=et(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class uu extends ve{constructor(e){super(),be(this,e,tA,eA,me,{value:0,mask:1})}}function nA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("label"),t=U("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters: + `),l[0]&2176&&(o.beforeHide=s[54]),l[0]&30461|l[2]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[55](null),H(e,s)}}}const ss="form",yl="providers";function JO(n,e,t){let i,s,l,o,r;const a=pt(),u="record_"+V.randomString(5);let{collection:f}=e,c,d=null,h=null,g=null,m=!1,_=!1,y={},S={},C=JSON.stringify(null),T=C,$=ss,O=!0,M=!1;function D(ce){return F(ce),t(11,_=!0),t(12,$=ss),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}async function F(ce){t(28,M=!1),en({}),t(2,d=ce||{}),t(3,h=structuredClone(d)),t(4,y={}),t(5,S={}),await ln(),t(9,g=R()),!g||Z(h,g)?t(9,g=null):(delete g.password,delete g.passwordConfirm),t(26,C=JSON.stringify(h)),t(28,M=!0)}async function P(ce){var Ze,It;en({}),t(2,d=ce||{}),t(4,y={}),t(5,S={});const we=((It=(Ze=f==null?void 0:f.schema)==null?void 0:Ze.filter(tt=>tt.type!="file"))==null?void 0:It.map(tt=>tt.name))||[];for(let tt in ce)we.includes(tt)||t(3,h[tt]=ce[tt],h);await ln(),t(26,C=JSON.stringify(h)),X()}function N(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function R(ce){try{const we=window.localStorage.getItem(N());if(we)return JSON.parse(we)}catch{}return ce}function q(ce){try{window.localStorage.setItem(N(),ce)}catch(we){console.warn("updateDraft failure:",we)}}function B(){g&&(t(3,h=g),t(9,g=null))}function Z(ce,we){var an;const Ze=structuredClone(ce||{}),It=structuredClone(we||{}),tt=(an=f==null?void 0:f.schema)==null?void 0:an.filter(Zt=>Zt.type==="file");for(let Zt of tt)delete Ze[Zt.name],delete It[Zt.name];return delete Ze.password,delete Ze.passwordConfirm,delete It.password,delete It.passwordConfirm,JSON.stringify(Ze)==JSON.stringify(It)}function X(){t(9,g=null),window.localStorage.removeItem(N())}async function J(ce=!0){if(!(m||!r||!(f!=null&&f.id))){t(10,m=!0);try{const we=le();let Ze;O?Ze=await de.collection(f.id).create(we):Ze=await de.collection(f.id).update(h.id,we),jt(O?"Successfully created record.":"Successfully updated record."),X(),ce?(t(11,_=!1),I()):P(Ze),a("save",{isNew:O,record:Ze})}catch(we){de.error(we)}t(10,m=!1)}}function W(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>de.collection(d.collectionId).delete(d.id).then(()=>{I(),jt("Successfully deleted record."),a("delete",d)}).catch(ce=>{de.error(ce)}))}function le(){const ce=structuredClone(h||{}),we=new FormData,Ze={id:ce.id},It={};for(const tt of(f==null?void 0:f.schema)||[])Ze[tt.name]=!0,tt.type=="json"&&(It[tt.name]=!0);i&&(Ze.username=!0,Ze.email=!0,Ze.emailVisibility=!0,Ze.password=!0,Ze.passwordConfirm=!0,Ze.verified=!0);for(const tt in ce)if(Ze[tt]){if(typeof ce[tt]>"u"&&(ce[tt]=null),It[tt]&&ce[tt]!=="")try{JSON.parse(ce[tt])}catch(an){const Zt={};throw Zt[tt]={code:"invalid_json",message:an.toString()},new Kn({status:400,response:{data:Zt}})}V.addValueToFormData(we,tt,ce[tt])}for(const tt in y){const an=V.toArray(y[tt]);for(const Zt of an)we.append(tt,Zt)}for(const tt in S){const an=V.toArray(S[tt]);for(const Zt of an)we.append(tt+"."+Zt,"")}return we}function ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>de.collection(f.id).requestVerification(d.email).then(()=>{jt(`Successfully sent verification email to ${d.email}.`)}).catch(ce=>{de.error(ce)}))}function ie(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>de.collection(f.id).requestPasswordReset(d.email).then(()=>{jt(`Successfully sent password reset email to ${d.email}.`)}).catch(ce=>{de.error(ce)}))}function Ee(){o?mn("You have unsaved changes. Do you really want to discard them?",()=>{Ne()}):Ne()}async function Ne(){let ce=d?structuredClone(d):null;if(ce){ce.id="",ce.created="",ce.updated="";const we=(f==null?void 0:f.schema)||[];for(const Ze of we)Ze.type==="file"&&delete ce[Ze.name]}X(),D(ce),await ln(),t(26,C="")}function Ve(ce){(ce.ctrlKey||ce.metaKey)&&ce.code=="KeyS"&&(ce.preventDefault(),ce.stopPropagation(),J(!1))}const ze=()=>I(),oe=()=>ee(),Ce=()=>ie(),We=()=>Ee(),_t=()=>W(),Xe=()=>t(12,$=ss),Je=()=>t(12,$=yl),wt=()=>B(),_e=()=>X();function ke(){h.id=this.value,t(3,h)}function Ge(ce){h=ce,t(3,h)}function Oe(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function ht(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Ft(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function rn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function xt(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function tn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Pn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Ae(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function St(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function Fn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}function bn(ce,we){n.$$.not_equal(y[we.name],ce)&&(y[we.name]=ce,t(4,y))}function hi(ce,we){n.$$.not_equal(S[we.name],ce)&&(S[we.name]=ce,t(5,S))}function Nn(ce,we){n.$$.not_equal(h[we.name],ce)&&(h[we.name]=ce,t(3,h))}const Zn=()=>o&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,_=!1),I()}),!1):(en({}),X(),!0);function mi(ce){te[ce?"unshift":"push"](()=>{c=ce,t(8,c)})}function Rn(ce){Fe.call(this,n,ce)}function Xn(ce){Fe.call(this,n,ce)}return n.$$set=ce=>{"collection"in ce&&t(0,f=ce.collection)},n.$$.update=()=>{var ce;n.$$.dirty[0]&1&&t(13,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(15,s=!!((ce=f==null?void 0:f.schema)!=null&&ce.find(we=>we.type==="editor"))),n.$$.dirty[0]&48&&t(29,l=V.hasNonEmptyProps(y)||V.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(27,T=JSON.stringify(h)),n.$$.dirty[0]&738197504&&t(7,o=l||C!=T),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&192&&t(14,r=O||o),n.$$.dirty[0]&402653184&&M&&q(T)},[f,I,d,h,y,S,O,o,c,g,m,_,$,i,r,s,u,B,X,J,W,ee,ie,Ee,Ve,D,C,T,M,l,ze,oe,Ce,We,_t,Xe,Je,wt,_e,ke,Ge,Oe,ht,Ft,rn,xt,tn,Pn,Ae,St,Fn,bn,hi,Nn,Zn,mi,Rn,Xn]}class M1 extends ve{constructor(e){super(),be(this,e,JO,KO,me,{collection:0,show:25,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[1]}}function Mh(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Oh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Dh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function GO(n){const e=n.slice(),t=V.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function ZO(n){var l,o;const e=n.slice(),t=V.toArray(e[3]);e[9]=t;const i=V.toArray((o=(l=e[0])==null?void 0:l.expand)==null?void 0:o[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function XO(n){const e=n.slice(),t=V.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function QO(n){let e,t;return{c(){e=v("div"),t=U(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function xO(n){let e,t=V.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=V.truncate(n[3]))},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&8&&t!==(t=V.truncate(l[3])+"")&&se(i,t),o&8&&s!==(s=V.truncate(l[3]))&&p(e,"title",s)},i:x,o:x,d(l){l&&k(e)}}}function eE(n){let e,t=[],i=new Map,s,l,o=ge(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&Ih();return{c(){var u;e=v("div");for(let f=0;fu[17]?a||(a=Ih(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!l||f&2)&&Q(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!l){for(let f=0;fn[11]&&Fh();return{c(){e=v("div"),i.c(),s=E(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),b(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(ue(),L(r[d],1,1,()=>{r[d]=null}),fe(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Fh(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function nE(n){let e,t=[],i=new Map,s=ge(V.toArray(n[3]));const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function lE(n){let e,t=V.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=U(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),b(e,i),s||(l=[Te(je.call(null,e,"Open in new tab")),K(e,"click",An(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=V.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function oE(n){let e,t;return{c(){e=v("span"),t=U(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&se(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function rE(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function aE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function uE(n){let e,t,i,s;const l=[mE,hE],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ue(),L(o[f],1,1,()=>{o[f]=null}),fe(),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){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Ah(n,e){let t,i,s;return i=new ru({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(i,l)}}}function Ih(n){let e;return{c(){e=U("...")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fE(n){let e,t=ge(n[9].slice(0,n[11])),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&Rh(n);return{c(){e=v("span"),i=U(t),s=E(),r&&r.c(),l=Se(),p(e,"class","txt")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=V.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=Rh(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(ue(),L(r,1,1,()=>{r=null}),fe())},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&(k(e),k(s),k(l)),r&&r.d(a)}}}function mE(n){let e,t=V.truncate(n[5])+"",i;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=V.truncate(s[5])+"")&&se(i,t)},i:x,o:x,d(s){s&&k(e)}}}function Rh(n){let e,t;return e=new qs({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gE(n){let e,t,i,s,l;const o=[uE,aE,rE,oE,lE,sE,iE,nE,tE,eE,xO,QO],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!V.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?XO(f):c===8?ZO(f):c===9?GO(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=Se()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(ue(),L(r[d],1,1,()=>{r[d]=null}),fe(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){f&&k(s),r[t].d(f)}}}function _E(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Fe.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[l.name])},[s,l,o,i,r]}class O1 extends ve{constructor(e){super(),be(this,e,_E,gE,me,{record:0,field:1,short:2})}}function qh(n,e,t){const i=n.slice();return i[10]=e[t],i}function jh(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new O1({props:{field:n[10],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=U(i),l=E(),o=v("td"),z(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),b(e,t),b(t,s),b(e,l),b(e,o),j(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&se(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){L(r.$$.fragment,u),a=!1},d(u){u&&k(e),H(r)}}}function Hh(n){let e,t,i,s,l,o;return l=new Ci({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),j(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function Vh(n){let e,t,i,s,l,o;return l=new Ci({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),j(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function bE(n){var O;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,h,g,m,_;a=new qs({props:{value:n[3].id}});let y=ge((O=n[0])==null?void 0:O.schema),S=[];for(let M=0;ML(S[M],1,1,()=>{S[M]=null});let T=n[3].created&&Hh(n),$=n[3].updated&&Vh(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=E(),o=v("td"),r=v("div"),z(a.$$.fragment),u=E(),f=v("span"),d=U(c),h=E();for(let M=0;M{T=null}),fe()),M[3].updated?$?($.p(M,D),D&8&&A($,1)):($=Vh(M),$.c(),A($,1),$.m(t,null)):$&&(ue(),L($,1,1,()=>{$=null}),fe())},i(M){if(!_){A(a.$$.fragment,M);for(let D=0;DClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[6]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function kE(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[yE],header:[vE],default:[bE]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function wE(n,e,t){let i,{collection:s}=e,l,o={};function r(h){return t(3,o=h),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(h){te[h?"unshift":"push"](()=>{l=h,t(2,l)})}function c(h){Fe.call(this,n,h)}function d(h){Fe.call(this,n,h)}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{var h;n.$$.dirty&1&&t(4,i=!!((h=s==null?void 0:s.schema)!=null&&h.find(g=>g.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class SE extends ve{constructor(e){super(),be(this,e,wE,kE,me,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function zh(n,e,t){const i=n.slice();return i[61]=e[t],i}function Bh(n,e,t){const i=n.slice();return i[64]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[64]=e[t],i}function Wh(n,e,t){const i=n.slice();return i[57]=e[t],i}function Yh(n){let e;function t(l,o){return l[13]?CE:TE}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&k(e),s.d()}}}function TE(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=E(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),o||(r=K(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&k(e),o=!1,r()}}}function CE(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Kh(n){let e,t,i;function s(o){n[32](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[$E]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function $E(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Jh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l,o=e&&Gh(n),r=i&&Zh(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=Se()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,s,u),l=!0},p(a,u){u[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,u),u[0]&32&&A(o,1)):(o=Gh(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(ue(),L(o,1,1,()=>{o=null}),fe()),u[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=Zh(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(ue(),L(r,1,1,()=>{r=null}),fe())},i(a){l||(A(o),A(r),l=!0)},o(a){L(o),L(r),l=!1},d(a){a&&(k(t),k(s)),o&&o.d(a),r&&r.d(a)}}}function Gh(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[ME]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ME(n){let e;return{c(){e=v("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Zh(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[OE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function OE(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function EE(n){let e,t,i,s,l,o=n[64].name+"",r;return{c(){e=v("div"),t=v("i"),s=E(),l=v("span"),r=U(o),p(t,"class",i=V.getFieldTypeIcon(n[64].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),b(l,r)},p(a,u){u[0]&524288&&i!==(i=V.getFieldTypeIcon(a[64].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[64].name+"")&&se(r,o)},d(a){a&&k(e)}}}function Xh(n,e){let t,i,s,l;function o(a){e[35](a)}let r={class:"col-type-"+e[64].type+" col-field-"+e[64].name,name:e[64].name,$$slots:{default:[EE]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new cn({props:r}),te.push(()=>he(i,"sort",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[64].type+" col-field-"+e[64].name),u[0]&524288&&(f.name=e[64].name),u[0]&524288|u[2]&128&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function Qh(n){let e,t,i;function s(o){n[36](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[DE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function DE(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function xh(n){let e,t,i;function s(o){n[37](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[AE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new cn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[2]&128&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function AE(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function em(n){let e;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[38](e)},p:x,d(t){t&&k(e),n[38](null)}}}function tm(n){let e;function t(l,o){return l[13]?LE:IE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function IE(n){let e,t,i,s;function l(a,u){var f;if((f=a[1])!=null&&f.length)return FE;if(!a[10])return PE}let o=l(n),r=o&&o(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=E(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),r&&r.m(t,null)},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&k(e),r&&r.d()}}}function LE(n){let e;return{c(){e=v("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[43]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function FE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[42]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function nm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[39](n[61])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[61].id),i.checked=l=n[4][n[61].id],p(r,"for",a="checkbox_"+n[61].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,h){w(d,e,h),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[K(i,"change",c),K(t,"click",An(n[29]))],u=!0)},p(d,h){n=d,h[0]&8&&s!==(s="checkbox_"+n[61].id)&&p(i,"id",s),h[0]&24&&l!==(l=n[4][n[61].id])&&(i.checked=l),h[0]&8&&a!==(a="checkbox_"+n[61].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,$e(f)}}}function im(n){let e,t,i,s,l,o,r=n[61].id+"",a,u,f;s=new qs({props:{value:n[61].id}});let c=n[9]&&sm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),a=U(r),u=E(),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,h){w(d,e,h),b(e,t),b(t,i),j(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,h){const g={};h[0]&8&&(g.value=d[61].id),s.$set(g),(!f||h[0]&8)&&r!==(r=d[61].id+"")&&se(a,r),d[9]?c?c.p(d,h):(c=sm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){L(s.$$.fragment,d),f=!1},d(d){d&&k(e),H(s),c&&c.d()}}}function sm(n){let e;function t(l,o){return l[61].verified?RE:NE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(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){l&&k(e),s.d(l)}}}function NE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Te(je.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function RE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=Te(je.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function lm(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l=e&&om(n),o=i&&rm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=Se()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?l?l.p(r,a):(l=om(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=rm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){r&&(k(t),k(s)),l&&l.d(r),o&&o.d(r)}}}function om(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!V.isEmpty(o[61].username)),t?jE:qE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(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&&k(e),l.d()}}}function qE(n){let e,t=n[61].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[61].username)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[61].username+"")&&se(i,t),o[0]&8&&s!==(s=l[61].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function jE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!V.isEmpty(o[61].email)),t?VE:HE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(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&&k(e),l.d()}}}function HE(n){let e,t=n[61].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[61].email)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[61].email+"")&&se(i,t),o[0]&8&&s!==(s=l[61].email)&&p(e,"title",s)},d(l){l&&k(e)}}}function VE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function am(n,e){let t,i,s,l;return i=new O1({props:{short:!0,record:e[61],field:e[64]}}),{key:n,first:null,c(){t=v("td"),z(i.$$.fragment),p(t,"class",s="col-type-"+e[64].type+" col-field-"+e[64].name),this.first=t},m(o,r){w(o,t,r),j(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[61]),r[0]&524288&&(a.field=e[64]),i.$set(a),(!l||r[0]&524288&&s!==(s="col-type-"+e[64].type+" col-field-"+e[64].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(i)}}}function um(n){let e,t,i;return t=new Ci({props:{date:n[61].created}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[61].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function fm(n){let e,t,i;return t=new Ci({props:{date:n[61].updated}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[61].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function cm(n,e){let t,i,s=!e[5].includes("@id"),l,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),h,g,m,_,y,S=!e[10]&&nm(e),C=s&&im(e),T=e[9]&&lm(e),$=ge(e[19]);const O=P=>P[64].name;for(let P=0;P<$.length;P+=1){let N=Bh(e,$,P),R=O(N);a.set(R,r[P]=am(R,N))}let M=f&&um(e),D=d&&fm(e);function I(){return e[40](e[61])}function F(...P){return e[41](e[61],...P)}return{key:n,first:null,c(){t=v("tr"),S&&S.c(),i=E(),C&&C.c(),l=E(),T&&T.c(),o=E();for(let P=0;P',p(g,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(P,N){w(P,t,N),S&&S.m(t,null),b(t,i),C&&C.m(t,null),b(t,l),T&&T.m(t,null),b(t,o);for(let R=0;R{C=null}),fe()),e[9]?T?T.p(e,N):(T=lm(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),N[0]&524296&&($=ge(e[19]),ue(),r=vt(r,N,O,1,e,$,a,t,Ut,am,u,Bh),fe()),N[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?M?(M.p(e,N),N[0]&288&&A(M,1)):(M=um(e),M.c(),A(M,1),M.m(t,c)):M&&(ue(),L(M,1,1,()=>{M=null}),fe()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?D?(D.p(e,N),N[0]&160&&A(D,1)):(D=fm(e),D.c(),A(D,1),D.m(t,h)):D&&(ue(),L(D,1,1,()=>{D=null}),fe())},i(P){if(!m){A(C);for(let N=0;N<$.length;N+=1)A(r[N]);A(M),A(D),m=!0}},o(P){L(C);for(let N=0;NJ[64].name;for(let J=0;JJ[10]?J[61]:J[61].id;for(let J=0;J{M=null}),fe()),J[9]?D?(D.p(J,W),W[0]&512&&A(D,1)):(D=Jh(J),D.c(),A(D,1),D.m(i,r)):D&&(ue(),L(D,1,1,()=>{D=null}),fe()),W[0]&524289&&(I=ge(J[19]),ue(),a=vt(a,W,F,1,J,I,u,i,Ut,Xh,f,Uh),fe()),W[0]&288&&(c=J[8]&&!J[5].includes("@created")),c?P?(P.p(J,W),W[0]&288&&A(P,1)):(P=Qh(J),P.c(),A(P,1),P.m(i,d)):P&&(ue(),L(P,1,1,()=>{P=null}),fe()),W[0]&160&&(h=J[7]&&!J[5].includes("@updated")),h?N?(N.p(J,W),W[0]&160&&A(N,1)):(N=xh(J),N.c(),A(N,1),N.m(i,g)):N&&(ue(),L(N,1,1,()=>{N=null}),fe()),J[16].length?R?R.p(J,W):(R=em(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null),W[0]&9971642&&(q=ge(J[3]),ue(),S=vt(S,W,B,1,J,q,C,y,Ut,cm,T,zh),fe(),!q.length&&Z?Z.p(J,W):q.length?Z&&(Z.d(1),Z=null):(Z=tm(J),Z.c(),Z.m(y,T))),J[3].length&&J[18]?X?X.p(J,W):(X=dm(J),X.c(),X.m(y,null)):X&&(X.d(1),X=null),(!$||W[0]&8192)&&Q(e,"table-loading",J[13])},i(J){if(!$){A(M),A(D);for(let W=0;W({60:l}),({uniqueId:l})=>[0,l?536870912:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&65568|o[1]&536870912|o[2]&128&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(i,l)}}}function UE(n){let e,t,i=[],s=new Map,l,o,r=ge(n[16]);const a=u=>u[57].id+u[57].name;for(let u=0;u{i=null}),fe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function mm(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,m,_,y,S;return{c(){e=v("div"),t=v("div"),i=U("Selected "),s=v("strong"),l=U(n[6]),o=E(),a=U(r),u=E(),f=v("button"),f.innerHTML='Reset',c=E(),d=v("div"),h=E(),g=v("button"),g.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-transparent btn-danger"),Q(g,"btn-loading",n[14]),Q(g,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(s,l),b(t,o),b(t,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,h),b(e,g),_=!0,y||(S=[K(f,"click",n[46]),K(g,"click",n[47])],y=!0)},p(C,T){(!_||T[0]&64)&&se(l,C[6]),(!_||T[0]&64)&&r!==(r=C[6]===1?"record":"records")&&se(a,r),(!_||T[0]&16384)&&Q(f,"btn-disabled",C[14]),(!_||T[0]&16384)&&Q(g,"btn-loading",C[14]),(!_||T[0]&16384)&&Q(g,"btn-disabled",C[14])},i(C){_||(C&&Qe(()=>{_&&(m||(m=qe(e,di,{duration:150,y:5},!0)),m.run(1))}),_=!0)},o(C){C&&(m||(m=qe(e,di,{duration:150,y:5},!1)),m.run(0)),_=!1},d(C){C&&k(e),C&&m&&m.end(),y=!1,$e(S)}}}function YE(n){let e,t,i,s,l={class:"table-wrapper",$$slots:{before:[WE],default:[zE]},$$scope:{ctx:n}};e=new Fa({props:l}),n[45](e);let o=n[6]&&mm(n);return{c(){z(e.$$.fragment),t=E(),o&&o.c(),i=Se()},m(r,a){j(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!0},p(r,a){const u={};a[0]&1030075|a[2]&128&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&A(o,1)):(o=mm(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(ue(),L(o,1,1,()=>{o=null}),fe())},i(r){s||(A(e.$$.fragment,r),A(o),s=!0)},o(r){L(e.$$.fragment,r),L(o),s=!1},d(r){r&&(k(t),k(i)),n[45](null),H(e,r),o&&o.d(r)}}}const KE=/^([\+\-])?(\w+)$/,gm=45;function JE(n,e,t){let i,s,l,o,r,a,u,f,c,d,h,g;Ke(n,ii,Ae=>t(51,g=Ae));const m=pt();let{collection:_}=e,{sort:y=""}=e,{filter:S=""}=e,C,T=[],$=1,O=0,M={},D=!0,I=!1,F=0,P,N=[],R=[];function q(){_!=null&&_.id&&localStorage.setItem((_==null?void 0:_.id)+"@hiddenCollumns",JSON.stringify(N))}function B(){if(t(5,N=[]),!!(_!=null&&_.id))try{const Ae=localStorage.getItem(_.id+"@hiddenCollumns");Ae&&t(5,N=JSON.parse(Ae)||[])}catch{}}async function Z(){const Ae=$;for(let St=1;St<=Ae;St++)(St===1||u)&&await X(St,!1)}async function X(Ae=1,St=!0){var mi,Rn,Xn;if(!(_!=null&&_.id))return;t(13,D=!0);let Fn=y;const bn=Fn.match(KE),hi=bn?r.find(ce=>ce.name===bn[2]):null;if(bn&&hi){const ce=((Xn=(Rn=(mi=g==null?void 0:g.find(Ze=>{var It;return Ze.id==((It=hi.options)==null?void 0:It.collectionId)}))==null?void 0:mi.schema)==null?void 0:Rn.filter(Ze=>Ze.presentable))==null?void 0:Xn.map(Ze=>Ze.name))||[],we=[];for(const Ze of ce)we.push((bn[1]||"")+bn[2]+"."+Ze);we.length>0&&(Fn=we.join(","))}const Nn=V.getAllCollectionIdentifiers(_),Zn=o.map(ce=>ce.name+":excerpt(200)").concat(r.map(ce=>"expand."+ce.name+".*:excerpt(200)"));return Zn.length&&Zn.unshift("*"),de.collection(_.id).getList(Ae,gm,{sort:Fn,skipTotal:1,filter:V.normalizeSearchFilter(S,Nn),expand:r.map(ce=>ce.name).join(","),requestKey:"records_list"}).then(async ce=>{var we;if(Ae<=1&&J(),t(13,D=!1),t(12,$=ce.page),t(27,O=ce.items.length),m("load",T.concat(ce.items)),St){const Ze=++F;for(;(we=ce.items)!=null&&we.length&&F==Ze;)t(3,T=T.concat(ce.items.splice(0,15))),await V.yieldToMain()}else t(3,T=T.concat(ce.items))}).catch(ce=>{ce!=null&&ce.isAbort||(t(13,D=!1),console.warn(ce),J(),de.error(ce,(ce==null?void 0:ce.status)!=400))})}function J(){C==null||C.resetVerticalScroll(),t(3,T=[]),t(12,$=1),t(27,O=0),t(4,M={})}function W(){c?le():ee()}function le(){t(4,M={})}function ee(){for(const Ae of T)t(4,M[Ae.id]=Ae,M);t(4,M)}function ie(Ae){M[Ae.id]?delete M[Ae.id]:t(4,M[Ae.id]=Ae,M),t(4,M)}function Ee(){mn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,Ne)}async function Ne(){if(I||!f||!(_!=null&&_.id))return;let Ae=[];for(const St of Object.keys(M))Ae.push(de.collection(_.id).delete(St));return t(14,I=!0),Promise.all(Ae).then(()=>{jt(`Successfully deleted the selected ${f===1?"record":"records"}.`),m("delete",M),le()}).catch(St=>{de.error(St)}).finally(()=>(t(14,I=!1),Z()))}function Ve(Ae){Fe.call(this,n,Ae)}const ze=(Ae,St)=>{St.target.checked?V.removeByValue(N,Ae.id):V.pushUnique(N,Ae.id),t(5,N)},oe=()=>W();function Ce(Ae){y=Ae,t(0,y)}function We(Ae){y=Ae,t(0,y)}function _t(Ae){y=Ae,t(0,y)}function Xe(Ae){y=Ae,t(0,y)}function Je(Ae){y=Ae,t(0,y)}function wt(Ae){y=Ae,t(0,y)}function _e(Ae){te[Ae?"unshift":"push"](()=>{P=Ae,t(15,P)})}const ke=Ae=>ie(Ae),Ge=Ae=>m("select",Ae),Oe=(Ae,St)=>{St.code==="Enter"&&(St.preventDefault(),m("select",Ae))},ht=()=>t(1,S=""),Ft=()=>m("new"),rn=()=>X($+1);function xt(Ae){te[Ae?"unshift":"push"](()=>{C=Ae,t(11,C)})}const tn=()=>le(),Pn=()=>Ee();return n.$$set=Ae=>{"collection"in Ae&&t(25,_=Ae.collection),"sort"in Ae&&t(0,y=Ae.sort),"filter"in Ae&&t(1,S=Ae.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(B(),J()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,s=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(28,l=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&268435456&&(o=l.filter(Ae=>Ae.type==="editor")),n.$$.dirty[0]&268435456&&(r=l.filter(Ae=>Ae.type==="relation")),n.$$.dirty[0]&268435488&&t(19,a=l.filter(Ae=>!N.includes(Ae.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&y!==-1&&S!==-1&&X(1),n.$$.dirty[0]&134217728&&t(18,u=O>=gm),n.$$.dirty[0]&16&&t(6,f=Object.keys(M).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&N!==-1&&q(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,h=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&268436352&&t(16,R=[].concat(s?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],l.map(Ae=>({id:Ae.id,name:Ae.name})),d?{id:"@created",name:"created"}:[],h?{id:"@updated",name:"updated"}:[]))},[y,S,X,T,M,N,f,h,d,s,i,C,$,D,I,P,R,c,u,a,m,W,le,ie,Ee,_,Z,O,l,Ve,ze,oe,Ce,We,_t,Xe,Je,wt,_e,ke,Ge,Oe,ht,Ft,rn,xt,tn,Pn]}class GE extends ve{constructor(e){super(),be(this,e,JE,YE,me,{collection:25,sort:0,filter:1,reloadLoadedPages:26,load:2},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[26]}get load(){return this.$$.ctx[2]}}function ZE(n){let e,t,i,s,l=(n[2]?"...":n[0])+"",o,r;return{c(){e=v("div"),t=v("span"),t.textContent="Total found:",i=E(),s=v("span"),o=U(l),p(t,"class","txt"),p(s,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),b(e,t),b(e,i),b(e,s),b(s,o)},p(a,[u]){u&5&&l!==(l=(a[2]?"...":a[0])+"")&&se(o,l),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:x,o:x,d(a){a&&k(e)}}}function XE(n,e,t){const i=pt();let{collection:s}=e,{filter:l=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(s!=null&&s.id){t(2,a=!0),t(0,o=0);try{const f=V.getAllCollectionIdentifiers(s),c=await de.collection(s.id).getList(1,1,{filter:V.normalizeSearchFilter(l,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,s=f.collection),"filter"in f&&t(4,l=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&s!=null&&s.id&&l!==-1&&u()},[o,r,a,s,l,u]}class QE extends ve{constructor(e){super(),be(this,e,XE,ZE,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function xE(n){let e,t,i,s;return e=new PM({}),i=new Sn({props:{class:"flex-content",$$slots:{footer:[iD],default:[nD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[0]&6135|o[1]&512&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function eD(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[oD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&4112|s[1]&512&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tD(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[rD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[1]&512&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _m(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Te(je.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[19])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function bm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[22]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function nD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F,P=!n[12]&&_m(n);c=new Yo({}),c.$on("refresh",n[20]);let N=n[2].type!=="view"&&bm(n);y=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[23]);function R(Z){n[25](Z)}function q(Z){n[26](Z)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),$=new GE({props:B}),n[24]($),te.push(()=>he($,"filter",R)),te.push(()=>he($,"sort",q)),$.$on("select",n[27]),$.$on("delete",n[28]),$.$on("new",n[29]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=U(o),a=E(),u=v("div"),P&&P.c(),f=E(),z(c.$$.fragment),d=E(),h=v("div"),g=v("button"),g.innerHTML=' API Preview',m=E(),N&&N.c(),_=E(),z(y.$$.fragment),S=E(),C=v("div"),T=E(),z($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(h,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-sm")},m(Z,X){w(Z,e,X),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),P&&P.m(u,null),b(u,f),j(c,u,null),b(e,d),b(e,h),b(h,g),b(h,m),N&&N.m(h,null),w(Z,_,X),j(y,Z,X),w(Z,S,X),w(Z,C,X),w(Z,T,X),j($,Z,X),D=!0,I||(F=K(g,"click",n[21]),I=!0)},p(Z,X){(!D||X[0]&4)&&o!==(o=Z[2].name+"")&&se(r,o),Z[12]?P&&(P.d(1),P=null):P?P.p(Z,X):(P=_m(Z),P.c(),P.m(u,f)),Z[2].type!=="view"?N?N.p(Z,X):(N=bm(Z),N.c(),N.m(h,null)):N&&(N.d(1),N=null);const J={};X[0]&1&&(J.value=Z[0]),X[0]&4&&(J.autocompleteCollection=Z[2]),y.$set(J);const W={};X[0]&4&&(W.collection=Z[2]),!O&&X[0]&1&&(O=!0,W.filter=Z[0],ye(()=>O=!1)),!M&&X[0]&2&&(M=!0,W.sort=Z[1],ye(()=>M=!1)),$.$set(W)},i(Z){D||(A(c.$$.fragment,Z),A(y.$$.fragment,Z),A($.$$.fragment,Z),D=!0)},o(Z){L(c.$$.fragment,Z),L(y.$$.fragment,Z),L($.$$.fragment,Z),D=!1},d(Z){Z&&(k(e),k(_),k(S),k(C),k(T)),P&&P.d(),H(c),N&&N.d(),H(y,Z),n[24](null),H($,Z),I=!1,F()}}}function iD(n){let e,t,i;function s(o){n[18](o)}let l={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(l.totalCount=n[10]),e=new QE({props:l}),n[17](e),te.push(()=>he(e,"totalCount",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){n[17](null),H(e,o)}}}function sD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=K(i,"click",n[16]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function lD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oD(n){let e,t,i;function s(r,a){return r[12]?lD:sD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='',i=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(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&&k(e),o.d()}}}function rD(n){let e;return{c(){e=v("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[tD,eD,xE],h=[];function g(C,T){return C[3]&&!C[11].length?0:C[11].length?2:1}e=g(n),t=h[e]=d[e](n);let m={};s=new ou({props:m}),n[30](s);let _={};o=new zM({props:_}),n[31](o);let y={collection:n[2]};a=new M1({props:y}),n[32](a),a.$on("save",n[33]),a.$on("delete",n[34]);let S={collection:n[2]};return f=new SE({props:S}),n[35](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(C,T){h[e].m(C,T),w(C,i,T),j(s,C,T),w(C,l,T),j(o,C,T),w(C,r,T),j(a,C,T),w(C,u,T),j(f,C,T),c=!0},p(C,T){let $=e;e=g(C),e===$?h[e].p(C,T):(ue(),L(h[$],1,1,()=>{h[$]=null}),fe(),t=h[e],t?t.p(C,T):(t=h[e]=d[e](C),t.c()),A(t,1),t.m(i.parentNode,i));const O={};s.$set(O);const M={};o.$set(M);const D={};T[0]&4&&(D.collection=C[2]),a.$set(D);const I={};T[0]&4&&(I.collection=C[2]),f.$set(I)},i(C){c||(A(t),A(s.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),A(f.$$.fragment,C),c=!0)},o(C){L(t),L(s.$$.fragment,C),L(o.$$.fragment,C),L(a.$$.fragment,C),L(f.$$.fragment,C),c=!1},d(C){C&&(k(i),k(l),k(r),k(u)),h[e].d(C),n[30](null),H(s,C),n[31](null),H(o,C),n[32](null),H(a,C),n[35](null),H(f,C)}}}function uD(n,e,t){let i,s,l,o,r,a,u;Ke(n,Ti,oe=>t(2,s=oe)),Ke(n,Dt,oe=>t(36,l=oe)),Ke(n,vo,oe=>t(3,o=oe)),Ke(n,ya,oe=>t(15,r=oe)),Ke(n,ii,oe=>t(11,a=oe)),Ke(n,Ms,oe=>t(12,u=oe));const f=new URLSearchParams(r);let c,d,h,g,m,_,y=f.get("filter")||"",S=f.get("sort")||"-created",C=f.get("collectionId")||(s==null?void 0:s.id),T=0;function $(){t(13,C=s==null?void 0:s.id),t(0,y=""),t(1,S="-created"),O()}async function O(){if(!S)return;const oe=V.getAllCollectionIdentifiers(s),Ce=S.split(",").map(We=>We.startsWith("+")||We.startsWith("-")?We.substring(1):We);Ce.filter(We=>oe.includes(We)).length!=Ce.length&&(oe.includes("created")?t(1,S="-created"):t(1,S=""))}qy(C);const M=()=>c==null?void 0:c.show();function D(oe){te[oe?"unshift":"push"](()=>{_=oe,t(9,_)})}function I(oe){T=oe,t(10,T)}const F=()=>c==null?void 0:c.show(s),P=()=>m==null?void 0:m.load(),N=()=>d==null?void 0:d.show(s),R=()=>h==null?void 0:h.show(),q=oe=>t(0,y=oe.detail);function B(oe){te[oe?"unshift":"push"](()=>{m=oe,t(8,m)})}function Z(oe){y=oe,t(0,y)}function X(oe){S=oe,t(1,S)}const J=oe=>{s.type==="view"?g.show(oe==null?void 0:oe.detail):h==null||h.show(oe==null?void 0:oe.detail)},W=()=>{_==null||_.reload()},le=()=>h==null?void 0:h.show();function ee(oe){te[oe?"unshift":"push"](()=>{c=oe,t(4,c)})}function ie(oe){te[oe?"unshift":"push"](()=>{d=oe,t(5,d)})}function Ee(oe){te[oe?"unshift":"push"](()=>{h=oe,t(6,h)})}const Ne=oe=>{var Ce;m==null||m.reloadLoadedPages(),(Ce=oe.detail)!=null&&Ce.isNew&&t(10,T++,T)},Ve=()=>{m==null||m.reloadLoadedPages(),t(10,T--,T)};function ze(oe){te[oe?"unshift":"push"](()=>{g=oe,t(7,g)})}return n.$$.update=()=>{if(n.$$.dirty[0]&32768&&t(14,i=new URLSearchParams(r)),n.$$.dirty[0]&24584&&!o&&i.get("collectionId")&&i.get("collectionId")!=C&&Fy(i.get("collectionId")),n.$$.dirty[0]&8196&&s!=null&&s.id&&C!=s.id&&$(),n.$$.dirty[0]&4&&s!=null&&s.id&&O(),n.$$.dirty[0]&7&&(S||y||s!=null&&s.id)){const oe=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:y,sort:S}).toString();Hi("/collections?"+oe)}n.$$.dirty[0]&4&&sn(Dt,l=(s==null?void 0:s.name)||"Collections",l)},[y,S,s,o,c,d,h,g,m,_,T,a,u,C,i,r,M,D,I,F,P,N,R,q,B,Z,X,J,W,le,ee,ie,Ee,Ne,Ve,ze]}class fD extends ve{constructor(e){super(),be(this,e,uD,aD,me,{},null,[-1,-1])}}function cD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=E(),l=v("a"),l.innerHTML=' Application',o=E(),r=v("a"),r.innerHTML=' Mail settings',a=E(),u=v("a"),u.innerHTML=' Files storage',f=E(),c=v("a"),c.innerHTML=' Backups',d=E(),h=v("div"),h.innerHTML='Sync',g=E(),m=v("a"),m.innerHTML=' Export collections',_=E(),y=v("a"),y.innerHTML=' Import collections',S=E(),C=v("div"),C.textContent="Authentication",T=E(),$=v("a"),$.innerHTML=' Auth providers',O=E(),M=v("a"),M.innerHTML=' Token options',D=E(),I=v("a"),I.innerHTML=' Admins',p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(h,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p(C,"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(I,"href","/settings/admins"),p(I,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(N,R){w(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),b(t,f),b(t,c),b(t,d),b(t,h),b(t,g),b(t,m),b(t,_),b(t,y),b(t,S),b(t,C),b(t,T),b(t,$),b(t,O),b(t,M),b(t,D),b(t,I),F||(P=[Te(zn.call(null,l,{path:"/settings"})),Te(un.call(null,l)),Te(zn.call(null,r,{path:"/settings/mail/?.*"})),Te(un.call(null,r)),Te(zn.call(null,u,{path:"/settings/storage/?.*"})),Te(un.call(null,u)),Te(zn.call(null,c,{path:"/settings/backups/?.*"})),Te(un.call(null,c)),Te(zn.call(null,m,{path:"/settings/export-collections/?.*"})),Te(un.call(null,m)),Te(zn.call(null,y,{path:"/settings/import-collections/?.*"})),Te(un.call(null,y)),Te(zn.call(null,$,{path:"/settings/auth-providers/?.*"})),Te(un.call(null,$)),Te(zn.call(null,M,{path:"/settings/tokens/?.*"})),Te(un.call(null,M)),Te(zn.call(null,I,{path:"/settings/admins/?.*"})),Te(un.call(null,I))],F=!0)},p:x,i:x,o:x,d(N){N&&k(e),F=!1,$e(P)}}}class Oi extends ve{constructor(e){super(),be(this,e,null,cD,me,{})}}function vm(n,e,t){const i=n.slice();return i[31]=e[t],i}function ym(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[dD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function dD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return a=new T1({props:{model:n[1]}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),z(a.$$.fragment),u=E(),f=v("input"),p(t,"class",V.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"class","form-field-addon"),p(f,"type","text"),p(f,"id",c=n[30]),f.value=d=n[1].id,f.readOnly=!0},m(g,m){w(g,e,m),b(e,t),b(e,i),b(e,s),w(g,o,m),w(g,r,m),j(a,r,null),w(g,u,m),w(g,f,m),h=!0},p(g,m){(!h||m[0]&1073741824&&l!==(l=g[30]))&&p(e,"for",l);const _={};m[0]&2&&(_.model=g[1]),a.$set(_),(!h||m[0]&1073741824&&c!==(c=g[30]))&&p(f,"id",c),(!h||m[0]&2&&d!==(d=g[1].id)&&f.value!==d)&&(f.value=d)},i(g){h||(A(a.$$.fragment,g),h=!0)},o(g){L(a.$$.fragment,g),h=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),H(a)}}}function km(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=E(),_n(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){w(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[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function pD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",V.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[3]),u||(f=K(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&ae(r,c[3])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function wm(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[hD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Sm(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[mD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(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){w(f,e,c),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742848|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Qe(()=>{u&&(a||(a=qe(t,it,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(t,it,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return c=new C1({}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(m,_){w(m,e,_),b(e,t),b(e,i),b(e,s),w(m,o,_),w(m,r,_),ae(r,n[9]),w(m,u,_),w(m,f,_),j(c,f,null),d=!0,h||(g=K(r,"input",n[21]),h=!0)},p(m,_){(!d||_[0]&1073741824&&l!==(l=m[30]))&&p(e,"for",l),(!d||_[0]&1073741824&&a!==(a=m[30]))&&p(r,"id",a),_[0]&512&&r.value!==m[9]&&ae(r,m[9])},i(m){d||(A(c.$$.fragment,m),d=!0)},o(m){L(c.$$.fragment,m),d=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),H(c),h=!1,g()}}}function gD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[10]),u||(f=K(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&ae(r,c[10])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function _D(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&ym(n),m=ge([0,1,2,3,4,5,6,7,8,9]),_=[];for(let C=0;C<10;C+=1)_[C]=km(vm(n,m,C));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[pD,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&wm(n),S=(n[5]||n[4])&&Sm(n);return{c(){e=v("form"),g&&g.c(),t=E(),i=v("div"),s=v("p"),s.textContent="Avatar",l=E(),o=v("div");for(let C=0;C<10;C+=1)_[C].c();r=E(),z(a.$$.fragment),u=E(),y&&y.c(),f=E(),S&&S.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(C,T){w(C,e,T),g&&g.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let $=0;$<10;$+=1)_[$]&&_[$].m(o,null);b(e,r),j(a,e,null),b(e,u),y&&y.m(e,null),b(e,f),S&&S.m(e,null),c=!0,d||(h=K(e,"submit",xe(n[13])),d=!0)},p(C,T){if(C[5]?g&&(ue(),L(g,1,1,()=>{g=null}),fe()):g?(g.p(C,T),T[0]&32&&A(g,1)):(g=ym(C),g.c(),A(g,1),g.m(e,t)),T[0]&4){m=ge([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const M=vm(C,m,O);_[O]?_[O].p(M,T):(_[O]=km(M),_[O].c(),_[O].m(o,null))}for(;O<10;O+=1)_[O].d(1)}const $={};T[0]&1073741832|T[1]&8&&($.$$scope={dirty:T,ctx:C}),a.$set($),C[5]?y&&(ue(),L(y,1,1,()=>{y=null}),fe()):y?(y.p(C,T),T[0]&32&&A(y,1)):(y=wm(C),y.c(),A(y,1),y.m(e,f)),C[5]||C[4]?S?(S.p(C,T),T[0]&48&&A(S,1)):(S=Sm(C),S.c(),A(S,1),S.m(e,null)):S&&(ue(),L(S,1,1,()=>{S=null}),fe())},i(C){c||(A(g),A(a.$$.fragment,C),A(y),A(S),c=!0)},o(C){L(g),L(a.$$.fragment,C),L(y),L(S),c=!1},d(C){C&&k(e),g&&g.d(),gt(_,C),H(a),y&&y.d(),S&&S.d(),d=!1,h()}}}function bD(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&32&&t!==(t=s[5]?"New admin":"Edit admin")&&se(i,t)},d(s){s&&k(e)}}}function Tm(n){let e,t,i,s,l,o,r,a,u;return o=new Ln({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[vD]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=E(),s=v("i"),l=E(),z(o.$$.fragment),r=E(),a=v("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),j(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){L(o.$$.fragment,f),u=!1},d(f){f&&(k(e),k(r),k(a)),H(o)}}}function vD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function yD(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,h=!n[5]&&Tm(n);return{c(){h&&h.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(g,m){h&&h.m(g,m),w(g,e,m),w(g,t,m),b(t,i),w(g,s,m),w(g,l,m),b(l,o),b(o,a),f=!0,c||(d=K(t,"click",n[17]),c=!0)},p(g,m){g[5]?h&&(ue(),L(h,1,1,()=>{h=null}),fe()):h?(h.p(g,m),m[0]&32&&A(h,1)):(h=Tm(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||m[0]&128)&&(t.disabled=g[7]),(!f||m[0]&32)&&r!==(r=g[5]?"Create":"Save changes")&&se(a,r),(!f||m[0]&2176&&u!==(u=!g[11]||g[7]))&&(l.disabled=u),(!f||m[0]&128)&&Q(l,"btn-loading",g[7])},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){g&&(k(e),k(t),k(s),k(l)),h&&h.d(g),c=!1,d()}}}function kD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[yD],header:[bD],default:[_D]},$$scope:{ctx:n}};return e=new on({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),H(e,s)}}}function wD(n,e,t){let i,s;const l=pt(),o="admin_"+V.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",h="",g="",m=!1;function _(X){return S(X),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),C()}function C(){t(4,m=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,h=""),t(10,g=""),en({})}function T(){if(u||!s)return;t(7,u=!0);const X={email:d,avatar:c};(i||m)&&(X.password=h,X.passwordConfirm=g);let J;i?J=de.admins.create(X):J=de.admins.update(a.id,X),J.then(async W=>{var le;t(8,f=!1),y(),jt(i?"Successfully created admin.":"Successfully updated admin."),((le=de.authStore.model)==null?void 0:le.id)===W.id&&de.authStore.save(de.authStore.token,W),l("save",W)}).catch(W=>{de.error(W)}).finally(()=>{t(7,u=!1)})}function $(){a!=null&&a.id&&mn("Do you really want to delete the selected admin?",()=>de.admins.delete(a.id).then(()=>{t(8,f=!1),y(),jt("Successfully deleted admin."),l("delete",a)}).catch(X=>{de.error(X)}))}const O=()=>$(),M=()=>y(),D=X=>t(2,c=X);function I(){d=this.value,t(3,d)}function F(){m=this.checked,t(4,m)}function P(){h=this.value,t(9,h)}function N(){g=this.value,t(10,g)}const R=()=>s&&f?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function B(X){Fe.call(this,n,X)}function Z(X){Fe.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||m||d!==a.email||c!==a.avatar)},[y,a,c,d,m,i,r,u,f,h,g,s,o,T,$,_,O,M,D,I,F,P,N,R,q,B,Z]}class SD extends ve{constructor(e){super(),be(this,e,wD,kD,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Cm(n,e,t){const i=n.slice();return i[24]=e[t],i}function TD(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function CD(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $D(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function MD(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $m(n){let e;function t(l,o){return l[5]?ED:OD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function OD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Mm(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(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[1])!=null&&f.length?o?o.p(a,u):(o=Mm(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function ED(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Mm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Om(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Em(n,e){let t,i,s,l,o,r,a,u,f,c,d,h=e[24].id+"",g,m,_,y,S,C=e[24].email+"",T,$,O,M,D,I,F,P,N,R,q,B,Z,X;f=new qs({props:{value:e[24].id}});let J=e[24].id===e[7].id&&Om();D=new Ci({props:{date:e[24].created}}),P=new Ci({props:{date:e[24].updated}});function W(){return e[15](e[24])}function le(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),z(f.$$.fragment),c=E(),d=v("span"),g=U(h),m=E(),J&&J.c(),_=E(),y=v("td"),S=v("span"),T=U(C),O=E(),M=v("td"),z(D.$$.fragment),I=E(),F=v("td"),z(P.$$.fragment),N=E(),R=v("td"),R.innerHTML='',q=E(),_n(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(S,"class","txt txt-ellipsis"),p(S,"title",$=e[24].email),p(y,"class","col-type-email col-field-email"),p(M,"class","col-type-date col-field-created"),p(F,"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(ee,ie){w(ee,t,ie),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),j(f,u,null),b(u,c),b(u,d),b(d,g),b(a,m),J&&J.m(a,null),b(t,_),b(t,y),b(y,S),b(S,T),b(t,O),b(t,M),j(D,M,null),b(t,I),b(t,F),j(P,F,null),b(t,N),b(t,R),b(t,q),B=!0,Z||(X=[K(t,"click",W),K(t,"keydown",le)],Z=!0)},p(ee,ie){e=ee,(!B||ie&16&&!_n(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Ee={};ie&16&&(Ee.value=e[24].id),f.$set(Ee),(!B||ie&16)&&h!==(h=e[24].id+"")&&se(g,h),e[24].id===e[7].id?J||(J=Om(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!B||ie&16)&&C!==(C=e[24].email+"")&&se(T,C),(!B||ie&16&&$!==($=e[24].email))&&p(S,"title",$);const Ne={};ie&16&&(Ne.date=e[24].created),D.$set(Ne);const Ve={};ie&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){B||(A(f.$$.fragment,ee),A(D.$$.fragment,ee),A(P.$$.fragment,ee),B=!0)},o(ee){L(f.$$.fragment,ee),L(D.$$.fragment,ee),L(P.$$.fragment,ee),B=!1},d(ee){ee&&k(t),H(f),J&&J.d(),H(D),H(P),Z=!1,$e(X)}}}function DD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$=[],O=new Map,M;function D(W){n[11](W)}let I={class:"col-type-text",name:"id",$$slots:{default:[TD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new cn({props:I}),te.push(()=>he(o,"sort",D));function F(W){n[12](W)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[CD]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new cn({props:P}),te.push(()=>he(u,"sort",F));function N(W){n[13](W)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[$D]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new cn({props:R}),te.push(()=>he(d,"sort",N));function q(W){n[14](W)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[MD]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),m=new cn({props:B}),te.push(()=>he(m,"sort",q));let Z=ge(n[4]);const X=W=>W[24].id;for(let W=0;Wr=!1)),o.$set(ee);const ie={};le&134217728&&(ie.$$scope={dirty:le,ctx:W}),!f&&le&4&&(f=!0,ie.sort=W[2],ye(()=>f=!1)),u.$set(ie);const Ee={};le&134217728&&(Ee.$$scope={dirty:le,ctx:W}),!h&&le&4&&(h=!0,Ee.sort=W[2],ye(()=>h=!1)),d.$set(Ee);const Ne={};le&134217728&&(Ne.$$scope={dirty:le,ctx:W}),!_&&le&4&&(_=!0,Ne.sort=W[2],ye(()=>_=!1)),m.$set(Ne),le&186&&(Z=ge(W[4]),ue(),$=vt($,le,X,1,W,Z,O,T,Ut,Em,null,Cm),fe(),!Z.length&&J?J.p(W,le):Z.length?J&&(J.d(1),J=null):(J=$m(W),J.c(),J.m(T,null))),(!M||le&32)&&Q(e,"table-loading",W[5])},i(W){if(!M){A(o.$$.fragment,W),A(u.$$.fragment,W),A(d.$$.fragment,W),A(m.$$.fragment,W);for(let le=0;le New admin',g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=E(),z(C.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(M,D){w(M,e,D),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),j(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),b(d,h),w(M,g,D),j(m,M,D),w(M,_,D),w(M,y,D),w(M,S,D),j(C,M,D),T=!0,$||(O=K(h,"click",n[9]),$=!0)},p(M,D){(!T||D&64)&&se(o,M[6]);const I={};D&2&&(I.value=M[1]),m.$set(I);const F={};D&134217918&&(F.$$scope={dirty:D,ctx:M}),C.$set(F)},i(M){T||(A(a.$$.fragment,M),A(m.$$.fragment,M),A(C.$$.fragment,M),T=!0)},o(M){L(a.$$.fragment,M),L(m.$$.fragment,M),L(C.$$.fragment,M),T=!1},d(M){M&&(k(e),k(g),k(_),k(y),k(S)),H(a),H(m,M),H(C,M),$=!1,O()}}}function ID(n){let e,t,i=n[4].length+"",s;return{c(){e=v("div"),t=U("Total found: "),s=U(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(l,o){w(l,e,o),b(e,t),b(e,s)},p(l,o){o&16&&i!==(i=l[4].length+"")&&se(s,i)},d(l){l&&k(e)}}}function LD(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{footer:[ID],default:[AD]},$$scope:{ctx:n}}});let r={};return l=new SD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),H(e,a),H(i,a),n[18](null),H(l,a)}}}function PD(n,e,t){let i,s,l;Ke(n,ya,P=>t(21,i=P)),Ke(n,Dt,P=>t(6,s=P)),Ke(n,La,P=>t(7,l=P)),sn(Dt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const P=V.normalizeSearchFilter(f,["id","email","created","updated"]);return de.admins.getFullList(100,{sort:c||"-created",filter:P}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),h(),de.error(N,(N==null?void 0:N.status)!=400))})}function h(){t(4,a=[])}const g=()=>d(),m=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function y(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function C(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const $=P=>r==null?void 0:r.show(P),O=(P,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(P))},M=()=>t(1,f="");function D(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const I=()=>d(),F=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();Hi("/settings/admins?"+P),d()}},[d,f,c,r,a,u,s,l,g,m,_,y,S,C,T,$,O,M,D,I,F]}class FD extends ve{constructor(e){super(),be(this,e,PD,LD,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function ND(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("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){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0]),l.focus(),r||(a=K(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]&&ae(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("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,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[1]),w(d,r,h),w(d,a,h),b(a,u),f||(c=[K(l,"input",n[5]),Te(un.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&ae(l,d[1])},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),f=!1,$e(c)}}}function qD(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:[ND,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[RD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=v("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),b(e,t),b(e,i),j(s,e,null),b(e,l),j(o,e,null),b(e,r),b(e,a),u=!0,f||(c=K(e,"submit",xe(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const m={};h&770&&(m.$$scope={dirty:h,ctx:d}),o.$set(m),(!u||h&4)&&Q(a,"btn-disabled",d[2]),(!u||h&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),H(s),H(o),f=!1,c()}}}function jD(n){let e,t;return e=new _b({props:{$$slots:{default:[qD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(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){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function HD(n,e,t){let i;Ke(n,ya,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),de.admins.authWithPassword(l,o).then(()=>{Aa(),Hi("/")}).catch(()=>{ls("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 VD extends ve{constructor(e){super(),be(this,e,HD,jD,me,{})}}function zD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[UD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[WD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[YD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[KD,({uniqueId:M})=>({19:M}),({uniqueId:M})=>M?524288:0]},$$scope:{ctx:n}}});let O=n[3]&&Dm(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),O&&O.c(),m=E(),_=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(_,"type","submit"),p(_,"class","btn btn-expanded"),_.disabled=S=!n[3]||n[2],Q(_,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),j(a,e,null),b(e,u),j(f,e,null),b(e,c),b(e,d),b(d,h),b(d,g),O&&O.m(d,null),b(d,m),b(d,_),b(_,y),C=!0,T||($=K(_,"click",n[13]),T=!0)},p(M,D){const I={};D&1572865&&(I.$$scope={dirty:D,ctx:M}),i.$set(I);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:M}),o.$set(F);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:M}),a.$set(P);const N={};D&1572865&&(N.$$scope={dirty:D,ctx:M}),f.$set(N),M[3]?O?O.p(M,D):(O=Dm(M),O.c(),O.m(d,m)):O&&(O.d(1),O=null),(!C||D&12&&S!==(S=!M[3]||M[2]))&&(_.disabled=S),(!C||D&4)&&Q(_,"btn-loading",M[2])},i(M){C||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(a.$$.fragment,M),A(f.$$.fragment,M),C=!0)},o(M){L(i.$$.fragment,M),L(o.$$.fragment,M),L(a.$$.fragment,M),L(f.$$.fragment,M),C=!1},d(M){M&&k(e),H(i),H(o),H(a),H(f),O&&O.d(),T=!1,$()}}}function BD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function UD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.appName),r||(a=K(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&&ae(l,u[0].meta.appName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function WD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application URL"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.appUrl),r||(a=K(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&&ae(l,u[0].meta.appUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function YD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Logs max days retention"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].logs.maxDays),r||(a=K(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&&dt(l.value)!==u[0].logs.maxDays&&ae(l,u[0].logs.maxDays)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function KD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),Te(je.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Dm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=K(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function JD(n){let e,t,i,s,l,o,r,a,u;const f=[BD,zD],c=[];function d(h,g){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML='',t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),b(i,s),c[l].m(s,null),r=!0,a||(u=K(s,"submit",xe(n[4])),a=!0)},p(h,g){let m=l;l=d(h),l===m?c[l].p(h,g):(ue(),L(c[m],1,1,()=>{c[m]=null}),fe(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&(k(e),k(t),k(i)),c[l].d(),a=!1,u()}}}function GD(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[JD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function ZD(n,e,t){let i,s,l,o;Ke(n,Ms,O=>t(14,s=O)),Ke(n,ko,O=>t(15,l=O)),Ke(n,Dt,O=>t(16,o=O)),sn(Dt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const O=await de.settings.update(V.filterRedactedProps(a));g(O),jt("Successfully saved application settings.")}catch(O){de.error(O)}t(2,f=!1)}}function g(O={}){var M,D;sn(ko,l=(M=O==null?void 0:O.meta)==null?void 0:M.appName,l),sn(Ms,s=!!((D=O==null?void 0:O.meta)!=null&&D.hideControls),s),t(0,a={meta:(O==null?void 0:O.meta)||{},logs:(O==null?void 0:O.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function m(){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 S(){a.logs.maxDays=dt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>m(),$=()=>h();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,h,m,r,c,_,y,S,C,T,$]}class XD extends ve{constructor(e){super(),be(this,e,ZD,GD,me,{})}}function QD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),fi(s,a)},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Te(je.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){fi(s,a=yt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(k(e),k(i),k(s)),l=!1,$e(o)}}}function eA(n){let e;function t(l,o){return l[3]?xD:QD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function tA(n,e,t){const i=["value","mask"];let s=et(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ln(),r==null||r.focus()}const f=()=>u();function c(h){te[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=He(He({},e),Qt(h)),t(5,s=et(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class uu extends ve{constructor(e){super(),be(this,e,tA,eA,me,{value:0,mask:1})}}function nA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;return{c(){e=v("label"),t=U("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters: `),f=v("button"),f.textContent="{APP_NAME} ",c=U(`, `),d=v("button"),d.textContent="{APP_URL} ",h=U("."),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(_,y){w(_,e,y),b(e,t),w(_,s,y),w(_,l,y),ae(l,n[0].subject),w(_,r,y),w(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),g||(m=[K(l,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],g=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&p(e,"for",i),y[1]&1&&o!==(o=_[31])&&p(l,"id",o),y[0]&1&&l.value!==_[0].subject&&ae(l,_[0].subject)},d(_){_&&(k(e),k(s),k(l),k(r),k(a)),g=!1,$e(m)}}}function iA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return{c(){e=v("label"),t=U("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters: `),f=v("button"),f.textContent="{APP_NAME} ",c=U(`, `),d=v("button"),d.textContent="{APP_URL} ",h=U(`, - `),g=v("button"),g.textContent="{TOKEN} ",m=U("."),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(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(S,C){w(S,e,C),b(e,t),w(S,s,C),w(S,l,C),ae(l,n[0].actionUrl),w(S,r,C),w(S,a,C),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),_||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(g,"click",n[19])],_=!0)},p(S,C){C[1]&1&&i!==(i=S[31])&&p(e,"for",i),C[1]&1&&o!==(o=S[31])&&p(l,"id",o),C[0]&1&&l.value!==S[0].actionUrl&&ae(l,S[0].actionUrl)},d(S){S&&(k(e),k(s),k(l),k(r),k(a)),_=!1,$e(y)}}}function sA(n){let e,t,i,s;return{c(){e=v("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){w(l,e,o),ae(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&ae(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function lA(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{V(f,1)}),fe()}o?(e=Dt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function oA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;const $=[lA,sA],O=[];function M(D,I){return D[4]&&!D[5]?0:1}return l=M(n),o=O[l]=$[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=U(`Available placeholder parameters: + `),g=v("button"),g.textContent="{TOKEN} ",m=U("."),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(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(S,C){w(S,e,C),b(e,t),w(S,s,C),w(S,l,C),ae(l,n[0].actionUrl),w(S,r,C),w(S,a,C),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),_||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(g,"click",n[19])],_=!0)},p(S,C){C[1]&1&&i!==(i=S[31])&&p(e,"for",i),C[1]&1&&o!==(o=S[31])&&p(l,"id",o),C[0]&1&&l.value!==S[0].actionUrl&&ae(l,S[0].actionUrl)},d(S){S&&(k(e),k(s),k(l),k(r),k(a)),_=!1,$e(y)}}}function sA(n){let e,t,i,s;return{c(){e=v("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){w(l,e,o),ae(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&ae(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function lA(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Et(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}o?(e=Et(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function oA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;const $=[lA,sA],O=[];function M(D,I){return D[4]&&!D[5]?0:1}return l=M(n),o=O[l]=$[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=U(`Available placeholder parameters: `),f=v("button"),f.textContent="{APP_NAME} ",c=U(`, `),d=v("button"),d.textContent="{APP_URL} ",h=U(`, `),g=v("button"),g.textContent="{TOKEN} ",m=U(`, - `),_=v("button"),_.textContent="{ACTION_URL} ",y=U("."),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(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(D,I){w(D,e,I),b(e,t),w(D,s,I),O[l].m(D,I),w(D,r,I),w(D,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),b(a,_),b(a,y),S=!0,C||(T=[K(f,"click",n[22]),K(d,"click",n[23]),K(g,"click",n[24]),K(_,"click",n[25])],C=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let F=l;l=M(D),l===F?O[l].p(D,I):(ue(),L(O[F],1,1,()=>{O[F]=null}),fe(),o=O[l],o?o.p(D,I):(o=O[l]=$[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&(k(e),k(s),k(r),k(a)),O[l].d(D),C=!1,$e(T)}}}function rA(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[nA,({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:[iA,({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:[oA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(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){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(t),k(s)),V(e,r),V(i,r),V(l,r)}}}function Am(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function aA(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Am();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=U(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=Se(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Am(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function uA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[aA],default:[rA]},$$scope:{ctx:n}};for(let l=0;lt(12,o=W));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Im,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function m(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-0c1b2f4c.js"),["./CodeEditor-0c1b2f4c.js","./index-808c8630.js"],import.meta.url)).default),Im=c,t(5,d=!1))}function y(W){j.copyToClipboard(W),bo(`Copied ${W} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),T=()=>y("{APP_URL}");function $(){u.actionUrl=this.value,t(0,u)}const O=()=>y("{APP_NAME}"),M=()=>y("{APP_URL}"),D=()=>y("{TOKEN}");function I(W){n.$$.not_equal(u.body,W)&&(u.body=W,t(0,u))}function F(){u.body=this.value,t(0,u)}const P=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),R=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function B(W){te[W?"unshift":"push"](()=>{f=W,t(3,f)})}function Z(W){Fe.call(this,n,W)}function X(W){Fe.call(this,n,W)}function J(W){Fe.call(this,n,W)}return n.$$set=W=>{e=He(He({},e),Qt(W)),t(8,l=et(e,s)),"key"in W&&t(1,r=W.key),"title"in W&&t(2,a=W.title),"config"in W&&t(0,u=W.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||ci(r))},[u,r,a,f,c,d,i,y,l,h,g,m,o,S,C,T,$,O,M,D,I,F,P,N,R,q,B,Z,X,J]}class Nr extends ve{constructor(e){super(),be(this,e,fA,uA,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Lm(n,e,t){const i=n.slice();return i[21]=e[t],i}function Pm(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d,h;return c=G1(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=E(),o=v("label"),a=U(r),f=E(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,ae(i,i.__value),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(g,m){w(g,t,m),b(t,i),i.checked=i.__value===e[2],b(t,l),b(t,o),b(o,a),b(t,f),d||(h=K(i,"change",e[10]),d=!0)},p(g,m){e=g,m&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),m&4&&(i.checked=i.__value===e[2]),m&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(g){g&&k(t),c.r(),d=!1,h()}}}function cA(n){let e=[],t=new Map,i,s=ge(n[7]);const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[dA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),H(t,e,null),b(e,i),H(s,e,null),l=!0,o||(r=K(e,"submit",xe(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){L(t.$$.fragment,a),L(s.$$.fragment,a),l=!1},d(a){a&&k(e),V(t),V(s),o=!1,r()}}}function hA(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function mA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(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&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function gA(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[mA],header:[hA],default:[pA]},$$scope:{ctx:n}};return e=new on({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[15](null),V(e,s)}}}const Rr="last_email_test",Fm="email_test_request";function _A(n,e,t){let i;const s=pt(),l="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Rr),u=o[0].value,f=!1,c=null;function d(M="",D=""){t(1,a=M||localStorage.getItem(Rr)),t(2,u=D||o[0].value),en({}),r==null||r.show()}function h(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(c),c=setTimeout(()=>{de.cancelRequest(Fm),ls("Test email send timeout.")},3e4);try{await de.settings.testEmail(a,u,{$cancelKey:Fm}),jt("Successfully sent test email."),s("submit"),t(4,f=!1),await ln(),h()}catch(M){t(4,f=!1),de.error(M)}clearTimeout(c)}}const m=[[]];function _(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const S=()=>g(),C=()=>!f;function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,g,d,_,m,y,S,C,T,$,O]}class bA extends ve{constructor(e){super(),be(this,e,_A,gA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function vA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F;i=new pe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[kA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[wA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});function P(ee){n[15](ee)}let N={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(N.config=n[0].meta.verificationTemplate),u=new Nr({props:N}),te.push(()=>he(u,"config",P));function R(ee){n[16](ee)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new Nr({props:q}),te.push(()=>he(d,"config",R));function B(ee){n[17](ee)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),m=new Nr({props:Z}),te.push(()=>he(m,"config",B)),T=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[SA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&Nm(n);function J(ee,ie){return ee[5]?PA:LA}let W=J(n),le=W(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),c=E(),z(d.$$.fragment),g=E(),z(m.$$.fragment),y=E(),S=v("hr"),C=E(),z(T.$$.fragment),$=E(),X&&X.c(),O=E(),M=v("div"),D=v("div"),I=E(),le.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(D,"class","flex-fill"),p(M,"class","flex")},m(ee,ie){w(ee,e,ie),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),w(ee,r,ie),w(ee,a,ie),H(u,a,null),b(a,c),H(d,a,null),b(a,g),H(m,a,null),w(ee,y,ie),w(ee,S,ie),w(ee,C,ie),H(T,ee,ie),w(ee,$,ie),X&&X.m(ee,ie),w(ee,O,ie),w(ee,M,ie),b(M,D),b(M,I),le.m(M,null),F=!0},p(ee,ie){const Ee={};ie[0]&1|ie[1]&24&&(Ee.$$scope={dirty:ie,ctx:ee}),i.$set(Ee);const Ne={};ie[0]&1|ie[1]&24&&(Ne.$$scope={dirty:ie,ctx:ee}),o.$set(Ne);const Ve={};!f&&ie[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,ye(()=>f=!1)),u.$set(Ve);const ze={};!h&&ie[0]&1&&(h=!0,ze.config=ee[0].meta.resetPasswordTemplate,ye(()=>h=!1)),d.$set(ze);const oe={};!_&&ie[0]&1&&(_=!0,oe.config=ee[0].meta.confirmEmailChangeTemplate,ye(()=>_=!1)),m.$set(oe);const Ce={};ie[0]&1|ie[1]&24&&(Ce.$$scope={dirty:ie,ctx:ee}),T.$set(Ce),ee[0].smtp.enabled?X?(X.p(ee,ie),ie[0]&1&&A(X,1)):(X=Nm(ee),X.c(),A(X,1),X.m(O.parentNode,O)):X&&(ue(),L(X,1,1,()=>{X=null}),fe()),W===(W=J(ee))&&le?le.p(ee,ie):(le.d(1),le=W(ee),le&&(le.c(),le.m(M,null)))},i(ee){F||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(m.$$.fragment,ee),A(T.$$.fragment,ee),A(X),F=!0)},o(ee){L(i.$$.fragment,ee),L(o.$$.fragment,ee),L(u.$$.fragment,ee),L(d.$$.fragment,ee),L(m.$$.fragment,ee),L(T.$$.fragment,ee),L(X),F=!1},d(ee){ee&&(k(e),k(r),k(a),k(y),k(S),k(C),k($),k(O),k(M)),V(i),V(o),V(u),V(d),V(m),V(T,ee),X&&X.d(ee),le.d()}}}function yA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function kA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender name"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.senderName),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&ae(l,u[0].meta.senderName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function wA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender address"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","email"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.senderAddress),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&ae(l,u[0].meta.senderAddress)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function SA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[18]),Te(je.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Nm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;s=new pe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[TA,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[CA,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[$A,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[MA,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}});function $(I,F){return I[4]?EA:OA}let O=$(n),M=O(n),D=n[4]&&Rm(n);return{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),m=v("button"),M.c(),_=E(),D&&D.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(m,"type","button"),p(m,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(I,F){w(I,e,F),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(e,g),b(e,m),M.m(m,null),b(e,_),D&&D.m(e,null),S=!0,C||(T=K(m,"click",xe(n[23])),C=!0)},p(I,F){const P={};F[0]&1|F[1]&24&&(P.$$scope={dirty:F,ctx:I}),s.$set(P);const N={};F[0]&1|F[1]&24&&(N.$$scope={dirty:F,ctx:I}),r.$set(N);const R={};F[0]&1|F[1]&24&&(R.$$scope={dirty:F,ctx:I}),f.$set(R);const q={};F[0]&1|F[1]&24&&(q.$$scope={dirty:F,ctx:I}),h.$set(q),O!==(O=$(I))&&(M.d(1),M=O(I),M&&(M.c(),M.m(m,null))),I[4]?D?(D.p(I,F),F[0]&16&&A(D,1)):(D=Rm(I),D.c(),A(D,1),D.m(e,null)):D&&(ue(),L(D,1,1,()=>{D=null}),fe())},i(I){S||(A(s.$$.fragment,I),A(r.$$.fragment,I),A(f.$$.fragment,I),A(h.$$.fragment,I),A(D),I&&Qe(()=>{S&&(y||(y=qe(e,it,{duration:150},!0)),y.run(1))}),S=!0)},o(I){L(s.$$.fragment,I),L(r.$$.fragment,I),L(f.$$.fragment,I),L(h.$$.fragment,I),L(D),I&&(y||(y=qe(e,it,{duration:150},!1)),y.run(0)),S=!1},d(I){I&&k(e),V(s),V(r),V(f),V(h),M.d(),D&&D.d(),I&&y&&y.end(),C=!1,T()}}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("SMTP server host"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].smtp.host),r||(a=K(l,"input",n[19]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&ae(l,u[0].smtp.host)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function CA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Port"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","number"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].smtp.port),r||(a=K(l,"input",n[20]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&dt(l.value)!==u[0].smtp.port&&ae(l,u[0].smtp.port)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function $A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Username"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].smtp.username),r||(a=K(l,"input",n[21]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&ae(l,u[0].smtp.username)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function MA(n){let e,t,i,s,l,o,r;function a(f){n[22](f)}let u={id:n[34]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new uu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Password"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function OA(n){let e,t,i;return{c(){e=v("span"),e.textContent="Show more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function EA(n){let e,t,i;return{c(){e=v("span"),e.textContent="Hide more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function Rm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new pe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[DA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[AA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[IA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),p(t,"class","col-lg-3"),p(l,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(g,m){w(g,e,m),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),h=!0},p(g,m){const _={};m[0]&1|m[1]&24&&(_.$$scope={dirty:m,ctx:g}),i.$set(_);const y={};m[0]&1|m[1]&24&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m[0]&1|m[1]&24&&(S.$$scope={dirty:m,ctx:g}),u.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),g&&Qe(()=>{h&&(d||(d=qe(e,it,{duration:150},!0)),d.run(1))}),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),g&&(d||(d=qe(e,it,{duration:150},!1)),d.run(0)),h=!1},d(g){g&&k(e),V(i),V(o),V(u),g&&d&&d.end()}}}function DA(n){let e,t,i,s,l,o,r;function a(f){n[24](f)}let u={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new Bi({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("TLS encryption"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function AA(n){let e,t,i,s,l,o,r;function a(f){n[25](f)}let u={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new Bi({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("AUTH method"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function IA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="EHLO/HELO domain",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[0].smtp.localName),u||(f=[Te(je.call(null,s,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),K(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&l!==(l=c[34])&&p(e,"for",l),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&ae(r,c[0].smtp.localName)},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function LA(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[29]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function PA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("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[5]||n[3],Q(s,"btn-loading",n[3])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=[K(e,"click",n[27]),K(s,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function FA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[yA,vA],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[6]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=E(),h.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,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=K(u,"submit",xe(n[30])),m=!0)},p(T,$){(!g||$[0]&64)&&se(o,T[6]);let O=d;d=C(T),d===O?S[d].p(T,$):(ue(),L(S[O],1,1,()=>{S[O]=null}),fe(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){L(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function NA(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{default:[FA]},$$scope:{ctx:n}}});let r={};return l=new bA({props:r}),n[31](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&127|u[1]&16&&(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[31](null),V(l,a)}}}function RA(n,e,t){let i,s,l;Ke(n,At,ee=>t(6,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];sn(At,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,h=!1;g();async function g(){t(2,c=!0);try{const ee=await de.settings.getAll()||{};_(ee)}catch(ee){de.error(ee)}t(2,c=!1)}async function m(){if(!(d||!s)){t(3,d=!0);try{const ee=await de.settings.update(j.filterRedactedProps(f));_(ee),en({}),jt("Successfully saved mail settings.")}catch(ee){de.error(ee)}t(3,d=!1)}}function _(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(11,u=JSON.parse(JSON.stringify(f)))}function y(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function C(){f.meta.senderAddress=this.value,t(0,f)}function T(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function $(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function O(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=dt(this.value),t(0,f)}function F(){f.smtp.username=this.value,t(0,f)}function P(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const N=()=>{t(4,h=!h)};function R(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function q(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function B(){f.smtp.localName=this.value,t(0,f)}const Z=()=>y(),X=()=>m(),J=()=>a==null?void 0:a.show(),W=()=>m();function le(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(u)),n.$$.dirty[0]&4097&&t(5,s=i!=JSON.stringify(f))},[f,a,c,d,h,s,l,o,r,m,y,u,i,S,C,T,$,O,M,D,I,F,P,N,R,q,B,Z,X,J,W,le]}class qA extends ve{constructor(e){super(),be(this,e,RA,NA,me,{},null,[-1,-1])}}const jA=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),qm=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function HA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&se(l,u[4]),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function jm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O;return i=new pe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[VA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[zA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[BA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[UA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[WA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),S=new pe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[YA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),z(d.$$.fragment),h=E(),g=v("div"),z(m.$$.fragment),_=E(),y=v("div"),z(S.$$.fragment),C=E(),T=v("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(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),H(d,c,null),b(e,h),b(e,g),H(m,g,null),b(e,_),b(e,y),H(S,y,null),b(e,C),b(e,T),O=!0},p(M,D){const I={};D&8&&(I.name=M[3]+".endpoint"),D&1081345&&(I.$$scope={dirty:D,ctx:M}),i.$set(I);const F={};D&8&&(F.name=M[3]+".bucket"),D&1081345&&(F.$$scope={dirty:D,ctx:M}),o.$set(F);const P={};D&8&&(P.name=M[3]+".region"),D&1081345&&(P.$$scope={dirty:D,ctx:M}),u.$set(P);const N={};D&8&&(N.name=M[3]+".accessKey"),D&1081345&&(N.$$scope={dirty:D,ctx:M}),d.$set(N);const R={};D&8&&(R.name=M[3]+".secret"),D&1081345&&(R.$$scope={dirty:D,ctx:M}),m.$set(R);const q={};D&8&&(q.name=M[3]+".forcePathStyle"),D&1081345&&(q.$$scope={dirty:D,ctx:M}),S.$set(q)},i(M){O||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(u.$$.fragment,M),A(d.$$.fragment,M),A(m.$$.fragment,M),A(S.$$.fragment,M),M&&Qe(()=>{O&&($||($=qe(e,it,{duration:150},!0)),$.run(1))}),O=!0)},o(M){L(i.$$.fragment,M),L(o.$$.fragment,M),L(u.$$.fragment,M),L(d.$$.fragment,M),L(m.$$.fragment,M),L(S.$$.fragment,M),M&&($||($=qe(e,it,{duration:150},!1)),$.run(0)),O=!1},d(M){M&&k(e),V(i),V(o),V(u),V(d),V(m),V(S),M&&$&&$.end()}}}function VA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Endpoint"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].endpoint),r||(a=K(l,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&ae(l,u[0].endpoint)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function zA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Bucket"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].bucket),r||(a=K(l,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&ae(l,u[0].bucket)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function BA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Region"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].region),r||(a=K(l,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].region&&ae(l,u[0].region)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function UA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Access key"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].accessKey),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&ae(l,u[0].accessKey)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function WA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new uu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function YA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[14]),Te(je.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function KA(n){let e,t,i,s,l;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[HA,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=Tt(o,n,n[15],qm);let a=n[0].enabled&&jm(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=Se()},m(u,f){H(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&32775)&&$t(r,o,u,u[15],l?Ct(o,u[15],f,jA):Mt(u[15]),qm),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=jm(u),a.c(),A(a,1),a.m(s.parentNode,s)):a&&(ue(),L(a,1,1,()=>{a=null}),fe())},i(u){l||(A(e.$$.fragment,u),A(r,u),A(a),l=!0)},o(u){L(e.$$.fragment,u),L(r,u),L(a),l=!1},d(u){u&&(k(t),k(i),k(s)),V(e,u),r&&r.d(u),a&&a.d(u)}}}const qr="s3_test_request";function JA(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,h=null;function g(M){t(2,c=!0),clearTimeout(h),h=setTimeout(()=>{m()},M)}async function m(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;de.cancelRequest(qr),clearTimeout(d),d=setTimeout(()=>{de.cancelRequest(qr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let M;try{await de.settings.testS3(u,{$cancelKey:qr})}catch(D){M=D}return M!=null&&M.isAbort||(t(1,f=M),t(2,c=!1),clearTimeout(d)),f}Gt(()=>()=>{clearTimeout(d),clearTimeout(h)});function _(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function C(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function $(M){n.$$.not_equal(o.secret,M)&&(o.secret=M,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=M=>{"originalConfig"in M&&t(5,l=M.originalConfig),"config"in M&&t(0,o=M.config),"configKey"in M&&t(3,r=M.configKey),"toggleLabel"in M&&t(4,a=M.toggleLabel),"testFilesystem"in M&&t(6,u=M.testFilesystem),"testError"in M&&t(1,f=M.testError),"isTesting"in M&&t(2,c=M.isTesting),"$$scope"in M&&t(15,s=M.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&g(100),n.$$.dirty&9&&(o.enabled||ci(r))},[o,f,c,r,a,l,u,i,_,y,S,C,T,$,O,s]}class E1 extends ve{constructor(e){super(),be(this,e,JA,KA,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function GA(n){var M;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;function y(D){n[11](D)}function S(D){n[12](D)}function C(D){n[13](D)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[XA]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new E1({props:T}),te.push(()=>he(e,"config",y)),te.push(()=>he(e,"isTesting",S)),te.push(()=>he(e,"testError",C));let $=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&Vm(n),O=n[6]&&zm(n);return{c(){z(e.$$.fragment),l=E(),o=v("div"),r=v("div"),a=E(),$&&$.c(),u=E(),O&&O.c(),f=E(),c=v("button"),d=v("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=h=!n[6]||n[3],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(D,I){H(e,D,I),w(D,l,I),w(D,o,I),b(o,r),b(o,a),$&&$.m(o,null),b(o,u),O&&O.m(o,null),b(o,f),b(o,c),b(c,d),g=!0,m||(_=K(c,"click",n[15]),m=!0)},p(D,I){var P;const F={};I&1&&(F.originalConfig=D[0].s3),I&524291&&(F.$$scope={dirty:I,ctx:D}),!t&&I&2&&(t=!0,F.config=D[1].s3,ye(()=>t=!1)),!i&&I&16&&(i=!0,F.isTesting=D[4],ye(()=>i=!1)),!s&&I&32&&(s=!0,F.testError=D[5],ye(()=>s=!1)),e.$set(F),(P=D[1].s3)!=null&&P.enabled&&!D[6]&&!D[3]?$?$.p(D,I):($=Vm(D),$.c(),$.m(o,u)):$&&($.d(1),$=null),D[6]?O?O.p(D,I):(O=zm(D),O.c(),O.m(o,f)):O&&(O.d(1),O=null),(!g||I&72&&h!==(h=!D[6]||D[3]))&&(c.disabled=h),(!g||I&8)&&Q(c,"btn-loading",D[3])},i(D){g||(A(e.$$.fragment,D),g=!0)},o(D){L(e.$$.fragment,D),g=!1},d(D){D&&(k(l),k(o)),V(e,D),$&&$.d(),O&&O.d(),m=!1,_()}}}function ZA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Hm(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,g,m,_,y,S,C,T,$,O,M,D;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually + `),_=v("button"),_.textContent="{ACTION_URL} ",y=U("."),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(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(D,I){w(D,e,I),b(e,t),w(D,s,I),O[l].m(D,I),w(D,r,I),w(D,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),b(a,_),b(a,y),S=!0,C||(T=[K(f,"click",n[22]),K(d,"click",n[23]),K(g,"click",n[24]),K(_,"click",n[25])],C=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let F=l;l=M(D),l===F?O[l].p(D,I):(ue(),L(O[F],1,1,()=>{O[F]=null}),fe(),o=O[l],o?o.p(D,I):(o=O[l]=$[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&(k(e),k(s),k(r),k(a)),O[l].d(D),C=!1,$e(T)}}}function rA(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[nA,({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:[iA,({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:[oA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),w(r,s,a),j(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){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(t),k(s)),H(e,r),H(i,r),H(l,r)}}}function Am(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function aA(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Am();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=U(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=Se(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Am(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function uA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[aA],default:[rA]},$$scope:{ctx:n}};for(let l=0;lt(12,o=W));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Im,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function m(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-73c7d443.js"),["./CodeEditor-73c7d443.js","./index-9cd23da9.js"],import.meta.url)).default),Im=c,t(5,d=!1))}function y(W){V.copyToClipboard(W),bo(`Copied ${W} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),T=()=>y("{APP_URL}");function $(){u.actionUrl=this.value,t(0,u)}const O=()=>y("{APP_NAME}"),M=()=>y("{APP_URL}"),D=()=>y("{TOKEN}");function I(W){n.$$.not_equal(u.body,W)&&(u.body=W,t(0,u))}function F(){u.body=this.value,t(0,u)}const P=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),R=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function B(W){te[W?"unshift":"push"](()=>{f=W,t(3,f)})}function Z(W){Fe.call(this,n,W)}function X(W){Fe.call(this,n,W)}function J(W){Fe.call(this,n,W)}return n.$$set=W=>{e=He(He({},e),Qt(W)),t(8,l=et(e,s)),"key"in W&&t(1,r=W.key),"title"in W&&t(2,a=W.title),"config"in W&&t(0,u=W.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!V.isEmpty(V.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||ci(r))},[u,r,a,f,c,d,i,y,l,h,g,m,o,S,C,T,$,O,M,D,I,F,P,N,R,q,B,Z,X,J]}class Nr extends ve{constructor(e){super(),be(this,e,fA,uA,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Lm(n,e,t){const i=n.slice();return i[21]=e[t],i}function Pm(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d,h;return c=G1(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=E(),o=v("label"),a=U(r),f=E(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,ae(i,i.__value),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(g,m){w(g,t,m),b(t,i),i.checked=i.__value===e[2],b(t,l),b(t,o),b(o,a),b(t,f),d||(h=K(i,"change",e[10]),d=!0)},p(g,m){e=g,m&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),m&4&&(i.checked=i.__value===e[2]),m&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(g){g&&k(t),c.r(),d=!1,h()}}}function cA(n){let e=[],t=new Map,i,s=ge(n[7]);const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[dA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),j(t,e,null),b(e,i),j(s,e,null),l=!0,o||(r=K(e,"submit",xe(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){L(t.$$.fragment,a),L(s.$$.fragment,a),l=!1},d(a){a&&k(e),H(t),H(s),o=!1,r()}}}function hA(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function mA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(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&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function gA(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[mA],header:[hA],default:[pA]},$$scope:{ctx:n}};return e=new on({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[15](null),H(e,s)}}}const Rr="last_email_test",Fm="email_test_request";function _A(n,e,t){let i;const s=pt(),l="email_test_"+V.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Rr),u=o[0].value,f=!1,c=null;function d(M="",D=""){t(1,a=M||localStorage.getItem(Rr)),t(2,u=D||o[0].value),en({}),r==null||r.show()}function h(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(c),c=setTimeout(()=>{de.cancelRequest(Fm),ls("Test email send timeout.")},3e4);try{await de.settings.testEmail(a,u,{$cancelKey:Fm}),jt("Successfully sent test email."),s("submit"),t(4,f=!1),await ln(),h()}catch(M){t(4,f=!1),de.error(M)}clearTimeout(c)}}const m=[[]];function _(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const S=()=>g(),C=()=>!f;function T(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,g,d,_,m,y,S,C,T,$,O]}class bA extends ve{constructor(e){super(),be(this,e,_A,gA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function vA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F;i=new pe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[kA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[wA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});function P(ee){n[15](ee)}let N={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(N.config=n[0].meta.verificationTemplate),u=new Nr({props:N}),te.push(()=>he(u,"config",P));function R(ee){n[16](ee)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new Nr({props:q}),te.push(()=>he(d,"config",R));function B(ee){n[17](ee)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),m=new Nr({props:Z}),te.push(()=>he(m,"config",B)),T=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[SA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&Nm(n);function J(ee,ie){return ee[5]?PA:LA}let W=J(n),le=W(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),c=E(),z(d.$$.fragment),g=E(),z(m.$$.fragment),y=E(),S=v("hr"),C=E(),z(T.$$.fragment),$=E(),X&&X.c(),O=E(),M=v("div"),D=v("div"),I=E(),le.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(D,"class","flex-fill"),p(M,"class","flex")},m(ee,ie){w(ee,e,ie),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),w(ee,r,ie),w(ee,a,ie),j(u,a,null),b(a,c),j(d,a,null),b(a,g),j(m,a,null),w(ee,y,ie),w(ee,S,ie),w(ee,C,ie),j(T,ee,ie),w(ee,$,ie),X&&X.m(ee,ie),w(ee,O,ie),w(ee,M,ie),b(M,D),b(M,I),le.m(M,null),F=!0},p(ee,ie){const Ee={};ie[0]&1|ie[1]&24&&(Ee.$$scope={dirty:ie,ctx:ee}),i.$set(Ee);const Ne={};ie[0]&1|ie[1]&24&&(Ne.$$scope={dirty:ie,ctx:ee}),o.$set(Ne);const Ve={};!f&&ie[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,ye(()=>f=!1)),u.$set(Ve);const ze={};!h&&ie[0]&1&&(h=!0,ze.config=ee[0].meta.resetPasswordTemplate,ye(()=>h=!1)),d.$set(ze);const oe={};!_&&ie[0]&1&&(_=!0,oe.config=ee[0].meta.confirmEmailChangeTemplate,ye(()=>_=!1)),m.$set(oe);const Ce={};ie[0]&1|ie[1]&24&&(Ce.$$scope={dirty:ie,ctx:ee}),T.$set(Ce),ee[0].smtp.enabled?X?(X.p(ee,ie),ie[0]&1&&A(X,1)):(X=Nm(ee),X.c(),A(X,1),X.m(O.parentNode,O)):X&&(ue(),L(X,1,1,()=>{X=null}),fe()),W===(W=J(ee))&&le?le.p(ee,ie):(le.d(1),le=W(ee),le&&(le.c(),le.m(M,null)))},i(ee){F||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(m.$$.fragment,ee),A(T.$$.fragment,ee),A(X),F=!0)},o(ee){L(i.$$.fragment,ee),L(o.$$.fragment,ee),L(u.$$.fragment,ee),L(d.$$.fragment,ee),L(m.$$.fragment,ee),L(T.$$.fragment,ee),L(X),F=!1},d(ee){ee&&(k(e),k(r),k(a),k(y),k(S),k(C),k($),k(O),k(M)),H(i),H(o),H(u),H(d),H(m),H(T,ee),X&&X.d(ee),le.d()}}}function yA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function kA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender name"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.senderName),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&ae(l,u[0].meta.senderName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function wA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Sender address"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","email"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].meta.senderAddress),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&ae(l,u[0].meta.senderAddress)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function SA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[18]),Te(je.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Nm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;s=new pe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[TA,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[CA,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[$A,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[MA,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}});function $(I,F){return I[4]?EA:OA}let O=$(n),M=O(n),D=n[4]&&Rm(n);return{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),m=v("button"),M.c(),_=E(),D&&D.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(m,"type","button"),p(m,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(I,F){w(I,e,F),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),b(t,a),b(t,u),j(f,u,null),b(t,c),b(t,d),j(h,d,null),b(e,g),b(e,m),M.m(m,null),b(e,_),D&&D.m(e,null),S=!0,C||(T=K(m,"click",xe(n[23])),C=!0)},p(I,F){const P={};F[0]&1|F[1]&24&&(P.$$scope={dirty:F,ctx:I}),s.$set(P);const N={};F[0]&1|F[1]&24&&(N.$$scope={dirty:F,ctx:I}),r.$set(N);const R={};F[0]&1|F[1]&24&&(R.$$scope={dirty:F,ctx:I}),f.$set(R);const q={};F[0]&1|F[1]&24&&(q.$$scope={dirty:F,ctx:I}),h.$set(q),O!==(O=$(I))&&(M.d(1),M=O(I),M&&(M.c(),M.m(m,null))),I[4]?D?(D.p(I,F),F[0]&16&&A(D,1)):(D=Rm(I),D.c(),A(D,1),D.m(e,null)):D&&(ue(),L(D,1,1,()=>{D=null}),fe())},i(I){S||(A(s.$$.fragment,I),A(r.$$.fragment,I),A(f.$$.fragment,I),A(h.$$.fragment,I),A(D),I&&Qe(()=>{S&&(y||(y=qe(e,it,{duration:150},!0)),y.run(1))}),S=!0)},o(I){L(s.$$.fragment,I),L(r.$$.fragment,I),L(f.$$.fragment,I),L(h.$$.fragment,I),L(D),I&&(y||(y=qe(e,it,{duration:150},!1)),y.run(0)),S=!1},d(I){I&&k(e),H(s),H(r),H(f),H(h),M.d(),D&&D.d(),I&&y&&y.end(),C=!1,T()}}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("SMTP server host"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].smtp.host),r||(a=K(l,"input",n[19]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&ae(l,u[0].smtp.host)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function CA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Port"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","number"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].smtp.port),r||(a=K(l,"input",n[20]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&dt(l.value)!==u[0].smtp.port&&ae(l,u[0].smtp.port)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function $A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Username"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].smtp.username),r||(a=K(l,"input",n[21]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&ae(l,u[0].smtp.username)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function MA(n){let e,t,i,s,l,o,r;function a(f){n[22](f)}let u={id:n[34]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new uu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Password"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),H(l,f)}}}function OA(n){let e,t,i;return{c(){e=v("span"),e.textContent="Show more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function EA(n){let e,t,i;return{c(){e=v("span"),e.textContent="Hide more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function Rm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new pe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[DA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[AA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[IA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),p(t,"class","col-lg-3"),p(l,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(g,m){w(g,e,m),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),b(e,a),j(u,a,null),b(e,f),b(e,c),h=!0},p(g,m){const _={};m[0]&1|m[1]&24&&(_.$$scope={dirty:m,ctx:g}),i.$set(_);const y={};m[0]&1|m[1]&24&&(y.$$scope={dirty:m,ctx:g}),o.$set(y);const S={};m[0]&1|m[1]&24&&(S.$$scope={dirty:m,ctx:g}),u.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),g&&Qe(()=>{h&&(d||(d=qe(e,it,{duration:150},!0)),d.run(1))}),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),g&&(d||(d=qe(e,it,{duration:150},!1)),d.run(0)),h=!1},d(g){g&&k(e),H(i),H(o),H(u),g&&d&&d.end()}}}function DA(n){let e,t,i,s,l,o,r;function a(f){n[24](f)}let u={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new Bi({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("TLS encryption"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),H(l,f)}}}function AA(n){let e,t,i,s,l,o,r;function a(f){n[25](f)}let u={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new Bi({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=U("AUTH method"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),H(l,f)}}}function IA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="EHLO/HELO domain",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),ae(r,n[0].smtp.localName),u||(f=[Te(je.call(null,s,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),K(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&l!==(l=c[34])&&p(e,"for",l),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&ae(r,c[0].smtp.localName)},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function LA(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[29]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function PA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("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[5]||n[3],Q(s,"btn-loading",n[3])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=[K(e,"click",n[27]),K(s,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function FA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[yA,vA],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[6]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=E(),h.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,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=K(u,"submit",xe(n[30])),m=!0)},p(T,$){(!g||$[0]&64)&&se(o,T[6]);let O=d;d=C(T),d===O?S[d].p(T,$):(ue(),L(S[O],1,1,()=>{S[O]=null}),fe(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){L(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function NA(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{default:[FA]},$$scope:{ctx:n}}});let r={};return l=new bA({props:r}),n[31](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&127|u[1]&16&&(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),H(e,a),H(i,a),n[31](null),H(l,a)}}}function RA(n,e,t){let i,s,l;Ke(n,Dt,ee=>t(6,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];sn(Dt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,h=!1;g();async function g(){t(2,c=!0);try{const ee=await de.settings.getAll()||{};_(ee)}catch(ee){de.error(ee)}t(2,c=!1)}async function m(){if(!(d||!s)){t(3,d=!0);try{const ee=await de.settings.update(V.filterRedactedProps(f));_(ee),en({}),jt("Successfully saved mail settings.")}catch(ee){de.error(ee)}t(3,d=!1)}}function _(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(11,u=JSON.parse(JSON.stringify(f)))}function y(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function C(){f.meta.senderAddress=this.value,t(0,f)}function T(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function $(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function O(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=dt(this.value),t(0,f)}function F(){f.smtp.username=this.value,t(0,f)}function P(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const N=()=>{t(4,h=!h)};function R(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function q(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function B(){f.smtp.localName=this.value,t(0,f)}const Z=()=>y(),X=()=>m(),J=()=>a==null?void 0:a.show(),W=()=>m();function le(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(u)),n.$$.dirty[0]&4097&&t(5,s=i!=JSON.stringify(f))},[f,a,c,d,h,s,l,o,r,m,y,u,i,S,C,T,$,O,M,D,I,F,P,N,R,q,B,Z,X,J,W,le]}class qA extends ve{constructor(e){super(),be(this,e,RA,NA,me,{},null,[-1,-1])}}const jA=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),qm=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function HA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&se(l,u[4]),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function jm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O;return i=new pe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[VA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[zA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[BA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[UA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[WA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),S=new pe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[YA,({uniqueId:M})=>({20:M}),({uniqueId:M})=>M?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),z(d.$$.fragment),h=E(),g=v("div"),z(m.$$.fragment),_=E(),y=v("div"),z(S.$$.fragment),C=E(),T=v("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(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(M,D){w(M,e,D),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),b(e,r),b(e,a),j(u,a,null),b(e,f),b(e,c),j(d,c,null),b(e,h),b(e,g),j(m,g,null),b(e,_),b(e,y),j(S,y,null),b(e,C),b(e,T),O=!0},p(M,D){const I={};D&8&&(I.name=M[3]+".endpoint"),D&1081345&&(I.$$scope={dirty:D,ctx:M}),i.$set(I);const F={};D&8&&(F.name=M[3]+".bucket"),D&1081345&&(F.$$scope={dirty:D,ctx:M}),o.$set(F);const P={};D&8&&(P.name=M[3]+".region"),D&1081345&&(P.$$scope={dirty:D,ctx:M}),u.$set(P);const N={};D&8&&(N.name=M[3]+".accessKey"),D&1081345&&(N.$$scope={dirty:D,ctx:M}),d.$set(N);const R={};D&8&&(R.name=M[3]+".secret"),D&1081345&&(R.$$scope={dirty:D,ctx:M}),m.$set(R);const q={};D&8&&(q.name=M[3]+".forcePathStyle"),D&1081345&&(q.$$scope={dirty:D,ctx:M}),S.$set(q)},i(M){O||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(u.$$.fragment,M),A(d.$$.fragment,M),A(m.$$.fragment,M),A(S.$$.fragment,M),M&&Qe(()=>{O&&($||($=qe(e,it,{duration:150},!0)),$.run(1))}),O=!0)},o(M){L(i.$$.fragment,M),L(o.$$.fragment,M),L(u.$$.fragment,M),L(d.$$.fragment,M),L(m.$$.fragment,M),L(S.$$.fragment,M),M&&($||($=qe(e,it,{duration:150},!1)),$.run(0)),O=!1},d(M){M&&k(e),H(i),H(o),H(u),H(d),H(m),H(S),M&&$&&$.end()}}}function VA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Endpoint"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].endpoint),r||(a=K(l,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&ae(l,u[0].endpoint)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function zA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Bucket"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].bucket),r||(a=K(l,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&ae(l,u[0].bucket)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function BA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Region"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].region),r||(a=K(l,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].region&&ae(l,u[0].region)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function UA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Access key"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].accessKey),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&ae(l,u[0].accessKey)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function WA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new uu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),H(l,f)}}}function YA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[14]),Te(je.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function KA(n){let e,t,i,s,l;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[HA,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=Tt(o,n,n[15],qm);let a=n[0].enabled&&jm(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=Se()},m(u,f){j(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&32775)&&$t(r,o,u,u[15],l?Ct(o,u[15],f,jA):Mt(u[15]),qm),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=jm(u),a.c(),A(a,1),a.m(s.parentNode,s)):a&&(ue(),L(a,1,1,()=>{a=null}),fe())},i(u){l||(A(e.$$.fragment,u),A(r,u),A(a),l=!0)},o(u){L(e.$$.fragment,u),L(r,u),L(a),l=!1},d(u){u&&(k(t),k(i),k(s)),H(e,u),r&&r.d(u),a&&a.d(u)}}}const qr="s3_test_request";function JA(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,h=null;function g(M){t(2,c=!0),clearTimeout(h),h=setTimeout(()=>{m()},M)}async function m(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;de.cancelRequest(qr),clearTimeout(d),d=setTimeout(()=>{de.cancelRequest(qr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let M;try{await de.settings.testS3(u,{$cancelKey:qr})}catch(D){M=D}return M!=null&&M.isAbort||(t(1,f=M),t(2,c=!1),clearTimeout(d)),f}Gt(()=>()=>{clearTimeout(d),clearTimeout(h)});function _(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function C(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function $(M){n.$$.not_equal(o.secret,M)&&(o.secret=M,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=M=>{"originalConfig"in M&&t(5,l=M.originalConfig),"config"in M&&t(0,o=M.config),"configKey"in M&&t(3,r=M.configKey),"toggleLabel"in M&&t(4,a=M.toggleLabel),"testFilesystem"in M&&t(6,u=M.testFilesystem),"testError"in M&&t(1,f=M.testError),"isTesting"in M&&t(2,c=M.isTesting),"$$scope"in M&&t(15,s=M.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&g(100),n.$$.dirty&9&&(o.enabled||ci(r))},[o,f,c,r,a,l,u,i,_,y,S,C,T,$,O,s]}class E1 extends ve{constructor(e){super(),be(this,e,JA,KA,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function GA(n){var M;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;function y(D){n[11](D)}function S(D){n[12](D)}function C(D){n[13](D)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[XA]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new E1({props:T}),te.push(()=>he(e,"config",y)),te.push(()=>he(e,"isTesting",S)),te.push(()=>he(e,"testError",C));let $=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&Vm(n),O=n[6]&&zm(n);return{c(){z(e.$$.fragment),l=E(),o=v("div"),r=v("div"),a=E(),$&&$.c(),u=E(),O&&O.c(),f=E(),c=v("button"),d=v("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=h=!n[6]||n[3],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(D,I){j(e,D,I),w(D,l,I),w(D,o,I),b(o,r),b(o,a),$&&$.m(o,null),b(o,u),O&&O.m(o,null),b(o,f),b(o,c),b(c,d),g=!0,m||(_=K(c,"click",n[15]),m=!0)},p(D,I){var P;const F={};I&1&&(F.originalConfig=D[0].s3),I&524291&&(F.$$scope={dirty:I,ctx:D}),!t&&I&2&&(t=!0,F.config=D[1].s3,ye(()=>t=!1)),!i&&I&16&&(i=!0,F.isTesting=D[4],ye(()=>i=!1)),!s&&I&32&&(s=!0,F.testError=D[5],ye(()=>s=!1)),e.$set(F),(P=D[1].s3)!=null&&P.enabled&&!D[6]&&!D[3]?$?$.p(D,I):($=Vm(D),$.c(),$.m(o,u)):$&&($.d(1),$=null),D[6]?O?O.p(D,I):(O=zm(D),O.c(),O.m(o,f)):O&&(O.d(1),O=null),(!g||I&72&&h!==(h=!D[6]||D[3]))&&(c.disabled=h),(!g||I&8)&&Q(c,"btn-loading",D[3])},i(D){g||(A(e.$$.fragment,D),g=!0)},o(D){L(e.$$.fragment,D),g=!1},d(D){D&&(k(l),k(o)),H(e,D),$&&$.d(),O&&O.d(),m=!1,_()}}}function ZA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Hm(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,g,m,_,y,S,C,T,$,O,M,D;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=v("strong"),u=U(a),f=U(` to the @@ -133,26 +133,26 @@ Also note that some OAuth2 providers (like Twitter), don't return an email and t `),y=v("a"),y.textContent=`rclone `,S=U(`, `),C=v("a"),C.textContent=`s5cmd - `,T=U(", etc."),$=E(),O=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(O,"class","clearfix m-t-base")},m(F,P){w(F,e,P),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,h),b(l,g),b(l,m),b(l,_),b(l,y),b(l,S),b(l,C),b(l,T),b(e,$),b(e,O),D=!0},p(F,P){var N;(!D||P&1)&&a!==(a=(N=F[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&se(u,a),(!D||P&2)&&d!==(d=F[1].s3.enabled?"S3 storage":"local file system")&&se(h,d)},i(F){D||(F&&Qe(()=>{D&&(M||(M=qe(e,it,{duration:150},!0)),M.run(1))}),D=!0)},o(F){F&&(M||(M=qe(e,it,{duration:150},!1)),M.run(0)),D=!1},d(F){F&&k(e),F&&M&&M.end()}}}function XA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Hm(n);return{c(){t&&t.c(),e=Se()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=Hm(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(ue(),L(t,1,1,()=>{t=null}),fe())},d(s){s&&k(e),t&&t.d(s)}}}function Vm(n){let e;function t(l,o){return l[4]?e8:l[5]?xA:QA}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function QA(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function xA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=je.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function e8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=K(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function t8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[ZA,GA],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[7]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=E(),h.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,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=K(u,"submit",xe(n[16])),m=!0)},p(T,$){(!g||$&128)&&se(o,T[7]);let O=d;d=C(T),d===O?S[d].p(T,$):(ue(),L(S[O],1,1,()=>{S[O]=null}),fe(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){L(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function n8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[t8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}const i8="s3_test_request";function s8(n,e,t){let i,s,l;Ke(n,At,O=>t(7,l=O)),sn(At,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{de.cancelRequest(i8);const O=await de.settings.update(j.filterRedactedProps(r));en({}),await g(O),Aa(),c?Py("Successfully saved but failed to establish S3 connection."):jt("Successfully saved files storage settings.")}catch(O){de.error(O)}t(3,u=!1)}}async function g(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function m(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){f=O,t(4,f)}function S(O){c=O,t(5,c)}const C=()=>m(),T=()=>h(),$=()=>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,m,i,_,y,S,C,T,$]}class l8 extends ve{constructor(e){super(),be(this,e,s8,n8,me,{})}}function o8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function r8(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[1].clientId),a||(u=K(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&ae(l,f[1].clientId)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function a8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new uu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function Bm(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a,u){let f={key:a[3].key};return a[1]!==void 0&&(f.config=a[1]),{props:f}}return o&&(t=Dt(o,r(n)),te.push(()=>he(t,"config",l))),{c(){e=v("div"),t&&z(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){w(a,e,u),t&&H(t,e,null),s=!0},p(a,u){if(u&8&&o!==(o=a[3].optionsComponent)){if(t){ue();const f=t;L(f.$$.fragment,1,0,()=>{V(f,1)}),fe()}o?(t=Dt(o,r(a)),te.push(()=>he(t,"config",l)),z(t.$$.fragment),A(t.$$.fragment,1),H(t,e,null)):t=null}else if(o){const f={};u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[1],ye(()=>i=!1)),t.$set(f)}},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&L(t.$$.fragment,a),s=!1},d(a){a&&k(e),t&&V(t)}}}function u8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new pe({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[o8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[r8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[a8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&Bm(n);return{c(){e=v("form"),t=v("div"),z(i.$$.fragment),s=E(),l=v("button"),l.innerHTML='Clear all fields',o=E(),z(r.$$.fragment),a=E(),z(u.$$.fragment),f=E(),g&&g.c(),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(m,_){w(m,e,_),b(e,t),H(i,t,null),b(t,s),b(t,l),b(e,o),H(r,e,null),b(e,a),H(u,e,null),b(e,f),g&&g.m(e,null),c=!0,d||(h=[K(l,"click",n[8]),K(e,"submit",xe(n[15]))],d=!0)},p(m,_){const y={};_&8&&(y.name=m[3].key+".enabled"),_&3145730&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.class="form-field "+(m[1].enabled?"required":"")),_&8&&(S.name=m[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:m}),r.$set(S);const C={};_&2&&(C.class="form-field "+(m[1].enabled?"required":"")),_&8&&(C.name=m[3].key+".clientSecret"),_&3145730&&(C.$$scope={dirty:_,ctx:m}),u.$set(C),m[3].optionsComponent?g?(g.p(m,_),_&8&&A(g,1)):(g=Bm(m),g.c(),A(g,1),g.m(e,null)):g&&(ue(),L(g,1,1,()=>{g=null}),fe())},i(m){c||(A(i.$$.fragment,m),A(r.$$.fragment,m),A(u.$$.fragment,m),A(g),c=!0)},o(m){L(i.$$.fragment,m),L(r.$$.fragment,m),L(u.$$.fragment,m),L(g),c=!1},d(m){m&&k(e),V(i),V(r),V(u),g&&g.d(),d=!1,$e(h)}}}function f8(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=v("h4"),i=U(t),s=U(" provider"),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&se(i,t)},d(l){l&&k(e)}}}function c8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function d8(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[c8],header:[f8],default:[u8]},$$scope:{ctx:n}};return e=new on({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[16](null),V(e,s)}}}function p8(n,e,t){let i;const s=pt(),l="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(M,D){en({}),t(3,r=Object.assign({},M)),t(1,a=Object.assign({enabled:!0},D)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function h(){t(4,u=!0);try{const M={};M[r.key]=j.filterRedactedProps(a);const D=await de.settings.update(M);en({}),jt("Successfully updated provider settings."),s("submit",D),d()}catch(M){de.error(M)}t(4,u=!1)}function g(){for(let M in a)t(1,a[M]="",a);t(1,a.enabled=!1,a)}function m(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function y(M){n.$$.not_equal(a.clientSecret,M)&&(a.clientSecret=M,t(1,a))}function S(M){a=M,t(1,a)}const C=()=>h();function T(M){te[M?"unshift":"push"](()=>{o=M,t(2,o)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,l,h,g,c,f,m,_,y,S,C,T,$,O]}class h8 extends ve{constructor(e){super(),be(this,e,p8,d8,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Um(n){let e,t,i;return{c(){e=v("img"),_n(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&2&&!_n(e.src,t="./images/oauth2/"+s[1].logo)&&p(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&p(e,"alt",i)},d(s){s&&k(e)}}}function Wm(n){let e;return{c(){e=v("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function m8(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,h,g,m,_,y,S,C,T,$=n[1].logo&&Um(n),O=n[0].enabled&&Wm(),M={};return y=new h8({props:M}),n[4](y),y.$on("submit",n[5]),{c(){e=v("div"),t=v("figure"),$&&$.c(),i=E(),s=v("div"),o=U(l),r=E(),a=v("em"),u=U("("),c=U(f),d=U(")"),h=E(),O&&O.c(),g=E(),m=v("button"),m.innerHTML='',_=E(),z(y.$$.fragment),p(t,"class","provider-logo"),p(s,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(m,"type","button"),p(m,"class","btn btn-circle btn-hint btn-transparent"),p(m,"aria-label","Provider settings"),p(e,"class","provider-card")},m(D,I){w(D,e,I),b(e,t),$&&$.m(t,null),b(e,i),b(e,s),b(s,o),b(e,r),b(e,a),b(a,u),b(a,c),b(a,d),b(e,h),O&&O.m(e,null),b(e,g),b(e,m),w(D,_,I),H(y,D,I),S=!0,C||(T=K(m,"click",n[3]),C=!0)},p(D,[I]){D[1].logo?$?$.p(D,I):($=Um(D),$.c(),$.m(t,null)):$&&($.d(1),$=null),(!S||I&2)&&l!==(l=D[1].title+"")&&se(o,l),(!S||I&2)&&f!==(f=D[1].key.slice(0,-4)+"")&&se(c,f),D[0].enabled?O||(O=Wm(),O.c(),O.m(e,g)):O&&(O.d(1),O=null);const F={};y.$set(F)},i(D){S||(A(y.$$.fragment,D),S=!0)},o(D){L(y.$$.fragment,D),S=!1},d(D){D&&(k(e),k(_)),$&&$.d(),O&&O.d(),n[4](null),V(y,D),C=!1,T()}}}function g8(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class D1 extends ve{constructor(e){super(),be(this,e,g8,m8,me,{provider:1,config:0})}}function Ym(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Km(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function _8(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=ge(n[3]);const c=m=>m[9].key;for(let m=0;m0&&n[2].length>0&&Gm(),h=ge(n[2]);const g=m=>m[9].key;for(let m=0;m0&&m[2].length>0?d||(d=Gm(),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),_&5&&(h=ge(m[2]),ue(),r=vt(r,_,g,1,m,h,a,o,Ut,Zm,null,Ym),fe())},i(m){if(!u){for(let _=0;_he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!s&&f&9&&(s=!0,c.config=e[0][e[9].key],ye(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function Gm(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zm(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new D1({props:a}),te.push(()=>he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!s&&f&5&&(s=!0,c.config=e[0][e[9].key],ye(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function v8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;const m=[b8,_8],_=[];function y(S,C){return S[1]?0:1}return d=y(n),h=_[d]=m[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("div"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,C){w(S,e,C),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(S,r,C),w(S,a,C),b(a,u),b(u,f),b(u,c),_[d].m(u,null),g=!0},p(S,C){(!g||C&16)&&se(o,S[4]);let T=d;d=y(S),d===T?_[d].p(S,C):(ue(),L(_[T],1,1,()=>{_[T]=null}),fe(),h=_[d],h?h.p(S,C):(h=_[d]=m[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&(k(e),k(r),k(a)),_[d].d()}}}function y8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[v8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function k8(n,e,t){let i,s,l;Ke(n,At,d=>t(4,l=d)),sn(At,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await de.settings.getAll()||{};u(d)}catch(d){de.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const h of co)t(0,r[h.key]=Object.assign({enabled:!1},d[h.key]),r)}function f(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}function c(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=co.filter(d=>{var h;return(h=r[d.key])==null?void 0:h.enabled})),n.$$.dirty&1&&t(2,s=co.filter(d=>{var h;return!((h=r[d.key])!=null&&h.enabled)}))},[r,o,s,i,l,f,c]}class w8 extends ve{constructor(e){super(),be(this,e,k8,y8,me,{})}}function S8(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=U(n[3]),i=U(" duration (in seconds)"),l=E(),o=v("input"),a=E(),u=v("div"),f=v("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(h,g){w(h,e,g),b(e,t),b(e,i),w(h,l,g),w(h,o,g),ae(o,n[0]),w(h,a,g),w(h,u,g),b(u,f),c||(d=[K(o,"input",n[4]),K(f,"click",n[5])],c=!0)},p(h,g){g&8&&se(t,h[3]),g&64&&s!==(s=h[6])&&p(e,"for",s),g&64&&r!==(r=h[6])&&p(o,"id",r),g&1&&dt(o.value)!==h[0]&&ae(o,h[0]),g&2&&Q(f,"txt-success",!!h[1])},d(h){h&&(k(e),k(l),k(o),k(a),k(u)),c=!1,$e(d)}}}function T8(n){let e,t;return e=new pe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[S8,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function C8(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=dt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class A1 extends ve{constructor(e){super(),be(this,e,C8,T8,me,{key:2,label:3,duration:0,secret:1})}}function Xm(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Qm(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function $8(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],c=new Map,d,h,g,m,_,y,S,C,T,$,O,M=ge(n[5]);const D=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nhe(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&33&&(s=!0,d.duration=e[0][e[19].key].duration,ye(()=>s=!1)),!l&&c&33&&(l=!0,d.secret=e[0][e[19].key].secret,ye(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function eg(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new A1({props:u}),te.push(()=>he(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&65&&(s=!0,d.duration=e[0][e[19].key].duration,ye(()=>s=!1)),!l&&c&65&&(l=!0,d.secret=e[0][e[19].key].secret,ye(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function tg(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=K(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function O8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[M8,$8],S=[];function C(T,$){return T[1]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Adjust common token options.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=K(u,"submit",xe(n[7])),m=!0)},p(T,$){(!g||$&16)&&se(o,T[4]);let O=d;d=C(T),d===O?S[d].p(T,$):(ue(),L(S[O],1,1,()=>{S[O]=null}),fe(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){L(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function E8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[O8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function D8(n,e,t){let i,s,l;Ke(n,At,O=>t(4,l=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];sn(At,l="Token options",l);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(1,f=!1)}async function h(){if(!(c||!s)){t(2,c=!0);try{const O=await de.settings.update(j.filterRedactedProps(u));g(O),jt("Successfully saved tokens options.")}catch(O){de.error(O)}t(2,c=!1)}}function g(O){var D;O=O||{},t(0,u={});const M=o.concat(r);for(const I of M)t(0,u[I.key]={duration:((D=O[I.key])==null?void 0:D.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function m(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function y(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}function S(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function C(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}const T=()=>m(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,c,s,l,o,r,h,m,a,i,_,y,S,C,T,$]}class A8 extends ve{constructor(e){super(),be(this,e,D8,E8,me,{})}}function I8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return o=new _1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`

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

    `,t=E(),i=v("div"),s=v("button"),s.innerHTML='Copy',l=E(),z(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),b(i,l),H(o,i,null),n[8](i),w(m,r,_),w(m,a,_),b(a,u),b(a,f),b(a,c),d=!0,h||(g=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],h=!0)},p(m,_){const y={};_&4&&(y.content=m[2]),o.$set(y)},i(m){d||(A(o.$$.fragment,m),d=!0)},o(m){L(o.$$.fragment,m),d=!1},d(m){m&&(k(e),k(t),k(i),k(r),k(a)),V(o),n[8](null),h=!1,$e(g)}}}function L8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function P8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[L8,I8],g=[];function m(_,y){return _[1]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[3]),r=E(),a=v("div"),u=v("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(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&se(o,_[3]);let S=f;f=m(_),f===S?g[f].p(_,y):(ue(),L(g[S],1,1,()=>{g[S]=null}),fe(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function F8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[P8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function N8(n,e,t){let i,s;Ke(n,At,_=>t(3,s=_)),sn(At,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await de.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){de.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),bo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},m=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,m]}class R8 extends ve{constructor(e){super(),be(this,e,N8,F8,me,{})}}function ng(n,e,t){const i=n.slice();return i[14]=e[t],i}function ig(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function sg(n,e,t){const i=n.slice();return i[14]=e[t],i}function lg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function og(n,e,t){const i=n.slice();return i[14]=e[t],i}function rg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function ag(n,e,t){const i=n.slice();return i[30]=e[t],i}function q8(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&ug(),a=n[0].name!==n[1].name&&fg(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(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=ug(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=fg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function j8(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=E(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function H8(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=E(),i=v("strong"),l=U(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function ug(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fg(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),b(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(k(e),k(s),k(l))}}}function cg(n){var g,m;let e,t,i,s,l,o,r=n[12]((g=n[0])==null?void 0:g[n[30]])+"",a,u,f,c,d=n[12]((m=n[1])==null?void 0:m[n[30]])+"",h;return{c(){var _,y,S,C,T,$;e=v("tr"),t=v("td"),i=v("span"),i.textContent=`${n[30]}`,s=E(),l=v("td"),o=v("pre"),a=U(r),u=E(),f=v("td"),c=v("pre"),h=U(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(l,"class","svelte-lmkr38"),Q(l,"changed-old-col",!n[10]&&yn((_=n[0])==null?void 0:_[n[30]],(y=n[1])==null?void 0:y[n[30]])),Q(l,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),Q(f,"changed-new-col",!n[5]&&yn((S=n[0])==null?void 0:S[n[30]],(C=n[1])==null?void 0:C[n[30]])),Q(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",yn((T=n[0])==null?void 0:T[n[30]],($=n[1])==null?void 0:$[n[30]]))},m(_,y){w(_,e,y),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(o,a),b(e,u),b(e,f),b(f,c),b(c,h)},p(_,y){var S,C,T,$,O,M,D,I;y[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&se(a,r),y[0]&3075&&Q(l,"changed-old-col",!_[10]&&yn((C=_[0])==null?void 0:C[_[30]],(T=_[1])==null?void 0:T[_[30]])),y[0]&1024&&Q(l,"changed-none-col",_[10]),y[0]&2&&d!==(d=_[12](($=_[1])==null?void 0:$[_[30]])+"")&&se(h,d),y[0]&2083&&Q(f,"changed-new-col",!_[5]&&yn((O=_[0])==null?void 0:O[_[30]],(M=_[1])==null?void 0:M[_[30]])),y[0]&32&&Q(f,"changed-none-col",_[5]),y[0]&2051&&Q(e,"txt-primary",yn((D=_[0])==null?void 0:D[_[30]],(I=_[1])==null?void 0:I[_[30]]))},d(_){_&&k(e)}}}function dg(n){let e,t=ge(n[6]),i=[];for(let s=0;sProps Old New',l=E(),o=v("tbody");for(let T=0;T!["schema","created","updated"].includes(y));function m(){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(S=>y.id==S.id))))}function _(y){return typeof y>"u"?"":j.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")&&m(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,_]}class B8 extends ve{constructor(e){super(),be(this,e,z8,V8,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function yg(n,e,t){const i=n.slice();return i[17]=e[t],i}function kg(n){let e,t;return e=new B8({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U8(n){let e,t,i=ge(n[2]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{D&&(M||(M=qe(e,it,{duration:150},!0)),M.run(1))}),D=!0)},o(F){F&&(M||(M=qe(e,it,{duration:150},!1)),M.run(0)),D=!1},d(F){F&&k(e),F&&M&&M.end()}}}function XA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Hm(n);return{c(){t&&t.c(),e=Se()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=Hm(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(ue(),L(t,1,1,()=>{t=null}),fe())},d(s){s&&k(e),t&&t.d(s)}}}function Vm(n){let e;function t(l,o){return l[4]?e8:l[5]?xA:QA}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function QA(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function xA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=je.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&At(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function e8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=K(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function t8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[ZA,GA],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[7]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=E(),h.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,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=K(u,"submit",xe(n[16])),m=!0)},p(T,$){(!g||$&128)&&se(o,T[7]);let O=d;d=C(T),d===O?S[d].p(T,$):(ue(),L(S[O],1,1,()=>{S[O]=null}),fe(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){L(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function n8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[t8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}const i8="s3_test_request";function s8(n,e,t){let i,s,l;Ke(n,Dt,O=>t(7,l=O)),sn(Dt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{de.cancelRequest(i8);const O=await de.settings.update(V.filterRedactedProps(r));en({}),await g(O),Aa(),c?Py("Successfully saved but failed to establish S3 connection."):jt("Successfully saved files storage settings.")}catch(O){de.error(O)}t(3,u=!1)}}async function g(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function m(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){f=O,t(4,f)}function S(O){c=O,t(5,c)}const C=()=>m(),T=()=>h(),$=()=>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,m,i,_,y,S,C,T,$]}class l8 extends ve{constructor(e){super(),be(this,e,s8,n8,me,{})}}function o8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function r8(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),ae(l,n[1].clientId),a||(u=K(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&ae(l,f[1].clientId)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function a8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new uu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,ye(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),H(l,f)}}}function Bm(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a,u){let f={key:a[3].key};return a[1]!==void 0&&(f.config=a[1]),{props:f}}return o&&(t=Et(o,r(n)),te.push(()=>he(t,"config",l))),{c(){e=v("div"),t&&z(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){w(a,e,u),t&&j(t,e,null),s=!0},p(a,u){if(u&8&&o!==(o=a[3].optionsComponent)){if(t){ue();const f=t;L(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}o?(t=Et(o,r(a)),te.push(()=>he(t,"config",l)),z(t.$$.fragment),A(t.$$.fragment,1),j(t,e,null)):t=null}else if(o){const f={};u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[1],ye(()=>i=!1)),t.$set(f)}},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&L(t.$$.fragment,a),s=!1},d(a){a&&k(e),t&&H(t)}}}function u8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new pe({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[o8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[r8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[a8,({uniqueId:m})=>({20:m}),({uniqueId:m})=>m?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&Bm(n);return{c(){e=v("form"),t=v("div"),z(i.$$.fragment),s=E(),l=v("button"),l.innerHTML='Clear all fields',o=E(),z(r.$$.fragment),a=E(),z(u.$$.fragment),f=E(),g&&g.c(),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(m,_){w(m,e,_),b(e,t),j(i,t,null),b(t,s),b(t,l),b(e,o),j(r,e,null),b(e,a),j(u,e,null),b(e,f),g&&g.m(e,null),c=!0,d||(h=[K(l,"click",n[8]),K(e,"submit",xe(n[15]))],d=!0)},p(m,_){const y={};_&8&&(y.name=m[3].key+".enabled"),_&3145730&&(y.$$scope={dirty:_,ctx:m}),i.$set(y);const S={};_&2&&(S.class="form-field "+(m[1].enabled?"required":"")),_&8&&(S.name=m[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:m}),r.$set(S);const C={};_&2&&(C.class="form-field "+(m[1].enabled?"required":"")),_&8&&(C.name=m[3].key+".clientSecret"),_&3145730&&(C.$$scope={dirty:_,ctx:m}),u.$set(C),m[3].optionsComponent?g?(g.p(m,_),_&8&&A(g,1)):(g=Bm(m),g.c(),A(g,1),g.m(e,null)):g&&(ue(),L(g,1,1,()=>{g=null}),fe())},i(m){c||(A(i.$$.fragment,m),A(r.$$.fragment,m),A(u.$$.fragment,m),A(g),c=!0)},o(m){L(i.$$.fragment,m),L(r.$$.fragment,m),L(u.$$.fragment,m),L(g),c=!1},d(m){m&&k(e),H(i),H(r),H(u),g&&g.d(),d=!1,$e(h)}}}function f8(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=v("h4"),i=U(t),s=U(" provider"),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&se(i,t)},d(l){l&&k(e)}}}function c8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function d8(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[c8],header:[f8],default:[u8]},$$scope:{ctx:n}};return e=new on({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[16](null),H(e,s)}}}function p8(n,e,t){let i;const s=pt(),l="provider_popup_"+V.randomString(5);let o,r={},a={},u=!1,f="";function c(M,D){en({}),t(3,r=Object.assign({},M)),t(1,a=Object.assign({enabled:!0},D)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function h(){t(4,u=!0);try{const M={};M[r.key]=V.filterRedactedProps(a);const D=await de.settings.update(M);en({}),jt("Successfully updated provider settings."),s("submit",D),d()}catch(M){de.error(M)}t(4,u=!1)}function g(){for(let M in a)t(1,a[M]="",a);t(1,a.enabled=!1,a)}function m(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function y(M){n.$$.not_equal(a.clientSecret,M)&&(a.clientSecret=M,t(1,a))}function S(M){a=M,t(1,a)}const C=()=>h();function T(M){te[M?"unshift":"push"](()=>{o=M,t(2,o)})}function $(M){Fe.call(this,n,M)}function O(M){Fe.call(this,n,M)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,l,h,g,c,f,m,_,y,S,C,T,$,O]}class h8 extends ve{constructor(e){super(),be(this,e,p8,d8,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Um(n){let e,t,i;return{c(){e=v("img"),_n(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&2&&!_n(e.src,t="./images/oauth2/"+s[1].logo)&&p(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&p(e,"alt",i)},d(s){s&&k(e)}}}function Wm(n){let e;return{c(){e=v("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function m8(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,h,g,m,_,y,S,C,T,$=n[1].logo&&Um(n),O=n[0].enabled&&Wm(),M={};return y=new h8({props:M}),n[4](y),y.$on("submit",n[5]),{c(){e=v("div"),t=v("figure"),$&&$.c(),i=E(),s=v("div"),o=U(l),r=E(),a=v("em"),u=U("("),c=U(f),d=U(")"),h=E(),O&&O.c(),g=E(),m=v("button"),m.innerHTML='',_=E(),z(y.$$.fragment),p(t,"class","provider-logo"),p(s,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(m,"type","button"),p(m,"class","btn btn-circle btn-hint btn-transparent"),p(m,"aria-label","Provider settings"),p(e,"class","provider-card")},m(D,I){w(D,e,I),b(e,t),$&&$.m(t,null),b(e,i),b(e,s),b(s,o),b(e,r),b(e,a),b(a,u),b(a,c),b(a,d),b(e,h),O&&O.m(e,null),b(e,g),b(e,m),w(D,_,I),j(y,D,I),S=!0,C||(T=K(m,"click",n[3]),C=!0)},p(D,[I]){D[1].logo?$?$.p(D,I):($=Um(D),$.c(),$.m(t,null)):$&&($.d(1),$=null),(!S||I&2)&&l!==(l=D[1].title+"")&&se(o,l),(!S||I&2)&&f!==(f=D[1].key.slice(0,-4)+"")&&se(c,f),D[0].enabled?O||(O=Wm(),O.c(),O.m(e,g)):O&&(O.d(1),O=null);const F={};y.$set(F)},i(D){S||(A(y.$$.fragment,D),S=!0)},o(D){L(y.$$.fragment,D),S=!1},d(D){D&&(k(e),k(_)),$&&$.d(),O&&O.d(),n[4](null),H(y,D),C=!1,T()}}}function g8(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class D1 extends ve{constructor(e){super(),be(this,e,g8,m8,me,{provider:1,config:0})}}function Ym(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Km(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function _8(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=ge(n[3]);const c=m=>m[9].key;for(let m=0;m0&&n[2].length>0&&Gm(),h=ge(n[2]);const g=m=>m[9].key;for(let m=0;m0&&m[2].length>0?d||(d=Gm(),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),_&5&&(h=ge(m[2]),ue(),r=vt(r,_,g,1,m,h,a,o,Ut,Zm,null,Ym),fe())},i(m){if(!u){for(let _=0;_he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),j(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!s&&f&9&&(s=!0,c.config=e[0][e[9].key],ye(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),H(i)}}}function Gm(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zm(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new D1({props:a}),te.push(()=>he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),j(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!s&&f&5&&(s=!0,c.config=e[0][e[9].key],ye(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),H(i)}}}function v8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;const m=[b8,_8],_=[];function y(S,C){return S[1]?0:1}return d=y(n),h=_[d]=m[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("div"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,C){w(S,e,C),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(S,r,C),w(S,a,C),b(a,u),b(u,f),b(u,c),_[d].m(u,null),g=!0},p(S,C){(!g||C&16)&&se(o,S[4]);let T=d;d=y(S),d===T?_[d].p(S,C):(ue(),L(_[T],1,1,()=>{_[T]=null}),fe(),h=_[d],h?h.p(S,C):(h=_[d]=m[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&(k(e),k(r),k(a)),_[d].d()}}}function y8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[v8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function k8(n,e,t){let i,s,l;Ke(n,Dt,d=>t(4,l=d)),sn(Dt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await de.settings.getAll()||{};u(d)}catch(d){de.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const h of co)t(0,r[h.key]=Object.assign({enabled:!1},d[h.key]),r)}function f(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}function c(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=co.filter(d=>{var h;return(h=r[d.key])==null?void 0:h.enabled})),n.$$.dirty&1&&t(2,s=co.filter(d=>{var h;return!((h=r[d.key])!=null&&h.enabled)}))},[r,o,s,i,l,f,c]}class w8 extends ve{constructor(e){super(),be(this,e,k8,y8,me,{})}}function S8(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=U(n[3]),i=U(" duration (in seconds)"),l=E(),o=v("input"),a=E(),u=v("div"),f=v("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(h,g){w(h,e,g),b(e,t),b(e,i),w(h,l,g),w(h,o,g),ae(o,n[0]),w(h,a,g),w(h,u,g),b(u,f),c||(d=[K(o,"input",n[4]),K(f,"click",n[5])],c=!0)},p(h,g){g&8&&se(t,h[3]),g&64&&s!==(s=h[6])&&p(e,"for",s),g&64&&r!==(r=h[6])&&p(o,"id",r),g&1&&dt(o.value)!==h[0]&&ae(o,h[0]),g&2&&Q(f,"txt-success",!!h[1])},d(h){h&&(k(e),k(l),k(o),k(a),k(u)),c=!1,$e(d)}}}function T8(n){let e,t;return e=new pe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[S8,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function C8(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=dt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=V.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class A1 extends ve{constructor(e){super(),be(this,e,C8,T8,me,{key:2,label:3,duration:0,secret:1})}}function Xm(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Qm(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function $8(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],c=new Map,d,h,g,m,_,y,S,C,T,$,O,M=ge(n[5]);const D=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nhe(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),j(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&33&&(s=!0,d.duration=e[0][e[19].key].duration,ye(()=>s=!1)),!l&&c&33&&(l=!0,d.secret=e[0][e[19].key].secret,ye(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),H(i,f)}}}function eg(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new A1({props:u}),te.push(()=>he(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),j(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&65&&(s=!0,d.duration=e[0][e[19].key].duration,ye(()=>s=!1)),!l&&c&65&&(l=!0,d.secret=e[0][e[19].key].secret,ye(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),H(i,f)}}}function tg(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=K(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function O8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[M8,$8],S=[];function C(T,$){return T[1]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[4]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Adjust common token options.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=K(u,"submit",xe(n[7])),m=!0)},p(T,$){(!g||$&16)&&se(o,T[4]);let O=d;d=C(T),d===O?S[d].p(T,$):(ue(),L(S[O],1,1,()=>{S[O]=null}),fe(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){L(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function E8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[O8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function D8(n,e,t){let i,s,l;Ke(n,Dt,O=>t(4,l=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];sn(Dt,l="Token options",l);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const O=await de.settings.getAll()||{};g(O)}catch(O){de.error(O)}t(1,f=!1)}async function h(){if(!(c||!s)){t(2,c=!0);try{const O=await de.settings.update(V.filterRedactedProps(u));g(O),jt("Successfully saved tokens options.")}catch(O){de.error(O)}t(2,c=!1)}}function g(O){var D;O=O||{},t(0,u={});const M=o.concat(r);for(const I of M)t(0,u[I.key]={duration:((D=O[I.key])==null?void 0:D.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function m(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function y(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}function S(O,M){n.$$.not_equal(u[M.key].duration,O)&&(u[M.key].duration=O,t(0,u))}function C(O,M){n.$$.not_equal(u[M.key].secret,O)&&(u[M.key].secret=O,t(0,u))}const T=()=>m(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,c,s,l,o,r,h,m,a,i,_,y,S,C,T,$]}class A8 extends ve{constructor(e){super(),be(this,e,D8,E8,me,{})}}function I8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return o=new _1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`

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

    `,t=E(),i=v("div"),s=v("button"),s.innerHTML='Copy',l=E(),z(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),b(i,l),j(o,i,null),n[8](i),w(m,r,_),w(m,a,_),b(a,u),b(a,f),b(a,c),d=!0,h||(g=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],h=!0)},p(m,_){const y={};_&4&&(y.content=m[2]),o.$set(y)},i(m){d||(A(o.$$.fragment,m),d=!0)},o(m){L(o.$$.fragment,m),d=!1},d(m){m&&(k(e),k(t),k(i),k(r),k(a)),H(o),n[8](null),h=!1,$e(g)}}}function L8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function P8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[L8,I8],g=[];function m(_,y){return _[1]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[3]),r=E(),a=v("div"),u=v("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(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&se(o,_[3]);let S=f;f=m(_),f===S?g[f].p(_,y):(ue(),L(g[S],1,1,()=>{g[S]=null}),fe(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function F8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[P8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function N8(n,e,t){let i,s;Ke(n,Dt,_=>t(3,s=_)),sn(Dt,s="Export collections",s);const l="export_"+V.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await de.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){de.error(_)}t(1,a=!1)}function f(){V.downloadJson(r,"pb_schema")}function c(){V.copyToClipboard(i),bo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},m=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,m]}class R8 extends ve{constructor(e){super(),be(this,e,N8,F8,me,{})}}function ng(n,e,t){const i=n.slice();return i[14]=e[t],i}function ig(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function sg(n,e,t){const i=n.slice();return i[14]=e[t],i}function lg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function og(n,e,t){const i=n.slice();return i[14]=e[t],i}function rg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function ag(n,e,t){const i=n.slice();return i[30]=e[t],i}function q8(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&ug(),a=n[0].name!==n[1].name&&fg(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(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=ug(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=fg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function j8(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=E(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function H8(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=E(),i=v("strong"),l=U(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function ug(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fg(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),b(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(k(e),k(s),k(l))}}}function cg(n){var g,m;let e,t,i,s,l,o,r=n[12]((g=n[0])==null?void 0:g[n[30]])+"",a,u,f,c,d=n[12]((m=n[1])==null?void 0:m[n[30]])+"",h;return{c(){var _,y,S,C,T,$;e=v("tr"),t=v("td"),i=v("span"),i.textContent=`${n[30]}`,s=E(),l=v("td"),o=v("pre"),a=U(r),u=E(),f=v("td"),c=v("pre"),h=U(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(l,"class","svelte-lmkr38"),Q(l,"changed-old-col",!n[10]&&yn((_=n[0])==null?void 0:_[n[30]],(y=n[1])==null?void 0:y[n[30]])),Q(l,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),Q(f,"changed-new-col",!n[5]&&yn((S=n[0])==null?void 0:S[n[30]],(C=n[1])==null?void 0:C[n[30]])),Q(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",yn((T=n[0])==null?void 0:T[n[30]],($=n[1])==null?void 0:$[n[30]]))},m(_,y){w(_,e,y),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(o,a),b(e,u),b(e,f),b(f,c),b(c,h)},p(_,y){var S,C,T,$,O,M,D,I;y[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&se(a,r),y[0]&3075&&Q(l,"changed-old-col",!_[10]&&yn((C=_[0])==null?void 0:C[_[30]],(T=_[1])==null?void 0:T[_[30]])),y[0]&1024&&Q(l,"changed-none-col",_[10]),y[0]&2&&d!==(d=_[12](($=_[1])==null?void 0:$[_[30]])+"")&&se(h,d),y[0]&2083&&Q(f,"changed-new-col",!_[5]&&yn((O=_[0])==null?void 0:O[_[30]],(M=_[1])==null?void 0:M[_[30]])),y[0]&32&&Q(f,"changed-none-col",_[5]),y[0]&2051&&Q(e,"txt-primary",yn((D=_[0])==null?void 0:D[_[30]],(I=_[1])==null?void 0:I[_[30]]))},d(_){_&&k(e)}}}function dg(n){let e,t=ge(n[6]),i=[];for(let s=0;sProps Old New',l=E(),o=v("tbody");for(let T=0;T!["schema","created","updated"].includes(y));function m(){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(S=>y.id==S.id))))}function _(y){return typeof y>"u"?"":V.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")&&m(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=V.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,_]}class B8 extends ve{constructor(e){super(),be(this,e,z8,V8,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function yg(n,e,t){const i=n.slice();return i[17]=e[t],i}function kg(n){let e,t;return e=new B8({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){j(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){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function U8(n){let e,t,i=ge(n[2]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await de.collections.import(o,a),jt("Successfully imported collections configuration."),i("submit")}catch(T){de.error(T)}t(4,u=!1),c()}}const m=()=>h(),_=()=>!u;function y(T){te[T?"unshift":"push"](()=>{s=T,t(1,s)})}function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,m,_,y,S,C]}class G8 extends ve{constructor(e){super(),be(this,e,J8,K8,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function wg(n,e,t){const i=n.slice();return i[32]=e[t],i}function Sg(n,e,t){const i=n.slice();return i[35]=e[t],i}function Tg(n,e,t){const i=n.slice();return i[32]=e[t],i}function Z8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[Q8,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let D=!1,I=n[6]&&n[1].length&&!n[7]&&$g(),F=n[6]&&n[1].length&&n[7]&&Mg(n),P=n[13].length&&qg(n),N=!!n[0]&&jg(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or - `),o=v("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),I&&I.c(),c=E(),F&&F.c(),d=E(),P&&P.c(),h=E(),g=v("div"),N&&N.c(),m=E(),_=v("div"),y=E(),S=v("button"),C=v("span"),C.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(_,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=T=!n[14],p(g,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),b(i,s),b(s,l),b(s,o),w(R,r,q),H(a,R,q),w(R,u,q),w(R,f,q),I&&I.m(R,q),w(R,c,q),F&&F.m(R,q),w(R,d,q),P&&P.m(R,q),w(R,h,q),w(R,g,q),N&&N.m(g,null),b(g,m),b(g,_),b(g,y),b(g,S),b(S,C),$=!0,O||(M=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],O=!0)},p(R,q){(!$||q[0]&4096)&&Q(o,"btn-loading",R[12]);const B={};q[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(B.$$scope={dirty:q,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?I||(I=$g(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?F?F.p(R,q):(F=Mg(R),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),R[13].length?P?P.p(R,q):(P=qg(R),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),R[0]?N?N.p(R,q):(N=jg(R),N.c(),N.m(g,m)):N&&(N.d(1),N=null),(!$||q[0]&16384&&T!==(T=!R[14]))&&(S.disabled=T)},i(R){$||(A(a.$$.fragment,R),A(D),$=!0)},o(R){L(a.$$.fragment,R),L(D),$=!1},d(R){R&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(h),k(g)),n[19](null),V(a,R),I&&I.d(R),F&&F.d(R),P&&P.d(R),N&&N.d(),O=!1,$e(M)}}}function X8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Cg(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Q8(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Cg();return{c(){e=v("label"),t=U("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=Se(),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,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=K(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&ae(l,d[0]),d[0]&&!d[6]?c||(c=Cg(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function $g(n){let e;return{c(){e=v("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mg(n){let e,t,i,s,l,o=n[9].length&&Og(n),r=n[4].length&&Ag(n),a=n[8].length&&Fg(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(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=Og(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Ag(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Fg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Og(n){let e=[],t=new Map,i,s=ge(n[9]);const l=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=E(),s=v("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are + `),o=v("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),I&&I.c(),c=E(),F&&F.c(),d=E(),P&&P.c(),h=E(),g=v("div"),N&&N.c(),m=E(),_=v("div"),y=E(),S=v("button"),C=v("span"),C.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(_,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=T=!n[14],p(g,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),b(i,s),b(s,l),b(s,o),w(R,r,q),j(a,R,q),w(R,u,q),w(R,f,q),I&&I.m(R,q),w(R,c,q),F&&F.m(R,q),w(R,d,q),P&&P.m(R,q),w(R,h,q),w(R,g,q),N&&N.m(g,null),b(g,m),b(g,_),b(g,y),b(g,S),b(S,C),$=!0,O||(M=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],O=!0)},p(R,q){(!$||q[0]&4096)&&Q(o,"btn-loading",R[12]);const B={};q[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(B.$$scope={dirty:q,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?I||(I=$g(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?F?F.p(R,q):(F=Mg(R),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),R[13].length?P?P.p(R,q):(P=qg(R),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),R[0]?N?N.p(R,q):(N=jg(R),N.c(),N.m(g,m)):N&&(N.d(1),N=null),(!$||q[0]&16384&&T!==(T=!R[14]))&&(S.disabled=T)},i(R){$||(A(a.$$.fragment,R),A(D),$=!0)},o(R){L(a.$$.fragment,R),L(D),$=!1},d(R){R&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(h),k(g)),n[19](null),H(a,R),I&&I.d(R),F&&F.d(R),P&&P.d(R),N&&N.d(),O=!1,$e(M)}}}function X8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Cg(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Q8(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Cg();return{c(){e=v("label"),t=U("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=Se(),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,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=K(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&ae(l,d[0]),d[0]&&!d[6]?c||(c=Cg(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function $g(n){let e;return{c(){e=v("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mg(n){let e,t,i,s,l,o=n[9].length&&Og(n),r=n[4].length&&Ag(n),a=n[8].length&&Fg(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(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=Og(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Ag(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Fg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Og(n){let e=[],t=new Map,i,s=ge(n[9]);const l=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=E(),s=v("div"),s.innerHTML=`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.`,l=E(),o=v("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(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&&k(e),r=!1,a()}}}function jg(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function x8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[X8,Z8],g=[];function m(_,y){return _[5]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[15]),r=E(),a=v("div"),u=v("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(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&se(o,_[15]);let S=f;f=m(_),f===S?g[f].p(_,y):(ue(),L(g[S],1,1,()=>{g[S]=null}),fe(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function eI(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{default:[x8]},$$scope:{ctx:n}}});let r={};return l=new G8({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[27](null),V(l,a)}}}function tI(n,e,t){let i,s,l,o,r,a,u;Ke(n,At,W=>t(15,u=W)),sn(At,u="Import collections",u);let f,c,d="",h=!1,g=[],m=[],_=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,m=await de.collections.getFullList(200));for(let W of m)delete W.created,delete W.updated}catch(W){de.error(W)}t(5,S=!1)}function T(){if(t(4,y=[]),!!i)for(let W of g){const le=j.findByKey(m,"id",W.id);!(le!=null&&le.id)||!j.hasCollectionChanges(le,W,_)||y.push({new:W,old:le})}}function $(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=j.filterDuplicatesByKey(g)):t(1,g=[]);for(let W of g)delete W.created,delete W.updated,W.schema=j.filterDuplicatesByKey(W.schema)}function O(){var W,le;for(let ee of g){const ie=j.findByKey(m,"name",ee.name)||j.findByKey(m,"id",ee.id);if(!ie)continue;const Ee=ee.id,Ne=ie.id;ee.id=Ne;const Ve=Array.isArray(ie.schema)?ie.schema:[],ze=Array.isArray(ee.schema)?ee.schema:[];for(const oe of ze){const Ce=j.findByKey(Ve,"name",oe.name);Ce&&Ce.id&&(oe.id=Ce.id)}for(let oe of g)if(Array.isArray(oe.schema))for(let Ce of oe.schema)(W=Ce.options)!=null&&W.collectionId&&((le=Ce.options)==null?void 0:le.collectionId)===Ee&&(Ce.options.collectionId=Ne)}t(0,d=JSON.stringify(g,null,4))}function M(W){t(12,h=!0);const le=new FileReader;le.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ee.target.result),await ln(),g.length||(ls("Invalid collections configuration."),D())},le.onerror=ee=>{console.warn(ee),ls("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},le.readAsText(W)}function D(){t(0,d=""),t(10,f.value="",f),en({})}function I(W){te[W?"unshift":"push"](()=>{f=W,t(10,f)})}const F=()=>{f.files.length&&M(f.files[0])},P=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const q=()=>O(),B=()=>D(),Z=()=>c==null?void 0:c.show(m,g,_);function X(W){te[W?"unshift":"push"](()=>{c=W,t(11,c)})}const J=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&$(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(W=>!!W.id&&!!W.name).length),n.$$.dirty[0]&78&&t(9,s=m.filter(W=>i&&_&&!j.findByKey(g,"id",W.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(W=>i&&!j.findByKey(m,"id",W.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(W=>{let le=j.findByKey(m,"name",W.name)||j.findByKey(m,"id",W.id);if(!le)return!1;if(le.id!=W.id)return!0;const ee=Array.isArray(le.schema)?le.schema:[],ie=Array.isArray(W.schema)?W.schema:[];for(const Ee of ie){if(j.findByKey(ee,"id",Ee.id))continue;const Ve=j.findByKey(ee,"name",Ee.name);if(Ve&&Ee.id!=Ve.id)return!0}return!1}))},[d,g,m,_,y,S,i,o,l,s,f,c,h,a,r,u,O,M,D,I,F,P,N,R,q,B,Z,X,J]}class nI extends ve{constructor(e){super(),be(this,e,tI,eI,me,{},null,[-1,-1])}}function iI(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),r=E(),a=v("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[2]),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&ae(l,c[2])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function sI(n){let e,t,i,s,l,o,r;return s=new pe({props:{class:"form-field m-0",name:"name",$$slots:{default:[iI,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + to.`,l=E(),o=v("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(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&&k(e),r=!1,a()}}}function jg(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function x8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[X8,Z8],g=[];function m(_,y){return _[5]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[15]),r=E(),a=v("div"),u=v("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(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&se(o,_[15]);let S=f;f=m(_),f===S?g[f].p(_,y):(ue(),L(g[S],1,1,()=>{g[S]=null}),fe(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function eI(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{default:[x8]},$$scope:{ctx:n}}});let r={};return l=new G8({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(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){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),H(e,a),H(i,a),n[27](null),H(l,a)}}}function tI(n,e,t){let i,s,l,o,r,a,u;Ke(n,Dt,W=>t(15,u=W)),sn(Dt,u="Import collections",u);let f,c,d="",h=!1,g=[],m=[],_=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,m=await de.collections.getFullList(200));for(let W of m)delete W.created,delete W.updated}catch(W){de.error(W)}t(5,S=!1)}function T(){if(t(4,y=[]),!!i)for(let W of g){const le=V.findByKey(m,"id",W.id);!(le!=null&&le.id)||!V.hasCollectionChanges(le,W,_)||y.push({new:W,old:le})}}function $(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=V.filterDuplicatesByKey(g)):t(1,g=[]);for(let W of g)delete W.created,delete W.updated,W.schema=V.filterDuplicatesByKey(W.schema)}function O(){var W,le;for(let ee of g){const ie=V.findByKey(m,"name",ee.name)||V.findByKey(m,"id",ee.id);if(!ie)continue;const Ee=ee.id,Ne=ie.id;ee.id=Ne;const Ve=Array.isArray(ie.schema)?ie.schema:[],ze=Array.isArray(ee.schema)?ee.schema:[];for(const oe of ze){const Ce=V.findByKey(Ve,"name",oe.name);Ce&&Ce.id&&(oe.id=Ce.id)}for(let oe of g)if(Array.isArray(oe.schema))for(let Ce of oe.schema)(W=Ce.options)!=null&&W.collectionId&&((le=Ce.options)==null?void 0:le.collectionId)===Ee&&(Ce.options.collectionId=Ne)}t(0,d=JSON.stringify(g,null,4))}function M(W){t(12,h=!0);const le=new FileReader;le.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ee.target.result),await ln(),g.length||(ls("Invalid collections configuration."),D())},le.onerror=ee=>{console.warn(ee),ls("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},le.readAsText(W)}function D(){t(0,d=""),t(10,f.value="",f),en({})}function I(W){te[W?"unshift":"push"](()=>{f=W,t(10,f)})}const F=()=>{f.files.length&&M(f.files[0])},P=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const q=()=>O(),B=()=>D(),Z=()=>c==null?void 0:c.show(m,g,_);function X(W){te[W?"unshift":"push"](()=>{c=W,t(11,c)})}const J=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&$(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(W=>!!W.id&&!!W.name).length),n.$$.dirty[0]&78&&t(9,s=m.filter(W=>i&&_&&!V.findByKey(g,"id",W.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(W=>i&&!V.findByKey(m,"id",W.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(W=>{let le=V.findByKey(m,"name",W.name)||V.findByKey(m,"id",W.id);if(!le)return!1;if(le.id!=W.id)return!0;const ee=Array.isArray(le.schema)?le.schema:[],ie=Array.isArray(W.schema)?W.schema:[];for(const Ee of ie){if(V.findByKey(ee,"id",Ee.id))continue;const Ve=V.findByKey(ee,"name",Ee.name);if(Ve&&Ee.id!=Ve.id)return!0}return!1}))},[d,g,m,_,y,S,i,o,l,s,f,c,h,a,r,u,O,M,D,I,F,P,N,R,q,B,Z,X,J]}class nI extends ve{constructor(e){super(),be(this,e,tI,eI,me,{},null,[-1,-1])}}function iI(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),r=E(),a=v("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[2]),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&ae(l,c[2])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function sI(n){let e,t,i,s,l,o,r;return s=new pe({props:{class:"form-field m-0",name:"name",$$slots:{default:[iI,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the database will be temporary "locked" (this usually happens only during the ZIP generation).

    If you are using S3 storage for the collections file upload, you'll have to backup them - separately since they are not locally stored and will not be included in the final backup!

    `,t=E(),i=v("form"),z(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),H(s,i,null),l=!0,o||(r=K(i,"submit",xe(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(t),k(i)),V(s),o=!1,r()}}}function lI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(s)),o=!1,r()}}}function rI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[oI],header:[lI],default:[sI]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function aI(n,e,t){const i=pt(),s="backup_create_"+j.randomString(5);let l,o="",r=!1,a;function u(S){en({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await de.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),jt("Successfully generated new backup.")}catch(S){S.isAbort||de.error(S)}clearTimeout(a),t(3,r=!1)}}Is(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const h=()=>r?(bo("A backup has already been started, please wait."),!1):!0,g=()=>(r&&bo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function m(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[f,l,o,r,s,c,u,d,h,g,m,_,y]}class uI extends ve{constructor(e){super(),be(this,e,aI,rI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function fI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(l,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(l,"id",o),f&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function cI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;return u=new qs({props:{value:n[1]}}),h=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[fI,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please proceed with caution. + separately since they are not locally stored and will not be included in the final backup!

    `,t=E(),i=v("form"),z(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),j(s,i,null),l=!0,o||(r=K(i,"submit",xe(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(t),k(i)),H(s),o=!1,r()}}}function lI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(s)),o=!1,r()}}}function rI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[oI],header:[lI],default:[sI]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function aI(n,e,t){const i=pt(),s="backup_create_"+V.randomString(5);let l,o="",r=!1,a;function u(S){en({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await de.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),jt("Successfully generated new backup.")}catch(S){S.isAbort||de.error(S)}clearTimeout(a),t(3,r=!1)}}Is(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const h=()=>r?(bo("A backup has already been started, please wait."),!1):!0,g=()=>(r&&bo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function m(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[f,l,o,r,s,c,u,d,h,g,m,_,y]}class uI extends ve{constructor(e){super(),be(this,e,aI,rI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function fI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(l,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(l,"id",o),f&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function cI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;return u=new qs({props:{value:n[1]}}),h=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[fI,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please proceed with caution.
    Backup restore is still experimental and currently works only on UNIX based systems.

    The restore operation will attempt to replace your existing pb_data with the one from the backup and will restart the application process.

    Nothing will happen if the backup file is invalid or incompatible.

    `,t=E(),i=v("div"),s=U(`Type the backup name `),l=v("div"),o=v("span"),r=U(n[1]),a=E(),z(u.$$.fragment),f=U(` - to confirm:`),c=E(),d=v("form"),z(h.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),H(u,l,null),b(i,f),w(y,c,S),w(y,d,S),H(h,d,null),g=!0,m||(_=K(d,"submit",xe(n[7])),m=!0)},p(y,S){(!g||S&2)&&se(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),h.$set(T)},i(y){g||(A(u.$$.fragment,y),A(h.$$.fragment,y),g=!0)},o(y){L(u.$$.fragment,y),L(h.$$.fragment,y),g=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),V(u),V(h),m=!1,_()}}}function dI(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function pI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function hI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[pI],header:[dI],default:[cI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function mI(n,e,t){let i;const s="backup_restore_"+j.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){en({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await de.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),ls(((S=C.response)==null?void 0:S.message)||C.message))}}}Is(()=>{clearTimeout(u)});function h(){r=this.value,t(2,r)}const g=()=>!a;function m(S){te[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,h,g,m,_,y]}class gI extends ve{constructor(e){super(),be(this,e,mI,hI,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Hg(n,e,t){const i=n.slice();return i[22]=e[t],i}function Vg(n,e,t){const i=n.slice();return i[19]=e[t],i}function _I(n){let e=[],t=new Map,i,s,l=ge(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Bg(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d,h=j.formattedFileSize(e[22].size)+"",g,m,_,y,S,C,T,$,O,M,D,I,F,P,N,R,q,B,Z,X;function J(){return e[10](e[22])}function W(){return e[11](e[22])}function le(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=U(r),f=E(),c=v("span"),d=U("("),g=U(h),m=U(")"),_=E(),y=v("div"),S=v("button"),C=v("i"),$=E(),O=v("button"),M=v("i"),I=E(),F=v("button"),P=v("i"),R=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(C,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),Q(S,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=D=e[6][e[22].key],p(O,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(F,"type","button"),p(F,"class","btn btn-sm btn-circle btn-hint btn-transparent"),F.disabled=N=e[6][e[22].key],p(F,"aria-label","Delete"),Q(F,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,ie){w(ee,t,ie),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,f),b(l,c),b(c,d),b(c,g),b(c,m),b(t,_),b(t,y),b(y,S),b(S,C),b(y,$),b(y,O),b(O,M),b(y,I),b(y,F),b(F,P),b(t,R),B=!0,Z||(X=[Te(je.call(null,S,"Download")),K(S,"click",xe(J)),Te(je.call(null,O,"Restore")),K(O,"click",xe(W)),Te(je.call(null,F,"Delete")),K(F,"click",xe(le))],Z=!0)},p(ee,ie){e=ee,(!B||ie&8)&&r!==(r=e[22].key+"")&&se(a,r),(!B||ie&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||ie&8)&&h!==(h=j.formattedFileSize(e[22].size)+"")&&se(g,h),(!B||ie&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||ie&40)&&Q(S,"btn-loading",e[5][e[22].key]),(!B||ie&72&&D!==(D=e[6][e[22].key]))&&(O.disabled=D),(!B||ie&72&&N!==(N=e[6][e[22].key]))&&(F.disabled=N),(!B||ie&72)&&Q(F,"btn-loading",e[6][e[22].key])},i(ee){B||(ee&&Qe(()=>{B&&(q||(q=qe(t,it,{duration:150},!0)),q.run(1))}),B=!0)},o(ee){ee&&(q||(q=qe(t,it,{duration:150},!1)),q.run(0)),B=!1},d(ee){ee&&k(t),ee&&q&&q.end(),Z=!1,$e(X)}}}function Ug(n){let e;return{c(){e=v("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function vI(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function yI(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function kI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;const _=[bI,_I],y=[];function S(D,I){return D[4]?0:1}i=S(n),s=y[i]=_[i](n);function C(D,I){return D[7]?yI:vI}let T=C(n),$=T(n),O={};f=new uI({props:O}),n[14](f),f.$on("submit",n[15]);let M={};return d=new gI({props:M}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),$.c(),u=E(),z(f.$$.fragment),c=E(),z(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(D,I){w(D,e,I),b(e,t),y[i].m(t,null),b(e,l),b(e,o),b(o,r),$.m(r,null),w(D,u,I),H(f,D,I),w(D,c,I),H(d,D,I),h=!0,g||(m=K(r,"click",n[13]),g=!0)},p(D,[I]){let F=i;i=S(D),i===F?y[i].p(D,I):(ue(),L(y[F],1,1,()=>{y[F]=null}),fe(),s=y[i],s?s.p(D,I):(s=y[i]=_[i](D),s.c()),A(s,1),s.m(t,null)),T!==(T=C(D))&&($.d(1),$=T(D),$&&($.c(),$.m(r,null))),(!h||I&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const P={};f.$set(P);const N={};d.$set(N)},i(D){h||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),h=!0)},o(D){L(s),L(f.$$.fragment,D),L(d.$$.fragment,D),h=!1},d(D){D&&(k(e),k(u),k(c)),y[i].d(),$.d(),n[14](null),V(f,D),n[16](null),V(d,D),g=!1,m()}}}function wI(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,l=await de.backups.getFullList()),l.sort((O,M)=>O.modifiedM.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(de.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const M=await de.getAdminFileToken(),D=de.backups.getDownloadUrl(M,O);j.download(D)}catch(M){M.isAbort||de.error(M)}delete r[O],t(5,r)}}function d(O){mn(`Do you really want to delete ${O}?`,()=>h(O))}async function h(O){if(!a[O]){t(6,a[O]=!0,a);try{await de.backups.delete(O),j.removeByKey(l,"name",O),f(),jt(`Successfully deleted ${O}.`)}catch(M){M.isAbort||de.error(M)}delete a[O],t(6,a)}}async function g(){var O;try{const M=await de.health.check({$autoCancel:!1}),D=u;t(7,u=((O=M==null?void 0:M.data)==null?void 0:O.canBackup)||!1),D!=u&&u&&f()}catch{}}Gt(()=>{let O=setInterval(()=>{g()},3e3);return()=>{clearInterval(O)}});const m=O=>c(O.key),_=O=>s.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function C(O){te[O?"unshift":"push"](()=>{i=O,t(1,i)})}const T=()=>{f()};function $(O){te[O?"unshift":"push"](()=>{s=O,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,m,_,y,S,C,T,$]}class SI extends ve{constructor(e){super(),be(this,e,wI,kI,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function TI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("i"),s=E(),l=v("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),Q(e,"btn-loading",n[2]),Q(e,"btn-disabled",n[2]),p(l,"type","file"),p(l,"accept","application/zip"),p(l,"class","hidden")},m(a,u){w(a,e,u),b(e,t),w(a,s,u),w(a,l,u),n[5](l),o||(r=[Te(je.call(null,e,"Upload backup")),K(e,"click",n[4]),K(l,"change",n[3])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&Q(e,"btn-loading",a[2]),u&5&&Q(e,"btn-disabled",a[2])},i:x,o:x,d(a){a&&(k(e),k(s),k(l)),n[5](null),o=!1,$e(r)}}}const Wg="upload_backup";function CI(n,e,t){const i=pt();let{class:s=""}=e,l,o=!1;async function r(f){var d,h,g,m,_;if(o||!((h=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&h.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await de.backups.upload(c,{requestKey:Wg}),t(2,o=!1),i("success"),jt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(_=(m=(g=y.response)==null?void 0:g.data)==null?void 0:m.file)!=null&&_.message?ls(y.response.data.file.message):de.error(y))}}Is(()=>{de.cancelRequest(Wg)});const a=()=>l==null?void 0:l.click();function u(f){te[f?"unshift":"push"](()=>{l=f,t(1,l)})}return n.$$set=f=>{"class"in f&&t(0,s=f.class)},[s,l,o,r,a,u]}class $I extends ve{constructor(e){super(),be(this,e,CI,TI,me,{class:0})}}function MI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function OI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yg(n){var B,Z,X;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;t=new pe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[EI,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});let D=n[2]&&Kg(n);function I(J){n[24](J)}function F(J){n[25](J)}function P(J){n[26](J)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new E1({props:N}),te.push(()=>he(r,"config",I)),te.push(()=>he(r,"isTesting",F)),te.push(()=>he(r,"testError",P));let R=((X=(Z=n[1].backups)==null?void 0:Z.s3)==null?void 0:X.enabled)&&!n[9]&&!n[5]&&Jg(n),q=n[9]&&Gg(n);return{c(){e=v("form"),z(t.$$.fragment),i=E(),D&&D.c(),s=E(),l=v("div"),o=E(),z(r.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),R&&R.c(),m=E(),q&&q.c(),_=E(),y=v("button"),S=v("span"),S.textContent="Save changes",p(l,"class","clearfix m-b-base"),p(h,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=C=!n[9]||n[5],Q(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(J,W){w(J,e,W),H(t,e,null),b(e,i),D&&D.m(e,null),b(e,s),b(e,l),b(e,o),H(r,e,null),b(e,c),b(e,d),b(d,h),b(d,g),R&&R.m(d,null),b(d,m),q&&q.m(d,null),b(d,_),b(d,y),b(y,S),$=!0,O||(M=[K(y,"click",n[28]),K(e,"submit",xe(n[11]))],O=!0)},p(J,W){var ie,Ee,Ne;const le={};W[0]&4|W[1]&3&&(le.$$scope={dirty:W,ctx:J}),t.$set(le),J[2]?D?(D.p(J,W),W[0]&4&&A(D,1)):(D=Kg(J),D.c(),A(D,1),D.m(e,s)):D&&(ue(),L(D,1,1,()=>{D=null}),fe());const ee={};W[0]&1&&(ee.originalConfig=(ie=J[0].backups)==null?void 0:ie.s3),!a&&W[0]&2&&(a=!0,ee.config=J[1].backups.s3,ye(()=>a=!1)),!u&&W[0]&128&&(u=!0,ee.isTesting=J[7],ye(()=>u=!1)),!f&&W[0]&256&&(f=!0,ee.testError=J[8],ye(()=>f=!1)),r.$set(ee),(Ne=(Ee=J[1].backups)==null?void 0:Ee.s3)!=null&&Ne.enabled&&!J[9]&&!J[5]?R?R.p(J,W):(R=Jg(J),R.c(),R.m(d,m)):R&&(R.d(1),R=null),J[9]?q?q.p(J,W):(q=Gg(J),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!$||W[0]&544&&C!==(C=!J[9]||J[5]))&&(y.disabled=C),(!$||W[0]&32)&&Q(y,"btn-loading",J[5])},i(J){$||(A(t.$$.fragment,J),A(D),A(r.$$.fragment,J),J&&Qe(()=>{$&&(T||(T=qe(e,it,{duration:150},!0)),T.run(1))}),$=!0)},o(J){L(t.$$.fragment,J),L(D),L(r.$$.fragment,J),J&&(T||(T=qe(e,it,{duration:150},!1)),T.run(0)),$=!1},d(J){J&&k(e),V(t),D&&D.d(),V(r),R&&R.d(),q&&q.d(),J&&T&&T.end(),O=!1,$e(M)}}}function EI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Kg(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[AI,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[II,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&2|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Qe(()=>{u&&(a||(a=qe(e,it,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(e,it,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function DI(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Every day at 00:00h',t=E(),i=v("button"),i.innerHTML='Every sunday at 00:00h',s=E(),l=v("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=E(),r=v("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[19]),K(i,"click",n[20]),K(l,"click",n[21]),K(r,"click",n[22])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function AI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F;return m=new Ln({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[DI]},$$scope:{ctx:n}}}),{c(){var P,N;e=v("label"),t=U("Cron expression"),s=E(),l=v("input"),a=E(),u=v("div"),f=v("button"),c=v("span"),c.textContent="Presets",d=E(),h=v("i"),g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=v("p"),C=U(`Supports numeric list, steps, ranges or + to confirm:`),c=E(),d=v("form"),z(h.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),j(u,l,null),b(i,f),w(y,c,S),w(y,d,S),j(h,d,null),g=!0,m||(_=K(d,"submit",xe(n[7])),m=!0)},p(y,S){(!g||S&2)&&se(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),h.$set(T)},i(y){g||(A(u.$$.fragment,y),A(h.$$.fragment,y),g=!0)},o(y){L(u.$$.fragment,y),L(h.$$.fragment,y),g=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),H(u),H(h),m=!1,_()}}}function dI(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function pI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function hI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[pI],header:[dI],default:[cI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function mI(n,e,t){let i;const s="backup_restore_"+V.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){en({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await de.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),ls(((S=C.response)==null?void 0:S.message)||C.message))}}}Is(()=>{clearTimeout(u)});function h(){r=this.value,t(2,r)}const g=()=>!a;function m(S){te[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,h,g,m,_,y]}class gI extends ve{constructor(e){super(),be(this,e,mI,hI,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Hg(n,e,t){const i=n.slice();return i[22]=e[t],i}function Vg(n,e,t){const i=n.slice();return i[19]=e[t],i}function _I(n){let e=[],t=new Map,i,s,l=ge(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Bg(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d,h=V.formattedFileSize(e[22].size)+"",g,m,_,y,S,C,T,$,O,M,D,I,F,P,N,R,q,B,Z,X;function J(){return e[10](e[22])}function W(){return e[11](e[22])}function le(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=U(r),f=E(),c=v("span"),d=U("("),g=U(h),m=U(")"),_=E(),y=v("div"),S=v("button"),C=v("i"),$=E(),O=v("button"),M=v("i"),I=E(),F=v("button"),P=v("i"),R=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(C,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),Q(S,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=D=e[6][e[22].key],p(O,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(F,"type","button"),p(F,"class","btn btn-sm btn-circle btn-hint btn-transparent"),F.disabled=N=e[6][e[22].key],p(F,"aria-label","Delete"),Q(F,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,ie){w(ee,t,ie),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,f),b(l,c),b(c,d),b(c,g),b(c,m),b(t,_),b(t,y),b(y,S),b(S,C),b(y,$),b(y,O),b(O,M),b(y,I),b(y,F),b(F,P),b(t,R),B=!0,Z||(X=[Te(je.call(null,S,"Download")),K(S,"click",xe(J)),Te(je.call(null,O,"Restore")),K(O,"click",xe(W)),Te(je.call(null,F,"Delete")),K(F,"click",xe(le))],Z=!0)},p(ee,ie){e=ee,(!B||ie&8)&&r!==(r=e[22].key+"")&&se(a,r),(!B||ie&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||ie&8)&&h!==(h=V.formattedFileSize(e[22].size)+"")&&se(g,h),(!B||ie&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||ie&40)&&Q(S,"btn-loading",e[5][e[22].key]),(!B||ie&72&&D!==(D=e[6][e[22].key]))&&(O.disabled=D),(!B||ie&72&&N!==(N=e[6][e[22].key]))&&(F.disabled=N),(!B||ie&72)&&Q(F,"btn-loading",e[6][e[22].key])},i(ee){B||(ee&&Qe(()=>{B&&(q||(q=qe(t,it,{duration:150},!0)),q.run(1))}),B=!0)},o(ee){ee&&(q||(q=qe(t,it,{duration:150},!1)),q.run(0)),B=!1},d(ee){ee&&k(t),ee&&q&&q.end(),Z=!1,$e(X)}}}function Ug(n){let e;return{c(){e=v("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function vI(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function yI(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function kI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m;const _=[bI,_I],y=[];function S(D,I){return D[4]?0:1}i=S(n),s=y[i]=_[i](n);function C(D,I){return D[7]?yI:vI}let T=C(n),$=T(n),O={};f=new uI({props:O}),n[14](f),f.$on("submit",n[15]);let M={};return d=new gI({props:M}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),$.c(),u=E(),z(f.$$.fragment),c=E(),z(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(D,I){w(D,e,I),b(e,t),y[i].m(t,null),b(e,l),b(e,o),b(o,r),$.m(r,null),w(D,u,I),j(f,D,I),w(D,c,I),j(d,D,I),h=!0,g||(m=K(r,"click",n[13]),g=!0)},p(D,[I]){let F=i;i=S(D),i===F?y[i].p(D,I):(ue(),L(y[F],1,1,()=>{y[F]=null}),fe(),s=y[i],s?s.p(D,I):(s=y[i]=_[i](D),s.c()),A(s,1),s.m(t,null)),T!==(T=C(D))&&($.d(1),$=T(D),$&&($.c(),$.m(r,null))),(!h||I&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const P={};f.$set(P);const N={};d.$set(N)},i(D){h||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),h=!0)},o(D){L(s),L(f.$$.fragment,D),L(d.$$.fragment,D),h=!1},d(D){D&&(k(e),k(u),k(c)),y[i].d(),$.d(),n[14](null),H(f,D),n[16](null),H(d,D),g=!1,m()}}}function wI(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,l=await de.backups.getFullList()),l.sort((O,M)=>O.modifiedM.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(de.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const M=await de.getAdminFileToken(),D=de.backups.getDownloadUrl(M,O);V.download(D)}catch(M){M.isAbort||de.error(M)}delete r[O],t(5,r)}}function d(O){mn(`Do you really want to delete ${O}?`,()=>h(O))}async function h(O){if(!a[O]){t(6,a[O]=!0,a);try{await de.backups.delete(O),V.removeByKey(l,"name",O),f(),jt(`Successfully deleted ${O}.`)}catch(M){M.isAbort||de.error(M)}delete a[O],t(6,a)}}async function g(){var O;try{const M=await de.health.check({$autoCancel:!1}),D=u;t(7,u=((O=M==null?void 0:M.data)==null?void 0:O.canBackup)||!1),D!=u&&u&&f()}catch{}}Gt(()=>{let O=setInterval(()=>{g()},3e3);return()=>{clearInterval(O)}});const m=O=>c(O.key),_=O=>s.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function C(O){te[O?"unshift":"push"](()=>{i=O,t(1,i)})}const T=()=>{f()};function $(O){te[O?"unshift":"push"](()=>{s=O,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,m,_,y,S,C,T,$]}class SI extends ve{constructor(e){super(),be(this,e,wI,kI,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function TI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("i"),s=E(),l=v("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),Q(e,"btn-loading",n[2]),Q(e,"btn-disabled",n[2]),p(l,"type","file"),p(l,"accept","application/zip"),p(l,"class","hidden")},m(a,u){w(a,e,u),b(e,t),w(a,s,u),w(a,l,u),n[5](l),o||(r=[Te(je.call(null,e,"Upload backup")),K(e,"click",n[4]),K(l,"change",n[3])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&Q(e,"btn-loading",a[2]),u&5&&Q(e,"btn-disabled",a[2])},i:x,o:x,d(a){a&&(k(e),k(s),k(l)),n[5](null),o=!1,$e(r)}}}const Wg="upload_backup";function CI(n,e,t){const i=pt();let{class:s=""}=e,l,o=!1;async function r(f){var d,h,g,m,_;if(o||!((h=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&h.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await de.backups.upload(c,{requestKey:Wg}),t(2,o=!1),i("success"),jt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(_=(m=(g=y.response)==null?void 0:g.data)==null?void 0:m.file)!=null&&_.message?ls(y.response.data.file.message):de.error(y))}}Is(()=>{de.cancelRequest(Wg)});const a=()=>l==null?void 0:l.click();function u(f){te[f?"unshift":"push"](()=>{l=f,t(1,l)})}return n.$$set=f=>{"class"in f&&t(0,s=f.class)},[s,l,o,r,a,u]}class $I extends ve{constructor(e){super(),be(this,e,CI,TI,me,{class:0})}}function MI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function OI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Yg(n){var B,Z,X;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;t=new pe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[EI,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});let D=n[2]&&Kg(n);function I(J){n[24](J)}function F(J){n[25](J)}function P(J){n[26](J)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new E1({props:N}),te.push(()=>he(r,"config",I)),te.push(()=>he(r,"isTesting",F)),te.push(()=>he(r,"testError",P));let R=((X=(Z=n[1].backups)==null?void 0:Z.s3)==null?void 0:X.enabled)&&!n[9]&&!n[5]&&Jg(n),q=n[9]&&Gg(n);return{c(){e=v("form"),z(t.$$.fragment),i=E(),D&&D.c(),s=E(),l=v("div"),o=E(),z(r.$$.fragment),c=E(),d=v("div"),h=v("div"),g=E(),R&&R.c(),m=E(),q&&q.c(),_=E(),y=v("button"),S=v("span"),S.textContent="Save changes",p(l,"class","clearfix m-b-base"),p(h,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=C=!n[9]||n[5],Q(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(J,W){w(J,e,W),j(t,e,null),b(e,i),D&&D.m(e,null),b(e,s),b(e,l),b(e,o),j(r,e,null),b(e,c),b(e,d),b(d,h),b(d,g),R&&R.m(d,null),b(d,m),q&&q.m(d,null),b(d,_),b(d,y),b(y,S),$=!0,O||(M=[K(y,"click",n[28]),K(e,"submit",xe(n[11]))],O=!0)},p(J,W){var ie,Ee,Ne;const le={};W[0]&4|W[1]&3&&(le.$$scope={dirty:W,ctx:J}),t.$set(le),J[2]?D?(D.p(J,W),W[0]&4&&A(D,1)):(D=Kg(J),D.c(),A(D,1),D.m(e,s)):D&&(ue(),L(D,1,1,()=>{D=null}),fe());const ee={};W[0]&1&&(ee.originalConfig=(ie=J[0].backups)==null?void 0:ie.s3),!a&&W[0]&2&&(a=!0,ee.config=J[1].backups.s3,ye(()=>a=!1)),!u&&W[0]&128&&(u=!0,ee.isTesting=J[7],ye(()=>u=!1)),!f&&W[0]&256&&(f=!0,ee.testError=J[8],ye(()=>f=!1)),r.$set(ee),(Ne=(Ee=J[1].backups)==null?void 0:Ee.s3)!=null&&Ne.enabled&&!J[9]&&!J[5]?R?R.p(J,W):(R=Jg(J),R.c(),R.m(d,m)):R&&(R.d(1),R=null),J[9]?q?q.p(J,W):(q=Gg(J),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!$||W[0]&544&&C!==(C=!J[9]||J[5]))&&(y.disabled=C),(!$||W[0]&32)&&Q(y,"btn-loading",J[5])},i(J){$||(A(t.$$.fragment,J),A(D),A(r.$$.fragment,J),J&&Qe(()=>{$&&(T||(T=qe(e,it,{duration:150},!0)),T.run(1))}),$=!0)},o(J){L(t.$$.fragment,J),L(D),L(r.$$.fragment,J),J&&(T||(T=qe(e,it,{duration:150},!1)),T.run(0)),$=!1},d(J){J&&k(e),H(t),D&&D.d(),H(r),R&&R.d(),q&&q.d(),J&&T&&T.end(),O=!1,$e(M)}}}function EI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Kg(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[AI,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[II,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&2|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Qe(()=>{u&&(a||(a=qe(e,it,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(e,it,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function DI(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Every day at 00:00h',t=E(),i=v("button"),i.innerHTML='Every sunday at 00:00h',s=E(),l=v("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=E(),r=v("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[19]),K(i,"click",n[20]),K(l,"click",n[21]),K(r,"click",n[22])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function AI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F;return m=new Ln({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[DI]},$$scope:{ctx:n}}}),{c(){var P,N;e=v("label"),t=U("Cron expression"),s=E(),l=v("input"),a=E(),u=v("div"),f=v("button"),c=v("span"),c.textContent="Presets",d=E(),h=v("i"),g=E(),z(m.$$.fragment),_=E(),y=v("div"),S=v("p"),C=U(`Supports numeric list, steps, ranges or `),T=v("span"),T.textContent="macros",$=U(`. `),O=v("br"),M=U(` - The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((N=(P=n[0])==null?void 0:P.backups)!=null&&N.cron),p(c,"class","txt"),p(h,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(y,"class","help-block")},m(P,N){var R,q;w(P,e,N),b(e,t),w(P,s,N),w(P,l,N),ae(l,n[1].backups.cron),w(P,a,N),w(P,u,N),b(u,f),b(f,c),b(f,d),b(f,h),b(f,g),H(m,f,null),w(P,_,N),w(P,y,N),b(y,S),b(S,C),b(S,T),b(S,$),b(S,O),b(S,M),D=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||l.focus(),I||(F=[K(l,"input",n[18]),Te(je.call(null,T,`@yearly + The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((N=(P=n[0])==null?void 0:P.backups)!=null&&N.cron),p(c,"class","txt"),p(h,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(y,"class","help-block")},m(P,N){var R,q;w(P,e,N),b(e,t),w(P,s,N),w(P,l,N),ae(l,n[1].backups.cron),w(P,a,N),w(P,u,N),b(u,f),b(f,c),b(f,d),b(f,h),b(f,g),j(m,f,null),w(P,_,N),w(P,y,N),b(y,S),b(S,C),b(S,T),b(S,$),b(S,O),b(S,M),D=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||l.focus(),I||(F=[K(l,"input",n[18]),Te(je.call(null,T,`@yearly @annually @monthly @weekly @daily @midnight -@hourly`))],I=!0)},p(P,N){var q,B;(!D||N[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!D||N[1]&1&&o!==(o=P[31]))&&p(l,"id",o),(!D||N[0]&1&&r!==(r=!((B=(q=P[0])==null?void 0:q.backups)!=null&&B.cron)))&&(l.autofocus=r),N[0]&2&&l.value!==P[1].backups.cron&&ae(l,P[1].backups.cron);const R={};N[0]&2|N[1]&2&&(R.$$scope={dirty:N,ctx:P}),m.$set(R)},i(P){D||(A(m.$$.fragment,P),D=!0)},o(P){L(m.$$.fragment,P),D=!1},d(P){P&&(k(e),k(s),k(l),k(a),k(u),k(_),k(y)),V(m),I=!1,$e(F)}}}function II(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[1].backups.cronMaxKeep),r||(a=K(l,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&2&&dt(l.value)!==u[1].backups.cronMaxKeep&&ae(l,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Jg(n){let e;function t(l,o){return l[7]?FI:l[8]?PI:LI}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function LI(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PI(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=je.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function FI(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Gg(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=K(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function NI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F,P;h=new Yo({props:{class:"btn-sm",tooltip:"Refresh"}}),h.$on("refresh",n[13]),m=new $I({props:{class:"btn-sm"}}),m.$on("success",n[13]);let N={};y=new SI({props:N}),n[15](y);function R(X,J){return X[6]?OI:MI}let q=R(n),B=q(n),Z=n[6]&&!n[4]&&Yg(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),z(h.$$.fragment),g=E(),z(m.$$.fragment),_=E(),z(y.$$.fragment),S=E(),C=v("hr"),T=E(),$=v("button"),O=v("span"),O.textContent="Backups options",M=E(),B.c(),D=E(),Z&&Z.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(X,J){w(X,e,J),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(X,r,J),w(X,a,J),b(a,u),b(u,f),b(f,c),b(f,d),H(h,f,null),b(f,g),H(m,f,null),b(u,_),H(y,u,null),b(u,S),b(u,C),b(u,T),b(u,$),b($,O),b($,M),B.m($,null),b(u,D),Z&&Z.m(u,null),I=!0,F||(P=[K($,"click",n[16]),K(u,"submit",xe(n[11]))],F=!0)},p(X,J){(!I||J[0]&1024)&&se(o,X[10]);const W={};y.$set(W),q!==(q=R(X))&&(B.d(1),B=q(X),B&&(B.c(),B.m($,null))),(!I||J[0]&16)&&($.disabled=X[4]),(!I||J[0]&16)&&Q($,"btn-loading",X[4]),X[6]&&!X[4]?Z?(Z.p(X,J),J[0]&80&&A(Z,1)):(Z=Yg(X),Z.c(),A(Z,1),Z.m(u,null)):Z&&(ue(),L(Z,1,1,()=>{Z=null}),fe())},i(X){I||(A(h.$$.fragment,X),A(m.$$.fragment,X),A(y.$$.fragment,X),A(Z),I=!0)},o(X){L(h.$$.fragment,X),L(m.$$.fragment,X),L(y.$$.fragment,X),L(Z),I=!1},d(X){X&&(k(e),k(r),k(a)),V(h),V(m),n[15](null),V(y),B.d(),Z&&Z.d(),F=!1,$e(P)}}}function RI(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function qI(n,e,t){let i,s;Ke(n,At,J=>t(10,s=J)),sn(At,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,h=!1,g=null;m();async function m(){t(4,a=!0);try{const J=await de.settings.getAll()||{};y(J)}catch(J){de.error(J)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const J=await de.settings.update(j.filterRedactedProps(r));await C(),y(J),jt("Successfully saved application settings.")}catch(J){de.error(J)}t(5,u=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function C(){return l==null?void 0:l.loadBackups()}function T(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const $=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function M(){r.backups.cron=this.value,t(1,r),t(2,c)}const D=()=>{t(1,r.backups.cron="0 0 * * *",r)},I=()=>{t(1,r.backups.cron="0 0 * * 0",r)},F=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},P=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=dt(this.value),t(1,r),t(2,c)}function R(J){n.$$.not_equal(r.backups.s3,J)&&(r.backups.s3=J,t(1,r),t(2,c))}function q(J){h=J,t(7,h)}function B(J){g=J,t(8,g)}const Z=()=>S(),X=()=>_();return n.$$.update=()=>{var J;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(J=r==null?void 0:r.backups)!=null&&J.cron&&(ci("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,h,g,i,s,_,S,C,f,T,$,O,M,D,I,F,P,N,R,q,B,Z,X]}class jI extends ve{constructor(e){super(),be(this,e,qI,RI,me,{},null,[-1,-1])}}const zt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Hi("/"):!0}],HI={"/login":Nt({component:VD,conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Nt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-20a6c3b2.js"),[],import.meta.url),conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-52e8e3c4.js"),[],import.meta.url),conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Nt({component:fD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Nt({component:H4,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Nt({component:XD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Nt({component:FD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Nt({component:qA,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Nt({component:l8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Nt({component:w8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Nt({component:A8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Nt({component:R8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Nt({component:nI,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Nt({component:jI,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-86dd6b83.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-86dd6b83.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-05cb41fe.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-05cb41fe.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-3ecd2702.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-3ecd2702.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Nt({asyncComponent:()=>rt(()=>import("./PageOAuth2Redirect-5550785f.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"*":Nt({component:rk,userData:{showAppSidebar:!1}})};function VI(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Uo}=i;return{delay:f,duration:Et(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const m=g*a,_=g*u,y=h+g*e.width/t.width,S=h+g*e.height/t.height;return`transform: ${l} translate(${m}px, ${_}px) scale(${y}, ${S});`}}}function Zg(n,e,t){const i=n.slice();return i[2]=e[t],i}function zI(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function BI(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function UI(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function WI(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xg(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h,g=x,m,_,y;function S(O,M){return O[2].type==="info"?WI:O[2].type==="success"?UI:O[2].type==="warning"?BI:zI}let C=S(e),T=C(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),T.c(),s=E(),l=v("div"),r=U(o),a=E(),u=v("button"),u.innerHTML='',f=E(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,M){w(O,t,M),b(t,i),T.m(i,null),b(t,s),b(t,l),b(l,r),b(t,a),b(t,u),b(t,f),m=!0,_||(y=K(u,"click",xe($)),_=!0)},p(O,M){e=O,C!==(C=S(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!m||M&1)&&o!==(o=e[2].message+"")&&se(r,o),(!m||M&1)&&Q(t,"alert-info",e[2].type=="info"),(!m||M&1)&&Q(t,"alert-success",e[2].type=="success"),(!m||M&1)&&Q(t,"alert-danger",e[2].type=="error"),(!m||M&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){h=t.getBoundingClientRect()},f(){t0(t),g(),o_(t,h)},a(){g(),g=e0(t,h,VI,{duration:150})},i(O){m||(O&&Qe(()=>{m&&(d&&d.end(1),c=u_(t,it,{duration:150}),c.start())}),m=!0)},o(O){c&&c.invalidate(),O&&(d=va(t,Zr,{duration:150})),m=!1},d(O){O&&k(t),T.d(),O&&d&&d.end(),_=!1,y()}}}function YI(n){let e,t=[],i=new Map,s,l=ge(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>mb(l)]}class JI extends ve{constructor(e){super(),be(this,e,KI,YI,me,{})}}function GI(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=U(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),b(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&se(i,t)},d(l){l&&k(e)}}}function ZI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=E(),s=v("button"),l=v("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),e.focus(),o||(r=[K(e,"click",n[4]),K(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(s)),o=!1,$e(r)}}}function XI(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[ZI],header:[GI]},$$scope:{ctx:n}};return e=new on({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[6](null),V(e,s)}}}function QI(n,e,t){let i;Ke(n,su,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){te[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await ln(),t(3,o=!1),v1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class xI extends ve{constructor(e){super(),be(this,e,QI,XI,me,{})}}function Qg(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return m=new Ln({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[eL]},$$scope:{ctx:n}}}),{c(){var C;e=v("aside"),t=v("a"),t.innerHTML='PocketBase logo',i=E(),s=v("nav"),l=v("a"),l.innerHTML='',o=E(),r=v("a"),r.innerHTML='',a=E(),u=v("a"),u.innerHTML='',f=E(),c=v("figure"),d=v("img"),g=E(),z(m.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),_n(d.src,h="./images/avatars/avatar"+(((C=n[0])==null?void 0:C.avatar)||0)+".svg")||p(d,"src",h),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(C,T){w(C,e,T),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(e,f),b(e,c),b(c,d),b(c,g),H(m,c,null),_=!0,y||(S=[Te(un.call(null,t)),Te(un.call(null,l)),Te(zn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Te(je.call(null,l,{text:"Collections",position:"right"})),Te(un.call(null,r)),Te(zn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Te(je.call(null,r,{text:"Logs",position:"right"})),Te(un.call(null,u)),Te(zn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Te(je.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p(C,T){var O;(!_||T&1&&!_n(d.src,h="./images/avatars/avatar"+(((O=C[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",h);const $={};T&4096&&($.$$scope={dirty:T,ctx:C}),m.$set($)},i(C){_||(A(m.$$.fragment,C),_=!0)},o(C){L(m.$$.fragment,C),_=!1},d(C){C&&k(e),V(m),y=!1,$e(S)}}}function eL(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=' Manage admins',t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Te(un.call(null,e)),K(l,"click",n[7])],o=!0)},p:x,d(a){a&&(k(e),k(t),k(i),k(s),k(l)),o=!1,$e(r)}}}function xg(n){let e,t,i;return t=new au({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function tL(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((_=n[0])==null?void 0:_.id)&&n[1]&&Qg(n);o=new m0({props:{routes:HI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new JI({}),f=new xI({});let m=n[1]&&!n[2]&&xg(n);return{c(){t=E(),i=v("div"),g&&g.c(),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),m&&m.c(),d=Se(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),g&&g.m(i,null),b(i,s),b(i,l),H(o,l,null),b(l,r),H(a,l,null),w(y,u,S),H(f,y,S),w(y,c,S),m&&m.m(y,S),w(y,d,S),h=!0},p(y,[S]){var C;(!h||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(C=y[0])!=null&&C.id&&y[1]?g?(g.p(y,S),S&3&&A(g,1)):(g=Qg(y),g.c(),A(g,1),g.m(i,s)):g&&(ue(),L(g,1,1,()=>{g=null}),fe()),y[1]&&!y[2]?m?(m.p(y,S),S&6&&A(m,1)):(m=xg(y),m.c(),A(m,1),m.m(d.parentNode,d)):m&&(ue(),L(m,1,1,()=>{m=null}),fe())},i(y){h||(A(g),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(m),h=!0)},o(y){L(g),L(o.$$.fragment,y),L(a.$$.fragment,y),L(f.$$.fragment,y),L(m),h=!1},d(y){y&&(k(t),k(i),k(u),k(c),k(d)),g&&g.d(),V(o),V(a),V(f,y),m&&m.d(y)}}}function nL(n,e,t){let i,s,l,o;Ke(n,Ms,m=>t(10,i=m)),Ke(n,ko,m=>t(3,s=m)),Ke(n,La,m=>t(0,l=m)),Ke(n,At,m=>t(4,o=m));let r,a=!1,u=!1;function f(m){var _,y,S,C;((_=m==null?void 0:m.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(y=m==null?void 0:m.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(C=m==null?void 0:m.detail)==null?void 0:C.location,sn(At,o="",o),en({}),v1())}function c(){Hi("/")}async function d(){var m,_;if(l!=null&&l.id)try{const y=await de.settings.getAll({$cancelKey:"initialAppSettings"});sn(ko,s=((m=y==null?void 0:y.meta)==null?void 0:m.appName)||"",s),sn(Ms,i=!!((_=y==null?void 0:y.meta)!=null&&_.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function h(){de.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,h,g]}class iL extends ve{constructor(e){super(),be(this,e,nL,tL,me,{})}}new iL({target:document.getElementById("app")});export{$e as A,jt as B,j as C,Hi as D,Se as E,_b as F,qo as G,lo as H,Gt as I,Ke as J,ii as K,pt as L,te as M,_1 as N,ge as O,vt as P,rs as Q,Ut as R,ve as S,gt as T,jr as U,L as a,E as b,z as c,V as d,v as e,p as f,w as g,b as h,be as i,Te as j,ue as k,un as l,H as m,fe as n,k as o,de as p,pe as q,Q as r,me as s,A as t,K as u,xe as v,U as w,se as x,x as y,ae as z}; +@hourly`))],I=!0)},p(P,N){var q,B;(!D||N[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!D||N[1]&1&&o!==(o=P[31]))&&p(l,"id",o),(!D||N[0]&1&&r!==(r=!((B=(q=P[0])==null?void 0:q.backups)!=null&&B.cron)))&&(l.autofocus=r),N[0]&2&&l.value!==P[1].backups.cron&&ae(l,P[1].backups.cron);const R={};N[0]&2|N[1]&2&&(R.$$scope={dirty:N,ctx:P}),m.$set(R)},i(P){D||(A(m.$$.fragment,P),D=!0)},o(P){L(m.$$.fragment,P),D=!1},d(P){P&&(k(e),k(s),k(l),k(a),k(u),k(_),k(y)),H(m),I=!1,$e(F)}}}function II(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[1].backups.cronMaxKeep),r||(a=K(l,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&2&&dt(l.value)!==u[1].backups.cronMaxKeep&&ae(l,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Jg(n){let e;function t(l,o){return l[7]?FI:l[8]?PI:LI}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function LI(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PI(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=je.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&At(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function FI(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Gg(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=K(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function NI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F,P;h=new Yo({props:{class:"btn-sm",tooltip:"Refresh"}}),h.$on("refresh",n[13]),m=new $I({props:{class:"btn-sm"}}),m.$on("success",n[13]);let N={};y=new SI({props:N}),n[15](y);function R(X,J){return X[6]?OI:MI}let q=R(n),B=q(n),Z=n[6]&&!n[4]&&Yg(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),z(h.$$.fragment),g=E(),z(m.$$.fragment),_=E(),z(y.$$.fragment),S=E(),C=v("hr"),T=E(),$=v("button"),O=v("span"),O.textContent="Backups options",M=E(),B.c(),D=E(),Z&&Z.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(X,J){w(X,e,J),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(X,r,J),w(X,a,J),b(a,u),b(u,f),b(f,c),b(f,d),j(h,f,null),b(f,g),j(m,f,null),b(u,_),j(y,u,null),b(u,S),b(u,C),b(u,T),b(u,$),b($,O),b($,M),B.m($,null),b(u,D),Z&&Z.m(u,null),I=!0,F||(P=[K($,"click",n[16]),K(u,"submit",xe(n[11]))],F=!0)},p(X,J){(!I||J[0]&1024)&&se(o,X[10]);const W={};y.$set(W),q!==(q=R(X))&&(B.d(1),B=q(X),B&&(B.c(),B.m($,null))),(!I||J[0]&16)&&($.disabled=X[4]),(!I||J[0]&16)&&Q($,"btn-loading",X[4]),X[6]&&!X[4]?Z?(Z.p(X,J),J[0]&80&&A(Z,1)):(Z=Yg(X),Z.c(),A(Z,1),Z.m(u,null)):Z&&(ue(),L(Z,1,1,()=>{Z=null}),fe())},i(X){I||(A(h.$$.fragment,X),A(m.$$.fragment,X),A(y.$$.fragment,X),A(Z),I=!0)},o(X){L(h.$$.fragment,X),L(m.$$.fragment,X),L(y.$$.fragment,X),L(Z),I=!1},d(X){X&&(k(e),k(r),k(a)),H(h),H(m),n[15](null),H(y),B.d(),Z&&Z.d(),F=!1,$e(P)}}}function RI(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[NI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function qI(n,e,t){let i,s;Ke(n,Dt,J=>t(10,s=J)),sn(Dt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,h=!1,g=null;m();async function m(){t(4,a=!0);try{const J=await de.settings.getAll()||{};y(J)}catch(J){de.error(J)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const J=await de.settings.update(V.filterRedactedProps(r));await C(),y(J),jt("Successfully saved application settings.")}catch(J){de.error(J)}t(5,u=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function C(){return l==null?void 0:l.loadBackups()}function T(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const $=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function M(){r.backups.cron=this.value,t(1,r),t(2,c)}const D=()=>{t(1,r.backups.cron="0 0 * * *",r)},I=()=>{t(1,r.backups.cron="0 0 * * 0",r)},F=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},P=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=dt(this.value),t(1,r),t(2,c)}function R(J){n.$$.not_equal(r.backups.s3,J)&&(r.backups.s3=J,t(1,r),t(2,c))}function q(J){h=J,t(7,h)}function B(J){g=J,t(8,g)}const Z=()=>S(),X=()=>_();return n.$$.update=()=>{var J;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(J=r==null?void 0:r.backups)!=null&&J.cron&&(ci("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,h,g,i,s,_,S,C,f,T,$,O,M,D,I,F,P,N,R,q,B,Z,X]}class jI extends ve{constructor(e){super(),be(this,e,qI,RI,me,{},null,[-1,-1])}}const zt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Hi("/"):!0}],HI={"/login":Nt({component:VD,conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Nt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-d3ed729d.js"),[],import.meta.url),conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-d4de5d9d.js"),[],import.meta.url),conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Nt({component:fD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Nt({component:H4,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Nt({component:XD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Nt({component:FD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Nt({component:qA,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Nt({component:l8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Nt({component:w8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Nt({component:A8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Nt({component:R8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Nt({component:nI,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Nt({component:jI,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-71871f92.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-71871f92.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-733361e3.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-733361e3.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-40a7baa1.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-40a7baa1.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Nt({asyncComponent:()=>rt(()=>import("./PageOAuth2Redirect-70afa6ea.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"*":Nt({component:rk,userData:{showAppSidebar:!1}})};function VI(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Uo}=i;return{delay:f,duration:At(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const m=g*a,_=g*u,y=h+g*e.width/t.width,S=h+g*e.height/t.height;return`transform: ${l} translate(${m}px, ${_}px) scale(${y}, ${S});`}}}function Zg(n,e,t){const i=n.slice();return i[2]=e[t],i}function zI(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function BI(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function UI(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function WI(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xg(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h,g=x,m,_,y;function S(O,M){return O[2].type==="info"?WI:O[2].type==="success"?UI:O[2].type==="warning"?BI:zI}let C=S(e),T=C(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),T.c(),s=E(),l=v("div"),r=U(o),a=E(),u=v("button"),u.innerHTML='',f=E(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,M){w(O,t,M),b(t,i),T.m(i,null),b(t,s),b(t,l),b(l,r),b(t,a),b(t,u),b(t,f),m=!0,_||(y=K(u,"click",xe($)),_=!0)},p(O,M){e=O,C!==(C=S(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!m||M&1)&&o!==(o=e[2].message+"")&&se(r,o),(!m||M&1)&&Q(t,"alert-info",e[2].type=="info"),(!m||M&1)&&Q(t,"alert-success",e[2].type=="success"),(!m||M&1)&&Q(t,"alert-danger",e[2].type=="error"),(!m||M&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){h=t.getBoundingClientRect()},f(){t0(t),g(),o_(t,h)},a(){g(),g=e0(t,h,VI,{duration:150})},i(O){m||(O&&Qe(()=>{m&&(d&&d.end(1),c=u_(t,it,{duration:150}),c.start())}),m=!0)},o(O){c&&c.invalidate(),O&&(d=va(t,Zr,{duration:150})),m=!1},d(O){O&&k(t),T.d(),O&&d&&d.end(),_=!1,y()}}}function YI(n){let e,t=[],i=new Map,s,l=ge(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>mb(l)]}class JI extends ve{constructor(e){super(),be(this,e,KI,YI,me,{})}}function GI(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=U(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),b(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&se(i,t)},d(l){l&&k(e)}}}function ZI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=E(),s=v("button"),l=v("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),e.focus(),o||(r=[K(e,"click",n[4]),K(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(s)),o=!1,$e(r)}}}function XI(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[ZI],header:[GI]},$$scope:{ctx:n}};return e=new on({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function QI(n,e,t){let i;Ke(n,su,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){te[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await ln(),t(3,o=!1),v1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class xI extends ve{constructor(e){super(),be(this,e,QI,XI,me,{})}}function Qg(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return m=new Ln({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[eL]},$$scope:{ctx:n}}}),{c(){var C;e=v("aside"),t=v("a"),t.innerHTML='PocketBase logo',i=E(),s=v("nav"),l=v("a"),l.innerHTML='',o=E(),r=v("a"),r.innerHTML='',a=E(),u=v("a"),u.innerHTML='',f=E(),c=v("figure"),d=v("img"),g=E(),z(m.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),_n(d.src,h="./images/avatars/avatar"+(((C=n[0])==null?void 0:C.avatar)||0)+".svg")||p(d,"src",h),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(C,T){w(C,e,T),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(e,f),b(e,c),b(c,d),b(c,g),j(m,c,null),_=!0,y||(S=[Te(un.call(null,t)),Te(un.call(null,l)),Te(zn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Te(je.call(null,l,{text:"Collections",position:"right"})),Te(un.call(null,r)),Te(zn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Te(je.call(null,r,{text:"Logs",position:"right"})),Te(un.call(null,u)),Te(zn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Te(je.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p(C,T){var O;(!_||T&1&&!_n(d.src,h="./images/avatars/avatar"+(((O=C[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",h);const $={};T&4096&&($.$$scope={dirty:T,ctx:C}),m.$set($)},i(C){_||(A(m.$$.fragment,C),_=!0)},o(C){L(m.$$.fragment,C),_=!1},d(C){C&&k(e),H(m),y=!1,$e(S)}}}function eL(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=' Manage admins',t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Te(un.call(null,e)),K(l,"click",n[7])],o=!0)},p:x,d(a){a&&(k(e),k(t),k(i),k(s),k(l)),o=!1,$e(r)}}}function xg(n){let e,t,i;return t=new au({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:V.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function tL(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;document.title=e=V.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((_=n[0])==null?void 0:_.id)&&n[1]&&Qg(n);o=new m0({props:{routes:HI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new JI({}),f=new xI({});let m=n[1]&&!n[2]&&xg(n);return{c(){t=E(),i=v("div"),g&&g.c(),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),m&&m.c(),d=Se(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),g&&g.m(i,null),b(i,s),b(i,l),j(o,l,null),b(l,r),j(a,l,null),w(y,u,S),j(f,y,S),w(y,c,S),m&&m.m(y,S),w(y,d,S),h=!0},p(y,[S]){var C;(!h||S&24)&&e!==(e=V.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(C=y[0])!=null&&C.id&&y[1]?g?(g.p(y,S),S&3&&A(g,1)):(g=Qg(y),g.c(),A(g,1),g.m(i,s)):g&&(ue(),L(g,1,1,()=>{g=null}),fe()),y[1]&&!y[2]?m?(m.p(y,S),S&6&&A(m,1)):(m=xg(y),m.c(),A(m,1),m.m(d.parentNode,d)):m&&(ue(),L(m,1,1,()=>{m=null}),fe())},i(y){h||(A(g),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(m),h=!0)},o(y){L(g),L(o.$$.fragment,y),L(a.$$.fragment,y),L(f.$$.fragment,y),L(m),h=!1},d(y){y&&(k(t),k(i),k(u),k(c),k(d)),g&&g.d(),H(o),H(a),H(f,y),m&&m.d(y)}}}function nL(n,e,t){let i,s,l,o;Ke(n,Ms,m=>t(10,i=m)),Ke(n,ko,m=>t(3,s=m)),Ke(n,La,m=>t(0,l=m)),Ke(n,Dt,m=>t(4,o=m));let r,a=!1,u=!1;function f(m){var _,y,S,C;((_=m==null?void 0:m.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(y=m==null?void 0:m.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(C=m==null?void 0:m.detail)==null?void 0:C.location,sn(Dt,o="",o),en({}),v1())}function c(){Hi("/")}async function d(){var m,_;if(l!=null&&l.id)try{const y=await de.settings.getAll({$cancelKey:"initialAppSettings"});sn(ko,s=((m=y==null?void 0:y.meta)==null?void 0:m.appName)||"",s),sn(Ms,i=!!((_=y==null?void 0:y.meta)!=null&&_.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function h(){de.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,h,g]}class iL extends ve{constructor(e){super(),be(this,e,nL,tL,me,{})}}new iL({target:document.getElementById("app")});export{$e as A,jt as B,V as C,Hi as D,Se as E,_b as F,qo as G,lo as H,Gt as I,Ke as J,ii as K,pt as L,te as M,_1 as N,ge as O,vt as P,rs as Q,Ut as R,ve as S,gt as T,jr as U,L as a,E as b,z as c,H as d,v as e,p as f,w as g,b as h,be as i,Te as j,ue as k,un as l,j as m,fe as n,k as o,de as p,pe as q,Q as r,me as s,A as t,K as u,xe as v,U as w,se as x,x as y,ae as z}; diff --git a/ui/dist/assets/index-808c8630.js b/ui/dist/assets/index-808c8630.js deleted file mode 100644 index 8e922f07..00000000 --- a/ui/dist/assets/index-808c8630.js +++ /dev/null @@ -1,13 +0,0 @@ -class I{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),Ke.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),Ke.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 oi(this),r=new oi(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 oi(this,e)}iterRange(e,t=this.length){return new hl(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 cl(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}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):Ke.from(G.split(e,[]))}}class G extends I{constructor(e,t=tc(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 ic(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(Ar(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Gi(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=Gi(this.text,Gi(i.text,Ar(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):Ke.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=` -`){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(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 Ke 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=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=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new Ke(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;re&&r&&(s+=i),eo&&(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 Ke))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 Ke)for(let g of d.children)f(g);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]:Ke.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Ke(l,t)}}I.empty=new G([""],0);function tc(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Gi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?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 hl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new oi(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 cl{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()},oi.prototype[Symbol.iterator]=hl.prototype[Symbol.iterator]=cl.prototype[Symbol.iterator]=function(){return this});class ic{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 It="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;nn)return It[e-1]<=n;return!1}function Mr(n){return n>=127462&&n<=127487}const Dr=8205;function ce(n,e,t=!0,i=!0){return(t?fl:sc)(n,e,i)}function fl(n,e,t){if(e==n.length)return e;e&&ul(n.charCodeAt(e))&&dl(n.charCodeAt(e-1))&&e--;let i=ne(n,e);for(e+=Oe(i);e=0&&Mr(ne(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function sc(n,e,t){for(;e>0;){let i=fl(n,e-2,t);if(i=56320&&n<57344}function dl(n){return n>=55296&&n<56320}function ne(n,e){let t=n.charCodeAt(e);if(!dl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return ul(i)?(t-55296<<10)+(i-56320)+65536:t}function _s(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Oe(n){return n<65536?1:2}const ns=/\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 Je{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=he.Simple&&h>=e&&(i==he.TrackDel&&se||i==he.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Je(e)}static create(e){return new Je(e)}}class Z extends Je{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ss(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return rs(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&nt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?I.of(d.split(i||ns)):d:I.empty,g=p.length;if(f==u&&g==0)return;fo&&ae(s,f-o,-1),ae(s,u-f,g),nt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Z(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function nt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function rs(n,e,t,i=!1){let s=[],r=i?[]:null,o=new hi(n),l=new hi(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ae(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class hi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class gt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new gt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new gt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>gt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function gl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Xs=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Xs++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Ys),!!e.static,e.enables)}of(e){return new Ji([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ji(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ji(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Ys(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Ji{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Xs++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||os(f,c)){let d=i(f);if(l?!Or(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=nn(u,p);if(this.dependencies.every(m=>m instanceof D?u.facet(m)===f.facet(m):m instanceof be?u.field(m,!1)==f.field(m,!1):!0)||(l?Or(d=i(f),g,s):s(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Or(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Tr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Tr.of({field:this,create:e})]}get extension(){return this}}const pt={lowest:4,low:3,default:2,high:1,highest:0};function Yt(n){return e=>new ml(e,n)}const At={highest:Yt(pt.highest),high:Yt(pt.high),default:Yt(pt.default),low:Yt(pt.low),lowest:Yt(pt.lowest)};class ml{constructor(e,t){this.inner=e,this.prec=t}}class An{of(e){return new ls(this,e)}reconfigure(e){return An.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ls{constructor(e,t){this.compartment=e,this.inner=t}}class tn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of oc(e,t,o))u instanceof be?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,Ys(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=h.length<<1,h.push(y=>m.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(m=>rc(m,p,d))}}let f=h.map(u=>u(l));return new tn(e,o,f,l,a,r)}}function oc(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof ls&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof ls){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof ml)r(o.inner,o.prec);else if(o instanceof be)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Ji)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,pt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,pt.default),i.reduce((o,l)=>o.concat(l))}function li(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function nn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const yl=D.define(),bl=D.define({combine:n=>n.some(e=>e),static:!0}),xl=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),wl=D.define(),kl=D.define(),Sl=D.define(),vl=D.define({combine:n=>n.length?n[0]:!1});class Ze{constructor(e,t){this.type=e,this.value=t}static define(){return new lc}}class lc{of(e){return new Ze(this,e)}}class ac{constructor(e){this.map=e}of(e){return new E(this,e)}}class E{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new E(this.type,t)}is(e){return this.type==e}static define(e={}){return new ac(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}E.reconfigure=E.define();E.appendConfig=E.define();class ee{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&gl(i,t.newLength),r.some(l=>l.type==ee.time)||(this.annotations=r.concat(ee.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ee(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ee.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ee.time=Ze.define();ee.userEvent=Ze.define();ee.addToHistory=Ze.define();ee.remote=Ze.define();function hc(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof ee?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ee?n=r[0]:n=Al(e,Nt(r),!1)}return n}function fc(n){let e=n.startState,t=e.facet(Sl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Cl(i,as(e,r,n.changes.newLength),!0))}return i==n?n:ee.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const uc=[];function Nt(n){return n==null?uc:Array.isArray(n)?n:[n]}var $=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}($||($={}));const dc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let hs;try{hs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function pc(n){if(hs)return hs.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||dc.test(t)))return!0}return!1}function gc(n){return e=>{if(!/\S/.test(e))return $.Space;if(pc(e))return $.Word;for(let t=0;t-1)return $.Word;return $.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(E.reconfigure)?(t=null,i=o.value):o.is(E.appendConfig)&&(t=null,i=Nt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=tn.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Nt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=tn.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||ns)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return gl(s,i.length),t.staticFacet(bl)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||` -`}get readOnly(){return this.facet(vl)}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(yl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return gc(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=ce(t,o,!1);if(r(t.slice(a,o))!=$.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=xl;N.readOnly=vl;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=yl;N.changeFilter=wl;N.transactionFilter=kl;N.transactionExtender=Sl;An.reconfigure=E.define();function Mt(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 cs.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=he.TrackDel;let cs=class Ml{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Ml(e,t,i)}};function fs(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Qs{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);rd||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 Qs(s,r,i,l):null,pos:o}}}class K{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 K(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(fs)),this.isEmpty)return t.length?K.of(t):this;let l=new Dl(this,null,-1).goto(0),a=0,h=[],c=new kt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=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 ci.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ci.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=Br(o,l,i),h=new Qt(o,a,r),c=new Qt(l,a,r);i.iterGaps((f,u,d)=>Pr(h,f,c,u,d,s)),i.empty&&i.length==0&&Pr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Br(r,o),a=new Qt(r,l,0).goto(i),h=new Qt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!us(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new Qt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new kt;for(let s of e instanceof cs?[e]:t?mc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}K.empty=new K([],[],null,-1);function mc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(fs);e=i}return n}K.empty.nextLayer=K.empty;class kt{finishChunk(e){this.chunks.push(new Qs(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new kt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(K.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Br(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new Dl(o,t,i,r));return s.length==1?s[0]:new ci(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Hn(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Hn(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Hn(this.heap,0)}}}function Hn(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Qt{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ci.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Di(this.active,e),Di(this.activeTo,e),Di(this.activeRank,e),this.minActive=Lr(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Di(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Pr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&us(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!us(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function us(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Lr(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ce(n,s)}return i===!0?-1:n.length}const ps="ͼ",Rr=typeof Symbol>"u"?"__"+ps:Symbol.for(ps),gs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Er=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class lt{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Er[Rr]||1;return Er[Rr]=e+1,ps+e.toString(36)}static mount(e,t,i){let s=e[gs],r=i&&i.nonce;s?r&&s.setNonce(r):s=new yc(e,r),s.mount(Array.isArray(t)?t:[t])}}let Ir=new Map;class yc{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=Ir.get(i);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[gs]=r;this.sheet=new s.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Ir.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[gs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},bc=typeof navigator<"u"&&/Mac/.test(navigator.platform),xc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);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),fi[se]=String.fromCharCode(se);for(var Wn in at)fi.hasOwnProperty(Wn)||(fi[Wn]=at[Wn]);function wc(n){var e=bc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||xc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?fi: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 sn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function ms(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function kc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function _i(n,e){if(!e.anchorNode)return!1;try{return ms(n,e.anchorNode)}catch{return!1}}function Vt(n){return n.nodeType==3?St(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function rn(n,e,t,i){return t?Nr(n,e,t,i,-1)||Nr(n,e,t,i,1):!1}function on(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Nr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:ht(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=on(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?ht(n):0}else return!1}}function ht(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Mn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Sc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function vc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body;if(d)u=Sc(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let m=c.getBoundingClientRect();u={left:m.left,right:m.left+c.clientWidth,top:m.top,bottom:m.top+c.clientHeight}}let p=0,g=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+g&&(g=e.bottom-u.bottom+g+o)):e.bottom>u.bottom&&(g=e.bottom-u.bottom+o,t<0&&e.top-g0&&e.right>u.right+p&&(p=e.right-u.right+p+r)):e.right>u.right&&(p=e.right-u.right+r,t<0&&e.leftt.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 Ac{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){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?ht(t):0),i,Math.min(e.focusOffset,i?ht(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Bt=null;function Ol(n){if(n.setActive)return n.setActive();if(Bt)return n.focus(Bt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Bt==null?{get preventScroll(){return Bt={preventScroll:!0},!0}}:void 0),!Bt){Bt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class de{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new de(e.parentNode,on(e),t)}static after(e,t){return new de(e.parentNode,on(e)+1,t)}}const Zs=[];class V{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=V.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Hr(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=Hr(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=ht(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!V.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Zs){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ll(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(tr)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=V.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function Wr(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class Vr{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}let De=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ys=typeof document<"u"?document:{documentElement:{style:{}}};const bs=/Edge\/(\d+)/.exec(De.userAgent),Il=/MSIE \d/.test(De.userAgent),xs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(De.userAgent),Dn=!!(Il||xs||bs),zr=!Dn&&/gecko\/(\d+)/i.test(De.userAgent),Vn=!Dn&&/Chrome\/(\d+)/.exec(De.userAgent),qr="webkitFontSmoothing"in ys.documentElement.style,Nl=!Dn&&/Apple Computer/.test(De.vendor),Kr=Nl&&(/Mobile\/\w+/.test(De.userAgent)||De.maxTouchPoints>2);var A={mac:Kr||/Mac/.test(De.platform),windows:/Win/.test(De.platform),linux:/Linux|X11/.test(De.platform),ie:Dn,ie_version:Il?ys.documentMode||6:xs?+xs[1]:bs?+bs[1]:0,gecko:zr,gecko_version:zr?+(/Firefox\/(\d+)/.exec(De.userAgent)||[0,0])[1]:0,chrome:!!Vn,chrome_version:Vn?+Vn[1]:0,ios:Kr,android:/Android\b/.test(De.userAgent),webkit:qr,safari:Nl,webkit_version:qr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:ys.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Oc=256;class _e extends V{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof _e)||this.length-(t-e)+i.length>Oc||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new _e(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new de(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Tc(this.dom,e,t)}}class Qe extends V{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Tl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Qe&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Qe(this.mark,t,o)}domAtPos(e){return Fl(this,e)}coordsAt(e,t){return Wl(this,e,t)}}function Tc(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?A.chrome||A.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return A.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Mn(a,o<0):a||null}class mt extends V{static create(e,t,i){return new mt(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=mt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof mt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?de.before(this.dom):de.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?de.before(this.dom):de.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return I.empty}get isHidden(){return!0}}_e.prototype.children=mt.prototype.children=zt.prototype.children=Zs;function Fl(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Qe&&s.length&&(i=s[s.length-1])instanceof Qe&&i.mark.eq(e.mark)?Hl(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Wl(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function ks(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function Pc(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ct(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Vl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new ct(e,i,s,t,e.widget||null,!0)}static line(e){return new Si(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}B.none=K.empty;class ki extends B{constructor(e){let{start:t,end:i}=Vl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof ki&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&er(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}ki.prototype.point=!1;class Si extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Si&&this.spec.class==e.spec.class&&er(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Si.prototype.mapMode=he.TrackBefore;Si.prototype.point=!0;class ct extends B{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?he.TrackBefore:he.TrackAfter:he.TrackDel}get type(){return this.startSide=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ct&&Lc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ct.prototype.point=!0;function Vl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Lc(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ss(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class ue extends V{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof ue))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Rl(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new ue;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){er(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Hl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=ws(t,this.attrs||{})),i&&(this.attrs=ws({class:i},this.attrs||{}))}domAtPos(e){return Fl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Tl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(ks(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&V.get(s)instanceof Qe;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=V.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!A.ios||!this.children.some(r=>r instanceof _e))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof _e)||/[^ -~]/.test(i.text))return null;let s=Vt(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Wl(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof ue)return r;if(o>t)break}s=o+r.breakAfter}return null}}class xt extends V{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof xt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Ti(new _e(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ct){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof ct)if(i.block){let{type:a}=i;a==_.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new xt(i.widget||new jr("div"),l,a))}else{let a=mt.create(i.widget||new jr("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Ti(new zt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Ti(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new ai(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ti(n,e){for(let t of e)n=new Qe(t,[n],n.length);return n}class jr extends Dt{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const zl=D.define(),ql=D.define(),Kl=D.define(),$l=D.define(),vs=D.define(),jl=D.define(),Ul=D.define(),Gl=D.define({combine:n=>n.some(e=>e)}),Jl=D.define({combine:n=>n.some(e=>e)});class ln{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new ln(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Ur=E.define({map:(n,e)=>n.map(e)});function Ie(n,e,t){let i=n.facet($l);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const On=D.define({combine:n=>n.length?n[0]:!0});let Rc=0;const ii=D.define();class ge{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new ge(Rc++,e,i,o=>{let l=[ii.of(o)];return r&&l.push(ui.of(a=>{let h=a.plugin(o);return h?r(h):B.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return ge.define(i=>new e(i),t)}}class zn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ie(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ie(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ie(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const _l=D.define(),tr=D.define(),ui=D.define(),ir=D.define(),Xl=D.define();function Gr(n,e,t){let i=n.state.facet(Xl);if(!i.length)return i;let s=i.map(o=>o instanceof Function?o(n):o),r=[];return K.spans(s,e,t,{point(){},span(o,l,a,h){let c=r;for(let f=a.length-1;f>=0;f--,h--){let u=a[f].spec.bidiIsolate,d;if(u!=null)if(h>0&&c.length&&(d=c[c.length-1]).to==o&&d.direction==u)d.to=l,c=d.inner;else{let p={from:o,to:l,direction:u,inner:[]};c.push(p),c=p.inner}}}}),r}const Yl=D.define();function Ql(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Yl)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ni=D.define();class Le{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Le(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Le(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class an{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Z.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Le(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new an(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var J=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(J||(J={}));const di=J.LTR,Zl=J.RTL;function ea(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ta(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;g-=3)if(He[g+1]==-d){let m=He[g+2],y=m&2?s:m&4?m&1?r:s:0;y&&(F[f]=F[He[g]]=y),l=g;break}}else{if(He.length==189)break;He[l++]=f,He[l++]=u,He[l++]=a}else if((p=F[f])==2||p==1){let g=p==s;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=He[m+2];if(y&2)break;if(g)He[m+2]|=2;else{if(y&4)break;He[m+2]|=4}}}}}function Vc(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=sa;)p==m&&(p=t[--g].from,m=g?t[g-1].to:n),F[--p]=d;a=c}else r=h,a++}}}function As(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;aa&&o.push(new st(a,g.from,d));let m=g.direction==di!=!(d%2);Ms(n,m?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(c?F[p]!=l:F[p]==l))break;p++}u?As(n,a,p,i+1,s,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let g=F[a-1];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let g=r[--h];if(!c)for(let m=g.from,y=h;;){if(m==e)break e;if(y&&r[y-1].to==m)m=r[--y].from;else{if(F[m-1]==l)break e;break}}if(u)u.push(g);else{g.toF.length;)F[F.length]=256;let i=[],s=e==di?0:1;return Ms(n,s,s,t,0,n.length,i),i}function ia(n){return[new st(0,n,0)]}let na="";function qc(n,e,t,i,s){var r;let o=i.head-n.from,l=-1;if(o==0){if(!s||!n.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),l=0)}else if(o==n.length){if(s)return null;let u=e[e.length-1];u.level!=t&&(o=u.side(!0,t),l=e.length-1)}l<0&&(l=st.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc));let a=e[l];o==a.side(s,t)&&(a=e[l+=s?1:-1],o=a.side(!s,t));let h=s==(a.dir==t),c=ce(n.text,o,h);if(na=n.text.slice(Math.min(o,c),Math.max(o,c)),c!=a.side(s,t))return b.cursor(c+n.from,h?-1:1,a.level);let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return!f&&a.level!=t?b.cursor(s?n.to:n.from,s?-1:1,t):f&&f.level0&&t.length&&(t.every(({fromA:l,toA:a})=>athis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=this.view.inputState.composing<0?null:$c(this.view,e.changes);if(this.hasComposition){this.markedForComposition.clear();let{from:l,to:a}=this.hasComposition;t=new Le(l,a,e.changes.mapPos(l,-1),e.changes.mapPos(a,1)).addToSet(t.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(A.ie||A.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,r=this.updateDeco(),o=Gc(s,r,e.changes);return t=Le.extendWithRanges(t,o),!(this.flags&7)&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=A.chrome||A.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,g;if(i&&i.range.fromBc){let x=ai.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=ai.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=x.breakAtStart,p=x.openStart,g=w.openEnd;let k=this.compositionView(i);w.breakAtStart?k.breakAfter=1:w.content.length&&k.merge(k.length,k.length,w.content[0],!1,w.openStart,0)&&(k.breakAfter=w.content[0].breakAfter,w.content.shift()),x.content.length&&k.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),u=x.content.concat(k).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=ai.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(h,1),{i:S,off:M}=r.findPos(a,-1);Ll(this,S,M,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new _e(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Qe(s,[t],t.length);let i=new ue;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8,this.markedForComposition.add(o);let l=V.get(r);l!=o&&(l&&(l.dom=null),o.setDOM(r))},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&_i(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.domAtPos(l.anchor),h=l.empty?a:this.domAtPos(l.head);if(A.gecko&&l.empty&&!this.hasComposition&&Kc(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new de(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!rn(a.node,a.offset,c.anchorNode,c.anchorOffset)||!rn(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{A.android&&A.chrome&&this.dom.contains(c.focusNode)&&Jc(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=sn(this.view.root);if(f)if(l.empty){if(A.gecko){let u=jc(a.node,a.offset);if(u&&u!=3){let d=ra(a.node,a.offset,u==1?1:-1);d&&(a=new de(d,u==1?0:d.nodeValue.length))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&c.caretBidiLevel!=null&&(c.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new de(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new de(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=sn(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=ue.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}nearest(e){for(let t=e;t;){let i=V.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=_.WidgetBefore&&r.type!=_.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==_.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof ue))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof _e))return null;let r=ce(s.text,i);if(r==i)return null;let o=St(s.dom,i,r).getClientRects();return!o.length||o[0].top>=o[0].bottom?null:o[0]}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==J.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,g=p?Vt(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?J.RTL:J.LTR}measureTextSize(){for(let r of this.children)if(r instanceof ue){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Vt(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Pl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(B.replace({widget:new _r(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return B.set(e)}updateDeco(){let e=this.view.state.facet(ui).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=Ql(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};vc(this.view.scrollDOM,o,t.head-1)return null;a+=d.text.length}if(h=h.parentNode,!h)return null;let c=V.get(h);if(c){r=c.posAtStart+a,o=r+l;break}}}return{from:r,to:o,node:i}}function $c(n,e){let t=sa(n,e.newLength-e.length);if(!t)return null;let{from:i,to:s,node:r}=t,o=e.mapPos(i,-1),l=e.mapPos(s,1),a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(l-o!=a.length){let u=e.mapPos(i,1),d=e.mapPos(s,-1);if(d-u==a.length)o=u,l=d;else if(n.state.doc.sliceString(l-a.length,l)==a)o=l-a.length;else if(n.state.doc.sliceString(o,o+a.length)==a)l=o+a.length;else return null}let{main:h}=n.state.selection;if(n.state.doc.sliceString(o,l)!=a||o>h.head||l0)i=i.childNodes[s-1],s=ht(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return i;if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function jc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=ce(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function Yc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function qn(n,e){return n.tope.top+1}function Xr(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Ds(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=Vt(p);for(let m=0;mM||o==M&&r>S){i=p,s=y,r=S,o=M;let x=M?t0?m0)}S==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&qn(c,y)?c=Yr(c,y.bottom):f&&qn(f,y)&&(f=Xr(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Qr(i,u,t);if(l&&i.contentEditable!="false")return Ds(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Qr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((A.chrome||A.gecko)&&St(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function oa(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let x=n.viewState.heightOracle.textHeight/2,w=!1;a=n.elementAtHeight(u),a.type!=_.Text;)for(;u=i>0?a.bottom+x:a.top-x,!(u>=0&&u<=h);){if(w)return t?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Zr(n,o,a,c,f);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,m=g.elementFromPoint(c,f);m&&!n.contentDOM.contains(m)&&(m=null),m||(c=Math.max(o.left+1,Math.min(o.right-1,c)),m=g.elementFromPoint(c,f),m&&!n.contentDOM.contains(m)&&(m=null));let y,S=-1;if(m&&((s=n.docView.nearest(m))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let x=p.caretPositionFromPoint(c,f);x&&({offsetNode:y,offset:S}=x)}else if(p.caretRangeFromPoint){let x=p.caretRangeFromPoint(c,f);x&&({startContainer:y,startOffset:S}=x,(!n.contentDOM.contains(y)||A.safari&&Qc(y,S,c)||A.chrome&&Zc(y,S,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let x=ue.find(n.docView,d);if(!x)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:S}=Ds(x.dom,c,f))}let M=n.docView.nearest(y);if(!M)return null;if(M.isWidget&&((r=M.dom)===null||r===void 0?void 0:r.nodeType)==1){let x=M.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+ds(o,r,n.state.tabSize)}function Qc(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return St(n,i-1,i).getBoundingClientRect().left>t}function Zc(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():St(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Os(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==_.Text))return i}return t}function ef(n,e,t,i){let s=Os(n,e.head),r=!i||s.type!=_.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==J.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,t?-1:1)}return b.cursor(t?s.to:s.from,t?-1:1)}function eo(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=qc(s,r,o,l,t),c=na;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` -`,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 tf(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 nf(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.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=oa(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gs))return b.cursor(g,e.assoc,void 0,o)}}function Xi(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,i{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 X){let s=X[i];e.contentDOM.addEventListener(i,r=>{to(e,r)&&t(s,r)},Ts[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{if(i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&(t(X.mousedown,i),!i.defaultPrevented&&i.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),e.scrollDOM.addEventListener("drop",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(X.drop,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),A.gecko&&bf(e.contentDOM.ownerDocument)}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=>{to(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){Ie(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){Ie(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!t.ctrlKey||rf.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,Ft(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:A.safari&&!A.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!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 la=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],rf="dthko",aa=[16,17,18,20,91,92,224,225],Bi=6;function Pi(n){return Math.max(0,n)*.7+8}function of(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class lf{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Cc(e.contentDOM),this.atoms=e.state.facet(ir).map(o=>o(e));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)&&af(e,t),this.dragging=cf(e,t)&&ua(t)==1?null:!1}start(e){this.dragging===!1&&(e.preventDefault(),this.select(e))}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&of(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=Ql(this.view);e.clientX-o.left<=r.left+Bi?i=-Pi(r.left-e.clientX):e.clientX+o.right>=r.right-Bi&&(i=Pi(e.clientX-r.right)),e.clientY-o.top<=r.top+Bi?s=-Pi(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Bi&&(s=Pi(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function af(n,e){let t=n.state.facet(zl);return t.length?t[0](e):A.mac?e.metaKey:e.ctrlKey}function hf(n,e){let t=n.state.facet(ql);return t.length?t[0](e):A.mac?!e.altKey:!e.ctrlKey}function cf(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=sn(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function to(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=V.get(t))&&i.ignoreEvent(e))return!1;return!0}const X=Object.create(null),Ts=Object.create(null),ha=A.ie&&A.ie_version<15||A.ios&&A.webkit_version<604;function ff(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),ca(n,t.value)},50)}function ca(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Bs!=null&&t.selection.ranges.every(a=>a.empty)&&Bs==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}X.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now())};X.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};X.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ts.touchstart=Ts.touchmove={passive:!0};X.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return;let t=null;for(let i of n.state.facet(Kl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=pf(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new lf(n,e,t,i)),i&&n.observer.ignore(()=>Ol(n.contentDOM)),n.inputState.mouseSelection&&n.inputState.mouseSelection.start(e)}};function io(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return _c(n.state,e,t);{let s=ue.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,no=(n,e,t)=>fa(e,t)&&n>=t.left&&n<=t.right;function uf(n,e,t,i){let s=ue.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&no(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&no(t,i,l)?1:o&&fa(i,o)?-1:1}function so(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:uf(n,t,e.clientX,e.clientY)}}const df=A.ie&&A.ie_version<=11;let ro=null,oo=0,lo=0;function ua(n){if(!df)return n.detail;let e=ro,t=lo;return ro=n,lo=Date.now(),oo=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(oo+1)%3:1}function pf(n,e){let t=so(n,e),i=ua(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=so(n,r),h,c=io(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=io(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=gf(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function gf(n,e){for(let t=0;t=e)return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}X.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function ao(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&hf(n,e)?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}X.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&ao(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else ao(n,e,e.dataTransfer.getData("Text"),!0)};X.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=ha?null:e.clipboardData;t?(ca(n,t.getData("text/plain")||t.getData("text/uri-text")),e.preventDefault()):ff(n)};function mf(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function yf(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Bs=null;X.copy=X.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=yf(n.state);if(!t&&!s)return;Bs=s?t:null;let r=ha?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):mf(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};const da=Ze.define();function pa(n,e){let t=[];for(let i of n.facet(Ul)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:da.of(!0)}):null}function ga(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=pa(n.state,e);t?n.dispatch(t):n.update([])}},10)}X.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ga(n)};X.blur=n=>{n.observer.clearSelectionRange(),ga(n)};X.compositionstart=X.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};X.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,A.chrome&&A.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};X.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};X.beforeinput=(n,e)=>{var t;let i;if(A.chrome&&A.android&&(i=la.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const ho=new Set;function bf(n){ho.has(n)||(ho.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const co=["pre-wrap","normal","pre-line","break-spaces"];class xf{constructor(e){this.lineWrapping=e,this.doc=I.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return co.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Yi&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return pe.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,q.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,q.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ae extends ma{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new $e(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ae||s instanceof ie&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ie?s=new Ae(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pe.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ie extends pe{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new $e(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new $e(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==q.ByHeight)return this.blockAt(e,i,s,r);if(t==q.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new $e(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new $e(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new $e(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ie?i[i.length-1]=new ie(r.length+s):i.push(null,new ie(s-1))}if(e>0){let r=i[0];r instanceof ie?i[0]=new ie(e+r.length):i.unshift(new ie(e-1),null)}return pe.of(i)}decomposeLeft(e,t){t.push(new ie(e-1),null)}decomposeRight(e,t){t.push(null,new ie(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new ie(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=Yi&&(a=-2);let u=new Ae(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new ie(r-l).updateHeight(e,l));let h=pe.of(o);return(a<0||Math.abs(h.height-this.height)>=Yi||Math.abs(a-this.heightMetrics(e,t).perLine)>=Yi)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class kf extends pe{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==q.ByPosNoHeight?q.ByPosNoHeight:q.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,q.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&fo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?pe.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function fo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ie&&(i=n[e+1])instanceof ie&&n.splice(e-1,3,new ie(t.length+1+i.length))}const Sf=5;class nr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ae?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ae(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Sf)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ae(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ie(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ae)return e;let t=new Ae(0,-1);return this.nodes.push(t),t}addBlock(e){var t;this.enterLine();let i=(t=e.deco)===null||t===void 0?void 0:t.type;i==_.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i!=_.WidgetBefore&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ae)&&!this.isCovered?this.nodes.push(new Ae(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Mf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class $n{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new xf(t),this.stateDeco=e.facet(ui).filter(i=>typeof i!="function"),this.heightMap=pe.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle.setDoc(e.doc),[new Le(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=B.set(this.lineGaps.map(i=>i.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Li(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?po:new Bf(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:si(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ui).filter(c=>typeof c!="function");let s=e.changedRanges,r=Le.extendWithRanges(s,vf(i,this.stateDeco,e?e.changes:Z.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Jl)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?J.RTL:J.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0,f=parseInt(i.paddingTop)||0,u=parseInt(i.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8),this.scrollTop!=e.scrollDOM.scrollTop&&(this.scrollAnchorHeight=-1,this.scrollTop=e.scrollDOM.scrollTop),this.scrolledToBottom=Bl(e.scrollDOM);let d=(this.printing?Mf:Af)(t,this.paddingTop),p=d.top-this.pixelViewport.top,g=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let M=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(M)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:x,charWidth:w,textHeight:k}=e.docView.measureTextSize();o=x>0&&s.refresh(r,x,w,k,y/w,M),o&&(e.docView.minWidth=0,h|=8)}p>0&&g>0?c=Math.max(p,g):p<0&&g<0&&(c=Math.min(p,g)),s.heightChanged=!1;for(let x of this.viewports){let w=x.from==this.viewport.from?M:e.docView.measureVisibleLineHeights(x);this.heightMap=(o?pe.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle,[new Le(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new wf(x.from,w))}s.heightChanged&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Li(s.lineAt(o-i*1e3,q.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,q.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,q.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=J.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&mm.from>=f.from&&m.to<=f.to&&Math.abs(m.from-h)m.fromy));if(!g){if(cm.from<=c&&m.to>=c)){let m=t.moveToLineBoundary(b.cursor(c),!1,!0).head;m>h&&(c=m)}g=new $n(h,c,this.gapSize(f,h,c,u))}l.push(g)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||si(this.heightMap.lineAt(e,q.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return si(this.heightMap.lineAt(this.scaler.fromDOM(e),q.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return si(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Li{constructor(e,t){this.from=e,this.to=t}}function Of(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Ei(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Tf(n,e){for(let t of n)if(e(t))return t}const po={toDOM(n){return n},fromDOM(n){return n},scale:1};class Bf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,q.ByPos,e,0,0).top,c=t.lineAt(a,q.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tsi(s,e)):n._content)}const Ii=D.define({combine:n=>n.join(" ")}),Ps=D.define({combine:n=>n.indexOf(!0)>-1}),Ls=lt.newName(),ya=lt.newName(),ba=lt.newName(),xa={"&light":"."+ya,"&dark":"."+ba};function Rs(n,e,t){return new lt(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const Pf=Rs("."+Ls,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},xa);class Lf{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:If(e),a=new El(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Nf(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!ms(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!ms(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(h,a)}}}function wa(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||A.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(A.mac||A.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}):A.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` - `&&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){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&&Ft(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengths.head)&&Ft(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Ft(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,a=()=>l||(l=Rf(n,t,i));return n.state.facet(jl).some(h=>h(n,t.from,t.to,o,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Rf(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=n.state.sliceDoc(e.from,e.to),c=sa(n,e.insert.length-(e.to-e.from))||n.state.doc.lineAt(r.head),f=r.to-e.to,u=r.to-r.from;i=s.changeByRange(d=>{if(d.from==r.from&&d.to==r.to)return{changes:l,range:a||d.map(l)};let p=d.to-f,g=p-h.length;if(d.to-d.from!=u||n.state.sliceDoc(g,p)!=h||c&&d.to>=c.from&&d.from<=c.to)return{range:d};let m=s.changes({from:g,to:p,insert:e.insert}),y=d.to-r.to;return{changes:m,range:a?b.range(Math.max(0,a.anchor+y),Math.max(0,a.head+y)):d.map(m)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Ef(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&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=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function If(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 Vr(t,i)),(s!=t||r!=i)&&e.push(new Vr(s,r))),e}function Nf(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 Ff={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jn=A.ie&&A.ie_version<=11;class Hf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Ac,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()}),jn&&(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)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")))},{threshold:[0,.001]}),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.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(On)?i.root.activeElement!=this.dom:!_i(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(A.ie&&A.ie_version<=11||A.android&&A.chrome)&&!i.state.selection.main.empty&&s.focusNode&&rn(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=A.safari&&e.root.nodeType==11&&kc(this.dom.ownerDocument)==this.dom&&Wf(this.view)||sn(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=_i(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ft(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&_i(this.dom,this.selectionRange);return e<0&&!s?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new Lf(this.view,e,t,i))}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=wa(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=go(t,e.previousSibling||e.target.previousSibling,-1),s=go(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function go(n,e,t){for(;e;){let i=V.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Wf(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return rn(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Mc(e.parent)||document,this.viewState=new uo(e.state||N.create(e)),this.plugins=this.state.facet(ii).map(i=>new zn(i));for(let i of this.plugins)i.update(this);this.observer=new Hf(this),this.inputState=new sf(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new Jr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof ee?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(da))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=pa(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=an.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new ln(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Ur)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=hn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ni)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Ii)!=s.state.facet(Ii)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(vs))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!wa(this,c)&&h.force&&Ft(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new uo(e),this.plugins=e.facet(ii).map(i=>new zn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Jr(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ii),i=e.state.facet(ii);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new zn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,{scrollTop:s}=i,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;s!=this.viewState.scrollTop&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Bl(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ie(this.state,p),mo}}),f=an.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=i.scrollTop=s+p,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(vs))l(t)}get themeClasses(){return Ls+" "+(this.state.facet(Ps)?ba:ya)+" "+this.state.facet(Ii)}updateAttrs(){let e=yo(this,_l,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(On)?"true":"false",class:"cm-content",style:`${A.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),yo(this,tr,t);let i=this.observer.ignore(()=>{let s=ks(this.contentDOM,this.contentAttrs,t),r=ks(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(O.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ni);let e=this.state.facet(O.cspNonce);lt.mount(this.root,this.styleModules.concat(Pf).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Kn(this,e,eo(this,e,t,i))}moveByGroup(e,t){return Kn(this,e,eo(this,e,t,i=>tf(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return ef(this,e,t,i)}moveVertically(e,t,i){return Kn(this,e,nf(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),oa(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[st.find(r,e-s.from,-1,t)];return Mn(i,o.dir==J.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Gl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Vf)return ia(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||ta(r.isolates,i=Gr(this,e.from,e.to))))return r.order;i||(i=Gr(this,e.from,e.to));let s=zc(e.text,t,i);return this.bidiCache.push(new hn(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||A.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ol(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Ur.of(new ln(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return ge.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=lt.newName(),s=[Ii.of(i),ni.of(Rs(`.${i}`,e))];return t&&t.dark&&s.push(Ps.of(!0)),s}static baseTheme(e){return At.lowest(ni.of(Rs("."+Ls,e,xa)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&V.get(i)||V.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}O.styleModule=ni;O.inputHandler=jl;O.focusChangeEffect=Ul;O.perLineTextDirection=Gl;O.exceptionSink=$l;O.updateListener=vs;O.editable=On;O.mouseSelectionStyle=Kl;O.dragMovesSelection=ql;O.clickAddsSelectionRange=zl;O.decorations=ui;O.atomicRanges=ir;O.bidiIsolatedRanges=Xl;O.scrollMargins=Yl;O.darkTheme=Ps;O.cspNonce=D.define({combine:n=>n.length?n[0]:""});O.contentAttributes=tr;O.editorAttributes=_l;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=E.define();const Vf=4096,mo={};class hn{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:J.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&ws(o,t)}return t}const zf=A.mac?"mac":A.windows?"win":A.linux?"linux":"key";function qf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function $f(n,e,t){return Sa(ka(n.state),e,n,t)}let it=null;const jf=4e3;function Uf(n,e=zf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>qf(y,e));for(let y=1;y{let x=it={view:M,prefix:S,scope:o};return setTimeout(()=>{it==x&&(it=null)},jf),!0}]})}let g=p.join(" ");s(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function Sa(n,e,t,i){let s=wc(e),r=ne(s,0),o=Oe(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;it&&it.view==t&&it.scope==i&&(l=it.prefix+" ",aa.indexOf(e.keyCode)<0&&(h=!0,it=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(t,e)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,g;return d&&(u(d[l+Ni(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(A.windows&&e.ctrlKey&&e.altKey)&&(p=at[e.keyCode])&&p!=s?(u(d[l+Ni(p,e,!0)])||e.shiftKey&&(g=fi[e.keyCode])!=s&&g!=p&&u(d[l+Ni(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Ni(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class vi{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=va(e);return[new vi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Gf(e,t,i)}}function va(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==J.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function xo(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:_.Text}}function Gf(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==J.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=va(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Os(n,i),p=Os(n,s),g=d.type==_.Text?d:null,m=p.type==_.Text?p:null;if(g&&(n.lineWrapping||d.widgetLineBreaks)&&(g=xo(n,i,g)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=xo(n,s,m)),g&&m&&g.from==m.from)return S(M(t.from,t.to,g));{let w=g?M(t.from,null,g):x(d,!1),k=m?M(null,t.to,m):x(p,!0),T=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2Y&&xe.from=oe)break;Q>te&&z(Math.max(U,te),w==null&&U<=Y,Math.min(Q,oe),k==null&&Q>=re,we.dir)}if(te=Fe.to+1,te>=oe)break}return R.length==0&&z(Y,w==null,re,k==null,n.textDirection),{top:H,bottom:P,horizontal:R}}function x(w,k){let T=l.top+(k?w.top:w.bottom);return{top:T,bottom:T,horizontal:[]}}}function Jf(n,e){return n.constructor==e.constructor&&n.eq(e)}class _f{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Qi)!=e.state.facet(Qi)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&e.view.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Qi);for(;t!Jf(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Qi=D.define();function Ca(n){return[ge.define(e=>new _f(e,n)),Qi.of(n)]}const Aa=!A.ios,pi=D.define({combine(n){return Mt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function zg(n={}){return[pi.of(n),Xf,Yf,Qf,Jl.of(!0)]}function Ma(n){return n.startState.facet(pi)!=n.state.facet(pi)}const Xf=Ca({above:!0,markers(n){let{state:e}=n,t=e.facet(pi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||Aa:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of vi.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Ma(n);return t&&wo(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){wo(e.state,n)},class:"cm-cursorLayer"});function wo(n,e){e.style.animationDuration=n.facet(pi).cursorBlinkRate+"ms"}const Yf=Ca({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:vi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Ma(n)},class:"cm-selectionLayer"}),Da={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Aa&&(Da[".cm-line"].caretColor="transparent !important");const Qf=At.highest(O.theme(Da)),Oa=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),ri=be.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Oa)?i.value:t,n)}}),Zf=ge.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(ri);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(ri)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(ri),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(ri)!=n&&this.view.dispatch({effects:Oa.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function qg(){return[ri,Zf]}function ko(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function eu(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class tu{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new kt,i=t.add.bind(t);for(let{from:s,to:r}of eu(e,this.maxLength))ko(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(g,m));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,e,g,p));t=t.update({filterFrom:c,filterTo:f,filter:(g,m)=>gf,add:u})}}return t}}const Es=/x/.unicode!=null?"gu":"g",iu=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Es),nu={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 Un=null;function su(){var n;if(Un==null&&typeof document<"u"&&document.body){let e=document.body.style;Un=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Un||!1}const Zi=D.define({combine(n){let e=Mt(n,{render:null,specialChars:iu,addSpecialChars:null});return(e.replaceTabs=!su())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Es)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Es)),e}});function Kg(n={}){return[Zi.of(n),ru()]}let So=null;function ru(){return So||(So=ge.fromClass(class{constructor(n){this.view=n,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Zi)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new tu({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=Gt(o.text,l,i-o.from);return B.replace({widget:new hu((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new au(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Zi);n.startState.facet(Zi)!=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 ou="•";function lu(n){return n>=32?ou:n==10?"␤":String.fromCharCode(9216+n)}class au extends Dt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=lu(this.code),i=e.state.phrase("Control character")+" "+(nu[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 hu extends Dt{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 cu extends Dt{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}coordsAt(e){let t=e.firstChild?Vt(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=Mn(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function $g(n){return ge.fromClass(class{constructor(e){this.view=e,this.placeholder=n?B.set([B.widget({widget:new cu(n),side:1}).range(0)]):B.none}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Is=2e3;function fu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Is||t.off>Is||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=ds(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=ds(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function uu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function vo(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>Is?-1:s==i.length?uu(n,e.clientX):Gt(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function du(n,e){let t=vo(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=vo(n,s);if(!l)return i;let a=fu(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function jg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?du(t,i):null)}const Fi="-10000px";class pu{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===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:A.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||gu}}}),Co=new WeakMap,Ta=ge.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Gn);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new pu(n,Ba,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Gn);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Fi,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Gn).tooltipSpace(this.view)}}writeMeasure(n){var e;let{editor:t,space:i}=n,s=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||h.rightMath.min(t.right,i.right)+.1){a.style.top=Fi;continue}let f=o.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,p=(e=Co.get(l))!==null&&e!==void 0?e:c.bottom-c.top,g=l.offset||yu,m=this.view.textDirection==J.LTR,y=c.width>i.right-i.left?m?i.left:i.right-c.width:m?Math.min(h.left-(f?14:0)+g.x,i.right-d):Math.max(i.left,h.left-d+(f?14:0)-g.x),S=!!o.above;!o.strictSide&&(S?h.top-(c.bottom-c.top)-g.yi.bottom)&&S==i.bottom-h.bottom>h.top-i.top&&(S=!S);let M=(S?h.top-i.top:i.bottom-h.bottom)-u;if(My&&k.topx&&(x=S?k.top-p-2-u:k.bottom+u+2);this.position=="absolute"?(a.style.top=x-n.parent.top+"px",a.style.left=y-n.parent.left+"px"):(a.style.top=x+"px",a.style.left=y+"px"),f&&(f.style.left=`${h.left+(m?g.x:-g.x)-(y+14-7)}px`),l.overlap!==!0&&s.push({left:y,top:x,right:w,bottom:x+p}),a.classList.toggle("cm-tooltip-above",S),a.classList.toggle("cm-tooltip-below",!S),l.positioned&&l.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Fi}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),mu=O.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),yu={x:0,y:0},Ba=D.define({enables:[Ta,mu]});function Pa(n,e){let t=n.plugin(Ta);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Ao=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function cn(n,e){let t=n.plugin(La),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const La=ge.fromClass(class{constructor(n){this.input=n.state.facet(fn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Ao);this.top=new Hi(n,!0,e.topContainer),this.bottom=new Hi(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Ao);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Hi(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Hi(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(fn);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Hi{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Mo(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Mo(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Mo(n){let e=n.nextSibling;return n.remove(),e}const fn=D.define({enables:La});class vt extends wt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}vt.prototype.elementClass="";vt.prototype.toDOM=void 0;vt.prototype.mapMode=he.TrackBefore;vt.prototype.startSide=vt.prototype.endSide=-1;vt.prototype.point=!0;const bu=D.define(),xu=new class extends vt{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},wu=bu.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(xu.range(s)))}return K.of(e)});function Ug(){return wu}const ku=1024;let Su=0;class Te{constructor(e,t){this.from=e,this.to=t}}class L{constructor(e={}){this.id=Su++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=me.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class vu{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const Cu=Object.create(null);class me{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Cu,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new me(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}me.none=new me("",Object.create(null),0,8);class rr{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|j.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:ar(me.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new W(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new W(me.none,t,i,s)))}static build(e){return Mu(e)}}W.empty=new W(me.none,[],[],0);class or{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new or(this.buffer,this.index)}}class Ot{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return me.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Ea(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function qt(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Ra(s,i,f,f+c.length)){if(c instanceof Ot){if(r&j.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new je(new Au(o,c,e,f),null,u)}else if(r&j.IncludeAnonymous||!c.type.isAnonymous||lr(c)){let u;if(!(r&j.IgnoreMounts)&&c.props&&(u=c.prop(L.mounted))&&!u.overlay)return new Re(u.tree,f,e,o);let d=new Re(c,f,e,o);return r&j.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&j.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&j.IgnoreOverlays)&&(s=this._tree.prop(L.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Re(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new gi(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return qt(this,e,t,!1)}resolveInner(e,t=0){return qt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Ea(this,e)}getChild(e,t=null,i=null){let s=un(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return un(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return dn(this,e)}}function un(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function dn(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Au{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class je{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new je(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&j.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new je(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new je(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new je(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new gi(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new W(this.type,e,t,this.to-this.from)}resolve(e,t=0){return qt(this,e,t,!1)}resolveInner(e,t=0){return qt(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Ea(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=un(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return un(this,e,t,i)}get node(){return this}matchContext(e){return dn(this,e)}}class gi{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Re)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Re?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&j.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&j.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&j.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&j.IncludeAnonymous||l instanceof Ot||!l.type.isAnonymous||lr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return dn(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function lr(n){return n.children.some(e=>e instanceof Ot||!e.type.isAnonymous||lr(e))}function Mu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=ku,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new or(t,t.length):t,a=i.types,h=0,c=0;function f(x,w,k,T,H){let{id:P,start:R,end:z,size:Y}=l,re=c;for(;Y<0;)if(l.next(),Y==-1){let we=r[P];k.push(we),T.push(R-x);return}else if(Y==-3){h=P;return}else if(Y==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let xe=a[P],te,oe,Fe=R-x;if(z-R<=s&&(oe=g(l.pos-w,H))){let we=new Uint16Array(oe.size-oe.skip),U=l.pos-oe.size,Q=we.length;for(;l.pos>U;)Q=m(oe.start,we,Q);te=new Ot(we,z-oe.start,i),Fe=oe.start-x}else{let we=l.pos-Y;l.next();let U=[],Q=[],ut=P>=o?P:-1,Tt=0,Mi=z;for(;l.pos>we;)ut>=0&&l.id==ut&&l.size>=0?(l.end<=Mi-s&&(d(U,Q,R,Tt,l.end,Mi,ut,re),Tt=U.length,Mi=l.end),l.next()):f(R,we,U,Q,ut);if(ut>=0&&Tt>0&&Tt-1&&Tt>0){let Cr=u(xe);te=ar(xe,U,Q,0,U.length,0,z-R,Cr,Cr)}else te=p(xe,U,Q,z-R,re-z)}k.push(te),T.push(Fe)}function u(x){return(w,k,T)=>{let H=0,P=w.length-1,R,z;if(P>=0&&(R=w[P])instanceof W){if(!P&&R.type==x&&R.length==T)return R;(z=R.prop(L.lookAhead))&&(H=k[P]+R.length+z)}return p(x,w,k,T,H)}}function d(x,w,k,T,H,P,R,z){let Y=[],re=[];for(;x.length>T;)Y.push(x.pop()),re.push(w.pop()+k-H);x.push(p(i.types[R],Y,re,P-H,z-P)),w.push(H-k)}function p(x,w,k,T,H=0,P){if(h){let R=[L.contextHash,h];P=P?[R].concat(P):[R]}if(H>25){let R=[L.lookAhead,H];P=P?[R].concat(P):[R]}return new W(x,w,k,T,P)}function g(x,w){let k=l.fork(),T=0,H=0,P=0,R=k.end-s,z={size:0,start:0,skip:0};e:for(let Y=k.pos-x;k.pos>Y;){let re=k.size;if(k.id==w&&re>=0){z.size=T,z.start=H,z.skip=P,P+=4,T+=4,k.next();continue}let xe=k.pos-re;if(re<0||xe=o?4:0,oe=k.start;for(k.next();k.pos>xe;){if(k.size<0)if(k.size==-3)te+=4;else break e;else k.id>=o&&(te+=4);k.next()}H=oe,T+=re,P+=te}return(w<0||T==x)&&(z.size=T,z.start=H,z.skip=P),z.size>4?z:void 0}function m(x,w,k){let{id:T,start:H,end:P,size:R}=l;if(l.next(),R>=0&&T4){let Y=l.pos-(R-4);for(;l.pos>Y;)k=m(x,w,k)}w[--k]=z,w[--k]=P-x,w[--k]=H-x,w[--k]=T}else R==-3?h=T:R==-4&&(c=T);return k}let y=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,S,-1);let M=(e=n.length)!==null&&e!==void 0?e:y.length?S[0]+y[0].length:0;return new W(a[n.topID],y.reverse(),S.reverse(),M)}const Oo=new WeakMap;function en(n,e){if(!n.isAnonymous||e instanceof Ot||e.type!=n)return 1;let t=Oo.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof W)){t=1;break}t+=en(n,i)}Oo.set(e,t)}return t}function ar(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;k+=T}if(M==x+1){if(k>c){let T=p[x];d(T.children,T.positions,0,T.children.length,g[x]+S);continue}f.push(p[x])}else{let T=g[M-1]+p[M-1].length-w;f.push(ar(n,p,g,x,M,w,T,null,a))}u.push(w+S-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class Gg{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof je?this.setBuffer(e.context.buffer,e.index,t):e instanceof Re&&this.map.set(e.tree,t)}get(e){return e instanceof je?this.getBuffer(e.context.buffer,e.index):e instanceof Re?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ye{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Ye(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ye(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Te(s.from,s.to)):[new Te(0,0)]:[new Te(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Du{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Jg(n){return(e,t,i,s)=>new Tu(e,n,t,i,s)}class To{constructor(e,t,i,s,r){if(this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r,!r.length||r.some(o=>o.from>=o.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class Ou{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Ns=new L({perNode:!0});class Tu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new W(i.type,i.children,i.positions,i.length,i.propValues.concat([[Ns,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[L.mounted.id]=new vu(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Bu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Te(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Te(s.from,s.to)),a.fromnew Te(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Bu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Bo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let g=[],m=[];Bo(o,h,p,g,m,u);let y=l[p+1],S=l[p+2],M=y+r==e.from&&S+r==e.to&&l[p]==e.type.id;return g.push(M?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],y,S-y)),m.push(y-u),Bo(o,l[p+3],c,g,m,u),new W(f,g,m,d)}s.children[i]=a(0,l.length,me.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class Po{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(j.IncludeAnonymous|j.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,j.IgnoreOverlays|j.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof W)t=t.children[0];else break}return!1}}class Lu{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Ns))!==null&&t!==void 0?t:i.to,this.inner=new Po(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Ns))!==null&&e!==void 0?e:t.to,this.inner=new Po(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Lo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Te(l,a.to))):a.to>l?t[r--]=new Te(l,a.to):t.splice(r--,1))}}return i}function Ru(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Te(u.from+i,u.to+i)),f=Ru(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new Ye(d,g,s.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else t.push(new Ye(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let Eu=0;class qe{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=Eu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new qe([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new pn;return t=>t.modified.indexOf(e)>-1?t:pn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Iu=0;class pn{constructor(){this.instances=[],this.id=Iu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Nu(t,l.modified));if(i)return i;let s=[],r=new qe(s,e,t);for(let l of t)l.instances.push(r);let o=Fu(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(pn.get(l,a));return r}}function Nu(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Fu(n){let e=[[]];for(let t=0;ti.length-t.length)}function Hu(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new gn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Na.add(e)}const Na=new L;class gn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Wu(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Vu(n,e,t,i=0,s=n.length){let r=new zu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class zu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=qu(e)||gn.empty,f=Wu(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(L.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=e.firstChild();for(let m=0,y=l;;m++){let S=m=M||!e.nextSibling())););if(!S||M>i)break;y=S.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}g&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function qu(n){let e=n.type.prop(Na);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const v=qe.define,Vi=v(),et=v(),Eo=v(et),Io=v(et),tt=v(),zi=v(tt),Jn=v(tt),ze=v(),dt=v(ze),We=v(),Ve=v(),Fs=v(),Zt=v(Fs),qi=v(),C={comment:Vi,lineComment:v(Vi),blockComment:v(Vi),docComment:v(Vi),name:et,variableName:v(et),typeName:Eo,tagName:v(Eo),propertyName:Io,attributeName:v(Io),className:v(et),labelName:v(et),namespace:v(et),macroName:v(et),literal:tt,string:zi,docString:v(zi),character:v(zi),attributeValue:v(zi),number:Jn,integer:v(Jn),float:v(Jn),bool:v(tt),regexp:v(tt),escape:v(tt),color:v(tt),url:v(tt),keyword:We,self:v(We),null:v(We),atom:v(We),unit:v(We),modifier:v(We),operatorKeyword:v(We),controlKeyword:v(We),definitionKeyword:v(We),moduleKeyword:v(We),operator:Ve,derefOperator:v(Ve),arithmeticOperator:v(Ve),logicOperator:v(Ve),bitwiseOperator:v(Ve),compareOperator:v(Ve),updateOperator:v(Ve),definitionOperator:v(Ve),typeOperator:v(Ve),controlOperator:v(Ve),punctuation:Fs,separator:v(Fs),bracket:Zt,angleBracket:v(Zt),squareBracket:v(Zt),paren:v(Zt),brace:v(Zt),content:ze,heading:dt,heading1:v(dt),heading2:v(dt),heading3:v(dt),heading4:v(dt),heading5:v(dt),heading6:v(dt),contentSeparator:v(ze),list:v(ze),quote:v(ze),emphasis:v(ze),strong:v(ze),link:v(ze),monospace:v(ze),strikethrough:v(ze),inserted:v(),deleted:v(),changed:v(),invalid:v(),meta:qi,documentMeta:v(qi),annotation:v(qi),processingInstruction:v(qi),definition:qe.defineModifier(),constant:qe.defineModifier(),function:qe.defineModifier(),standard:qe.defineModifier(),local:qe.defineModifier(),special:qe.defineModifier()};Fa([{tag:C.link,class:"tok-link"},{tag:C.heading,class:"tok-heading"},{tag:C.emphasis,class:"tok-emphasis"},{tag:C.strong,class:"tok-strong"},{tag:C.keyword,class:"tok-keyword"},{tag:C.atom,class:"tok-atom"},{tag:C.bool,class:"tok-bool"},{tag:C.url,class:"tok-url"},{tag:C.labelName,class:"tok-labelName"},{tag:C.inserted,class:"tok-inserted"},{tag:C.deleted,class:"tok-deleted"},{tag:C.literal,class:"tok-literal"},{tag:C.string,class:"tok-string"},{tag:C.number,class:"tok-number"},{tag:[C.regexp,C.escape,C.special(C.string)],class:"tok-string2"},{tag:C.variableName,class:"tok-variableName"},{tag:C.local(C.variableName),class:"tok-variableName tok-local"},{tag:C.definition(C.variableName),class:"tok-variableName tok-definition"},{tag:C.special(C.variableName),class:"tok-variableName2"},{tag:C.definition(C.propertyName),class:"tok-propertyName tok-definition"},{tag:C.typeName,class:"tok-typeName"},{tag:C.namespace,class:"tok-namespace"},{tag:C.className,class:"tok-className"},{tag:C.macroName,class:"tok-macroName"},{tag:C.propertyName,class:"tok-propertyName"},{tag:C.operator,class:"tok-operator"},{tag:C.comment,class:"tok-comment"},{tag:C.meta,class:"tok-meta"},{tag:C.invalid,class:"tok-invalid"},{tag:C.punctuation,class:"tok-punctuation"}]);var _n;const yt=new L;function Ha(n){return D.define({combine:n?e=>e.concat(n):void 0})}const Ku=new L;class Be{constructor(e,t,i=[],s=""){this.data=e,this.name=s,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return ye(this)}}),this.parser=t,this.extension=[jt.of(this),N.languageData.of((r,o,l)=>{let a=No(r,o,l),h=a.type.prop(yt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Ku);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return No(e,t,i).type.prop(yt)==this.data}findRegions(e){let t=e.facet(jt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(yt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(yt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Hs(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ye(n){let e=n.field(Be.state,!1);return e?e.tree:W.empty}class $u{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ei=null;class Kt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Kt(e,t,[],W.empty,0,i,[],null)}startParse(){return this.parser.startParse(new $u(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=W.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ye.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ei;ei=this;try{return e()}finally{ei=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Fo(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ye.applyChanges(i,a),s=W.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Fo(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ia{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=ei;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new W(me.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ei}}function Fo(n,e,t){return Ye.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class $t{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new $t(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Kt.create(e.facet(jt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new $t(i)}}Be.state=be.define({create:$t.init,update(n,e){for(let t of e.effects)if(t.is(Be.setState))return t.value;return e.startState.facet(jt)!=e.state.facet(jt)?$t.init(e.state):n.apply(e)}});let Wa=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Wa=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Xn=typeof navigator<"u"&&(!((_n=navigator.scheduling)===null||_n===void 0)&&_n.isInputPending)?()=>navigator.scheduling.isInputPending():null,ju=ge.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Be.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Wa(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Xn&&Xn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Be.setState.of(new $t(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ie(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),jt=D.define({combine(n){return n.length?n[0]:null},enables:n=>[Be.state,ju,O.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Xg{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Va=D.define(),Tn=D.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ct(n){let e=n.facet(Tn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function mn(n,e){let t="",i=n.tabSize,s=n.facet(Tn)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?Gu(n,t,e):null}class Bn{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ct(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Gt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Uu=new L;function Gu(n,e,t){return qa(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function Ju(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function _u(n){let e=n.type.prop(Uu);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Ka(o,!0,1,void 0,r&&!Ju(o)?s.from:void 0)}return n.parent==null?Xu:null}function qa(n,e,t){for(;n;n=n.parent){let i=_u(n);if(i)return i(hr.create(t,e,n))}return null}function Xu(){return 0}class hr extends Bn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new hr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Yu(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){let e=this.node.parent;return e?qa(e,this.pos,this.base):0}}function Yu(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Qu(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromKa(i,e,t,n)}function Ka(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?Qu(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Qg=n=>n.baseIndent;function Zg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const em=new L;function tm(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(yt)==o.data:o?l=>l==o:void 0,this.style=Fa(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new lt(i):null,this.themeType=t.themeType}static define(e,t){return new Pn(e,t||{})}}const Ws=D.define(),$a=D.define({combine(n){return n.length?[n[0]]:null}});function Yn(n){let e=n.facet(Ws);return e.length?e:n.facet($a)}function im(n,e){let t=[ed],i;return n instanceof Pn&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push($a.of(n)):i?t.push(Ws.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Ws.of(n)),t}class Zu{constructor(e){this.markCache=Object.create(null),this.tree=ye(e.state),this.decorations=this.buildDeco(e,Yn(e.state))}update(e){let t=ye(e.state),i=Yn(e.state),s=i!=Yn(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=B.mark({class:a})))},s,r);return i.finish()}}const ed=At.high(ge.fromClass(Zu,{decorations:n=>n.decorations})),nm=Pn.define([{tag:C.meta,color:"#404740"},{tag:C.link,textDecoration:"underline"},{tag:C.heading,textDecoration:"underline",fontWeight:"bold"},{tag:C.emphasis,fontStyle:"italic"},{tag:C.strong,fontWeight:"bold"},{tag:C.strikethrough,textDecoration:"line-through"},{tag:C.keyword,color:"#708"},{tag:[C.atom,C.bool,C.url,C.contentSeparator,C.labelName],color:"#219"},{tag:[C.literal,C.inserted],color:"#164"},{tag:[C.string,C.deleted],color:"#a11"},{tag:[C.regexp,C.escape,C.special(C.string)],color:"#e40"},{tag:C.definition(C.variableName),color:"#00f"},{tag:C.local(C.variableName),color:"#30a"},{tag:[C.typeName,C.namespace],color:"#085"},{tag:C.className,color:"#167"},{tag:[C.special(C.variableName),C.macroName],color:"#256"},{tag:C.definition(C.propertyName),color:"#00c"},{tag:C.comment,color:"#940"},{tag:C.invalid,color:"#f00"}]),td=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ja=1e4,Ua="()[]{}",Ga=D.define({combine(n){return Mt(n,{afterCursor:!0,brackets:Ua,maxScanDistance:ja,renderMatch:sd})}}),id=B.mark({class:"cm-matchingBracket"}),nd=B.mark({class:"cm-nonmatchingBracket"});function sd(n){let e=[],t=n.matched?id:nd;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const rd=be.define({create(){return B.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Ga);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=Ue(e.state,s.head,-1,i)||s.head>0&&Ue(e.state,s.head-1,1,i)||i.afterCursor&&(Ue(e.state,s.head,1,i)||s.headO.decorations.from(n)}),od=[rd,td];function sm(n={}){return[Ga.of(n),od]}const ld=new L;function Vs(n,e,t){let i=n.prop(e<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function zs(n){let e=n.type.prop(ld);return e?e(n.node):n}function Ue(n,e,t,i={}){let s=i.maxScanDistance||ja,r=i.brackets||Ua,o=ye(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Vs(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return ad(n,e,t,a,c,h,r)}}return hd(n,e,t,o,l.type,s,r)}function ad(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,m=t>0?d.length:-1;g!=m;g+=t){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Ho(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function cd(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||fd,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||fr}}function fd(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Wo=new WeakMap;class _a extends Be{constructor(e){let t=Ha(e.languageData),i=cd(e),s,r=new class extends Ia{createParse(o,l,a){return new dd(s,o,l,a)}};super(t,r,[Va.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=md(t),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=e.tokenTable?new Za(i.tokenTable):gd}static define(e){return new _a(e)}getIndent(e,t){let i=ye(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Wo.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof W&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&cr(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Xa(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?Ct(i):4),tree:W.empty}}class dd{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Kt.get(),o=s[0].from,{state:l,tree:a}=ud(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` -`&&(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].to1){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 Ja(t,e?e.state.tabSize:4,e?Ct(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Ya(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.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const fr=Object.create(null),mi=[me.none],pd=new rr(mi),Vo=[],Qa=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"]])Qa[n]=eh(fr,e);class Za{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Qa)}resolve(e){return e?this.table[e]||(this.table[e]=eh(this.extra,e)):0}}const gd=new Za(fr);function Qn(n,e){Vo.indexOf(n)>-1||(Vo.push(n),console.warn(e))}function eh(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):Qn(r,`Modifier ${r} used at start of tag`):t?Qn(r,`Tag ${r} used as modifier`):t=o:Qn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=me.define({id:mi.length,name:i,props:[Hu({[i]:t})]});return mi.push(s),s.id}function md(n){let e=me.define({id:mi.length,name:"Document",props:[yt.add(()=>n)],top:!0});return mi.push(e),e}const yd=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=dr(n.state,t.from);return i.line?bd(n):i.block?wd(n):!1};function ur(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 bd=ur(vd,0),xd=ur(th,0),wd=ur((n,e)=>th(n,e,Sd(e)),0);function dr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ti=50;function kd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-ti,i),o=n.sliceDoc(s,s+ti),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*ti?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+ti),f=n.sliceDoc(s-ti,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 Sd(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+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function th(n,e,t=e.selection.ranges){let i=t.map(r=>dr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>kd(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;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const qs=Ze.define(),Cd=Ze.define(),Ad=D.define(),ih=D.define({combine(n){return Mt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function Md(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const nh=be.define({create(){return Ge.empty},update(n,e){let t=e.state.facet(ih),i=e.annotation(qs);if(i){let a=e.docChanged?b.single(Md(e.changes)):void 0,h=Se.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=yn(f,f.length,t.minDepth,h):f=oh(f,e.startState.selection),new Ge(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(Cd);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(ee.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Se.fromTransaction(e),o=e.annotation(ee.time),l=e.annotation(ee.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ge(n.done.map(Se.fromJSON),n.undone.map(Se.fromJSON))}});function rm(n={}){return[nh,ih.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?sh:e.inputType=="historyRedo"?Ks:null;return i?(e.preventDefault(),i(t)):!1}})]}function Ln(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(nh,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const sh=Ln(0,!1),Ks=Ln(1,!1),Dd=Ln(0,!0),Od=Ln(1,!0);class Se{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Se(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Se(e.changes&&Z.fromJSON(e.changes),[],e.mapped&&Je.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Pe;for(let s of e.startState.facet(Ad)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Se(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Pe)}static selection(e){return new Se(void 0,Pe,void 0,void 0,e)}}function yn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Td(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Bd(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function rh(n,e){return n.length?e.length?n.concat(e):n:e}const Pe=[],Pd=200;function oh(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Pd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),yn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Se.selection([e])]}function Ld(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Zn(n,e){if(!n.length)return n;let t=n.length,i=Pe;for(;t;){let s=Rd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Se.selection(i)]:Pe}function Rd(n,e,t){let i=rh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Pe,t);if(!n.changes)return Se.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Se(s,E.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const Ed=/^(input\.type|delete)($|\.)/;class Ge{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ge(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Ed.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Rn(t,e))}function fe(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const ah=n=>lh(n,!fe(n)),hh=n=>lh(n,fe(n));function ch(n,e){return Ne(n,t=>t.empty?n.moveByGroup(t,e):Rn(t,e))}const Id=n=>ch(n,!fe(n)),Nd=n=>ch(n,fe(n));function Fd(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function En(n,e,t){let i=ye(n).resolveInner(e.head),s=t?L.closedBy:L.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Fd(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?Ue(n,i.from,1):Ue(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const Hd=n=>Ne(n,e=>En(n.state,e,!fe(n))),Wd=n=>Ne(n,e=>En(n.state,e,fe(n)));function fh(n,e){return Ne(n,t=>{if(!t.empty)return Rn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const uh=n=>fh(n,!1),dh=n=>fh(n,!0);function ph(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Rn(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomgh(n,!1),$s=n=>gh(n,!0);function ft(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const Vd=n=>Ne(n,e=>ft(n,e,!0)),zd=n=>Ne(n,e=>ft(n,e,!1)),qd=n=>Ne(n,e=>ft(n,e,!fe(n))),Kd=n=>Ne(n,e=>ft(n,e,fe(n))),$d=n=>Ne(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),jd=n=>Ne(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function Ud(n,e,t){let i=!1,s=Jt(n.selection,r=>{let o=Ue(n,r.head,-1)||Ue(n,r.head,1)||r.head>0&&Ue(n,r.head-1,1)||r.headUd(n,e,!1);function Ee(n,e){let t=Jt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Xe(n.state,t)),!0)}function mh(n,e){return Ee(n,t=>n.moveByChar(t,e))}const yh=n=>mh(n,!fe(n)),bh=n=>mh(n,fe(n));function xh(n,e){return Ee(n,t=>n.moveByGroup(t,e))}const Jd=n=>xh(n,!fe(n)),_d=n=>xh(n,fe(n)),Xd=n=>Ee(n,e=>En(n.state,e,!fe(n))),Yd=n=>Ee(n,e=>En(n.state,e,fe(n)));function wh(n,e){return Ee(n,t=>n.moveVertically(t,e))}const kh=n=>wh(n,!1),Sh=n=>wh(n,!0);function vh(n,e){return Ee(n,t=>n.moveVertically(t,e,ph(n).height))}const qo=n=>vh(n,!1),Ko=n=>vh(n,!0),Qd=n=>Ee(n,e=>ft(n,e,!0)),Zd=n=>Ee(n,e=>ft(n,e,!1)),ep=n=>Ee(n,e=>ft(n,e,!fe(n))),tp=n=>Ee(n,e=>ft(n,e,fe(n))),ip=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).from)),np=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).to)),$o=({state:n,dispatch:e})=>(e(Xe(n,{anchor:0})),!0),jo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.doc.length})),!0),Uo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:0})),!0),Go=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),sp=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),rp=({state:n,dispatch:e})=>{let t=Nn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},op=({state:n,dispatch:e})=>{let t=Jt(n.selection,i=>{var s;let r=ye(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return b.range(r.to,r.from)});return e(Xe(n,t)),!0},lp=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(Xe(n,i)),!0):!1};function In(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(o);ao&&(t="delete.forward",a=Ki(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Ki(n,o,!1),l=Ki(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?O.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Ki(n,e,t){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const Ch=(n,e)=>In(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tCh(n,!1),Ah=n=>Ch(n,!0),Mh=(n,e)=>In(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ce(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t)&&(l=c),i=a}return i}),Dh=n=>Mh(n,!1),ap=n=>Mh(n,!0),Oh=n=>In(n,e=>{let t=n.lineBlockAt(e).to;return eIn(n,e=>{let t=n.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),cp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:I.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},fp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ce(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ce(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Nn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Th(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Nn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const up=({state:n,dispatch:e})=>Th(n,e,!1),dp=({state:n,dispatch:e})=>Th(n,e,!0);function Bh(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Nn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const pp=({state:n,dispatch:e})=>Bh(n,e,!1),gp=({state:n,dispatch:e})=>Bh(n,e,!0),mp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Nn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function yp(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ye(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const bp=Ph(!1),xp=Ph(!0);function Ph(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&yp(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Bn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=za(h,r);for(c==null&&(c=Gt(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const wp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Bn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=pr(n,(r,o,l)=>{let a=za(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=mn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(pr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Tn)})}),{userEvent:"input.indent"})),!0),Sp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(pr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Gt(s,n.tabSize),o=0,l=mn(n,Math.max(0,r-Ct(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),lm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Hd,shift:Xd},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Wd,shift:Yd},{key:"Alt-ArrowUp",run:up},{key:"Shift-Alt-ArrowUp",run:pp},{key:"Alt-ArrowDown",run:dp},{key:"Shift-Alt-ArrowDown",run:gp},{key:"Escape",run:lp},{key:"Mod-Enter",run:xp},{key:"Alt-l",mac:"Ctrl-l",run:rp},{key:"Mod-i",run:op,preventDefault:!0},{key:"Mod-[",run:Sp},{key:"Mod-]",run:kp},{key:"Mod-Alt-\\",run:wp},{key:"Shift-Mod-k",run:mp},{key:"Shift-Mod-\\",run:Gd},{key:"Mod-/",run:yd},{key:"Alt-A",run:xd}].concat(Cp);function le(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class Ut{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Jo(l)):Jo,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ne(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=_s(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Oe(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=bn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Ht(t,e.sliceString(t,i));return es.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=bn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ht.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Eh.prototype[Symbol.iterator]=Ih.prototype[Symbol.iterator]=function(){return this});function Ap(n){try{return new RegExp(n,gr),!0}catch{return!1}}function bn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Us(n){let e=le("input",{class:"cm-textfield",name:"line"}),t=le("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:xn.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},le("label",n.state.phrase("Go to line"),": ",e)," ",le("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,a,h,c]=s,f=h?+h.slice(1):0,u=a?+a:o.number;if(a&&c){let g=u/100;l&&(g=g*(l=="-"?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*g)}else a&&l&&(u=u*(l=="-"?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),p=b.cursor(d.from+Math.max(0,Math.min(f,d.length)));n.dispatch({effects:[xn.of(!1),O.scrollIntoView(p.from,{y:"center"})],selection:p}),n.focus()}return{dom:t}}const xn=E.define(),_o=be.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(xn)&&(n=t.value);return n},provide:n=>fn.from(n,e=>e?Us:null)}),Mp=n=>{let e=cn(n,Us);if(!e){let t=[xn.of(!0)];n.state.field(_o,!1)==null&&t.push(E.appendConfig.of([_o,Dp])),n.dispatch({effects:t}),e=cn(n,Us)}return e&&e.dom.querySelector("input").focus(),!0},Dp=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Op={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Nh=D.define({combine(n){return Mt(n,Op,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function am(n){let e=[Rp,Lp];return n&&e.push(Nh.of(n)),e}const Tp=B.mark({class:"cm-selectionMatch"}),Bp=B.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Xo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=$.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=$.Word)}function Pp(n,e,t,i){return n(e.sliceDoc(t,t+1))==$.Word&&n(e.sliceDoc(i-1,i))==$.Word}const Lp=ge.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Nh),{state:t}=n,i=t.selection;if(i.ranges.length>1)return B.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return B.none;let a=t.wordAt(s.head);if(!a)return B.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return B.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Xo(o,t,s.from,s.to)&&Pp(o,t,s.from,s.to)))return B.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return B.none}let l=[];for(let a of n.visibleRanges){let h=new Ut(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Xo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Bp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Tp.range(c,f)),l.length>e.maxMatches))return B.none}}return B.set(l)}},{decorations:n=>n.decorations}),Rp=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Ep=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Ip(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Ut(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Ut(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Np=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Ep({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Ip(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},_t=D.define({combine(n){return Mt(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Gp(e),scrollToMatch:e=>O.scrollIntoView(e)})}});class Fh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Ap(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`: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 Vp(this):new Hp(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Lt(this,s,t,i):Pt(this,s,t,i)}}class Hh{constructor(e){this.spec=e}}function Pt(n,e,t,i){return new Ut(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Fp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Fp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Pt(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 Lt(n,e,t,i){return new Eh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Wp(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function wn(n,e){return n.slice(ce(n,e,!1),e)}function kn(n,e){return n.slice(e,ce(n,e))}function Wp(n){return(e,t,i)=>!i[0].length||(n(wn(i.input,i.index))!=$.Word||n(kn(i.input,i.index))!=$.Word)&&(n(kn(i.input,i.index+i[0].length))!=$.Word||n(wn(i.input,i.index+i[0].length))!=$.Word)}class Vp extends Hh{nextMatch(e,t,i){let s=Lt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Lt(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=Lt(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=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Lt(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 yi=E.define(),mr=E.define(),rt=be.define({create(n){return new ts(Gs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(yi)?n=new ts(t.value.create(),n.panel):t.is(mr)&&(n=new ts(n.query,t.value?yr:null));return n},provide:n=>fn.from(n,e=>e.panel)});class ts{constructor(e,t){this.query=e,this.panel=t}}const zp=B.mark({class:"cm-searchMatch"}),qp=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Kp=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 kt;for(let s=0,r=t.visibleRanges,o=r.length;sr[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?qp:zp)})}return i.finish()}},{decorations:n=>n.decorations});function Ci(n){return e=>{let t=e.state.field(rt,!1);return t&&t.query.spec.valid?n(e,t):zh(e)}}const Sn=Ci((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(_t);return n.dispatch({selection:s,effects:[br(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Vh(n),!0}),vn=Ci((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(_t);return n.dispatch({selection:r,effects:[br(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),Vh(n),!0}),$p=Ci((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)}),jp=({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 Ut(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),userEvent:"select.search.matches"})),!0},Yo=Ci((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-c,r.to-c),h.push(br(n,r)),h.push(t.facet(_t).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),Up=Ci((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function yr(n){return n.state.facet(_t).createPanel(n)}function Gs(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(_t);return new Fh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Wh(n){let e=cn(n,yr);return e&&e.dom.querySelector("[main-field]")}function Vh(n){let e=Wh(n);e&&e==n.root.activeElement&&e.select()}const zh=n=>{let e=n.state.field(rt,!1);if(e&&e.panel){let t=Wh(n);if(t&&t!=n.root.activeElement){let i=Gs(n.state,e.query.spec);i.valid&&n.dispatch({effects:yi.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[mr.of(!0),e?yi.of(Gs(n.state,e.query.spec)):E.appendConfig.of(_p)]});return!0},qh=n=>{let e=n.state.field(rt,!1);if(!e||!e.panel)return!1;let t=cn(n,yr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:mr.of(!1)}),!0},hm=[{key:"Mod-f",run:zh,scope:"editor search-panel"},{key:"F3",run:Sn,shift:vn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Sn,shift:vn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:qh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:jp},{key:"Alt-g",run:Mp},{key:"Mod-d",run:Np,preventDefault:!0}];class Gp{constructor(e){this.view=e;let t=this.query=e.state.field(rt).query.spec;this.commit=this.commit.bind(this),this.searchField=le("input",{value:t.search,placeholder:Ce(e,"Find"),"aria-label":Ce(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=le("input",{value:t.replace,placeholder:Ce(e,"Replace"),"aria-label":Ce(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=le("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=le("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=le("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return le("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=le("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>Sn(e),[Ce(e,"next")]),i("prev",()=>vn(e),[Ce(e,"previous")]),i("select",()=>$p(e),[Ce(e,"all")]),le("label",null,[this.caseField,Ce(e,"match case")]),le("label",null,[this.reField,Ce(e,"regexp")]),le("label",null,[this.wordField,Ce(e,"by word")]),...e.state.readOnly?[]:[le("br"),this.replaceField,i("replace",()=>Yo(e),[Ce(e,"replace")]),i("replaceAll",()=>Up(e),[Ce(e,"replace all")])],le("button",{name:"close",onclick:()=>qh(e),"aria-label":Ce(e,"close"),type:"button"},["×"])])}commit(){let e=new Fh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:yi.of(e)}))}keydown(e){$f(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?vn:Sn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Yo(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(yi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(_t).top}}function Ce(n,e){return n.state.phrase(e)}const $i=30,ji=/[\s\.,:;?!]/;function br(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-$i),o=Math.min(s,t+$i),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<$i;a++)if(!ji.test(l[a+1])&&ji.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-$i;a--)if(!ji.test(l[a-1])&&ji.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Jp=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),_p=[rt,At.low(Kp),Jp];class Kh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ye(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search($h(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Qo(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Xp(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Xp(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function cm(n,e){return t=>{for(let i=ye(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class Zo{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function ot(n){return n.selection.main.from}function $h(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const jh=Ze.define();function Qp(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:b.cursor(l.from+r+e.length)})),{userEvent:"input.complete"})}const el=new WeakMap;function Zp(n){if(!Array.isArray(n))return n;let e=el.get(n);return e||el.set(n,e=Yp(n)),e}const xr=E.define(),bi=E.define();class eg{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(k=_s(w))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!S||T==1&&m||x==0&&T!=0)&&(t[f]==w||i[f]==w&&(u=!0)?o[f++]=S:o.length&&(y=!1)),x=T,S+=Oe(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Oe(ne(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const ve=D.define({combine(n){return Mt(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:tg,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>tl(e(i),t(i)),optionClass:(e,t)=>i=>tl(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function tl(n,e){return n?e?n+" "+e:n:e}function tg(n,e,t,i,s){let r=n.textDirection==J.RTL,o=r,l=!1,a="top",h,c,f=e.left-s.left,u=s.right-e.right,d=i.right-i.left,p=i.bottom-i.top;if(o&&f=p||g>e.top?h=t.bottom-e.top:(a="bottom",h=e.bottom-t.top)}return{style:`${a}: ${h}px; max-width: ${c}px`,class:"cm-completionInfo-"+(l?r?"left-narrow":"right-narrow":o?"left":"right")}}function ig(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function il(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class ng{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(ve);this.optionContent=ig(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=il(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ve).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:bi.of(null)})}),this.list=this.dom.appendChild(this.createListBox(r,s.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=il(t.options.length,t.selected,this.view.state.facet(ve).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Ie(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&rg(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew ng(t,n,e)}function rg(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function nl(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function og(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new Zo(c,a.source,h?h(c):[],1e9-t.length));else{let c=new eg(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new Zo(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):nl(a.completion)>nl(o)&&(r[r.length-1]=a),o=a.completion}return r}class Et{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Et(this.options,sl(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=og(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Et(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(ve).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:sg(Me,Jh),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Et(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Cn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Cn(hg,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(ve),r=(i.override||t.languageDataAt("autocomplete",ot(t)).map(Zp)).map(l=>(this.active.find(h=>h.source==l)||new ke(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!lg(r,this.active)?o=Et.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new ke(l.source,0):l));for(let l of e.effects)l.is(Gh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new Cn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:ag}}function lg(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const hg=[];function Js(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class ke{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Js(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new ke(s.source,0));for(let r of e.effects)if(r.is(xr))s=new ke(s.source,1,r.value?ot(e.state):-1);else if(r.is(bi))s=new ke(s.source,0);else if(r.is(Uh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new ke(this.source,1)}handleChange(e){return e.changes.touchesRange(ot(e.startState))?new ke(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ke(this.source,this.state,e.mapPos(this.explicitPos))}}class Wt extends ke{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ot(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&ot(e.startState)==this.from)return new ke(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return cg(this.result.validFor,e.state,r,o)?new Wt(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Kh(e.state,l,a>=0)))?new Wt(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:ot(e.state)):new ke(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ke(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Wt(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function cg(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):$h(n,!0).test(s)}const Uh=E.define({map(n,e){return n.map(t=>t.map(e))}}),Gh=E.define(),Me=be.define({create(){return Cn.start()},update(n,e){return n.update(e)},provide:n=>[Ba.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]});function Jh(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Me).active.find(s=>s.source==e.source);return i instanceof Wt?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},Qp(n.state,t,i.from,i.to)),{annotations:jh.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}function Ui(n,e="option"){return t=>{let i=t.state.field(Me,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Gh.of(l)}),!0}}const fg=n=>{let e=n.state.field(Me,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Me,!1)?(n.dispatch({effects:xr.of(!0)}),!0):!1,dg=n=>{let e=n.state.field(Me,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:bi.of(null)}),!0)};class pg{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const rl=50,gg=50,mg=1e3,yg=ge.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Me).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Me);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Me)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Js(i));for(let i=0;igg&&Date.now()-s.time>mg){for(let r of s.context.abortListeners)try{r()}catch(o){Ie(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),rl):-1,this.composing!=0)for(let i of n.transactions)Js(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Me);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=ot(e),i=new Kh(e,t,n.explicitPos==t),s=new pg(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:bi.of(null)}),Ie(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),rl))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ve);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new ke(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Uh.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Me,!1);if(e&&e.tooltip&&this.view.state.facet(ve).closeOnBlur){let t=e.open&&Pa(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:bi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:xr.of(!1)}),20),this.composing=0}}}),_h=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class bg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class wr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new wr(this.field,t,i)}}class kr{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew wr(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new bg(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new kr(i,s)}}let xg=B.widget({widget:new class extends Dt{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),wg=B.mark({class:"cm-snippetField"});class Xt{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?xg:wg).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Xt(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Ai=E.define({map(n,e){return n&&n.map(e)}}),kg=E.define(),xi=be.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Ai))return t.value;if(t.is(kg)&&n)return new Xt(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>O.decorations.from(n,e=>e?e.deco:B.none)});function Sr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function Sg(n){let e=kr.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0,annotations:i?jh.of(i):void 0};if(l.length&&(a.selection=Sr(l,0)),l.length>1){let h=new Xt(l,0),c=a.effects=[Ai.of(h)];t.state.field(xi,!1)===void 0&&c.push(E.appendConfig.of([xi,Dg,Og,_h]))}t.dispatch(t.state.update(a))}}function Xh(n){return({state:e,dispatch:t})=>{let i=e.field(xi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:Sr(i.ranges,s),effects:Ai.of(r?null:new Xt(i.ranges,s))})),!0}}const vg=({state:n,dispatch:e})=>n.field(xi,!1)?(e(n.update({effects:Ai.of(null)})),!0):!1,Cg=Xh(1),Ag=Xh(-1),Mg=[{key:"Tab",run:Cg,shift:Ag},{key:"Escape",run:vg}],ol=D.define({combine(n){return n.length?n[0]:Mg}}),Dg=At.highest(sr.compute([ol],n=>n.facet(ol)));function fm(n,e){return Object.assign(Object.assign({},e),{apply:Sg(n)})}const Og=O.domEventHandlers({mousedown(n,e){let t=e.state.field(xi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:Sr(t.ranges,s.field),effects:Ai.of(t.ranges.some(r=>r.field>s.field)?new Xt(t.ranges,s.field):null)}),!0)}}),wi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},bt=E.define({map(n,e){let t=e.mapPos(n,-1,he.TrackAfter);return t??void 0}}),vr=new class extends wt{};vr.startSide=1;vr.endSide=-1;const Yh=be.define({create(){return K.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=K.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(bt)&&(n=n.update({add:[vr.range(t.value,t.value+1)]}));return n}});function um(){return[Bg,Yh]}const is="()[]{}<>";function Qh(n){for(let e=0;e{if((Tg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Oe(ne(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Lg(n.state,i);return r?(n.dispatch(r),!0):!1}),Pg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Zh(n,n.selection.main.head).brackets||wi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Rg(n.doc,o.head);for(let a of i)if(a==l&&Fn(n.doc,o.head)==Qh(ne(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},dm=[{key:"Backspace",run:Pg}];function Lg(n,e){let t=Zh(n,n.selection.main.head),i=t.brackets||wi.brackets;for(let s of i){let r=Qh(ne(s,0));if(e==s)return r==s?Ng(n,s,i.indexOf(s+s+s)>-1,t):Eg(n,s,r,t.before||wi.before);if(e==r&&ec(n,n.selection.main.from))return Ig(n,s,r)}return null}function ec(n,e){let t=!1;return n.field(Yh).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Fn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Oe(ne(t,0)))}function Rg(n,e){let t=n.sliceString(e-2,e);return Oe(ne(t,0))==t.length?t:t.slice(1)}function Eg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:bt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Fn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:bt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Ig(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Fn(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ng(n,e,t,i){let s=i.stringPrefixes||wi.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:bt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Fn(n.doc,a),c;if(h==e){if(ll(n,a))return{changes:{insert:e+e,from:a},effects:bt.of(a+e.length),range:b.cursor(a+e.length)};if(ec(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=al(n,a-2*e.length,s))>-1&&ll(n,c))return{changes:{insert:e+e+e+e,from:a},effects:bt.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=$.Word&&al(n,a,s)>-1&&!Fg(n,a,e,s))return{changes:{insert:e+e,from:a},effects:bt.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ll(n,e){let t=ye(n).resolveInner(e+1);return t.parent&&t.from==e}function Fg(n,e,t,i){let s=ye(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function al(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=$.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=$.Word)return r}return-1}function pm(n={}){return[Me,ve.of(n),yg,Wg,_h]}const Hg=[{key:"Ctrl-Space",run:ug},{key:"Escape",run:dg},{key:"ArrowDown",run:Ui(!0)},{key:"ArrowUp",run:Ui(!1)},{key:"PageDown",run:Ui(!0,"page")},{key:"PageUp",run:Ui(!1,"page")},{key:"Enter",run:fg}],Wg=At.highest(sr.computeN([ve],n=>n.facet(ve).defaultKeymap?[Hg]:[]));export{Zg as A,em as B,An as C,ku as D,O as E,tm as F,Xg as G,ye as H,j as I,Gg as J,cm as K,Hs as L,Yp as M,rr as N,b as O,Ia as P,fm as Q,Qg as R,_a as S,W as T,Yg as U,Ku as V,Ha as W,ld as X,N as a,Kg as b,rm as c,zg as d,qg as e,sm as f,um as g,Ug as h,am as i,dm as j,sr as k,lm as l,hm as m,om as n,Hg as o,pm as p,$g as q,jg as r,im as s,nm as t,me as u,L as v,Hu as w,C as x,Jg as y,Uu as z}; diff --git a/ui/dist/assets/index-9cd23da9.js b/ui/dist/assets/index-9cd23da9.js new file mode 100644 index 00000000..cea4b7a0 --- /dev/null +++ b/ui/dist/assets/index-9cd23da9.js @@ -0,0 +1,13 @@ +class N{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 oi(this),r=new oi(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 oi(this,e)}iterRange(e,t=this.length){return new cl(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 fl(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?N.empty:e.length<=32?new G(e):qe.from(G.split(e,[]))}}class G extends N{constructor(e,t=tc(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 ic(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(Ar(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,Ar(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&&oe&&o&&(s+=i),er&&(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 N{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=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=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>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;re&&r&&(s+=i),eo&&(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)}}N.empty=new G([""],0);function tc(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=t&&(a>i&&(l=l.slice(0,i-s)),s0?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 cl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new oi(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 fl{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"&&(N.prototype[Symbol.iterator]=function(){return this.iter()},oi.prototype[Symbol.iterator]=cl.prototype[Symbol.iterator]=fl.prototype[Symbol.iterator]=function(){return this});class ic{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 It="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;nn)return It[e-1]<=n;return!1}function Mr(n){return n>=127462&&n<=127487}const Dr=8205;function ce(n,e,t=!0,i=!0){return(t?ul:sc)(n,e,i)}function ul(n,e,t){if(e==n.length)return e;e&&dl(n.charCodeAt(e))&&pl(n.charCodeAt(e-1))&&e--;let i=ie(n,e);for(e+=Oe(i);e=0&&Mr(ie(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function sc(n,e,t){for(;e>0;){let i=ul(n,e-2,t);if(i=56320&&n<57344}function pl(n){return n>=55296&&n<56320}function ie(n,e){let t=n.charCodeAt(e);if(!pl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return dl(i)?(t-55296<<10)+(i-56320)+65536:t}function Ys(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Oe(n){return n<65536?1:2}const ns=/\r\n?|\n/;var ae=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ae||(ae={}));class Ge{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=ae.Simple&&h>=e&&(i==ae.TrackDel&&se||i==ae.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ge(e)}static create(e){return new Ge(e)}}class Q extends Ge{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ss(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return rs(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&rt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?N.of(d.split(i||ns)):d:N.empty,m=p.length;if(f==u&&m==0)return;fo&&le(s,f-o,-1),le(s,u-f,m),rt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Q(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function rt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function rs(n,e,t,i=!1){let s=[],r=i?[]:null,o=new hi(n),l=new hi(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);le(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class hi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?N.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?N.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class mt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new mt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new mt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>mt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function ml(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _s=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=_s++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Xs),!!e.static,e.enables)}of(e){return new Xi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Xi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Xi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Xs(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Xi{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=_s++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||os(f,c)){let d=i(f);if(l?!Or(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=on(u,p);if(this.dependencies.every(g=>g instanceof D?u.facet(g)===f.facet(g):g instanceof ye?u.field(g,!1)==f.field(g,!1):!0)||(l?Or(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function Or(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Tr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Tr.of({field:this,create:e})]}get extension(){return this}}const gt={lowest:4,low:3,default:2,high:1,highest:0};function _t(n){return e=>new yl(e,n)}const Mt={highest:_t(gt.highest),high:_t(gt.high),default:_t(gt.default),low:_t(gt.low),lowest:_t(gt.lowest)};class yl{constructor(e,t){this.inner=e,this.prec=t}}class Mn{of(e){return new ls(this,e)}reconfigure(e){return Mn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ls{constructor(e,t){this.compartment=e,this.inner=t}}class rn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of oc(e,t,o))u instanceof ye?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Xs(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>rc(g,p,d))}}let f=h.map(u=>u(l));return new rn(e,o,f,l,a,r)}}function oc(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof ls&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof ls){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof yl)r(o.inner,o.prec);else if(o instanceof ye)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Xi)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,gt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,gt.default),i.reduce((o,l)=>o.concat(l))}function li(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function on(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const bl=D.define(),wl=D.define({combine:n=>n.some(e=>e),static:!0}),xl=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),kl=D.define(),vl=D.define(),Sl=D.define(),Cl=D.define({combine:n=>n.length?n[0]:!1});class tt{constructor(e,t){this.type=e,this.value=t}static define(){return new lc}}class lc{of(e){return new tt(this,e)}}class ac{constructor(e){this.map=e}of(e){return new I(this,e)}}class I{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new I(this.type,t)}is(e){return this.type==e}static define(e={}){return new ac(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}I.reconfigure=I.define();I.appendConfig=I.define();class Z{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ml(i,t.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(e,t,i,s,r,o){return new Z(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Z.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Z.time=tt.define();Z.userEvent=tt.define();Z.addToHistory=tt.define();Z.remote=tt.define();function hc(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof Z?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?n=r[0]:n=Ml(e,Nt(r),!1)}return n}function fc(n){let e=n.startState,t=e.facet(Sl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Al(i,as(e,r,n.changes.newLength),!0))}return i==n?n:Z.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const uc=[];function Nt(n){return n==null?uc:Array.isArray(n)?n:[n]}var $=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}($||($={}));const dc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let hs;try{hs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function pc(n){if(hs)return hs.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||dc.test(t)))return!0}return!1}function gc(n){return e=>{if(!/\S/.test(e))return $.Space;if(pc(e))return $.Word;for(let t=0;t-1)return $.Word;return $.Other}}class F{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(I.reconfigure)?(t=null,i=o.value):o.is(I.appendConfig)&&(t=null,i=Nt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=rn.resolve(i,s,this),r=new F(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new F(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Nt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return F.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=rn.resolve(e.extensions||[],new Map),i=e.doc instanceof N?e.doc:N.of((e.doc||"").split(t.staticFacet(F.lineSeparator)||ns)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return ml(s,i.length),t.staticFacet(wl)||(s=s.asSingle()),new F(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(F.tabSize)}get lineBreak(){return this.facet(F.lineSeparator)||` +`}get readOnly(){return this.facet(Cl)}phrase(e,...t){for(let i of this.facet(F.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(bl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return gc(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=ce(t,o,!1);if(r(t.slice(a,o))!=$.Word)break;o=a}for(;ln.length?n[0]:4});F.lineSeparator=xl;F.readOnly=Cl;F.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])}});F.languageData=bl;F.changeFilter=kl;F.transactionFilter=vl;F.transactionExtender=Sl;Mn.reconfigure=I.define();function Dt(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 kt{eq(e){return this==e}range(e,t=e){return cs.create(e,t,this)}}kt.prototype.startSide=kt.prototype.endSide=0;kt.prototype.point=!1;kt.prototype.mapMode=ae.TrackDel;let cs=class Dl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Dl(e,t,i)}};function fs(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Qs{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);rd||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 Qs(s,r,i,l):null,pos:o}}}class K{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 K(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(fs)),this.isEmpty)return t.length?K.of(t):this;let l=new Ol(this,null,-1).goto(0),a=0,h=[],c=new vt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=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 ci.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ci.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=Br(o,l,i),h=new Xt(o,a,r),c=new Xt(l,a,r);i.iterGaps((f,u,d)=>Pr(h,f,c,u,d,s)),i.empty&&i.length==0&&Pr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Br(r,o),a=new Xt(r,l,0).goto(i),h=new Xt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!us(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new Xt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new vt;for(let s of e instanceof cs?[e]:t?mc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}K.empty=new K([],[],null,-1);function mc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(fs);e=i}return n}K.empty.nextLayer=K.empty;class vt{finishChunk(e){this.chunks.push(new Qs(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new vt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(K.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Br(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new Ol(o,t,i,r));return s.length==1?s[0]:new ci(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Hn(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Hn(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Hn(this.heap,0)}}}function Hn(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Xt{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ci.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Bi(this.active,e),Bi(this.activeTo,e),Bi(this.activeRank,e),this.minActive=Lr(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Bi(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Pr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&us(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!us(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function us(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Lr(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ce(n,s)}return i===!0?-1:n.length}const ps="ͼ",Rr=typeof Symbol>"u"?"__"+ps:Symbol.for(ps),gs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Er=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ht{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Er[Rr]||1;return Er[Rr]=e+1,ps+e.toString(36)}static mount(e,t,i){let s=e[gs],r=i&&i.nonce;s?r&&s.setNonce(r):s=new yc(e,r),s.mount(Array.isArray(t)?t:[t])}}let Ir=new Map;class yc{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=Ir.get(i);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[gs]=r;this.sheet=new s.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Ir.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[gs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},bc=typeof navigator<"u"&&/Mac/.test(navigator.platform),wc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ne=0;ne<10;ne++)ct[48+ne]=ct[96+ne]=String(ne);for(var ne=1;ne<=24;ne++)ct[ne+111]="F"+ne;for(var ne=65;ne<=90;ne++)ct[ne]=String.fromCharCode(ne+32),fi[ne]=String.fromCharCode(ne);for(var Vn in ct)fi.hasOwnProperty(Vn)||(fi[Vn]=ct[Vn]);function xc(n){var e=bc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||wc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?fi:ct)[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 ln(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function ms(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function kc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Qi(n,e){if(!e.anchorNode)return!1;try{return ms(n,e.anchorNode)}catch{return!1}}function Wt(n){return n.nodeType==3?St(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function an(n,e,t,i){return t?Nr(n,e,t,i,-1)||Nr(n,e,t,i,1):!1}function ui(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Nr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:Qe(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=ui(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?Qe(n):0}else return!1}}function Qe(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Dn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function vc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Sc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,m=1;if(d)u=vc(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let k=c.getBoundingClientRect();p=k.width/c.offsetWidth,m=k.height/c.offsetHeight,u={left:k.left,right:k.left+c.clientWidth*p,top:k.top,bottom:k.top+c.clientHeight*m}}let g=0,y=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y0&&e.right>u.right+g&&(g=e.right-u.right+g+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.leftt.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 Ac{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){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Qe(t):0),i,Math.min(e.focusOffset,i?Qe(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Pt=null;function Tl(n){if(n.setActive)return n.setActive();if(Pt)return n.focus(Pt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Pt==null?{get preventScroll(){return Pt={preventScroll:!0},!0}}:void 0),!Pt){Pt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class he{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new he(e.parentNode,ui(e),t)}static after(e,t){return new he(e.parentNode,ui(e)+1,t)}}const Zs=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=q.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Hr(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=Hr(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=Qe(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!q.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Zs){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Rl(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var M={mac:zr||/Mac/.test(Me.platform),windows:/Win/.test(Me.platform),linux:/Linux|X11/.test(Me.platform),ie:On,ie_version:Il?ys.documentMode||6:ws?+ws[1]:bs?+bs[1]:0,gecko:Vr,gecko_version:Vr?+(/Firefox\/(\d+)/.exec(Me.userAgent)||[0,0])[1]:0,chrome:!!Wn,chrome_version:Wn?+Wn[1]:0,ios:zr,android:/Android\b/.test(Me.userAgent),webkit:Wr,safari:Nl,webkit_version:Wr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:ys.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Oc=256;class Ze extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Ze)||this.length-(t-e)+i.length>Oc||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ze(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new he(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Tc(this.dom,e,t)}}class et extends q{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Bl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof et&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new et(this.mark,t,o)}domAtPos(e){return Fl(this,e)}coordsAt(e,t){return Vl(this,e,t)}}function Tc(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?M.chrome||M.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return M.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Dn(a,o<0):a||null}class yt extends q{static create(e,t,i){return new yt(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=yt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof yt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?he.before(this.dom):he.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?he.before(this.dom):he.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return N.empty}get isHidden(){return!0}}Ze.prototype.children=yt.prototype.children=zt.prototype.children=Zs;function Fl(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof et&&s.length&&(i=s[s.length-1])instanceof et&&i.mark.eq(e.mark)?Hl(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Vl(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function ks(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function Pc(n){let e=Object.create(null);for(let t=0;t0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){er(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Hl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=xs(t,this.attrs||{})),i&&(this.attrs=xs({class:i},this.attrs||{}))}domAtPos(e){return Fl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Bl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(ks(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&q.get(s)instanceof et;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=q.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!M.ios||!this.children.some(r=>r instanceof Ze))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Ze)||/[^ -~]/.test(i.text))return null;let s=Wt(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Vl(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof X)return r;if(o>t)break}s=o+r.breakAfter}return null}}class xt extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof xt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0}}class Ot{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}destroy(e){}}var De=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(De||(De={}));class B extends kt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Si(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new ft(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Wl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new ft(e,i,s,t,e.widget||null,!0)}static line(e){return new Ci(e)}static set(e,t=!1){return K.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}B.none=K.empty;class Si extends B{constructor(e){let{start:t,end:i}=Wl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof Si&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&er(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Si.prototype.point=!1;class Ci extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ci&&this.spec.class==e.spec.class&&er(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ci.prototype.mapMode=ae.TrackBefore;Ci.prototype.point=!0;class ft extends B{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?ae.TrackBefore:ae.TrackAfter:ae.TrackDel}get type(){return this.startSide!=this.endSide?De.WidgetRange:this.startSide<=0?De.WidgetBefore:De.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ft&&Lc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ft.prototype.point=!0;function Wl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Lc(n,e){return n==e||!!(n&&e&&n.compare(e))}function vs(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class ai{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof xt&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new X),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Li(new zt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!e&&!this.posCovered()&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Li(new Ze(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ft){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof ft)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new xt(i.widget||new Kr("div"),l,i));else{let a=yt.create(i.widget||new Kr("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Li(new zt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Li(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new ai(e,t,i,r);return o.openEnd=K.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Li(n,e){for(let t of e)n=new et(t,[n],n.length);return n}class Kr extends Ot{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const zl=D.define(),ql=D.define(),Kl=D.define(),$l=D.define(),Ss=D.define(),jl=D.define(),Ul=D.define(),Gl=D.define({combine:n=>n.some(e=>e)}),Jl=D.define({combine:n=>n.some(e=>e)});class hn{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new hn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const $r=I.define({map:(n,e)=>n.map(e)});function Je(n,e,t){let i=n.facet($l);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Tn=D.define({combine:n=>n.length?n[0]:!0});let Rc=0;const ti=D.define();class fe{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new fe(Rc++,e,i,s,l=>{let a=[ti.of(l)];return o&&a.push(di.of(h=>{let c=h.plugin(l);return c?o(c):B.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return fe.define(i=>new e(i),t)}}class zn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Je(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Je(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Je(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Yl=D.define(),tr=D.define(),di=D.define(),ir=D.define(),_l=D.define();function jr(n,e,t){let i=n.state.facet(_l);if(!i.length)return i;let s=i.map(o=>o instanceof Function?o(n):o),r=[];return K.spans(s,e,t,{point(){},span(o,l,a,h){let c=r;for(let f=a.length-1;f>=0;f--,h--){let u=a[f].spec.bidiIsolate,d;if(u!=null)if(h>0&&c.length&&(d=c[c.length-1]).to==o&&d.direction==u)d.to=l,c=d.inner;else{let p={from:o,to:l,direction:u,inner:[]};c.push(p),c=p.inner}}}}),r}const Xl=D.define();function Ql(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Xl)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ii=D.define();class Le{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Le(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Le(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class cn{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Q.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Le(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new cn(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var J=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(J||(J={}));const pi=J.LTR,Zl=J.RTL;function ea(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ta(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(Fe[m+1]==-d){let g=Fe[m+2],y=g&2?s:g&4?g&1?r:s:0;y&&(H[f]=H[Fe[m]]=y),l=m;break}}else{if(Fe.length==189)break;Fe[l++]=f,Fe[l++]=u,Fe[l++]=a}else if((p=H[f])==2||p==1){let m=p==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let y=Fe[g+2];if(y&2)break;if(m)Fe[g+2]|=2;else{if(y&4)break;Fe[g+2]|=4}}}}}function Wc(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=sa;)p==g&&(p=t[--m].from,g=m?t[m-1].to:n),H[--p]=d;a=c}else r=h,a++}}}function As(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;aa&&o.push(new ot(a,m.from,d));let g=m.direction==pi!=!(d%2);Ms(n,g?i+1:i,s,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(c?H[p]!=l:H[p]==l))break;p++}u?As(n,a,p,i+1,s,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let m=H[a-1];m!=l&&(c=!1,f=m==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let m=r[--h];if(!c)for(let g=m.from,y=h;;){if(g==e)break e;if(y&&r[y-1].to==g)g=r[--y].from;else{if(H[g-1]==l)break e;break}}if(u)u.push(m);else{m.toH.length;)H[H.length]=256;let i=[],s=e==pi?0:1;return Ms(n,s,s,t,0,n.length,i),i}function ia(n){return[new ot(0,n,0)]}let na="";function qc(n,e,t,i,s){var r;let o=i.head-n.from,l=-1;if(o==0){if(!s||!n.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),l=0)}else if(o==n.length){if(s)return null;let u=e[e.length-1];u.level!=t&&(o=u.side(!0,t),l=e.length-1)}l<0&&(l=ot.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc));let a=e[l];o==a.side(s,t)&&(a=e[l+=s?1:-1],o=a.side(!s,t));let h=s==(a.dir==t),c=ce(n.text,o,h);if(na=n.text.slice(Math.min(o,c),Math.max(o,c)),c!=a.side(s,t))return b.cursor(c+n.from,h?-1:1,a.level);let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return!f&&a.level!=t?b.cursor(s?n.to:n.from,s?-1:1,t):f&&f.level0&&i.length&&(i.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let s=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!Yc(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?$c(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new Le(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(M.ie||M.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=Gc(o,l,e.changes);return i=Le.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=M.chrome||M.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,m;if(i&&i.range.fromBc){let w=ai.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),x=ai.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=w.breakAtStart,p=w.openStart,m=x.openEnd;let v=this.compositionView(i);x.breakAtStart?v.breakAfter=1:x.content.length&&v.merge(v.length,v.length,x.content[0],!1,x.openStart,0)&&(v.breakAfter=x.content[0].breakAfter,x.content.shift()),w.content.length&&v.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),u=w.content.concat(v).concat(x.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=ai.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=r.findPos(h,1),{i:k,off:C}=r.findPos(a,-1);Rl(this,k,C,g,y,u,d,p,m)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new Ze(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new et(s,[t],t.length);let i=new X;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=q.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&Qi(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(M.gecko&&l.empty&&!this.hasComposition&&Kc(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new he(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!an(a.node,a.offset,c.anchorNode,c.anchorOffset)||!an(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(c.focusNode)&&Jc(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=ln(this.view.root);if(f)if(l.empty){if(M.gecko){let u=jc(a.node,a.offset);if(u&&u!=3){let d=ra(a.node,a.offset,u==1?1:-1);d&&(a=new he(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new he(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new he(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=ln(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=X.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let s=e.offset;!i&&s=0;s--){let r=q.get(t.childNodes[s]);r instanceof X&&(i=r.domAtPos(r.length))}return i?new he(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=q.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(ae||l.covers(1))&&(!i||l instanceof X&&!(i instanceof X&&t>=0))&&(i=l,s=h),r=h}return i?i.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof X))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Ze))return null;let r=ce(s.text,i);if(r==i)return null;let o=St(s.dom,i,r).getClientRects();return!o.length||o[0].top>=o[0].bottom?null:o[0]}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==J.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?Wt(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?J.RTL:J.LTR}measureTextSize(){for(let r of this.children)if(r instanceof X){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Wt(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ll(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(B.replace({widget:new Gr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return B.set(e)}updateDeco(){let e=this.view.state.facet(di).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=Ql(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};Sc(this.view.scrollDOM,o,t.head0)i=i.childNodes[s-1],s=Qe(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return{node:i,offset:s};if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function jc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function _c(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return b.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=ce(s.text,r,!1):l=ce(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let h=ce(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function Qc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function qn(n,e){return n.tope.top+1}function Jr(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Ds(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=Wt(p);for(let g=0;gC||o==C&&r>k){i=p,s=y,r=k,o=C;let w=C?t0?g0)}k==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&qn(c,y)?c=Yr(c,y.bottom):f&&qn(f,y)&&(f=Jr(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return _r(i,u,t);if(l&&i.contentEditable!="false")return Ds(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function _r(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((M.chrome||M.gecko)&&St(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function oa(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let w=n.viewState.heightOracle.textHeight/2,x=!1;a=n.elementAtHeight(u),a.type!=De.Text;)for(;u=i>0?a.bottom+w:a.top-w,!(u>=0&&u<=h);){if(x)return t?null:0;x=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Xr(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,k=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(c,f);w&&({offsetNode:y,offset:k}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(c,f);w&&({startContainer:y,startOffset:k}=w,(!n.contentDOM.contains(y)||M.safari&&Zc(y,k,c)||M.chrome&&ef(y,k,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let w=X.find(n.docView,d);if(!w)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:k}=Ds(w.dom,c,f))}let C=n.docView.nearest(y);if(!C)return null;if(C.isWidget&&((r=C.dom)===null||r===void 0?void 0:r.nodeType)==1){let w=C.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+ds(o,r,n.state.tabSize)}function Zc(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return St(n,i-1,i).getBoundingClientRect().left>t}function ef(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():St(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Os(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==De.Text))return i}return t}function tf(n,e,t,i){let s=Os(n,e.head),r=!i||s.type!=De.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==J.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,t?-1:1)}return b.cursor(t?s.to:s.from,t?-1:1)}function Qr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=qc(s,r,o,l,t),c=na;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` +`,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 nf(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 sf(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,e.assoc||-1),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.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=oa(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms)){let g=n.docView.coordsForChar(m),y=!g||p{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,i{if(t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&(this.runHandlers("mousedown",t),!t.defaultPrevented&&t.button==2)){let i=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=i,200)}}),e.scrollDOM.addEventListener("drop",t=>{t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&this.runHandlers("drop",t)}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null),M.gecko&&kf(e.contentDOM.ownerDocument)}handleEvent(e){!df(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=of(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()i.keyCode==e.keyCode))&&!e.ctrlKey||lf.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Ft(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}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()}}function Zr(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Je(t.state,s)}}}function of(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(Zr(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(Zr(i.value,o))}}for(let i in Ye)t(i).handlers.push(Ye[i]);for(let i in Ee)t(i).observers.push(Ee[i]);return e}const la=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],lf="dthko",aa=[16,17,18,20,91,92,224,225],Ri=6;function Ei(n){return Math.max(0,n)*.7+8}function af(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class hf{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Cc(e.contentDOM),this.atoms=e.state.facet(ir).map(o=>o(e));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(F.allowMultipleSelections)&&cf(e,t),this.dragging=uf(e,t)&&ua(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&af(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=Ql(this.view);e.clientX-o.left<=r.left+Ri?i=-Ei(r.left-e.clientX):e.clientX+o.right>=r.right-Ri&&(i=Ei(e.clientX-r.right)),e.clientY-o.top<=r.top+Ri?s=-Ei(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Ri&&(s=Ei(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function cf(n,e){let t=n.state.facet(zl);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function ff(n,e){let t=n.state.facet(ql);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function uf(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=ln(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function df(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=q.get(t))&&i.ignoreEvent(e))return!1;return!0}const Ye=Object.create(null),Ee=Object.create(null),ha=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function pf(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),ca(n,t.value)},50)}function ca(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Ts!=null&&t.selection.ranges.every(a=>a.empty)&&Ts==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Ee.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Ye.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Ee.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Ee.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ye.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(Kl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=yf(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new hf(n,e,t,i)),i&&n.observer.ignore(()=>Tl(n.contentDOM));let s=n.inputState.mouseSelection;if(s)return s.start(e),!s.dragging}return!1};function eo(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return _c(n.state,e,t);{let s=X.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,to=(n,e,t)=>fa(e,t)&&n>=t.left&&n<=t.right;function gf(n,e,t,i){let s=X.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&to(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&to(t,i,l)?1:o&&fa(i,o)?-1:1}function io(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:gf(n,t,e.clientX,e.clientY)}}const mf=M.ie&&M.ie_version<=11;let no=null,so=0,ro=0;function ua(n){if(!mf)return n.detail;let e=no,t=ro;return no=n,ro=Date.now(),so=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(so+1)%3:1}function yf(n,e){let t=io(n,e),i=ua(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=io(n,r),h,c=eo(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=eo(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=bf(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function bf(n,e){for(let t=0;t=e)return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Ye.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;return i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function oo(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&ff(n,e)?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}Ye.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,r=()=>{++s==t.length&&oo(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return oo(n,e,i,!0),!0}return!1};Ye.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=ha?null:e.clipboardData;return t?(ca(n,t.getData("text/plain")||t.getData("text/uri-text")),!0):(pf(n),!1)};function wf(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function xf(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Ts=null;Ye.copy=Ye.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=xf(n.state);if(!t&&!s)return!1;Ts=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=ha?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(wf(n,t),!1)};const da=tt.define();function pa(n,e){let t=[];for(let i of n.facet(Ul)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:da.of(!0)}):null}function ga(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=pa(n.state,e);t?n.dispatch(t):n.update([])}},10)}Ee.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ga(n)};Ee.blur=n=>{n.observer.clearSelectionRange(),ga(n)};Ee.compositionstart=Ee.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Ee.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,M.chrome&&M.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Ee.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Ye.beforeinput=(n,e)=>{var t;let i;if(M.chrome&&M.android&&(i=la.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return!1};const lo=new Set;function kf(n){lo.has(n)||(lo.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const ao=["pre-wrap","normal","pre-line","break-spaces"];class vf{constructor(e){this.lineWrapping=e,this.doc=N.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return ao.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>en&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return de.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,z.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,z.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ce extends ma{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Ke(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ce||s instanceof te&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof te?s=new Ce(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):de.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class te extends de{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new Ke(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new Ke(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==z.ByHeight)return this.blockAt(e,i,s,r);if(t==z.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new Ke(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new Ke(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new Ke(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof te?i[i.length-1]=new te(r.length+s):i.push(null,new te(s-1))}if(e>0){let r=i[0];r instanceof te?i[0]=new te(e+r.length):i.unshift(new te(e-1),null)}return de.of(i)}decomposeLeft(e,t){t.push(new te(e-1),null)}decomposeRight(e,t){t.push(null,new te(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new te(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=en&&(a=-2);let u=new Ce(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new te(r-l).updateHeight(e,l));let h=de.of(o);return(a<0||Math.abs(h.height-this.height)>=en||Math.abs(a-this.heightMetrics(e,t).perLine)>=en)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Cf extends de{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==z.ByPosNoHeight?z.ByPosNoHeight:z.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,z.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&ho(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?de.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ho(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof te&&(i=n[e+1])instanceof te&&n.splice(e-1,3,new te(t.length+1+i.length))}const Af=5;class nr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ce?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ce(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Af)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ce(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new te(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ce)return e;let t=new Ce(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ce)&&!this.isCovered?this.nodes.push(new Ce(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Tf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class $n{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new vf(t),this.stateDeco=e.facet(di).filter(i=>typeof i!="function"),this.heightMap=de.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle.setDoc(e.doc),[new Le(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=B.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Ii(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?fo:new Rf(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:ni(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(di).filter(c=>typeof c!="function");let s=e.changedRanges,r=Le.extendWithRanges(s,Mf(i,this.stateDeco,e?e.changes:Q.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Jl)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?J.RTL:J.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let w=l.width/t.offsetWidth,x=l.height/t.offsetHeight;(w>.995&&w<1.005||!isFinite(w)||Math.abs(l.width-t.offsetWidth)<1)&&(w=1),(x>.995&&x<1.005||!isFinite(x)||Math.abs(l.height-t.offsetHeight)<1)&&(x=1),(this.scaleX!=w||this.scaleY!=x)&&(this.scaleX=w,this.scaleY=x,h|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Pl(e.scrollDOM);let p=(this.printing?Tf:Of)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let k=l.width;if((this.contentDOMWidth!=k||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(w)&&(o=!0),o||s.lineWrapping&&Math.abs(k-this.contentDOMWidth)>s.charWidth){let{lineHeight:x,charWidth:v,textHeight:O}=e.docView.measureTextSize();o=x>0&&s.refresh(r,x,v,O,k/v,w),o&&(e.docView.minWidth=0,h|=8)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),s.heightChanged=!1;for(let x of this.viewports){let v=x.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(x);this.heightMap=(o?de.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle,[new Le(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Sf(x.from,v))}s.heightChanged&&(h|=2)}let C=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Ii(s.lineAt(o-i*1e3,z.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,z.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,z.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=J.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromy));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(b.cursor(c),!1,!0).head;g>h&&(c=g)}m=new $n(h,c,this.gapSize(f,h,c,u))}l.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];K.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ni(this.heightMap.lineAt(e,z.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return ni(this.heightMap.lineAt(this.scaler.fromDOM(e),z.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ni(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ii{constructor(e,t){this.from=e,this.to=t}}function Pf(n,e,t){let i=[],s=n,r=0;return K.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Fi(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Lf(n,e){for(let t of n)if(e(t))return t}const fo={toDOM(n){return n},fromDOM(n){return n},scale:1};class Rf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,z.ByPos,e,0,0).top,c=t.lineAt(a,z.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tni(s,e)):n._content)}const Hi=D.define({combine:n=>n.join(" ")}),Bs=D.define({combine:n=>n.indexOf(!0)>-1}),Ps=ht.newName(),ya=ht.newName(),ba=ht.newName(),wa={"&light":"."+ya,"&dark":"."+ba};function Ls(n,e,t){return new ht(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const Ef=Ls("."+Ps,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},wa),si="￿";class If{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(F.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=si}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=q.get(s),a=q.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:uo(s))||uo(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Nf(e,i.node,i.offset)?t:0))}}function Nf(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:Wf(e),a=new If(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=zf(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!ms(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!ms(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(h,a)}}}function xa(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||M.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(M.mac||M.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:N.of([" "])}):M.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:N.of([" "])}),t){if(M.ios&&n.inputState.flushIOSKey()||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Ft(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengths.head)&&Ft(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Ft(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,a=()=>l||(l=Hf(n,t,i));return n.state.facet(jl).some(h=>h(n,t.from,t.to,o,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Hf(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=n.state.sliceDoc(e.from,e.to),c,f=t&&sa(n,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=n.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let m=p.to-u,g=m-h.length;if(p.to-p.from!=d||n.state.sliceDoc(g,m)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let y=s.changes({from:g,to:m,insert:e.insert}),k=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+k),Math.max(0,a.head+k)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Vf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&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=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Wf(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 po(t,i)),(s!=t||r!=i)&&e.push(new po(s,r))),e}function zf(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 qf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jn=M.ie&&M.ie_version<=11;class Kf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Ac,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()}),jn&&(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)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")))},{threshold:[0,.001]}),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.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Tn)?i.root.activeElement!=this.dom:!Qi(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(M.ie&&M.ie_version<=11||M.android&&M.chrome)&&!i.state.selection.main.empty&&s.focusNode&&an(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=M.safari&&e.root.nodeType==11&&kc(this.dom.ownerDocument)==this.dom&&$f(this.view)||ln(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=Qi(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ft(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&Qi(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Ff(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=xa(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=go(t,e.previousSibling||e.target.previousSibling,-1),s=go(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function go(n,e,t){for(;e;){let i=q.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function $f(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return an(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class T{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Mc(e.parent)||document,this.viewState=new co(e.state||F.create(e)),this.plugins=this.state.facet(ti).map(i=>new zn(i));for(let i of this.plugins)i.update(this);this.observer=new Kf(this),this.inputState=new rf(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Ur(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof Z?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(da))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=pa(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(F.phrases)!=this.state.facet(F.phrases))return this.setState(r);s=cn.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new hn(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($r)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=fn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ii)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Hi)!=s.state.facet(Hi)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(Ss))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!xa(this,c)&&h.force&&Ft(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new co(e),this.plugins=e.facet(ti).map(i=>new zn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Ur(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ti),i=e.state.facet(ti);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new zn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Pl(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Je(this.state,p),mo}}),f=cn.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ss))l(t)}get themeClasses(){return Ps+" "+(this.state.facet(Bs)?ba:ya)+" "+this.state.facet(Hi)}updateAttrs(){let e=yo(this,Yl,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Tn)?"true":"false",class:"cm-content",style:`${M.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),yo(this,tr,t);let i=this.observer.ignore(()=>{let s=ks(this.contentDOM,this.contentAttrs,t),r=ks(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(T.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ii);let e=this.state.facet(T.cspNonce);ht.mount(this.root,this.styleModules.concat(Ef).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Kn(this,e,Qr(this,e,t,i))}moveByGroup(e,t){return Kn(this,e,Qr(this,e,t,i=>nf(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return tf(this,e,t,i)}moveVertically(e,t,i){return Kn(this,e,sf(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),oa(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[ot.find(r,e-s.from,-1,t)];return Dn(i,o.dir==J.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Gl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>jf)return ia(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||ta(r.isolates,i=jr(this,e.from,e.to))))return r.order;i||(i=jr(this,e.from,e.to));let s=zc(e.text,t,i);return this.bidiCache.push(new fn(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||M.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Tl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return $r.of(new hn(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return fe.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return fe.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ht.newName(),s=[Hi.of(i),ii.of(Ls(`.${i}`,e))];return t&&t.dark&&s.push(Bs.of(!0)),s}static baseTheme(e){return Mt.lowest(ii.of(Ls("."+Ps,e,wa)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&q.get(i)||q.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}T.styleModule=ii;T.inputHandler=jl;T.focusChangeEffect=Ul;T.perLineTextDirection=Gl;T.exceptionSink=$l;T.updateListener=Ss;T.editable=Tn;T.mouseSelectionStyle=Kl;T.dragMovesSelection=ql;T.clickAddsSelectionRange=zl;T.decorations=di;T.atomicRanges=ir;T.bidiIsolatedRanges=_l;T.scrollMargins=Xl;T.darkTheme=Bs;T.cspNonce=D.define({combine:n=>n.length?n[0]:""});T.contentAttributes=tr;T.editorAttributes=Yl;T.lineWrapping=T.contentAttributes.of({class:"cm-lineWrapping"});T.announce=I.define();const jf=4096,mo={};class fn{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:J.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&xs(o,t)}return t}const Uf=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function Gf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function Yf(n,e,t){return va(ka(n.state),e,n,t)}let st=null;const _f=4e3;function Xf(n,e=Uf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Gf(y,e));for(let y=1;y{let w=st={view:C,prefix:k,scope:o};return setTimeout(()=>{st==w&&(st=null)},_f),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function va(n,e,t,i){let s=xc(e),r=ie(s,0),o=Oe(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;st&&st.view==t&&st.scope==i&&(l=st.prefix+" ",aa.indexOf(e.keyCode)<0&&(h=!0,st=null));let f=new Set,u=g=>{if(g){for(let y of g.run)if(!f.has(y)&&(f.add(y),y(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+Vi(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(p=ct[e.keyCode])&&p!=s?(u(d[l+Vi(p,e,!0)])||e.shiftKey&&(m=fi[e.keyCode])!=s&&m!=p&&u(d[l+Vi(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Vi(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class Ai{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=Sa(e);return[new Ai(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Qf(e,t,i)}}function Sa(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==J.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function wo(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:De.Text}}function Qf(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==J.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=Sa(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Os(n,i),p=Os(n,s),m=d.type==De.Text?d:null,g=p.type==De.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=wo(n,i,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=wo(n,s,g)),m&&g&&m.from==g.from)return k(C(t.from,t.to,m));{let x=m?C(t.from,null,m):w(d,!1),v=g?C(null,t.to,g):w(p,!0),O=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&x.bottom+n.defaultLineHeight/2Y&&be.from=re)break;_>ee&&W(Math.max(U,ee),x==null&&U<=Y,Math.min(_,re),v==null&&_>=se,we.dir)}if(ee=Ne.to+1,ee>=re)break}return L.length==0&&W(Y,x==null,se,v==null,n.textDirection),{top:E,bottom:P,horizontal:L}}function w(x,v){let O=l.top+(v?x.top:x.bottom);return{top:O,bottom:O,horizontal:[]}}}function Zf(n,e){return n.constructor==e.constructor&&n.eq(e)}class eu{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(tn)!=e.state.facet(tn)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,i=e.facet(tn);for(;t!Zf(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const tn=D.define();function Ca(n){return[fe.define(e=>new eu(e,n)),tn.of(n)]}const Aa=!M.ios,gi=D.define({combine(n){return Dt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Yg(n={}){return[gi.of(n),tu,iu,nu,Jl.of(!0)]}function Ma(n){return n.startState.facet(gi)!=n.state.facet(gi)}const tu=Ca({above:!0,markers(n){let{state:e}=n,t=e.facet(gi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||Aa:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Ai.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Ma(n);return t&&xo(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){xo(e.state,n)},class:"cm-cursorLayer"});function xo(n,e){e.style.animationDuration=n.facet(gi).cursorBlinkRate+"ms"}const iu=Ca({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Ai.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Ma(n)},class:"cm-selectionLayer"}),Da={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Aa&&(Da[".cm-line"].caretColor="transparent !important");const nu=Mt.highest(T.theme(Da)),Oa=I.define({map(n,e){return n==null?null:e.mapPos(n)}}),ri=ye.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Oa)?i.value:t,n)}}),su=fe.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(ri);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(ri)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(ri),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(ri)!=n&&this.view.dispatch({effects:Oa.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function _g(){return[ri,su]}function ko(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function ru(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class ou{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new vt,i=t.add.bind(t);for(let{from:s,to:r}of ru(e,this.maxLength))ko(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const Rs=/x/.unicode!=null?"gu":"g",lu=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Rs),au={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 Un=null;function hu(){var n;if(Un==null&&typeof document<"u"&&document.body){let e=document.body.style;Un=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Un||!1}const nn=D.define({combine(n){let e=Dt(n,{render:null,specialChars:lu,addSpecialChars:null});return(e.replaceTabs=!hu())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Rs)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Rs)),e}});function Xg(n={}){return[nn.of(n),cu()]}let vo=null;function cu(){return vo||(vo=fe.fromClass(class{constructor(n){this.view=n,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(nn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new ou({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ie(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=Ut(o.text,l,i-o.from);return B.replace({widget:new pu((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new du(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(nn);n.startState.facet(nn)!=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 fu="•";function uu(n){return n>=32?fu:n==10?"␤":String.fromCharCode(9216+n)}class du extends Ot{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=uu(this.code),i=e.state.phrase("Control character")+" "+(au[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 pu extends Ot{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 gu extends Ot{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}coordsAt(e){let t=e.firstChild?Wt(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=Dn(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Qg(n){return fe.fromClass(class{constructor(e){this.view=e,this.placeholder=n?B.set([B.widget({widget:new gu(n),side:1}).range(0)]):B.none}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Es=2e3;function mu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Es||t.off>Es||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=ds(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=ds(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function yu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function So(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>Es?-1:s==i.length?yu(n,e.clientX):Ut(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function bu(n,e){let t=So(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=So(n,s);if(!l)return i;let a=mu(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Zg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?bu(t,i):null)}const Wi="-10000px";class wu{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===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:M.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||xu}}}),Co=new WeakMap,Ta=fe.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Gn);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new wu(n,Ba,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Gn);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Wi,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{offsetParent:s}=this.manager.tooltipViews[0].dom;i=!!(s&&s!=this.container.ownerDocument.body)}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((s,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Gn).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1){c.style.top=Wi;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=Co.get(h))!==null&&e!==void 0?e:u.bottom-u.top,y=h.offset||vu,k=this.view.textDirection==J.LTR,C=u.width>i.right-i.left?k?i.left:i.right-u.width:k?Math.min(f.left-(d?14:0)+y.x,i.right-m):Math.max(i.left,f.left-m+(d?14:0)-y.x),w=!!a.above;!a.strictSide&&(w?f.top-(u.bottom-u.top)-y.yi.bottom)&&w==i.bottom-f.bottom>f.top-i.top&&(w=!w);let x=(w?f.top-i.top:i.bottom-f.bottom)-p;if(xC&&E.topv&&(v=w?E.top-g-2-p:E.bottom+p+2);if(this.position=="absolute"?(c.style.top=(v-n.parent.top)/r+"px",c.style.left=(C-n.parent.left)/s+"px"):(c.style.top=v/r+"px",c.style.left=C/s+"px"),d){let E=f.left+(k?y.x:-y.x)-(C+14-7);d.style.left=E/s+"px"}h.overlap!==!0&&o.push({left:C,top:v,right:O,bottom:v+g}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Wi}},{eventObservers:{scroll(){this.maybeMeasure()}}}),ku=T.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),vu={x:0,y:0},Ba=D.define({enables:[Ta,ku]});function Pa(n,e){let t=n.plugin(Ta);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Ao=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function un(n,e){let t=n.plugin(La),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const La=fe.fromClass(class{constructor(n){this.input=n.state.facet(dn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Ao);this.top=new zi(n,!0,e.topContainer),this.bottom=new zi(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Ao);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new zi(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new zi(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(dn);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>T.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class zi{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Mo(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Mo(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Mo(n){let e=n.nextSibling;return n.remove(),e}const dn=D.define({enables:La});class Ct extends kt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ct.prototype.elementClass="";Ct.prototype.toDOM=void 0;Ct.prototype.mapMode=ae.TrackBefore;Ct.prototype.startSide=Ct.prototype.endSide=-1;Ct.prototype.point=!0;const Su=D.define(),Cu=new class extends Ct{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Au=Su.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(Cu.range(s)))}return K.of(e)});function em(){return Au}const Mu=1024;let Du=0;class Te{constructor(e,t){this.from=e,this.to=t}}class R{constructor(e={}){this.id=Du++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ge.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}R.closedBy=new R({deserialize:n=>n.split(" ")});R.openedBy=new R({deserialize:n=>n.split(" ")});R.group=new R({deserialize:n=>n.split(" ")});R.contextHash=new R({perNode:!0});R.lookAhead=new R({perNode:!0});R.mounted=new R({perNode:!0});class mi{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[R.mounted.id]}}const Ou=Object.create(null);class ge{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Ou,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ge(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(R.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(R.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ge.none=new ge("",Object.create(null),0,8);class rr{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|j.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:ar(ge.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new V(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new V(ge.none,t,i,s)))}static build(e){return Lu(e)}}V.empty=new V(ge.none,[],[],0);class or{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new or(this.buffer,this.index)}}class Tt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ge.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function yi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Ra(s,i,f,f+c.length)){if(c instanceof Tt){if(r&j.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new $e(new Tu(o,c,e,f),null,u)}else if(r&j.IncludeAnonymous||!c.type.isAnonymous||lr(c)){let u;if(!(r&j.IgnoreMounts)&&(u=mi.get(c))&&!u.overlay)return new pe(u.tree,f,e,o);let d=new pe(c,f,e,o);return r&j.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&j.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&j.IgnoreOverlays)&&(s=mi.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new pe(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Oo(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Is(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Tu{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class $e extends Ea{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new $e(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&j.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new $e(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new $e(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new $e(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new V(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ia(n){if(!n.length)return null;if(n.length==1)return n[0];let e=0,t=n[0];for(let r=1;rt.from||o.to=e){let l=new pe(o.tree,o.overlay[0].from+r.from,0,null);(s||(s=[i])).push(yi(l,e,t,!1))}}return s?Ia(s):i}class pn{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof pe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&j.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&j.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&j.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&j.IncludeAnonymous||l instanceof Tt||!l.type.isAnonymous||lr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return Is(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function lr(n){return n.children.some(e=>e instanceof Tt||!e.type.isAnonymous||lr(e))}function Lu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Mu,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new or(t,t.length):t,a=i.types,h=0,c=0;function f(w,x,v,O,E){let{id:P,start:L,end:W,size:Y}=l,se=c;for(;Y<0;)if(l.next(),Y==-1){let we=r[P];v.push(we),O.push(L-w);return}else if(Y==-3){h=P;return}else if(Y==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let be=a[P],ee,re,Ne=L-w;if(W-L<=s&&(re=m(l.pos-x,E))){let we=new Uint16Array(re.size-re.skip),U=l.pos-re.size,_=we.length;for(;l.pos>U;)_=g(re.start,we,_);ee=new Tt(we,W-re.start,i),Ne=re.start-w}else{let we=l.pos-Y;l.next();let U=[],_=[],dt=P>=o?P:-1,Bt=0,Ti=W;for(;l.pos>we;)dt>=0&&l.id==dt&&l.size>=0?(l.end<=Ti-s&&(d(U,_,L,Bt,l.end,Ti,dt,se),Bt=U.length,Ti=l.end),l.next()):f(L,we,U,_,dt);if(dt>=0&&Bt>0&&Bt-1&&Bt>0){let Cr=u(be);ee=ar(be,U,_,0,U.length,0,W-L,Cr,Cr)}else ee=p(be,U,_,W-L,se-W)}v.push(ee),O.push(Ne)}function u(w){return(x,v,O)=>{let E=0,P=x.length-1,L,W;if(P>=0&&(L=x[P])instanceof V){if(!P&&L.type==w&&L.length==O)return L;(W=L.prop(R.lookAhead))&&(E=v[P]+L.length+W)}return p(w,x,v,O,E)}}function d(w,x,v,O,E,P,L,W){let Y=[],se=[];for(;w.length>O;)Y.push(w.pop()),se.push(x.pop()+v-E);w.push(p(i.types[L],Y,se,P-E,W-P)),x.push(E-v)}function p(w,x,v,O,E=0,P){if(h){let L=[R.contextHash,h];P=P?[L].concat(P):[L]}if(E>25){let L=[R.lookAhead,E];P=P?[L].concat(P):[L]}return new V(w,x,v,O,P)}function m(w,x){let v=l.fork(),O=0,E=0,P=0,L=v.end-s,W={size:0,start:0,skip:0};e:for(let Y=v.pos-w;v.pos>Y;){let se=v.size;if(v.id==x&&se>=0){W.size=O,W.start=E,W.skip=P,P+=4,O+=4,v.next();continue}let be=v.pos-se;if(se<0||be=o?4:0,re=v.start;for(v.next();v.pos>be;){if(v.size<0)if(v.size==-3)ee+=4;else break e;else v.id>=o&&(ee+=4);v.next()}E=re,O+=se,P+=ee}return(x<0||O==w)&&(W.size=O,W.start=E,W.skip=P),W.size>4?W:void 0}function g(w,x,v){let{id:O,start:E,end:P,size:L}=l;if(l.next(),L>=0&&O4){let Y=l.pos-(L-4);for(;l.pos>Y;)v=g(w,x,v)}x[--v]=W,x[--v]=P-w,x[--v]=E-w,x[--v]=O}else L==-3?h=O:L==-4&&(c=O);return v}let y=[],k=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,k,-1);let C=(e=n.length)!==null&&e!==void 0?e:y.length?k[0]+y[0].length:0;return new V(a[n.topID],y.reverse(),k.reverse(),C)}const To=new WeakMap;function sn(n,e){if(!n.isAnonymous||e instanceof Tt||e.type!=n)return 1;let t=To.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof V)){t=1;break}t+=sn(n,i)}To.set(e,t)}return t}function ar(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;v+=O}if(C==w+1){if(v>c){let O=p[w];d(O.children,O.positions,0,O.children.length,m[w]+k);continue}f.push(p[w])}else{let O=m[C-1]+p[C-1].length-x;f.push(ar(n,p,m,w,C,x,O,null,a))}u.push(x+k-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class tm{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof $e?this.setBuffer(e.context.buffer,e.index,t):e instanceof pe&&this.map.set(e.tree,t)}get(e){return e instanceof $e?this.getBuffer(e.context.buffer,e.index):e instanceof pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xe{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Xe(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Xe(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Te(s.from,s.to)):[new Te(0,0)]:[new Te(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Ru{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function im(n){return(e,t,i,s)=>new Iu(e,n,t,i,s)}class Bo{constructor(e,t,i,s,r){if(this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r,!r.length||r.some(o=>o.from>=o.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class Eu{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Ns=new R({perNode:!0});class Iu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new V(i.type,i.children,i.positions,i.length,i.propValues.concat([[Ns,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[R.mounted.id]=new mi(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Nu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Te(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Te(s.from,s.to)),a.fromnew Te(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Nu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Po(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let m=[],g=[];Po(o,h,p,m,g,u);let y=l[p+1],k=l[p+2],C=y+r==e.from&&k+r==e.to&&l[p]==e.type.id;return m.push(C?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],y,k-y)),g.push(y-u),Po(o,l[p+3],c,m,g,u),new V(f,m,g,d)}s.children[i]=a(0,l.length,ge.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class Lo{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(j.IncludeAnonymous|j.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,j.IgnoreOverlays|j.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof V)t=t.children[0];else break}return!1}}class Hu{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Ns))!==null&&t!==void 0?t:i.to,this.inner=new Lo(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Ns))!==null&&e!==void 0?e:t.to,this.inner=new Lo(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(R.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Ro(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Te(l,a.to))):a.to>l?t[r--]=new Te(l,a.to):t.splice(r--,1))}}return i}function Vu(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Te(u.from+i,u.to+i)),f=Vu(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Xe(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Xe(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let Wu=0;class ze{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=Wu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new ze([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new gn;return t=>t.modified.indexOf(e)>-1?t:gn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let zu=0;class gn{constructor(){this.instances=[],this.id=zu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&qu(t,l.modified));if(i)return i;let s=[],r=new ze(s,e,t);for(let l of t)l.instances.push(r);let o=Ku(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(gn.get(l,a));return r}}function qu(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Ku(n){let e=[[]];for(let t=0;ti.length-t.length)}function $u(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new mn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Fa.add(e)}const Fa=new R;class mn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function ju(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Uu(n,e,t,i=0,s=n.length){let r=new Gu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Gu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Ju(e)||mn.empty,f=ju(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(R.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let k=g=C||!e.nextSibling())););if(!k||C>i)break;y=k.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,k.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Ju(n){let e=n.type.prop(Fa);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const S=ze.define,Ki=S(),it=S(),Io=S(it),No=S(it),nt=S(),$i=S(nt),Jn=S(nt),We=S(),pt=S(We),He=S(),Ve=S(),Fs=S(),Qt=S(Fs),ji=S(),A={comment:Ki,lineComment:S(Ki),blockComment:S(Ki),docComment:S(Ki),name:it,variableName:S(it),typeName:Io,tagName:S(Io),propertyName:No,attributeName:S(No),className:S(it),labelName:S(it),namespace:S(it),macroName:S(it),literal:nt,string:$i,docString:S($i),character:S($i),attributeValue:S($i),number:Jn,integer:S(Jn),float:S(Jn),bool:S(nt),regexp:S(nt),escape:S(nt),color:S(nt),url:S(nt),keyword:He,self:S(He),null:S(He),atom:S(He),unit:S(He),modifier:S(He),operatorKeyword:S(He),controlKeyword:S(He),definitionKeyword:S(He),moduleKeyword:S(He),operator:Ve,derefOperator:S(Ve),arithmeticOperator:S(Ve),logicOperator:S(Ve),bitwiseOperator:S(Ve),compareOperator:S(Ve),updateOperator:S(Ve),definitionOperator:S(Ve),typeOperator:S(Ve),controlOperator:S(Ve),punctuation:Fs,separator:S(Fs),bracket:Qt,angleBracket:S(Qt),squareBracket:S(Qt),paren:S(Qt),brace:S(Qt),content:We,heading:pt,heading1:S(pt),heading2:S(pt),heading3:S(pt),heading4:S(pt),heading5:S(pt),heading6:S(pt),contentSeparator:S(We),list:S(We),quote:S(We),emphasis:S(We),strong:S(We),link:S(We),monospace:S(We),strikethrough:S(We),inserted:S(),deleted:S(),changed:S(),invalid:S(),meta:ji,documentMeta:S(ji),annotation:S(ji),processingInstruction:S(ji),definition:ze.defineModifier(),constant:ze.defineModifier(),function:ze.defineModifier(),standard:ze.defineModifier(),local:ze.defineModifier(),special:ze.defineModifier()};Ha([{tag:A.link,class:"tok-link"},{tag:A.heading,class:"tok-heading"},{tag:A.emphasis,class:"tok-emphasis"},{tag:A.strong,class:"tok-strong"},{tag:A.keyword,class:"tok-keyword"},{tag:A.atom,class:"tok-atom"},{tag:A.bool,class:"tok-bool"},{tag:A.url,class:"tok-url"},{tag:A.labelName,class:"tok-labelName"},{tag:A.inserted,class:"tok-inserted"},{tag:A.deleted,class:"tok-deleted"},{tag:A.literal,class:"tok-literal"},{tag:A.string,class:"tok-string"},{tag:A.number,class:"tok-number"},{tag:[A.regexp,A.escape,A.special(A.string)],class:"tok-string2"},{tag:A.variableName,class:"tok-variableName"},{tag:A.local(A.variableName),class:"tok-variableName tok-local"},{tag:A.definition(A.variableName),class:"tok-variableName tok-definition"},{tag:A.special(A.variableName),class:"tok-variableName2"},{tag:A.definition(A.propertyName),class:"tok-propertyName tok-definition"},{tag:A.typeName,class:"tok-typeName"},{tag:A.namespace,class:"tok-namespace"},{tag:A.className,class:"tok-className"},{tag:A.macroName,class:"tok-macroName"},{tag:A.propertyName,class:"tok-propertyName"},{tag:A.operator,class:"tok-operator"},{tag:A.comment,class:"tok-comment"},{tag:A.meta,class:"tok-meta"},{tag:A.invalid,class:"tok-invalid"},{tag:A.punctuation,class:"tok-punctuation"}]);var Yn;const bt=new R;function Va(n){return D.define({combine:n?e=>e.concat(n):void 0})}const Yu=new R;class Be{constructor(e,t,i=[],s=""){this.data=e,this.name=s,F.prototype.hasOwnProperty("tree")||Object.defineProperty(F.prototype,"tree",{get(){return me(this)}}),this.parser=t,this.extension=[$t.of(this),F.languageData.of((r,o,l)=>{let a=Fo(r,o,l),h=a.type.prop(bt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Yu);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return Fo(e,t,i).type.prop(bt)==this.data}findRegions(e){let t=e.facet($t);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(bt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(R.mounted);if(l){if(l.tree.prop(bt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Hs(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function me(n){let e=n.field(Be.state,!1);return e?e.tree:V.empty}class _u{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Zt=null;class qt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new qt(e,t,[],V.empty,0,i,[],null)}startParse(){return this.parser.startParse(new _u(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=V.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Xe.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Zt;Zt=this;try{return e()}finally{Zt=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ho(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Xe.applyChanges(i,a),s=V.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Ho(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Na{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Zt;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new V(ge.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Zt}}function Ho(n,e,t){return Xe.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Kt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Kt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=qt.create(e.facet($t).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Kt(i)}}Be.state=ye.define({create:Kt.init,update(n,e){for(let t of e.effects)if(t.is(Be.setState))return t.value;return e.startState.facet($t)!=e.state.facet($t)?Kt.init(e.state):n.apply(e)}});let Wa=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Wa=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const _n=typeof navigator<"u"&&(!((Yn=navigator.scheduling)===null||Yn===void 0)&&Yn.isInputPending)?()=>navigator.scheduling.isInputPending():null,Xu=fe.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Be.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Wa(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>_n&&_n()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Be.setState.of(new Kt(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Je(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),$t=D.define({combine(n){return n.length?n[0]:null},enables:n=>[Be.state,Xu,T.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class sm{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const za=D.define(),Bn=D.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function At(n){let e=n.facet(Bn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function yn(n,e){let t="",i=n.tabSize,s=n.facet(Bn)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?Zu(n,t,e):null}class Pn{constructor(e,t={}){this.state=e,this.options=t,this.unit=At(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Ut(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Qu=new R;function Zu(n,e,t){let i=e.resolveStack(t),s=i.node.enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return Ka(i,n,t)}function Ka(n,e,t){for(let i=n;i;i=i.next){let s=td(i.node);if(s)return s(hr.create(e,t,i))}return 0}function ed(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function td(n){let e=n.type.prop(Qu);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(R.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>$a(o,!0,1,void 0,r&&!ed(o)?s.from:void 0)}return n.parent==null?id:null}function id(){return 0}class hr extends Pn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new hr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(nd(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return Ka(this.context.next,this.base,this.pos)}}function nd(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function sd(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from$a(i,e,t,n)}function $a(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?sd(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const om=n=>n.baseIndent;function lm({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const am=new R;function hm(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(bt)==o.data:o?l=>l==o:void 0,this.style=Ha(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ht(i):null,this.themeType=t.themeType}static define(e,t){return new Ln(e,t||{})}}const Vs=D.define(),ja=D.define({combine(n){return n.length?[n[0]]:null}});function Xn(n){let e=n.facet(Vs);return e.length?e:n.facet(ja)}function cm(n,e){let t=[od],i;return n instanceof Ln&&(n.module&&t.push(T.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(ja.of(n)):i?t.push(Vs.computeN([T.darkTheme],s=>s.facet(T.darkTheme)==(i=="dark")?[n]:[])):t.push(Vs.of(n)),t}class rd{constructor(e){this.markCache=Object.create(null),this.tree=me(e.state),this.decorations=this.buildDeco(e,Xn(e.state))}update(e){let t=me(e.state),i=Xn(e.state),s=i!=Xn(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=B.mark({class:a})))},s,r);return i.finish()}}const od=Mt.high(fe.fromClass(rd,{decorations:n=>n.decorations})),fm=Ln.define([{tag:A.meta,color:"#404740"},{tag:A.link,textDecoration:"underline"},{tag:A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:A.emphasis,fontStyle:"italic"},{tag:A.strong,fontWeight:"bold"},{tag:A.strikethrough,textDecoration:"line-through"},{tag:A.keyword,color:"#708"},{tag:[A.atom,A.bool,A.url,A.contentSeparator,A.labelName],color:"#219"},{tag:[A.literal,A.inserted],color:"#164"},{tag:[A.string,A.deleted],color:"#a11"},{tag:[A.regexp,A.escape,A.special(A.string)],color:"#e40"},{tag:A.definition(A.variableName),color:"#00f"},{tag:A.local(A.variableName),color:"#30a"},{tag:[A.typeName,A.namespace],color:"#085"},{tag:A.className,color:"#167"},{tag:[A.special(A.variableName),A.macroName],color:"#256"},{tag:A.definition(A.propertyName),color:"#00c"},{tag:A.comment,color:"#940"},{tag:A.invalid,color:"#f00"}]),ld=T.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ua=1e4,Ga="()[]{}",Ja=D.define({combine(n){return Dt(n,{afterCursor:!0,brackets:Ga,maxScanDistance:Ua,renderMatch:cd})}}),ad=B.mark({class:"cm-matchingBracket"}),hd=B.mark({class:"cm-nonmatchingBracket"});function cd(n){let e=[],t=n.matched?ad:hd;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const fd=ye.define({create(){return B.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Ja);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=je(e.state,s.head,-1,i)||s.head>0&&je(e.state,s.head-1,1,i)||i.afterCursor&&(je(e.state,s.head,1,i)||s.headT.decorations.from(n)}),ud=[fd,ld];function um(n={}){return[Ja.of(n),ud]}const dd=new R;function Ws(n,e,t){let i=n.prop(e<0?R.openedBy:R.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function zs(n){let e=n.type.prop(dd);return e?e(n.node):n}function je(n,e,t,i={}){let s=i.maxScanDistance||Ua,r=i.brackets||Ga,o=me(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Ws(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return pd(n,e,t,a,c,h,r)}}return gd(n,e,t,o,l.type,s,r)}function pd(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Vo(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function md(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||yd,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||fr}}function yd(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Wo=new WeakMap;class _a extends Be{constructor(e){let t=Va(e.languageData),i=md(e),s,r=new class extends Na{createParse(o,l,a){return new wd(s,o,l,a)}};super(t,r,[za.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=vd(t),s=this,this.streamParser=i,this.stateAfter=new R({perNode:!0}),this.tokenTable=e.tokenTable?new eh(i.tokenTable):kd}static define(e){return new _a(e)}getIndent(e,t){let i=me(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Wo.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof V&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&cr(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Xa(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?At(i):4),tree:V.empty}}class wd{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=qt.get(),o=s[0].from,{state:l,tree:a}=bd(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +`&&(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].to1){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 Ya(t,e?e.state.tabSize:4,e?At(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Qa(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.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const fr=Object.create(null),bi=[ge.none],xd=new rr(bi),zo=[],Za=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"]])Za[n]=th(fr,e);class eh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Za)}resolve(e){return e?this.table[e]||(this.table[e]=th(this.extra,e)):0}}const kd=new eh(fr);function Qn(n,e){zo.indexOf(n)>-1||(zo.push(n),console.warn(e))}function th(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||A[r];o?typeof o=="function"?t?t=o(t):Qn(r,`Modifier ${r} used at start of tag`):t?Qn(r,`Tag ${r} used as modifier`):t=o:Qn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=ge.define({id:bi.length,name:i,props:[$u({[i]:t})]});return bi.push(s),s.id}function vd(n){let e=ge.define({id:bi.length,name:"Document",props:[bt.add(()=>n)],top:!0});return bi.push(e),e}const Sd=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=dr(n.state,t.from);return i.line?Cd(n):i.block?Md(n):!1};function ur(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 Cd=ur(Td,0),Ad=ur(ih,0),Md=ur((n,e)=>ih(n,e,Od(e)),0);function dr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ei=50;function Dd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-ei,i),o=n.sliceDoc(s,s+ei),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*ei?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+ei),f=n.sliceDoc(s-ei,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 Od(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+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function ih(n,e,t=e.selection.ranges){let i=t.map(r=>dr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Dd(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;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const qs=tt.define(),Bd=tt.define(),Pd=D.define(),nh=D.define({combine(n){return Dt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function Ld(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const sh=ye.define({create(){return Ue.empty},update(n,e){let t=e.state.facet(nh),i=e.annotation(qs);if(i){let a=e.docChanged?b.single(Ld(e.changes)):void 0,h=ke.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=bn(f,f.length,t.minDepth,h):f=lh(f,e.startState.selection),new Ue(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(Bd);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(Z.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=ke.fromTransaction(e),o=e.annotation(Z.time),l=e.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ue(n.done.map(ke.fromJSON),n.undone.map(ke.fromJSON))}});function dm(n={}){return[sh,nh.of(n),T.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?rh:e.inputType=="historyRedo"?Ks:null;return i?(e.preventDefault(),i(t)):!1}})]}function Rn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(sh,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const rh=Rn(0,!1),Ks=Rn(1,!1),Rd=Rn(0,!0),Ed=Rn(1,!0);class ke{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new ke(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new ke(e.changes&&Q.fromJSON(e.changes),[],e.mapped&&Ge.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Pe;for(let s of e.startState.facet(Pd)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new ke(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Pe)}static selection(e){return new ke(void 0,Pe,void 0,void 0,e)}}function bn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Id(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Nd(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function oh(n,e){return n.length?e.length?n.concat(e):n:e}const Pe=[],Fd=200;function lh(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Fd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),bn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ke.selection([e])]}function Hd(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Zn(n,e){if(!n.length)return n;let t=n.length,i=Pe;for(;t;){let s=Vd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[ke.selection(i)]:Pe}function Vd(n,e,t){let i=oh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Pe,t);if(!n.changes)return ke.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ke(s,I.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const Wd=/^(input\.type|delete)($|\.)/;class Ue{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ue(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Wd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):En(t,e))}function ue(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const hh=n=>ah(n,!ue(n)),ch=n=>ah(n,ue(n));function fh(n,e){return Ie(n,t=>t.empty?n.moveByGroup(t,e):En(t,e))}const zd=n=>fh(n,!ue(n)),qd=n=>fh(n,ue(n));function Kd(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function In(n,e,t){let i=me(n).resolveInner(e.head),s=t?R.closedBy:R.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Kd(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?je(n,i.from,1):je(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const $d=n=>Ie(n,e=>In(n.state,e,!ue(n))),jd=n=>Ie(n,e=>In(n.state,e,ue(n)));function uh(n,e){return Ie(n,t=>{if(!t.empty)return En(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const dh=n=>uh(n,!1),ph=n=>uh(n,!0);function gh(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):En(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottommh(n,!1),$s=n=>mh(n,!0);function ut(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const Ud=n=>Ie(n,e=>ut(n,e,!0)),Gd=n=>Ie(n,e=>ut(n,e,!1)),Jd=n=>Ie(n,e=>ut(n,e,!ue(n))),Yd=n=>Ie(n,e=>ut(n,e,ue(n))),_d=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),Xd=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function Qd(n,e,t){let i=!1,s=Gt(n.selection,r=>{let o=je(n,r.head,-1)||je(n,r.head,1)||r.head>0&&je(n,r.head-1,1)||r.headQd(n,e,!1);function Re(n,e){let t=Gt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(_e(n.state,t)),!0)}function yh(n,e){return Re(n,t=>n.moveByChar(t,e))}const bh=n=>yh(n,!ue(n)),wh=n=>yh(n,ue(n));function xh(n,e){return Re(n,t=>n.moveByGroup(t,e))}const ep=n=>xh(n,!ue(n)),tp=n=>xh(n,ue(n)),ip=n=>Re(n,e=>In(n.state,e,!ue(n))),np=n=>Re(n,e=>In(n.state,e,ue(n)));function kh(n,e){return Re(n,t=>n.moveVertically(t,e))}const vh=n=>kh(n,!1),Sh=n=>kh(n,!0);function Ch(n,e){return Re(n,t=>n.moveVertically(t,e,gh(n).height))}const Ko=n=>Ch(n,!1),$o=n=>Ch(n,!0),sp=n=>Re(n,e=>ut(n,e,!0)),rp=n=>Re(n,e=>ut(n,e,!1)),op=n=>Re(n,e=>ut(n,e,!ue(n))),lp=n=>Re(n,e=>ut(n,e,ue(n))),ap=n=>Re(n,e=>b.cursor(n.lineBlockAt(e.head).from)),hp=n=>Re(n,e=>b.cursor(n.lineBlockAt(e.head).to)),jo=({state:n,dispatch:e})=>(e(_e(n,{anchor:0})),!0),Uo=({state:n,dispatch:e})=>(e(_e(n,{anchor:n.doc.length})),!0),Go=({state:n,dispatch:e})=>(e(_e(n,{anchor:n.selection.main.anchor,head:0})),!0),Jo=({state:n,dispatch:e})=>(e(_e(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),cp=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),fp=({state:n,dispatch:e})=>{let t=Nn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},up=({state:n,dispatch:e})=>{let t=Gt(n.selection,i=>{var s;let r=me(n).resolveStack(i.from,1);for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&(!((s=l.parent)===null||s===void 0)&&s.parent))return b.range(l.to,l.from)}return i});return e(_e(n,t)),!0},dp=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(_e(n,i)),!0):!1};function Mi(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=Ui(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Ui(n,o,!1),l=Ui(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const Ah=(n,e)=>Mi(n,t=>{let i=t.from,{state:s}=n,r=s.doc.lineAt(i),o,l;if(!e&&i>r.from&&iAh(n,!1),Mh=n=>Ah(n,!0),Dh=(n,e)=>Mi(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ce(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),Oh=n=>Dh(n,!1),pp=n=>Dh(n,!0),gp=n=>Mi(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headMi(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),yp=n=>Mi(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:N.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},wp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ce(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ce(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Nn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Th(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Nn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const xp=({state:n,dispatch:e})=>Th(n,e,!1),kp=({state:n,dispatch:e})=>Th(n,e,!0);function Bh(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Nn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const vp=({state:n,dispatch:e})=>Bh(n,e,!1),Sp=({state:n,dispatch:e})=>Bh(n,e,!0),Cp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Nn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Ap(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=me(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(R.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Mp=Ph(!1),Dp=Ph(!0);function Ph(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Ap(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Pn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=qa(h,r);for(c==null&&(c=Ut(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Op=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Pn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=pr(n,(r,o,l)=>{let a=qa(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=yn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(pr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Bn)})}),{userEvent:"input.indent"})),!0),Bp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(pr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Ut(s,n.tabSize),o=0,l=yn(n,Math.max(0,r-At(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),gm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$d,shift:ip},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:jd,shift:np},{key:"Alt-ArrowUp",run:xp},{key:"Shift-Alt-ArrowUp",run:vp},{key:"Alt-ArrowDown",run:kp},{key:"Shift-Alt-ArrowDown",run:Sp},{key:"Escape",run:dp},{key:"Mod-Enter",run:Dp},{key:"Alt-l",mac:"Ctrl-l",run:fp},{key:"Mod-i",run:up,preventDefault:!0},{key:"Mod-[",run:Bp},{key:"Mod-]",run:Tp},{key:"Mod-Alt-\\",run:Op},{key:"Shift-Mod-k",run:Cp},{key:"Shift-Mod-\\",run:Zd},{key:"Mod-/",run:Sd},{key:"Alt-A",run:Ad}].concat(Lp);function oe(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class jt{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Yo(l)):Yo,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ie(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Ys(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Oe(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=wn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Ht(t,e.sliceString(t,i));return es.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=wn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ht.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Eh.prototype[Symbol.iterator]=Ih.prototype[Symbol.iterator]=function(){return this});function Rp(n){try{return new RegExp(n,gr),!0}catch{return!1}}function wn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Us(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=oe("input",{class:"cm-textfield",name:"line",value:e}),i=oe("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:xn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},oe("label",n.state.phrase("Go to line"),": ",t)," ",oe("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=r,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),m=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[xn.of(!1),T.scrollIntoView(m.from,{y:"center"})],selection:m}),n.focus()}return{dom:i}}const xn=I.define(),_o=ye.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(xn)&&(n=t.value);return n},provide:n=>dn.from(n,e=>e?Us:null)}),Ep=n=>{let e=un(n,Us);if(!e){let t=[xn.of(!0)];n.state.field(_o,!1)==null&&t.push(I.appendConfig.of([_o,Ip])),n.dispatch({effects:t}),e=un(n,Us)}return e&&e.dom.querySelector("input").select(),!0},Ip=T.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Np={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Nh=D.define({combine(n){return Dt(n,Np,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function mm(n){let e=[zp,Wp];return n&&e.push(Nh.of(n)),e}const Fp=B.mark({class:"cm-selectionMatch"}),Hp=B.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Xo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=$.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=$.Word)}function Vp(n,e,t,i){return n(e.sliceDoc(t,t+1))==$.Word&&n(e.sliceDoc(i-1,i))==$.Word}const Wp=fe.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Nh),{state:t}=n,i=t.selection;if(i.ranges.length>1)return B.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return B.none;let a=t.wordAt(s.head);if(!a)return B.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return B.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Xo(o,t,s.from,s.to)&&Vp(o,t,s.from,s.to)))return B.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return B.none}let l=[];for(let a of n.visibleRanges){let h=new jt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Xo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Hp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Fp.range(c,f)),l.length>e.maxMatches))return B.none}}return B.set(l)}},{decorations:n=>n.decorations}),zp=T.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),qp=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Kp(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new jt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new jt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const $p=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return qp({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Kp(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:T.scrollIntoView(s.to)})),!0):!1},Jt=D.define({combine(n){return Dt(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new tg(e),scrollToMatch:e=>T.scrollIntoView(e)})}});class Fh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Rp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`: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 Jp(this):new Up(this)}getCursor(e,t=0,i){let s=e.doc?e:F.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Rt(this,s,t,i):Lt(this,s,t,i)}}class Hh{constructor(e){this.spec=e}}function Lt(n,e,t,i){return new jt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?jp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function jp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Lt(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 Rt(n,e,t,i){return new Eh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Gp(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function kn(n,e){return n.slice(ce(n,e,!1),e)}function vn(n,e){return n.slice(e,ce(n,e))}function Gp(n){return(e,t,i)=>!i[0].length||(n(kn(i.input,i.index))!=$.Word||n(vn(i.input,i.index))!=$.Word)&&(n(vn(i.input,i.index+i[0].length))!=$.Word||n(kn(i.input,i.index+i[0].length))!=$.Word)}class Jp extends Hh{nextMatch(e,t,i){let s=Rt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Rt(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=Rt(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=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Rt(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 wi=I.define(),mr=I.define(),lt=ye.define({create(n){return new ts(Gs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(wi)?n=new ts(t.value.create(),n.panel):t.is(mr)&&(n=new ts(n.query,t.value?yr:null));return n},provide:n=>dn.from(n,e=>e.panel)});class ts{constructor(e,t){this.query=e,this.panel=t}}const Yp=B.mark({class:"cm-searchMatch"}),_p=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Xp=fe.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(lt))}update(n){let e=n.state.field(lt);(e!=n.startState.field(lt)||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 vt;for(let s=0,r=t.visibleRanges,o=r.length;sr[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?_p:Yp)})}return i.finish()}},{decorations:n=>n.decorations});function Di(n){return e=>{let t=e.state.field(lt,!1);return t&&t.query.spec.valid?n(e,t):zh(e)}}const Sn=Di((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(Jt);return n.dispatch({selection:s,effects:[br(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Wh(n),!0}),Cn=Di((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(Jt);return n.dispatch({selection:r,effects:[br(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),Wh(n),!0}),Qp=Di((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)}),Zp=({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 jt(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),userEvent:"select.search.matches"})),!0},Qo=Di((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(T.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-c,r.to-c),h.push(br(n,r)),h.push(t.facet(Jt).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),eg=Di((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:T.announce.of(i),userEvent:"input.replace.all"}),!0});function yr(n){return n.state.facet(Jt).createPanel(n)}function Gs(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(Jt);return new Fh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Vh(n){let e=un(n,yr);return e&&e.dom.querySelector("[main-field]")}function Wh(n){let e=Vh(n);e&&e==n.root.activeElement&&e.select()}const zh=n=>{let e=n.state.field(lt,!1);if(e&&e.panel){let t=Vh(n);if(t&&t!=n.root.activeElement){let i=Gs(n.state,e.query.spec);i.valid&&n.dispatch({effects:wi.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[mr.of(!0),e?wi.of(Gs(n.state,e.query.spec)):I.appendConfig.of(ng)]});return!0},qh=n=>{let e=n.state.field(lt,!1);if(!e||!e.panel)return!1;let t=un(n,yr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:mr.of(!1)}),!0},ym=[{key:"Mod-f",run:zh,scope:"editor search-panel"},{key:"F3",run:Sn,shift:Cn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Sn,shift:Cn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:qh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Zp},{key:"Alt-g",run:Ep},{key:"Mod-d",run:$p,preventDefault:!0}];class tg{constructor(e){this.view=e;let t=this.query=e.state.field(lt).query.spec;this.commit=this.commit.bind(this),this.searchField=oe("input",{value:t.search,placeholder:Se(e,"Find"),"aria-label":Se(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=oe("input",{value:t.replace,placeholder:Se(e,"Replace"),"aria-label":Se(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=oe("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=oe("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=oe("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return oe("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=oe("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>Sn(e),[Se(e,"next")]),i("prev",()=>Cn(e),[Se(e,"previous")]),i("select",()=>Qp(e),[Se(e,"all")]),oe("label",null,[this.caseField,Se(e,"match case")]),oe("label",null,[this.reField,Se(e,"regexp")]),oe("label",null,[this.wordField,Se(e,"by word")]),...e.state.readOnly?[]:[oe("br"),this.replaceField,i("replace",()=>Qo(e),[Se(e,"replace")]),i("replaceAll",()=>eg(e),[Se(e,"replace all")])],oe("button",{name:"close",onclick:()=>qh(e),"aria-label":Se(e,"close"),type:"button"},["×"])])}commit(){let e=new Fh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:wi.of(e)}))}keydown(e){Yf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Cn:Sn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Qo(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(wi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Jt).top}}function Se(n,e){return n.state.phrase(e)}const Gi=30,Ji=/[\s\.,:;?!]/;function br(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Gi),o=Math.min(s,t+Gi),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Gi;a--)if(!Ji.test(l[a-1])&&Ji.test(l[a])){l=l.slice(0,a);break}}return T.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const ig=T.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ng=[lt,Mt.low(Xp),ig];class Kh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=me(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search($h(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Zo(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function sg(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:sg(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function bm(n,e){return t=>{for(let i=me(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class el{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function at(n){return n.selection.main.from}function $h(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const jh=tt.define();function og(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:b.cursor(l.from+r+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const tl=new WeakMap;function lg(n){if(!Array.isArray(n))return n;let e=tl.get(n);return e||tl.set(n,e=rg(n)),e}const wr=I.define(),xi=I.define();class ag{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(v=Ys(x))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!k||O==1&&g||w==0&&O!=0)&&(t[f]==x||i[f]==x&&(u=!0)?o[f++]=k:o.length&&(y=!1)),w=O,k+=Oe(x)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Oe(ie(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const ve=D.define({combine(n){return Dt(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:hg,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>il(e(i),t(i)),optionClass:(e,t)=>i=>il(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function il(n,e){return n?e?n+" "+e:n:e}function hg(n,e,t,i,s,r){let o=n.textDirection==J.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u=m||k>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function cg(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function nl(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class fg{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(ve);this.optionContent=cg(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=nl(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ve).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:xi.of(null)})}),this.list=this.dom.appendChild(this.createListBox(r,s.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=nl(t.options.length,t.selected,this.view.state.facet(ve).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Je(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&dg(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew fg(t,n,e)}function dg(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function sl(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function pg(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new el(c,a.source,h?h(c):[],1e9-t.length));else{let c=new ag(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new el(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):sl(a.completion)>sl(o)&&(r[r.length-1]=a),o=a.completion}return r}class Et{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Et(this.options,rl(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=pg(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Et(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(ve).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:ug(Ae,Jh),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Et(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class An{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new An(yg,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(ve),r=(i.override||t.languageDataAt("autocomplete",at(t)).map(lg)).map(l=>(this.active.find(h=>h.source==l)||new xe(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!gg(r,this.active)?o=Et.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new xe(l.source,0):l));for(let l of e.effects)l.is(Gh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new An(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:mg}}function gg(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const yg=[];function Js(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class xe{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Js(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new xe(s.source,0));for(let r of e.effects)if(r.is(wr))s=new xe(s.source,1,r.value?at(e.state):-1);else if(r.is(xi))s=new xe(s.source,0);else if(r.is(Uh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new xe(this.source,1)}handleChange(e){return e.changes.touchesRange(at(e.startState))?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new xe(this.source,this.state,e.mapPos(this.explicitPos))}}class Vt extends xe{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=at(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&at(e.startState)==this.from)return new xe(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return bg(this.result.validFor,e.state,r,o)?new Vt(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Kh(e.state,l,a>=0)))?new Vt(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:at(e.state)):new xe(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Vt(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function bg(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):$h(n,!0).test(s)}const Uh=I.define({map(n,e){return n.map(t=>t.map(e))}}),Gh=I.define(),Ae=ye.define({create(){return An.start()},update(n,e){return n.update(e)},provide:n=>[Ba.from(n,e=>e.tooltip),T.contentAttributes.from(n,e=>e.attrs)]});function Jh(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Ae).active.find(s=>s.source==e.source);return i instanceof Vt?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},og(n.state,t,i.from,i.to)),{annotations:jh.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}function Yi(n,e="option"){return t=>{let i=t.state.field(Ae,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Gh.of(l)}),!0}}const wg=n=>{let e=n.state.field(Ae,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Ae,!1)?(n.dispatch({effects:wr.of(!0)}),!0):!1,kg=n=>{let e=n.state.field(Ae,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:xi.of(null)}),!0)};class vg{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const ol=50,Sg=50,Cg=1e3,Ag=fe.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Ae).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ae);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ae)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Js(i));for(let i=0;iSg&&Date.now()-s.time>Cg){for(let r of s.context.abortListeners)try{r()}catch(o){Je(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),ol):-1,this.composing!=0)for(let i of n.transactions)Js(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Ae);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=at(e),i=new Kh(e,t,n.explicitPos==t),s=new vg(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:xi.of(null)}),Je(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),ol))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ve);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new xe(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Uh.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Ae,!1);if(e&&e.tooltip&&this.view.state.facet(ve).closeOnBlur){let t=e.open&&Pa(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:xi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:wr.of(!1)}),20),this.composing=0}}}),Yh=T.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Mg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class xr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ae.TrackDel),i=e.mapPos(this.to,1,ae.TrackDel);return t==null||i==null?null:new xr(this.field,t,i)}}class kr{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew xr(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new Mg(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new kr(i,s)}}let Dg=B.widget({widget:new class extends Ot{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),Og=B.mark({class:"cm-snippetField"});class Yt{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?Dg:Og).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Yt(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Oi=I.define({map(n,e){return n&&n.map(e)}}),Tg=I.define(),ki=ye.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Oi))return t.value;if(t.is(Tg)&&n)return new Yt(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>T.decorations.from(n,e=>e?e.deco:B.none)});function vr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function Bg(n){let e=kr.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:N.of(o)},scrollIntoView:!0,annotations:i?jh.of(i):void 0};if(l.length&&(a.selection=vr(l,0)),l.length>1){let h=new Yt(l,0),c=a.effects=[Oi.of(h)];t.state.field(ki,!1)===void 0&&c.push(I.appendConfig.of([ki,Ig,Ng,Yh]))}t.dispatch(t.state.update(a))}}function _h(n){return({state:e,dispatch:t})=>{let i=e.field(ki,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:vr(i.ranges,s),effects:Oi.of(r?null:new Yt(i.ranges,s)),scrollIntoView:!0})),!0}}const Pg=({state:n,dispatch:e})=>n.field(ki,!1)?(e(n.update({effects:Oi.of(null)})),!0):!1,Lg=_h(1),Rg=_h(-1),Eg=[{key:"Tab",run:Lg,shift:Rg},{key:"Escape",run:Pg}],ll=D.define({combine(n){return n.length?n[0]:Eg}}),Ig=Mt.highest(sr.compute([ll],n=>n.facet(ll)));function wm(n,e){return Object.assign(Object.assign({},e),{apply:Bg(n)})}const Ng=T.domEventHandlers({mousedown(n,e){let t=e.state.field(ki,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:vr(t.ranges,s.field),effects:Oi.of(t.ranges.some(r=>r.field>s.field)?new Yt(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),vi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},wt=I.define({map(n,e){let t=e.mapPos(n,-1,ae.TrackAfter);return t??void 0}}),Sr=new class extends kt{};Sr.startSide=1;Sr.endSide=-1;const Xh=ye.define({create(){return K.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=K.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(wt)&&(n=n.update({add:[Sr.range(t.value,t.value+1)]}));return n}});function xm(){return[Hg,Xh]}const is="()[]{}<>";function Qh(n){for(let e=0;e{if((Fg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Oe(ie(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Wg(n.state,i);return r?(n.dispatch(r),!0):!1}),Vg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Zh(n,n.selection.main.head).brackets||vi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=zg(n.doc,o.head);for(let a of i)if(a==l&&Fn(n.doc,o.head)==Qh(ie(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},km=[{key:"Backspace",run:Vg}];function Wg(n,e){let t=Zh(n,n.selection.main.head),i=t.brackets||vi.brackets;for(let s of i){let r=Qh(ie(s,0));if(e==s)return r==s?$g(n,s,i.indexOf(s+s+s)>-1,t):qg(n,s,r,t.before||vi.before);if(e==r&&ec(n,n.selection.main.from))return Kg(n,s,r)}return null}function ec(n,e){let t=!1;return n.field(Xh).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Fn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Oe(ie(t,0)))}function zg(n,e){let t=n.sliceString(e-2,e);return Oe(ie(t,0))==t.length?t:t.slice(1)}function qg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:wt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Fn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:wt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Kg(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Fn(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function $g(n,e,t,i){let s=i.stringPrefixes||vi.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:wt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Fn(n.doc,a),c;if(h==e){if(al(n,a))return{changes:{insert:e+e,from:a},effects:wt.of(a+e.length),range:b.cursor(a+e.length)};if(ec(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=hl(n,a-2*e.length,s))>-1&&al(n,c))return{changes:{insert:e+e+e+e,from:a},effects:wt.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=$.Word&&hl(n,a,s)>-1&&!jg(n,a,e,s))return{changes:{insert:e+e,from:a},effects:wt.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function al(n,e){let t=me(n).resolveInner(e+1);return t.parent&&t.from==e}function jg(n,e,t,i){let s=me(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function hl(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=$.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=$.Word)return r}return-1}function vm(n={}){return[Ae,ve.of(n),Ag,Gg,Yh]}const Ug=[{key:"Ctrl-Space",run:xg},{key:"Escape",run:kg},{key:"ArrowDown",run:Yi(!0)},{key:"ArrowUp",run:Yi(!1)},{key:"PageDown",run:Yi(!0,"page")},{key:"PageUp",run:Yi(!1,"page")},{key:"Enter",run:wg}],Gg=Mt.highest(sr.computeN([ve],n=>n.facet(ve).defaultKeymap?[Ug]:[]));export{lm as A,am as B,Mn as C,Mu as D,T as E,hm as F,sm as G,me as H,j as I,tm as J,bm as K,Hs as L,rg as M,rr as N,b as O,Na as P,wm as Q,om as R,_a as S,V as T,rm as U,Yu as V,Va as W,dd as X,F as a,Xg as b,dm as c,Yg as d,_g as e,um as f,xm as g,em as h,mm as i,km as j,sr as k,gm as l,ym as m,pm as n,Ug as o,vm as p,Qg as q,Zg as r,cm as s,fm as t,ge as u,R as v,$u as w,A as x,im as y,Qu as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index ee3cd84c..0663b6b2 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -45,7 +45,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/package-lock.json b/ui/package-lock.json index 5a3d6e5d..0e2dfa47 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -45,14 +45,14 @@ } }, "node_modules/@codemirror/autocomplete": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.0.tgz", - "integrity": "sha512-Fbwm0V/Wn3BkEJZRhr0hi5BhCo5a7eBL6LYaliPjOSwCyfOpnjXY59HruSxOUNV+1OYer0Tgx1zRNQttjXyDog==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.1.tgz", + "integrity": "sha512-yma56tqD7khIZK4gy4X5lX3/k5ArMiCGat7HEWRF/8L2kqOjVdp2qKZqpcJjwTIjSj6fqKAHqi7IjtH3QFE+Bw==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", - "@codemirror/view": "^6.6.0", + "@codemirror/view": "^6.17.0", "@lezer/common": "^1.0.0" }, "peerDependencies": { @@ -63,15 +63,15 @@ } }, "node_modules/@codemirror/commands": { - "version": "6.2.5", - "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.5.tgz", - "integrity": "sha512-dSi7ow2P2YgPBZflR9AJoaTHvqmeGIgkhignYMd5zK5y6DANTvxKxp6eMEpIDUJkRAaOY/TFZ4jP1ADIO/GLVA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.3.0.tgz", + "integrity": "sha512-tFfcxRIlOWiQDFhjBSWJ10MxcvbCIsRr6V64SgrcaY0MwNk32cUOcCuNlWo8VjV4qRQCgNgUAnIeo0svkk4R5Q==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.2.0", "@codemirror/view": "^6.0.0", - "@lezer/common": "^1.0.0" + "@lezer/common": "^1.1.0" } }, "node_modules/@codemirror/lang-css": { @@ -143,14 +143,14 @@ } }, "node_modules/@codemirror/language": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.0.tgz", - "integrity": "sha512-nFu311/0ne/qGuGCL3oKuktBgzVOaxCHZPZv1tLSZkNjPYxxvkjSbzno3MlErG2tgw1Yw1yF8BxMCegeMXqpiw==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz", + "integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", - "@lezer/common": "^1.0.0", + "@lezer/common": "^1.1.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.0.0", "style-mod": "^4.0.0" @@ -166,9 +166,9 @@ } }, "node_modules/@codemirror/lint": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.1.tgz", - "integrity": "sha512-2Hx945qKX7FBan5/gUdTM8fsMYrNG9clIgEcPXestbLVFAUyQYFAuju/5BMNf/PwgpVaX5pvRm4+ovjbp9D9gQ==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz", + "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", @@ -177,9 +177,9 @@ } }, "node_modules/@codemirror/search": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.2.tgz", - "integrity": "sha512-WRihpqd0l9cEh9J3IZe45Yi+Z5MfTsEXnyc3V7qXHP4ZYtIYpGOn+EJ7fyLIkyAm/8S6QIr7/mMISfAadf8zCg==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.4.tgz", + "integrity": "sha512-YoTrvjv9e8EbPs58opjZKyJ3ewFrVSUzQ/4WXlULQLSDDr1nGPJ67mMXFNNVYwdFhybzhrzrtqgHmtpJwIF+8g==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", @@ -194,9 +194,9 @@ "dev": true }, "node_modules/@codemirror/view": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.17.1.tgz", - "integrity": "sha512-I5KVxsLbm1f56n9SUajLW0/AzMXYEZVvkiYahMw/yGl5gUjT2WquuKO39xUtiT4z/hNhGD7YuAEVPI8u0mncaQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.21.0.tgz", + "integrity": "sha512-JI3asAk/fZ7h2ATjY9ErDFGWoWe4Bu7XgzR31G26RU3M/DLjfdQK8Im7hL1P/PAyprfVrf0uRNqxu02TkBcm3g==", "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", @@ -605,9 +605,9 @@ } }, "node_modules/@lezer/common": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.4.tgz", - "integrity": "sha512-lZHlk8p67x4aIDtJl6UQrXSOP6oi7dQR3W/geFVrENdA1JDaAJWldnVqVjPMJupbTKbzDfFcePfKttqVidS/dg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz", + "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw==", "dev": true }, "node_modules/@lezer/css": { @@ -661,25 +661,25 @@ } }, "node_modules/@lezer/lr": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.10.tgz", - "integrity": "sha512-BZfVvf7Re5BIwJHlZXbJn9L8lus5EonxQghyn+ih8Wl36XMFBPTXC0KM0IdUtj9w/diPHsKlXVgL+AlX2jYJ0Q==", + "version": "1.3.12", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.12.tgz", + "integrity": "sha512-5nwY1JzCueUdRtlMBnlf1SUi69iGCq2ABq7WQFQMkn/kxPvoACAEnTp4P17CtXxYr7WCwtYPLL2AEvxKPuF1OQ==", "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.5.tgz", - "integrity": "sha512-UJKsFNwhzCVuiZd06jM/psscyNJNDwjQC+qIeb7GBJK9iWeQCcIyfcPWDvbCudfcJggY9jtxJeeaZH7uny93FQ==", + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.6.tgz", + "integrity": "sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==", "dev": true, "dependencies": { - "@sveltejs/vite-plugin-svelte-inspector": "^1.0.3", + "@sveltejs/vite-plugin-svelte-inspector": "^1.0.4", "debug": "^4.3.4", "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.30.2", + "magic-string": "^0.30.3", "svelte-hmr": "^0.15.3", "vitefu": "^0.2.4" }, @@ -718,9 +718,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz", + "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==", "dev": true }, "node_modules/acorn": { @@ -1036,9 +1036,9 @@ } }, "node_modules/is-reference": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.1.tgz", - "integrity": "sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", + "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", "dev": true, "dependencies": { "@types/estree": "*" @@ -1069,9 +1069,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -1155,9 +1155,9 @@ "dev": true }, "node_modules/postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -1213,9 +1213,9 @@ } }, "node_modules/rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -1235,9 +1235,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.66.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.66.1.tgz", - "integrity": "sha512-50c+zTsZOJVgFfTgwwEzkjA3/QACgdNsKueWPyAR0mRINIvLAStVQBbPg14iuqEQ74NPDbXzJARJ/O4SI1zftA==", + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.68.0.tgz", + "integrity": "sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -1267,9 +1267,9 @@ "dev": true }, "node_modules/svelte": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.0.tgz", - "integrity": "sha512-kVsdPjDbLrv74SmLSUzAsBGquMs4MPgWGkGLpH+PjOYnFOziAvENVzgJmyOCV2gntxE32aNm8/sqNKD6LbIpeQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.1.tgz", + "integrity": "sha512-LpLqY2Jr7cRxkrTc796/AaaoMLF/1ax7cto8Ot76wrvKQhrPmZ0JgajiWPmg9mTSDqO16SSLiD17r9MsvAPTmw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", @@ -1426,27 +1426,27 @@ } }, "@codemirror/autocomplete": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.0.tgz", - "integrity": "sha512-Fbwm0V/Wn3BkEJZRhr0hi5BhCo5a7eBL6LYaliPjOSwCyfOpnjXY59HruSxOUNV+1OYer0Tgx1zRNQttjXyDog==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.9.1.tgz", + "integrity": "sha512-yma56tqD7khIZK4gy4X5lX3/k5ArMiCGat7HEWRF/8L2kqOjVdp2qKZqpcJjwTIjSj6fqKAHqi7IjtH3QFE+Bw==", "dev": true, "requires": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", - "@codemirror/view": "^6.6.0", + "@codemirror/view": "^6.17.0", "@lezer/common": "^1.0.0" } }, "@codemirror/commands": { - "version": "6.2.5", - "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.5.tgz", - "integrity": "sha512-dSi7ow2P2YgPBZflR9AJoaTHvqmeGIgkhignYMd5zK5y6DANTvxKxp6eMEpIDUJkRAaOY/TFZ4jP1ADIO/GLVA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.3.0.tgz", + "integrity": "sha512-tFfcxRIlOWiQDFhjBSWJ10MxcvbCIsRr6V64SgrcaY0MwNk32cUOcCuNlWo8VjV4qRQCgNgUAnIeo0svkk4R5Q==", "dev": true, "requires": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.2.0", "@codemirror/view": "^6.0.0", - "@lezer/common": "^1.0.0" + "@lezer/common": "^1.1.0" } }, "@codemirror/lang-css": { @@ -1518,14 +1518,14 @@ } }, "@codemirror/language": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.0.tgz", - "integrity": "sha512-nFu311/0ne/qGuGCL3oKuktBgzVOaxCHZPZv1tLSZkNjPYxxvkjSbzno3MlErG2tgw1Yw1yF8BxMCegeMXqpiw==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz", + "integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==", "dev": true, "requires": { "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", - "@lezer/common": "^1.0.0", + "@lezer/common": "^1.1.0", "@lezer/highlight": "^1.0.0", "@lezer/lr": "^1.0.0", "style-mod": "^4.0.0" @@ -1541,9 +1541,9 @@ } }, "@codemirror/lint": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.1.tgz", - "integrity": "sha512-2Hx945qKX7FBan5/gUdTM8fsMYrNG9clIgEcPXestbLVFAUyQYFAuju/5BMNf/PwgpVaX5pvRm4+ovjbp9D9gQ==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz", + "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==", "dev": true, "requires": { "@codemirror/state": "^6.0.0", @@ -1552,9 +1552,9 @@ } }, "@codemirror/search": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.2.tgz", - "integrity": "sha512-WRihpqd0l9cEh9J3IZe45Yi+Z5MfTsEXnyc3V7qXHP4ZYtIYpGOn+EJ7fyLIkyAm/8S6QIr7/mMISfAadf8zCg==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.4.tgz", + "integrity": "sha512-YoTrvjv9e8EbPs58opjZKyJ3ewFrVSUzQ/4WXlULQLSDDr1nGPJ67mMXFNNVYwdFhybzhrzrtqgHmtpJwIF+8g==", "dev": true, "requires": { "@codemirror/state": "^6.0.0", @@ -1569,9 +1569,9 @@ "dev": true }, "@codemirror/view": { - "version": "6.17.1", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.17.1.tgz", - "integrity": "sha512-I5KVxsLbm1f56n9SUajLW0/AzMXYEZVvkiYahMw/yGl5gUjT2WquuKO39xUtiT4z/hNhGD7YuAEVPI8u0mncaQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.21.0.tgz", + "integrity": "sha512-JI3asAk/fZ7h2ATjY9ErDFGWoWe4Bu7XgzR31G26RU3M/DLjfdQK8Im7hL1P/PAyprfVrf0uRNqxu02TkBcm3g==", "dev": true, "requires": { "@codemirror/state": "^6.1.4", @@ -1773,9 +1773,9 @@ } }, "@lezer/common": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.4.tgz", - "integrity": "sha512-lZHlk8p67x4aIDtJl6UQrXSOP6oi7dQR3W/geFVrENdA1JDaAJWldnVqVjPMJupbTKbzDfFcePfKttqVidS/dg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz", + "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw==", "dev": true }, "@lezer/css": { @@ -1829,25 +1829,25 @@ } }, "@lezer/lr": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.10.tgz", - "integrity": "sha512-BZfVvf7Re5BIwJHlZXbJn9L8lus5EonxQghyn+ih8Wl36XMFBPTXC0KM0IdUtj9w/diPHsKlXVgL+AlX2jYJ0Q==", + "version": "1.3.12", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.12.tgz", + "integrity": "sha512-5nwY1JzCueUdRtlMBnlf1SUi69iGCq2ABq7WQFQMkn/kxPvoACAEnTp4P17CtXxYr7WCwtYPLL2AEvxKPuF1OQ==", "dev": true, "requires": { "@lezer/common": "^1.0.0" } }, "@sveltejs/vite-plugin-svelte": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.5.tgz", - "integrity": "sha512-UJKsFNwhzCVuiZd06jM/psscyNJNDwjQC+qIeb7GBJK9iWeQCcIyfcPWDvbCudfcJggY9jtxJeeaZH7uny93FQ==", + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.6.tgz", + "integrity": "sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==", "dev": true, "requires": { - "@sveltejs/vite-plugin-svelte-inspector": "^1.0.3", + "@sveltejs/vite-plugin-svelte-inspector": "^1.0.4", "debug": "^4.3.4", "deepmerge": "^4.3.1", "kleur": "^4.1.5", - "magic-string": "^0.30.2", + "magic-string": "^0.30.3", "svelte-hmr": "^0.15.3", "vitefu": "^0.2.4" } @@ -1871,9 +1871,9 @@ } }, "@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz", + "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==", "dev": true }, "acorn": { @@ -2111,9 +2111,9 @@ "dev": true }, "is-reference": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.1.tgz", - "integrity": "sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz", + "integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==", "dev": true, "requires": { "@types/estree": "*" @@ -2138,9 +2138,9 @@ "dev": true }, "magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.4.tgz", + "integrity": "sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==", "dev": true, "requires": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -2200,9 +2200,9 @@ "dev": true }, "postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "requires": { "nanoid": "^3.3.6", @@ -2232,9 +2232,9 @@ "dev": true }, "rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "3.29.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", + "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -2247,9 +2247,9 @@ "dev": true }, "sass": { - "version": "1.66.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.66.1.tgz", - "integrity": "sha512-50c+zTsZOJVgFfTgwwEzkjA3/QACgdNsKueWPyAR0mRINIvLAStVQBbPg14iuqEQ74NPDbXzJARJ/O4SI1zftA==", + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.68.0.tgz", + "integrity": "sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0", @@ -2270,9 +2270,9 @@ "dev": true }, "svelte": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.0.tgz", - "integrity": "sha512-kVsdPjDbLrv74SmLSUzAsBGquMs4MPgWGkGLpH+PjOYnFOziAvENVzgJmyOCV2gntxE32aNm8/sqNKD6LbIpeQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.1.tgz", + "integrity": "sha512-LpLqY2Jr7cRxkrTc796/AaaoMLF/1ax7cto8Ot76wrvKQhrPmZ0JgajiWPmg9mTSDqO16SSLiD17r9MsvAPTmw==", "dev": true, "requires": { "@ampproject/remapping": "^2.2.1",