simplified mail settings ui
This commit is contained in:
		
							parent
							
								
									456ced75ce
								
							
						
					
					
						commit
						ccd010c490
					
				| 
						 | 
				
			
			@ -14,12 +14,12 @@ var defaultVerificationTemplate = EmailTemplate{
 | 
			
		|||
<p>Thank you for joining us at ` + EmailPlaceholderAppName + `.</p>
 | 
			
		||||
<p>Click on the button below to verify your email address.</p>
 | 
			
		||||
<p>
 | 
			
		||||
    <a class="btn" href="` + EmailPlaceholderActionUrl + `" target="_blank" rel="noopener">Verify</a>
 | 
			
		||||
  <a class="btn" href="` + EmailPlaceholderActionUrl + `" target="_blank" rel="noopener">Verify</a>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
    Thanks,<br/>
 | 
			
		||||
    ` + EmailPlaceholderAppName + ` team
 | 
			
		||||
  Thanks,<br/>
 | 
			
		||||
  ` + EmailPlaceholderAppName + ` team
 | 
			
		||||
</p>`,
 | 
			
		||||
	ActionUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-verification/" + EmailPlaceholderToken,
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -29,12 +29,12 @@ var defaultResetPasswordTemplate = EmailTemplate{
 | 
			
		|||
	Body: `<p>Hello,</p>
 | 
			
		||||
<p>Click on the button below to reset your password.</p>
 | 
			
		||||
<p>
 | 
			
		||||
    <a class="btn" href="` + EmailPlaceholderActionUrl + `" target="_blank" rel="noopener">Reset password</a>
 | 
			
		||||
  <a class="btn" href="` + EmailPlaceholderActionUrl + `" target="_blank" rel="noopener">Reset password</a>
 | 
			
		||||
</p>
 | 
			
		||||
<p><i>If you didn't ask to reset your password, you can ignore this email.</i></p>
 | 
			
		||||
<p>
 | 
			
		||||
    Thanks,<br/>
 | 
			
		||||
    ` + EmailPlaceholderAppName + ` team
 | 
			
		||||
  Thanks,<br/>
 | 
			
		||||
  ` + EmailPlaceholderAppName + ` team
 | 
			
		||||
</p>`,
 | 
			
		||||
	ActionUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-password-reset/" + EmailPlaceholderToken,
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -44,12 +44,12 @@ var defaultConfirmEmailChangeTemplate = EmailTemplate{
 | 
			
		|||
	Body: `<p>Hello,</p>
 | 
			
		||||
<p>Click on the button below to confirm your new email address.</p>
 | 
			
		||||
<p>
 | 
			
		||||
    <a class="btn" href="` + EmailPlaceholderActionUrl + `" target="_blank" rel="noopener">Confirm new email</a>
 | 
			
		||||
  <a class="btn" href="` + EmailPlaceholderActionUrl + `" target="_blank" rel="noopener">Confirm new email</a>
 | 
			
		||||
</p>
 | 
			
		||||
<p><i>If you didn't ask to change your email address, you can ignore this email.</i></p>
 | 
			
		||||
<p>
 | 
			
		||||
    Thanks,<br/>
 | 
			
		||||
    ` + EmailPlaceholderAppName + ` team
 | 
			
		||||
  Thanks,<br/>
 | 
			
		||||
  ` + EmailPlaceholderAppName + ` team
 | 
			
		||||
</p>`,
 | 
			
		||||
	ActionUrl: EmailPlaceholderAppUrl + "/_/#/users/confirm-email-change/" + EmailPlaceholderToken,
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
				
			
			@ -1,2 +1,2 @@
 | 
			
		|||
import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as k,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index.43854ca0.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
 | 
			
		||||
import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as k,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index.b939bbf0.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
 | 
			
		||||
                `),m&&m.c(),t=k(),A(r.$$.fragment),p=k(),A(d.$$.fragment),n=k(),i=c("button"),g=c("span"),g.textContent="Set new password",R=k(),C=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(C,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,C,$),_(C,v),P=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!P||$&4)&&(i.disabled=a[2]),$&4&&L(i,"btn-loading",a[2])},i(a){P||(H(r.$$.fragment,a),H(d.$$.fragment,a),P=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),P=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(C),F=!1,V(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default};
 | 
			
		||||
| 
						 | 
				
			
			@ -1,2 +1,2 @@
 | 
			
		|||
import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index.43854ca0.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4> 
 | 
			
		||||
import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index.b939bbf0.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4> 
 | 
			
		||||
                <p>Enter the email associated with your account and we\u2019ll send you a recovery link:</p>`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),$&2&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='<i class="ri-checkbox-circle-line"></i>',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){S(e,n)}}}function W(c,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default};
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
import{S as M,i as N,s as R,F as U,c as L,m as z,t as $,a as v,d as J,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,q as B,e as m,w as y,b as C,f as d,r as H,h as k,u as E,v as D,y as h,x as G,z as S}from"./index.43854ca0.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&T(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address
 | 
			
		||||
import{S as M,i as N,s as R,F as U,c as L,m as z,t as $,a as v,d as J,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,q as B,e as m,w as y,b as C,f as d,r as H,h as k,u as E,v as D,y as h,x as G,z as S}from"./index.b939bbf0.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&T(r);return o=new B({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address
 | 
			
		||||
                    `),p&&p.c(),n=C(),L(o.$$.fragment),c=C(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","m-b-xs"),d(s,"class","content txt-center m-b-sm"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,s),k(s,t),k(t,l),p&&p.m(t,null),k(e,n),z(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||(q=E(e,"submit",D(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=T(f),p.c(),p.m(t,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(a.disabled=f[1]),w&2&&H(a,"btn-loading",f[1])},i(f){u||($(o.$$.fragment,f),u=!0)},o(f){v(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),J(o),g=!1,q()}}}function K(r){let e,s,t,l,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div> 
 | 
			
		||||
            <div class="content txt-bold"><p>Successfully changed the user email address.</p> 
 | 
			
		||||
                <p>You can now sign in with your new email address.</p></div>`,s=C(),t=m("button"),t.textContent="Close",d(e,"class","alert alert-success"),d(t,"type","button"),d(t,"class","btn btn-secondary btn-block")},m(o,c){_(o,e,c),_(o,s,c),_(o,t,c),l||(n=E(t,"click",r[6]),l=!0)},p:h,i:h,o:h,d(o){o&&b(e),o&&b(s),o&&b(t),l=!1,n()}}}function T(r){let e,s,t;return{c(){e=y("to "),s=m("strong"),t=y(r[3]),d(s,"class","txt-nowrap")},m(l,n){_(l,e,n),_(l,s,n),k(s,t)},p(l,n){n&8&&G(t,l[3])},d(l){l&&b(e),l&&b(s)}}}function O(r){let e,s,t,l,n,o,c,a;return{c(){e=m("label"),s=y("Password"),l=C(),n=m("input"),d(e,"for",t=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,s),_(i,l,u),_(i,n,u),S(n,r[0]),n.focus(),c||(a=E(n,"input",r[7]),c=!0)},p(i,u){u&256&&t!==(t=i[8])&&d(e,"for",t),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&S(n,i[0])},d(i){i&&b(e),i&&b(l),i&&b(n),c=!1,a()}}}function Q(r){let e,s,t,l;const n=[K,I],o=[];function c(a,i){return a[2]?0:1}return e=c(r),s=o[e]=n[e](r),{c(){s.c(),t=Y()},m(a,i){o[e].m(a,i),_(a,t,i),l=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(j(),v(o[u],1,1,()=>{o[u]=null}),A(),s=o[e],s?s.p(a,i):(s=o[e]=n[e](a),s.c()),$(s,1),s.m(t.parentNode,t))},i(a){l||($(s),l=!0)},o(a){v(s),l=!1},d(a){o[e].d(a),a&&b(t)}}}function V(r){let e,s;return e=new U({props:{nobranding:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),{c(){L(e.$$.fragment)},m(t,l){z(e,t,l),s=!0},p(t,[l]){const n={};l&527&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||($(e.$$.fragment,t),s=!0)},o(t){v(e.$$.fragment,t),s=!1},d(t){J(e,t)}}}function X(r,e,s){let t,{params:l}=e,n="",o=!1,c=!1;async function a(){if(!o){s(1,o=!0);try{await F.users.confirmEmailChange(l==null?void 0:l.token,n),s(2,c=!0)}catch(g){F.errorResponseHandler(g)}s(1,o=!1)}}const i=()=>window.close();function u(){n=this.value,s(0,n)}return r.$$set=g=>{"params"in g&&s(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&s(3,t=W.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[n,o,c,t,a,l,i,u]}class x extends M{constructor(e){super(),N(this,e,X,V,R,{params:5})}}export{x as default};
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
import{S as W,i as Y,s as j,F as A,c as F,m as H,t as P,a as q,d as N,C as B,E as D,g as _,k as G,n as I,o as m,p as E,q as J,e as b,w as y,b as C,f as c,r as M,h as w,u as R,v as K,y as S,x as O,z as h}from"./index.43854ca0.js";function Q(i){let e,l,t,n,s,o,p,u,r,a,v,g,k,L,d=i[4]&&U(i);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),u=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password
 | 
			
		||||
import{S as W,i as Y,s as j,F as A,c as F,m as H,t as P,a as q,d as N,C as B,E as D,g as _,k as G,n as I,o as m,p as E,q as J,e as b,w as y,b as C,f as c,r as M,h as w,u as R,v as K,y as S,x as O,z as h}from"./index.b939bbf0.js";function Q(i){let e,l,t,n,s,o,p,u,r,a,v,g,k,L,d=i[4]&&U(i);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[X,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),u=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password
 | 
			
		||||
                    `),d&&d.c(),s=C(),F(o.$$.fragment),p=C(),F(u.$$.fragment),r=C(),a=b("button"),v=b("span"),v.textContent="Set new password",c(t,"class","m-b-xs"),c(l,"class","content txt-center m-b-sm"),c(v,"class","txt"),c(a,"type","submit"),c(a,"class","btn btn-lg btn-block"),a.disabled=i[2],M(a,"btn-loading",i[2])},m(f,$){_(f,e,$),w(e,l),w(l,t),w(t,n),d&&d.m(t,null),w(e,s),H(o,e,null),w(e,p),H(u,e,null),w(e,r),w(e,a),w(a,v),g=!0,k||(L=R(e,"submit",K(i[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=U(f),d.c(),d.m(t,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),u.$set(z),(!g||$&4)&&(a.disabled=f[2]),$&4&&M(a,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(u.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(u.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),N(o),N(u),k=!1,L()}}}function V(i){let e,l,t,n,s;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div> 
 | 
			
		||||
            <div class="content txt-bold"><p>Successfully changed the user password.</p> 
 | 
			
		||||
                <p>You can now sign in with your new password.</p></div>`,l=C(),t=b("button"),t.textContent="Close",c(e,"class","alert alert-success"),c(t,"type","button"),c(t,"class","btn btn-secondary btn-block")},m(o,p){_(o,e,p),_(o,l,p),_(o,t,p),n||(s=R(t,"click",i[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(t),n=!1,s()}}}function U(i){let e,l,t;return{c(){e=y("for "),l=b("strong"),t=y(i[4])},m(n,s){_(n,e,s),_(n,l,s),w(l,t)},p(n,s){s&16&&O(t,n[4])},d(n){n&&m(e),n&&m(l)}}}function X(i){let e,l,t,n,s,o,p,u;return{c(){e=b("label"),l=y("New password"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0,s.autofocus=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,s,a),h(s,i[0]),s.focus(),p||(u=R(s,"input",i[8]),p=!0)},p(r,a){a&1024&&t!==(t=r[10])&&c(e,"for",t),a&1024&&o!==(o=r[10])&&c(s,"id",o),a&1&&s.value!==r[0]&&h(s,r[0])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,u()}}}function Z(i){let e,l,t,n,s,o,p,u;return{c(){e=b("label"),l=y("New password confirm"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0},m(r,a){_(r,e,a),w(e,l),_(r,n,a),_(r,s,a),h(s,i[1]),p||(u=R(s,"input",i[9]),p=!0)},p(r,a){a&1024&&t!==(t=r[10])&&c(e,"for",t),a&1024&&o!==(o=r[10])&&c(s,"id",o),a&2&&s.value!==r[1]&&h(s,r[1])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,u()}}}function x(i){let e,l,t,n;const s=[V,Q],o=[];function p(u,r){return u[3]?0:1}return e=p(i),l=o[e]=s[e](i),{c(){l.c(),t=D()},m(u,r){o[e].m(u,r),_(u,t,r),n=!0},p(u,r){let a=e;e=p(u),e===a?o[e].p(u,r):(G(),q(o[a],1,1,()=>{o[a]=null}),I(),l=o[e],l?l.p(u,r):(l=o[e]=s[e](u),l.c()),P(l,1),l.m(t.parentNode,t))},i(u){n||(P(l),n=!0)},o(u){q(l),n=!1},d(u){o[e].d(u),u&&m(t)}}}function ee(i){let e,l;return e=new A({props:{nobranding:!0,$$slots:{default:[x]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},m(t,n){H(e,t,n),l=!0},p(t,[n]){const s={};n&2079&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(P(e.$$.fragment,t),l=!0)},o(t){q(e.$$.fragment,t),l=!1},d(t){N(e,t)}}}function te(i,e,l){let t,{params:n}=e,s="",o="",p=!1,u=!1;async function r(){if(!p){l(2,p=!0);try{await E.users.confirmPasswordReset(n==null?void 0:n.token,s,o),l(3,u=!0)}catch(k){E.errorResponseHandler(k)}l(2,p=!1)}}const a=()=>window.close();function v(){s=this.value,l(0,s)}function g(){o=this.value,l(1,o)}return i.$$set=k=>{"params"in k&&l(6,n=k.params)},i.$$.update=()=>{i.$$.dirty&64&&l(4,t=B.getJWTPayload(n==null?void 0:n.token).email||"")},[s,o,p,u,t,r,n,a,v,g]}class le extends W{constructor(e){super(),Y(this,e,te,ee,j,{params:6})}}export{le as default};
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +1,3 @@
 | 
			
		|||
import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.43854ca0.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div> 
 | 
			
		||||
import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.b939bbf0.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div> 
 | 
			
		||||
            <div class="content txt-bold"><p>Invalid or expired verification token.</p></div>`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[4]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function S(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div> 
 | 
			
		||||
            <div class="content txt-bold"><p>Successfully verified email address.</p></div>`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[3]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function T(o){let t;return{c(){t=u("div"),t.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function F(o){let t;function s(i,l){return i[1]?T:i[0]?S:P}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(i,l){n.m(i,l),r(i,t,l)},p(i,l){e===(e=s(i))&&n?n.p(i,l):(n.d(1),n=e(i),n&&(n.c(),n.m(t.parentNode,t)))},d(i){n.d(i),i&&a(t)}}}function V(o){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[F]},$$scope:{ctx:o}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const i={};n&67&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){s||(g(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(o,t,s){let{params:e}=t,n=!1,i=!1;l();async function l(){s(1,i=!0);try{await H.users.confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch(d){console.warn(d),s(0,n=!1)}s(1,i=!1)}const c=()=>window.close(),b=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,i,e,c,b]}class I extends k{constructor(t){super(),v(this,t,q,V,y,{params:2})}}export{I as default};
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
				
			
			@ -24,8 +24,8 @@
 | 
			
		|||
        window.Prism = window.Prism || {};
 | 
			
		||||
        window.Prism.manual = true;
 | 
			
		||||
    </script>
 | 
			
		||||
  <script type="module" crossorigin src="./assets/index.43854ca0.js"></script>
 | 
			
		||||
  <link rel="stylesheet" href="./assets/index.49c63202.css">
 | 
			
		||||
  <script type="module" crossorigin src="./assets/index.b939bbf0.js"></script>
 | 
			
		||||
  <link rel="stylesheet" href="./assets/index.45ad4c0e.css">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
    <div id="app"></div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,6 +8,8 @@
 | 
			
		|||
      "devDependencies": {
 | 
			
		||||
        "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
        "@codemirror/commands": "^6.0.0",
 | 
			
		||||
        "@codemirror/lang-html": "^6.1.0",
 | 
			
		||||
        "@codemirror/lang-javascript": "^6.0.2",
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/legacy-modes": "^6.0.0",
 | 
			
		||||
        "@codemirror/search": "^6.0.0",
 | 
			
		||||
| 
						 | 
				
			
			@ -56,6 +58,48 @@
 | 
			
		|||
        "@lezer/common": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/lang-css": {
 | 
			
		||||
      "version": "6.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-jBqc+BTuwhNOTlrimFghLlSrN6iFuE44HULKWoR4qKYObhOIl9Lci1iYj6zMIte1XTQmZguNvjXMyr43LUKwSw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@lezer/css": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/lang-html": {
 | 
			
		||||
      "version": "6.1.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.1.0.tgz",
 | 
			
		||||
      "integrity": "sha512-gA7NmJxqvnhwza05CvR7W/39Ap9r/4Vs9uiC0IeFYo1hSlJzc/8N6Evviz6vTW1x8SpHcRYyqKOf6rpl6LfWtg==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
        "@codemirror/lang-css": "^6.0.0",
 | 
			
		||||
        "@codemirror/lang-javascript": "^6.0.0",
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@lezer/common": "^1.0.0",
 | 
			
		||||
        "@lezer/html": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/lang-javascript": {
 | 
			
		||||
      "version": "6.0.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.0.2.tgz",
 | 
			
		||||
      "integrity": "sha512-BZRJ9u/zl16hLkSpDAWm73mrfIR7HJrr0lvnhoSOCQVea5BglguWI/slxexhvUb0CB5cXgKWuo2bM+N9EhIaZw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/lint": "^6.0.0",
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@codemirror/view": "^6.0.0",
 | 
			
		||||
        "@lezer/common": "^1.0.0",
 | 
			
		||||
        "@lezer/javascript": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/language": {
 | 
			
		||||
      "version": "6.2.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.2.1.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -79,6 +123,17 @@
 | 
			
		|||
        "@codemirror/language": "^6.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/lint": {
 | 
			
		||||
      "version": "6.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-nUUXcJW1Xp54kNs+a1ToPLK8MadO0rMTnJB8Zk4Z8gBdrN0kqV7uvUraU/T2yqg+grDNR38Vmy/MrhQN/RgwiA==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@codemirror/view": "^6.0.0",
 | 
			
		||||
        "crelt": "^1.0.5"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/search": {
 | 
			
		||||
      "version": "6.0.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.0.1.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -129,6 +184,16 @@
 | 
			
		|||
      "integrity": "sha512-ohydQe+Hb+w4oMDvXzs8uuJd2NoA3D8YDcLiuDsLqH+yflDTPEpgCsWI3/6rH5C3BAedtH1/R51dxENldQceEA==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@lezer/css": {
 | 
			
		||||
      "version": "1.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-616VqgDKumHmYIuxs3tnX1irEQmoDHgF/TlP4O5ICWwyHwLMErq+8iKVuzTkOdBqvYAVmObqThcDEAaaMJjAdg==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@lezer/highlight": "^1.0.0",
 | 
			
		||||
        "@lezer/lr": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@lezer/highlight": {
 | 
			
		||||
      "version": "1.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.0.0.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -138,10 +203,31 @@
 | 
			
		|||
        "@lezer/common": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@lezer/html": {
 | 
			
		||||
      "version": "1.0.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.0.1.tgz",
 | 
			
		||||
      "integrity": "sha512-sC00zEt3GBh3vVO6QaGX4YZCl41S9dHWN/WGBsDixy9G+sqOC7gsa4cxA/fmRVAiBvhqYkJk+5Ul4oul92CPVw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@lezer/common": "^1.0.0",
 | 
			
		||||
        "@lezer/highlight": "^1.0.0",
 | 
			
		||||
        "@lezer/lr": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@lezer/javascript": {
 | 
			
		||||
      "version": "1.0.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.0.2.tgz",
 | 
			
		||||
      "integrity": "sha512-IjOVeIRhM8IuafWNnk+UzRz7p4/JSOKBNINLYLsdSGuJS9Ju7vFdc82AlTt0jgtV5D8eBZf4g0vK4d3ttBNz7A==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@lezer/highlight": "^1.0.0",
 | 
			
		||||
        "@lezer/lr": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@lezer/lr": {
 | 
			
		||||
      "version": "1.2.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.2.1.tgz",
 | 
			
		||||
      "integrity": "sha512-RpHRs+Q+5tPsXtobSfSeRFRAnTRD0e4bApDvo74O+JiaWq9812x5S8WgftNX67owdaTQXCB5E8XZGALo4Wt77A==",
 | 
			
		||||
      "version": "1.2.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.2.2.tgz",
 | 
			
		||||
      "integrity": "sha512-Df2R6Q7mieAVKYOD5ifo9j5SUoT6EHp10FvHU0v4cQ3MoPsifi6mb8eEycI0uNTdtPSCZLqDqT8G1mNvEqSB1Q==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@lezer/common": "^1.0.0"
 | 
			
		||||
| 
						 | 
				
			
			@ -1061,9 +1147,9 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/vite": {
 | 
			
		||||
      "version": "3.0.6",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.6.tgz",
 | 
			
		||||
      "integrity": "sha512-pjfsWIzfUlQME/VAmU6SsjdHkTt6WAHysuqPkHDcjzNu6IGtxDSZ/VfRYOwHaCqX4M3Ivz0kxuSfAPM6gAIX+w==",
 | 
			
		||||
      "version": "3.0.8",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.8.tgz",
 | 
			
		||||
      "integrity": "sha512-AOZ4eN7mrkJiOLuw8IA7piS4IdOQyQCA81GxGsAQvAZzMRi9ZwGB3TOaYsj4uLAWK46T5L4AfQ6InNGlxX30IQ==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "esbuild": "^0.14.47",
 | 
			
		||||
| 
						 | 
				
			
			@ -1133,6 +1219,48 @@
 | 
			
		|||
        "@lezer/common": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@codemirror/lang-css": {
 | 
			
		||||
      "version": "6.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-jBqc+BTuwhNOTlrimFghLlSrN6iFuE44HULKWoR4qKYObhOIl9Lci1iYj6zMIte1XTQmZguNvjXMyr43LUKwSw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@lezer/css": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@codemirror/lang-html": {
 | 
			
		||||
      "version": "6.1.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.1.0.tgz",
 | 
			
		||||
      "integrity": "sha512-gA7NmJxqvnhwza05CvR7W/39Ap9r/4Vs9uiC0IeFYo1hSlJzc/8N6Evviz6vTW1x8SpHcRYyqKOf6rpl6LfWtg==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
        "@codemirror/lang-css": "^6.0.0",
 | 
			
		||||
        "@codemirror/lang-javascript": "^6.0.0",
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@lezer/common": "^1.0.0",
 | 
			
		||||
        "@lezer/html": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@codemirror/lang-javascript": {
 | 
			
		||||
      "version": "6.0.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.0.2.tgz",
 | 
			
		||||
      "integrity": "sha512-BZRJ9u/zl16hLkSpDAWm73mrfIR7HJrr0lvnhoSOCQVea5BglguWI/slxexhvUb0CB5cXgKWuo2bM+N9EhIaZw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/lint": "^6.0.0",
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@codemirror/view": "^6.0.0",
 | 
			
		||||
        "@lezer/common": "^1.0.0",
 | 
			
		||||
        "@lezer/javascript": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@codemirror/language": {
 | 
			
		||||
      "version": "6.2.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.2.1.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -1156,6 +1284,17 @@
 | 
			
		|||
        "@codemirror/language": "^6.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@codemirror/lint": {
 | 
			
		||||
      "version": "6.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-nUUXcJW1Xp54kNs+a1ToPLK8MadO0rMTnJB8Zk4Z8gBdrN0kqV7uvUraU/T2yqg+grDNR38Vmy/MrhQN/RgwiA==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@codemirror/view": "^6.0.0",
 | 
			
		||||
        "crelt": "^1.0.5"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@codemirror/search": {
 | 
			
		||||
      "version": "6.0.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.0.1.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -1197,6 +1336,16 @@
 | 
			
		|||
      "integrity": "sha512-ohydQe+Hb+w4oMDvXzs8uuJd2NoA3D8YDcLiuDsLqH+yflDTPEpgCsWI3/6rH5C3BAedtH1/R51dxENldQceEA==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "@lezer/css": {
 | 
			
		||||
      "version": "1.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-616VqgDKumHmYIuxs3tnX1irEQmoDHgF/TlP4O5ICWwyHwLMErq+8iKVuzTkOdBqvYAVmObqThcDEAaaMJjAdg==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@lezer/highlight": "^1.0.0",
 | 
			
		||||
        "@lezer/lr": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@lezer/highlight": {
 | 
			
		||||
      "version": "1.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.0.0.tgz",
 | 
			
		||||
| 
						 | 
				
			
			@ -1206,10 +1355,31 @@
 | 
			
		|||
        "@lezer/common": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@lezer/html": {
 | 
			
		||||
      "version": "1.0.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.0.1.tgz",
 | 
			
		||||
      "integrity": "sha512-sC00zEt3GBh3vVO6QaGX4YZCl41S9dHWN/WGBsDixy9G+sqOC7gsa4cxA/fmRVAiBvhqYkJk+5Ul4oul92CPVw==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@lezer/common": "^1.0.0",
 | 
			
		||||
        "@lezer/highlight": "^1.0.0",
 | 
			
		||||
        "@lezer/lr": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@lezer/javascript": {
 | 
			
		||||
      "version": "1.0.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.0.2.tgz",
 | 
			
		||||
      "integrity": "sha512-IjOVeIRhM8IuafWNnk+UzRz7p4/JSOKBNINLYLsdSGuJS9Ju7vFdc82AlTt0jgtV5D8eBZf4g0vK4d3ttBNz7A==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@lezer/highlight": "^1.0.0",
 | 
			
		||||
        "@lezer/lr": "^1.0.0"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@lezer/lr": {
 | 
			
		||||
      "version": "1.2.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.2.1.tgz",
 | 
			
		||||
      "integrity": "sha512-RpHRs+Q+5tPsXtobSfSeRFRAnTRD0e4bApDvo74O+JiaWq9812x5S8WgftNX67owdaTQXCB5E8XZGALo4Wt77A==",
 | 
			
		||||
      "version": "1.2.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.2.2.tgz",
 | 
			
		||||
      "integrity": "sha512-Df2R6Q7mieAVKYOD5ifo9j5SUoT6EHp10FvHU0v4cQ3MoPsifi6mb8eEycI0uNTdtPSCZLqDqT8G1mNvEqSB1Q==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@lezer/common": "^1.0.0"
 | 
			
		||||
| 
						 | 
				
			
			@ -1771,9 +1941,9 @@
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "vite": {
 | 
			
		||||
      "version": "3.0.6",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.6.tgz",
 | 
			
		||||
      "integrity": "sha512-pjfsWIzfUlQME/VAmU6SsjdHkTt6WAHysuqPkHDcjzNu6IGtxDSZ/VfRYOwHaCqX4M3Ivz0kxuSfAPM6gAIX+w==",
 | 
			
		||||
      "version": "3.0.8",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.8.tgz",
 | 
			
		||||
      "integrity": "sha512-AOZ4eN7mrkJiOLuw8IA7piS4IdOQyQCA81GxGsAQvAZzMRi9ZwGB3TOaYsj4uLAWK46T5L4AfQ6InNGlxX30IQ==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "esbuild": "^0.14.47",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,6 +14,8 @@
 | 
			
		|||
  "devDependencies": {
 | 
			
		||||
    "@codemirror/autocomplete": "^6.0.0",
 | 
			
		||||
    "@codemirror/commands": "^6.0.0",
 | 
			
		||||
    "@codemirror/lang-html": "^6.1.0",
 | 
			
		||||
    "@codemirror/lang-javascript": "^6.0.2",
 | 
			
		||||
    "@codemirror/language": "^6.0.0",
 | 
			
		||||
    "@codemirror/legacy-modes": "^6.0.0",
 | 
			
		||||
    "@codemirror/search": "^6.0.0",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
<script>
 | 
			
		||||
    // @todo consider replacing with readonly CodeEditor
 | 
			
		||||
    import Prism from "prismjs";
 | 
			
		||||
    import "prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js";
 | 
			
		||||
    import "prismjs/components/prism-dart.js";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,225 @@
 | 
			
		|||
<script>
 | 
			
		||||
    /**
 | 
			
		||||
     * This component uses Codemirror editor under the hood and its a "little heavy".
 | 
			
		||||
     * To allow manuall chunking it is recommended to load the component lazily!
 | 
			
		||||
     *
 | 
			
		||||
     * Example usage:
 | 
			
		||||
     * ```
 | 
			
		||||
     * <script>
 | 
			
		||||
     * import { onMount } from "svelte";
 | 
			
		||||
     *
 | 
			
		||||
     * let editorComponent;
 | 
			
		||||
     *
 | 
			
		||||
     * onMount(async () => {
 | 
			
		||||
     *     try {
 | 
			
		||||
     *         editorComponent = (await import("@/components/base/CodeEditor.svelte")).default;
 | 
			
		||||
     *     } catch (err) {
 | 
			
		||||
     *         console.warn(err);
 | 
			
		||||
     *     }
 | 
			
		||||
     * });
 | 
			
		||||
     * <//script>
 | 
			
		||||
     *
 | 
			
		||||
     * ...
 | 
			
		||||
     *
 | 
			
		||||
     * <svelte:component
 | 
			
		||||
     *     this={editorComponent}
 | 
			
		||||
     *     bind:value={value}
 | 
			
		||||
     *     disabled={disabled}
 | 
			
		||||
     *     language="html"
 | 
			
		||||
     * />
 | 
			
		||||
     * ```
 | 
			
		||||
     */
 | 
			
		||||
    import { onMount, createEventDispatcher } from "svelte";
 | 
			
		||||
    // code mirror imports
 | 
			
		||||
    // ---
 | 
			
		||||
    import {
 | 
			
		||||
        keymap,
 | 
			
		||||
        highlightSpecialChars,
 | 
			
		||||
        drawSelection,
 | 
			
		||||
        dropCursor,
 | 
			
		||||
        rectangularSelection,
 | 
			
		||||
        highlightActiveLineGutter,
 | 
			
		||||
        EditorView,
 | 
			
		||||
        placeholder as placeholderExt,
 | 
			
		||||
    } from "@codemirror/view";
 | 
			
		||||
    import { EditorState, Compartment } from "@codemirror/state";
 | 
			
		||||
    import { defaultHighlightStyle, syntaxHighlighting, bracketMatching } from "@codemirror/language";
 | 
			
		||||
    import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
 | 
			
		||||
    import { searchKeymap, highlightSelectionMatches } from "@codemirror/search";
 | 
			
		||||
    import {
 | 
			
		||||
        autocompletion,
 | 
			
		||||
        completionKeymap,
 | 
			
		||||
        closeBrackets,
 | 
			
		||||
        closeBracketsKeymap,
 | 
			
		||||
    } from "@codemirror/autocomplete";
 | 
			
		||||
    import { html as htmlLang } from "@codemirror/lang-html";
 | 
			
		||||
    import { javascript as javascriptLang } from "@codemirror/lang-javascript";
 | 
			
		||||
    // ---
 | 
			
		||||
 | 
			
		||||
    const dispatch = createEventDispatcher();
 | 
			
		||||
 | 
			
		||||
    export let id = "";
 | 
			
		||||
    export let value = "";
 | 
			
		||||
    export let maxHeight = null;
 | 
			
		||||
    export let disabled = false;
 | 
			
		||||
    export let placeholder = "";
 | 
			
		||||
    export let language = "javascript";
 | 
			
		||||
    export let singleLine = false;
 | 
			
		||||
 | 
			
		||||
    let editor;
 | 
			
		||||
    let container;
 | 
			
		||||
    let langCompartment = new Compartment();
 | 
			
		||||
    let editableCompartment = new Compartment();
 | 
			
		||||
    let readOnlyCompartment = new Compartment();
 | 
			
		||||
    let placeholderCompartment = new Compartment();
 | 
			
		||||
 | 
			
		||||
    $: if (id) {
 | 
			
		||||
        addLabelListeners();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $: if (editor && language) {
 | 
			
		||||
        editor.dispatch({
 | 
			
		||||
            effects: [langCompartment.reconfigure(getEditorLang())],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $: if (editor && typeof disabled !== "undefined") {
 | 
			
		||||
        editor.dispatch({
 | 
			
		||||
            effects: [
 | 
			
		||||
                editableCompartment.reconfigure(EditorView.editable.of(!disabled)),
 | 
			
		||||
                readOnlyCompartment.reconfigure(EditorState.readOnly.of(disabled)),
 | 
			
		||||
            ],
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        triggerNativeChange();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $: if (editor && value != editor.state.doc.toString()) {
 | 
			
		||||
        editor.dispatch({
 | 
			
		||||
            changes: {
 | 
			
		||||
                from: 0,
 | 
			
		||||
                to: editor.state.doc.length,
 | 
			
		||||
                insert: value,
 | 
			
		||||
            },
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $: if (editor && typeof placeholder !== "undefined") {
 | 
			
		||||
        editor.dispatch({
 | 
			
		||||
            effects: [placeholderCompartment.reconfigure(placeholderExt(placeholder))],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Focus the editor (if inited).
 | 
			
		||||
    export function focus() {
 | 
			
		||||
        editor?.focus();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Emulate native change event for the editor container element.
 | 
			
		||||
    function triggerNativeChange() {
 | 
			
		||||
        container?.dispatchEvent(
 | 
			
		||||
            new CustomEvent("change", {
 | 
			
		||||
                detail: { value },
 | 
			
		||||
                bubbles: true,
 | 
			
		||||
            })
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Remove any attached label listeners.
 | 
			
		||||
    function removeLabelListeners() {
 | 
			
		||||
        if (!id) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const labels = document.querySelectorAll('[for="' + id + '"]');
 | 
			
		||||
        for (let label of labels) {
 | 
			
		||||
            label.removeEventListener("click", focus);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Add `<label for="ID">...</label>` focus support.
 | 
			
		||||
    function addLabelListeners() {
 | 
			
		||||
        if (!id) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        removeLabelListeners();
 | 
			
		||||
 | 
			
		||||
        const labels = document.querySelectorAll('[for="' + id + '"]');
 | 
			
		||||
        for (let label of labels) {
 | 
			
		||||
            label.addEventListener("click", focus);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Returns the current active editor language.
 | 
			
		||||
    function getEditorLang() {
 | 
			
		||||
        return language === "html" ? htmlLang() : javascriptLang();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    onMount(() => {
 | 
			
		||||
        const submitShortcut = {
 | 
			
		||||
            key: "Enter",
 | 
			
		||||
            run: (_) => {
 | 
			
		||||
                // trigger submit on enter for singleline input
 | 
			
		||||
                if (singleLine) {
 | 
			
		||||
                    dispatch("submit", value);
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        addLabelListeners();
 | 
			
		||||
 | 
			
		||||
        editor = new EditorView({
 | 
			
		||||
            parent: container,
 | 
			
		||||
            state: EditorState.create({
 | 
			
		||||
                doc: value,
 | 
			
		||||
                extensions: [
 | 
			
		||||
                    highlightActiveLineGutter(),
 | 
			
		||||
                    highlightSpecialChars(),
 | 
			
		||||
                    history(),
 | 
			
		||||
                    drawSelection(),
 | 
			
		||||
                    dropCursor(),
 | 
			
		||||
                    EditorState.allowMultipleSelections.of(true),
 | 
			
		||||
                    syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
 | 
			
		||||
                    bracketMatching(),
 | 
			
		||||
                    closeBrackets(),
 | 
			
		||||
                    rectangularSelection(),
 | 
			
		||||
                    highlightSelectionMatches(),
 | 
			
		||||
                    keymap.of([
 | 
			
		||||
                        submitShortcut,
 | 
			
		||||
                        ...closeBracketsKeymap,
 | 
			
		||||
                        ...defaultKeymap,
 | 
			
		||||
                        ...searchKeymap,
 | 
			
		||||
                        ...historyKeymap,
 | 
			
		||||
                        ...completionKeymap,
 | 
			
		||||
                    ]),
 | 
			
		||||
                    EditorView.lineWrapping,
 | 
			
		||||
                    autocompletion({
 | 
			
		||||
                        icons: false,
 | 
			
		||||
                    }),
 | 
			
		||||
                    langCompartment.of(getEditorLang()),
 | 
			
		||||
                    placeholderCompartment.of(placeholderExt(placeholder)),
 | 
			
		||||
                    editableCompartment.of(EditorView.editable.of(true)),
 | 
			
		||||
                    readOnlyCompartment.of(EditorState.readOnly.of(false)),
 | 
			
		||||
                    EditorState.transactionFilter.of((tr) => {
 | 
			
		||||
                        return singleLine && tr.newDoc.lines > 1 ? [] : tr;
 | 
			
		||||
                    }),
 | 
			
		||||
                    EditorView.updateListener.of((v) => {
 | 
			
		||||
                        if (!v.docChanged || disabled) {
 | 
			
		||||
                            return;
 | 
			
		||||
                        }
 | 
			
		||||
                        value = v.state.doc.toString();
 | 
			
		||||
                        triggerNativeChange();
 | 
			
		||||
                    }),
 | 
			
		||||
                ],
 | 
			
		||||
            }),
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return () => {
 | 
			
		||||
            removeLabelListeners();
 | 
			
		||||
            editor?.destroy();
 | 
			
		||||
        };
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<div bind:this={container} class="code-editor" style:max-height={maxHeight ? maxHeight + "px" : "auto"} />
 | 
			
		||||
| 
						 | 
				
			
			@ -1,5 +1,7 @@
 | 
			
		|||
<script>
 | 
			
		||||
    /**
 | 
			
		||||
     * @todo consider combining with the CodeEditor component.
 | 
			
		||||
     *
 | 
			
		||||
     * This component uses Codemirror editor under the hood and its a "little heavy".
 | 
			
		||||
     * To allow manuall chunking it is recommended to load the component lazily!
 | 
			
		||||
     *
 | 
			
		||||
| 
						 | 
				
			
			@ -65,6 +67,7 @@
 | 
			
		|||
 | 
			
		||||
    const dispatch = createEventDispatcher();
 | 
			
		||||
 | 
			
		||||
    export let id = "";
 | 
			
		||||
    export let value = "";
 | 
			
		||||
    export let disabled = false;
 | 
			
		||||
    export let placeholder = "";
 | 
			
		||||
| 
						 | 
				
			
			@ -83,6 +86,10 @@
 | 
			
		|||
 | 
			
		||||
    $: mergedCollections = mergeWithBaseCollection($collections);
 | 
			
		||||
 | 
			
		||||
    $: if (id) {
 | 
			
		||||
        addLabelListeners();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $: if (editor && baseCollection?.schema) {
 | 
			
		||||
        editor.dispatch({
 | 
			
		||||
            effects: [langCompartment.reconfigure(ruleLang())],
 | 
			
		||||
| 
						 | 
				
			
			@ -138,7 +145,33 @@
 | 
			
		|||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Returns list with all collection field keys recursively.
 | 
			
		||||
    // Remove any attached label listeners.
 | 
			
		||||
    function removeLabelListeners() {
 | 
			
		||||
        if (!id) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const labels = document.querySelectorAll('[for="' + id + '"]');
 | 
			
		||||
        for (let label of labels) {
 | 
			
		||||
            label.removeEventListener("click", focus);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Add `<label for="ID">...</label>` focus support.
 | 
			
		||||
    function addLabelListeners() {
 | 
			
		||||
        if (!id) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        removeLabelListeners();
 | 
			
		||||
 | 
			
		||||
        const labels = document.querySelectorAll('[for="' + id + '"]');
 | 
			
		||||
        for (let label of labels) {
 | 
			
		||||
            label.addEventListener("click", focus);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Returns a list with all collection field keys recursively.
 | 
			
		||||
    function getCollectionFieldKeys(nameOrId, prefix = "", level = 0) {
 | 
			
		||||
        let collection = mergedCollections.find((item) => item.name == nameOrId || item.id == nameOrId);
 | 
			
		||||
        if (!collection || level >= 4) {
 | 
			
		||||
| 
						 | 
				
			
			@ -324,6 +357,8 @@
 | 
			
		|||
            },
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        addLabelListeners();
 | 
			
		||||
 | 
			
		||||
        editor = new EditorView({
 | 
			
		||||
            parent: container,
 | 
			
		||||
            state: EditorState.create({
 | 
			
		||||
| 
						 | 
				
			
			@ -371,7 +406,10 @@
 | 
			
		|||
            }),
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return () => editor?.destroy();
 | 
			
		||||
        return () => {
 | 
			
		||||
            removeLabelListeners();
 | 
			
		||||
            editor?.destroy();
 | 
			
		||||
        };
 | 
			
		||||
    });
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,6 +62,7 @@
 | 
			
		|||
        {#if filterComponent && !isFilterComponentLoading}
 | 
			
		||||
            <svelte:component
 | 
			
		||||
                this={filterComponent}
 | 
			
		||||
                id={uniqueId}
 | 
			
		||||
                singleLine
 | 
			
		||||
                disableRequestKeys
 | 
			
		||||
                disableIndirectCollectionsKeys
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -152,12 +152,13 @@
 | 
			
		|||
                name={prop}
 | 
			
		||||
                let:uniqueId
 | 
			
		||||
            >
 | 
			
		||||
                <label for={uniqueId} on:click={() => editorRefs[prop]?.focus()}>
 | 
			
		||||
                <label for={uniqueId}>
 | 
			
		||||
                    {label} - {isAdminOnly(collection[prop]) ? "Admins only" : "Custom rule"}
 | 
			
		||||
                </label>
 | 
			
		||||
 | 
			
		||||
                <svelte:component
 | 
			
		||||
                    this={ruleInputComponent}
 | 
			
		||||
                    id={uniqueId}
 | 
			
		||||
                    bind:this={editorRefs[prop]}
 | 
			
		||||
                    bind:value={collection[prop]}
 | 
			
		||||
                    baseCollection={collection}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,14 +4,16 @@
 | 
			
		|||
    import { errors, removeError } from "@/stores/errors";
 | 
			
		||||
    import { addInfoToast } from "@/stores/toasts";
 | 
			
		||||
    import CommonHelper from "@/utils/CommonHelper";
 | 
			
		||||
    import Accordion from "@/components/base/Accordion.svelte";
 | 
			
		||||
    import Field from "@/components/base/Field.svelte";
 | 
			
		||||
    import Accordion from "@/components/base/Accordion.svelte";
 | 
			
		||||
 | 
			
		||||
    export let key;
 | 
			
		||||
    export let title;
 | 
			
		||||
    export let config = {};
 | 
			
		||||
 | 
			
		||||
    let accordion;
 | 
			
		||||
    let editorComponent;
 | 
			
		||||
    let isEditorComponentLoading = false;
 | 
			
		||||
 | 
			
		||||
    $: hasErrors = !CommonHelper.isEmpty(CommonHelper.getNestedVal($errors, key));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -31,6 +33,20 @@
 | 
			
		|||
        accordion?.collapseSiblings();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async function loadEditorComponent() {
 | 
			
		||||
        if (editorComponent || isEditorComponentLoading) {
 | 
			
		||||
            return; // already loaded or in the process
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        isEditorComponentLoading = true;
 | 
			
		||||
 | 
			
		||||
        editorComponent = (await import("@/components/base/CodeEditor.svelte")).default;
 | 
			
		||||
 | 
			
		||||
        isEditorComponentLoading = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    loadEditorComponent();
 | 
			
		||||
 | 
			
		||||
    function copy(param) {
 | 
			
		||||
        CommonHelper.copyToClipboard(param);
 | 
			
		||||
        addInfoToast(`Copied ${param} to clipboard`, 2000);
 | 
			
		||||
| 
						 | 
				
			
			@ -90,14 +106,25 @@
 | 
			
		|||
 | 
			
		||||
    <Field class="form-field m-0 required" name="{key}.body" let:uniqueId>
 | 
			
		||||
        <label for={uniqueId}>Body (HTML)</label>
 | 
			
		||||
        <textarea
 | 
			
		||||
            id={uniqueId}
 | 
			
		||||
            bind:value={config.body}
 | 
			
		||||
            class="txt-mono"
 | 
			
		||||
            spellcheck="false"
 | 
			
		||||
            rows="12"
 | 
			
		||||
            required
 | 
			
		||||
        />
 | 
			
		||||
 | 
			
		||||
        {#if editorComponent && !isEditorComponentLoading}
 | 
			
		||||
            <svelte:component
 | 
			
		||||
                this={editorComponent}
 | 
			
		||||
                id={uniqueId}
 | 
			
		||||
                language="html"
 | 
			
		||||
                bind:value={config.body}
 | 
			
		||||
            />
 | 
			
		||||
        {:else}
 | 
			
		||||
            <textarea
 | 
			
		||||
                id={uniqueId}
 | 
			
		||||
                class="txt-mono"
 | 
			
		||||
                spellcheck="false"
 | 
			
		||||
                rows="12"
 | 
			
		||||
                required
 | 
			
		||||
                bind:value={config.body}
 | 
			
		||||
            />
 | 
			
		||||
        {/if}
 | 
			
		||||
 | 
			
		||||
        <div class="help-block">
 | 
			
		||||
            Available placeholder parameters:
 | 
			
		||||
            <span class="label label-sm link-primary txt-mono" on:click={() => copy("{APP_NAME}")}>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,6 +5,7 @@
 | 
			
		|||
    import { pageTitle } from "@/stores/app";
 | 
			
		||||
    import { setErrors } from "@/stores/errors";
 | 
			
		||||
    import { addSuccessToast } from "@/stores/toasts";
 | 
			
		||||
    import tooltip from "@/actions/tooltip";
 | 
			
		||||
    import PageWrapper from "@/components/base/PageWrapper.svelte";
 | 
			
		||||
    import Field from "@/components/base/Field.svelte";
 | 
			
		||||
    import ObjectSelect from "@/components/base/ObjectSelect.svelte";
 | 
			
		||||
| 
						 | 
				
			
			@ -19,7 +20,6 @@
 | 
			
		|||
 | 
			
		||||
    $pageTitle = "Mail settings";
 | 
			
		||||
 | 
			
		||||
    let firstAccordion;
 | 
			
		||||
    let originalFormSettings = {};
 | 
			
		||||
    let formSettings = {};
 | 
			
		||||
    let isLoading = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -55,7 +55,6 @@
 | 
			
		|||
            const settings = await ApiClient.settings.update(CommonHelper.filterRedactedProps(formSettings));
 | 
			
		||||
            init(settings);
 | 
			
		||||
            setErrors({});
 | 
			
		||||
            firstAccordion?.collapseSiblings();
 | 
			
		||||
            addSuccessToast("Successfully saved mail settings.");
 | 
			
		||||
        } catch (err) {
 | 
			
		||||
            ApiClient.errorResponseHandler(err);
 | 
			
		||||
| 
						 | 
				
			
			@ -125,7 +124,6 @@
 | 
			
		|||
 | 
			
		||||
                <div class="accordions">
 | 
			
		||||
                    <EmailTemplateAccordion
 | 
			
		||||
                        bind:this={firstAccordion}
 | 
			
		||||
                        single
 | 
			
		||||
                        key="meta.verificationTemplate"
 | 
			
		||||
                        title={'Default "Verification" email template'}
 | 
			
		||||
| 
						 | 
				
			
			@ -151,22 +149,19 @@
 | 
			
		|||
 | 
			
		||||
                <Field class="form-field form-field-toggle m-b-sm" let:uniqueId>
 | 
			
		||||
                    <input type="checkbox" id={uniqueId} required bind:checked={formSettings.smtp.enabled} />
 | 
			
		||||
                    <label for={uniqueId}>Use SMTP mail server</label>
 | 
			
		||||
                    <label for={uniqueId}>
 | 
			
		||||
                        <span class="txt">Use SMTP mail server <strong>(recommended)</strong></span>
 | 
			
		||||
                        <i
 | 
			
		||||
                            class="ri-information-line link-hint"
 | 
			
		||||
                            use:tooltip={{
 | 
			
		||||
                                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",
 | 
			
		||||
                            }}
 | 
			
		||||
                        />
 | 
			
		||||
                    </label>
 | 
			
		||||
                </Field>
 | 
			
		||||
 | 
			
		||||
                {#if !formSettings.smtp.enabled}
 | 
			
		||||
                    <div class="content" transition:slide|local={{ duration: 150 }}>
 | 
			
		||||
                        <p>
 | 
			
		||||
                            By default PocketBase uses the OS <code>sendmail</code> command for sending
 | 
			
		||||
                            emails.
 | 
			
		||||
                            <br />
 | 
			
		||||
                            <strong class="txt-bold">
 | 
			
		||||
                                For better emails deliverability it is recommended to use a SMTP mail server.
 | 
			
		||||
                            </strong>
 | 
			
		||||
                        </p>
 | 
			
		||||
                        <div class="clearfix m-t-lg" />
 | 
			
		||||
                    </div>
 | 
			
		||||
                {:else}
 | 
			
		||||
                {#if formSettings.smtp.enabled}
 | 
			
		||||
                    <div class="grid" transition:slide|local={{ duration: 150 }}>
 | 
			
		||||
                        <div class="col-lg-6">
 | 
			
		||||
                            <Field class="form-field required" name="smtp.host" let:uniqueId>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -332,10 +332,19 @@ button {
 | 
			
		|||
    font-family: var(--baseFontFamily);
 | 
			
		||||
    font-weight: normal;
 | 
			
		||||
    border-radius: var(--baseRadius);
 | 
			
		||||
    overflow: auto; /* fallback */
 | 
			
		||||
    overflow: overlay;
 | 
			
		||||
    &::placeholder {
 | 
			
		||||
      color: var(--txtDisabledColor);
 | 
			
		||||
    }
 | 
			
		||||
    &:focus,
 | 
			
		||||
    &:focus-within {
 | 
			
		||||
        @include scrollbar(
 | 
			
		||||
            $thumbColor: var(--baseAlt3Color),
 | 
			
		||||
            $thumbActiveColor: var(--baseAlt4Color)
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
    &:focus,
 | 
			
		||||
    &.active {
 | 
			
		||||
        border-color: var(--primaryColor);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -393,13 +402,6 @@ input[type=number]::-webkit-outer-spin-button {
 | 
			
		|||
textarea {
 | 
			
		||||
    min-height: 80px;
 | 
			
		||||
    resize: vertical;
 | 
			
		||||
    &:focus,
 | 
			
		||||
    &:focus-within {
 | 
			
		||||
        @include scrollbar(
 | 
			
		||||
            $thumbColor: var(--baseAlt3Color),
 | 
			
		||||
            $thumbActiveColor: var(--baseAlt4Color)
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
select {
 | 
			
		||||
    padding-left: 8px;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue