@saasquatch/mint-components 1.8.5-20 → 1.8.5-21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i["throw"](e))}catch(e){o(e)}}function u(e){e.done?n(e.value):r(e.value).then(a,s)}u((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-ff17b3a4.system.js","./p-d5a682bf.system.js","./p-c5429a81.system.js","./p-4bd679a7.system.js","./p-f6934a55.system.js","./p-1a673057.system.js","./p-6333265f.system.js","./p-4f775e84.system.js","./p-a40d2ed3.system.js"],(function(e){"use strict";var t,n,i,r,o,a,s,u,l,c,d,f,v;return{setters:[function(e){t=e.r;n=e.h},function(e){i=e.k;r=e.f;o=e.n},function(e){a=e.j;s=e.$;u=e.b;l=e.i},function(e){c=e.c},function(){},function(){},function(e){d=e.s;f=e.g},function(){},function(e){v=e.P}],execute:function(){var y="sq:verify-submitted";function g(e){window[y]=e}function h(e){var t=this;var n=e.nextPage,o=e.failedPage,l=e.verifySuccessText,c=e.verifyEmailText,f=e.verifyInvalidText,v=e.networkErrorMessage,h=e.continueText;var m,p,b,x,T,w,_,I,S;var k=window[y];var E=i(null),P=E[0],j=E[1];var C=i(false),M=C[0],q=C[1];var N=a(),O=N[0],U=N[1],D=U.loading,G=U.data,L=U.errors;var V=new URLSearchParams(s.location.search);var A=V.get("oobCode");var B=V.get("email");var J=V.get("nextPage");var R=G===undefined&&L===undefined&&!!A;var Y=localStorage.getItem("sq:user-identity");var $=H(Y);var z=(m=$===null||$===void 0?void 0:$.managedIdentity)===null||m===void 0?void 0:m.email;var F=!!(((p=$===null||$===void 0?void 0:$.managedIdentity)===null||p===void 0?void 0:p.emailVerified)||(G===null||G===void 0?void 0:G.verifyManagedIdentityEmail.success));function H(e){try{return JSON.parse(e)}catch(e){return undefined}}var K=function(){return s.push({pathname:o,search:V.toString()&&"?"+V.toString()})};var Q=function(){V.delete("nextPage");var e=d(J||n);s.push(e.href)};var W=function(){console.debug("LOGOUT");setTimeout((function(){Q();u(undefined);g(false)}),3e3)};var X=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:g(true);return[4,O({oobCode:A})];case 1:n=i.sent();if(n instanceof Error||!((e=n===null||n===void 0?void 0:n.verifyManagedIdentityEmail)===null||e===void 0?void 0:e.success)){j({message:true})}else if((t=n===null||n===void 0?void 0:n.verifyManagedIdentityEmail)===null||t===void 0?void 0:t.success){q(true)}if(z&&z!==B){console.debug("email mismatch",{response:n});W();return[2]}console.debug("SUBMITTED",n);return[2]}}))}))};r((function(){console.log({verified:F,userIdent:$});if(F){q(true);setTimeout((function(){Q();u(undefined);g(false)}),3e3)}else if(!G&&!k&&A)X()}),[F,k,G,$]);return{states:{loading:D||R,success:M,error:((w=(T=(x=(b=P===null||P===void 0?void 0:P.response)===null||b===void 0?void 0:b.errors)===null||x===void 0?void 0:x[0])===null||T===void 0?void 0:T.extensions)===null||w===void 0?void 0:w.message)||((S=(I=(_=P===null||P===void 0?void 0:P.response)===null||_===void 0?void 0:_.errors)===null||I===void 0?void 0:I[0])===null||S===void 0?void 0:S.message)||(P===null||P===void 0?void 0:P.message)&&v,verified:F},data:{oobCode:A},callbacks:{failed:K,gotoNextPage:Q},content:{verifySuccessText:l,verifyEmailText:c,verifyInvalidText:f,continueText:h}}}var m=e("sqm_portal_verify_email",function(){function e(e){t(this,e);this.ignored=true;this.nextPage="/";this.failedPage="/";this.verifyEmailText="Verify your email";this.verifySuccessText="Your email has been verified and you are being redirected. If you are not redirected, please click Continue.";this.verifyInvalidText="The email verification code is invalid or has expired, please try again.";this.continueText="Continue";this.networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.";o(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=l()?p(f(this)):h(f(this)),t=e.states,i=e.data,r=e.callbacks,o=e.content;return n(v,{states:t,data:i,callbacks:r,content:o})};return e}());function p(e){return c({states:{error:"",loading:false,verified:true},data:{oobCode:"code"},callbacks:{failed:function(){console.log("failed")},gotoNextPage:function(){}},content:{verifySuccessText:e.verifySuccessText,verifyEmailText:e.verifyEmailText,verifyInvalidText:e.verifyInvalidText,continueText:e.continueText}},e.demoData||{},{arrayMerge:function(e,t){return t}})}}}}));
@@ -1 +0,0 @@
1
- import{r as e,h as i}from"./p-64c3217a.js";import{k as o,f as a,n as t}from"./p-2446212d.js";import{j as r,$ as s,b as n,i as l}from"./p-ab49b4e4.js";import{c as d}from"./p-c1086930.js";import"./p-02be1a88.js";import"./p-cef45012.js";import{s as c,g as v}from"./p-9ec99ced.js";import"./p-5d0c9424.js";import{P as u}from"./p-b9d010e0.js";function f(e){window["sq:verify-submitted"]=e}function m({nextPage:e,failedPage:i,verifySuccessText:t,verifyEmailText:l,verifyInvalidText:d,networkErrorMessage:v,continueText:u}){var m,p,h,y,g,x,T,b,j;const P=window["sq:verify-submitted"],[k,w]=o(null),[C,S]=o(!1),[E,{loading:I,data:M,errors:N}]=r(),O=new URLSearchParams(s.location.search),U=O.get("oobCode"),_=O.get("email"),q=O.get("nextPage"),L=void 0===M&&void 0===N&&!!U,A=function(e){try{return JSON.parse(e)}catch{return}}(localStorage.getItem("sq:user-identity")),B=null===(m=null==A?void 0:A.managedIdentity)||void 0===m?void 0:m.email,D=!(!(null===(p=null==A?void 0:A.managedIdentity)||void 0===p?void 0:p.emailVerified)&&!(null==M?void 0:M.verifyManagedIdentityEmail.success)),G=()=>{O.delete("nextPage");const i=c(q||e);s.push(i.href)};return a((()=>{console.log({verified:D,userIdent:A}),D?(S(!0),setTimeout((()=>{G(),n(void 0),f(!1)}),3e3)):M||P||!U||(async()=>{var e,i;f(!0);const o=await E({oobCode:U});if(o instanceof Error||!(null===(e=null==o?void 0:o.verifyManagedIdentityEmail)||void 0===e?void 0:e.success)?w({message:!0}):(null===(i=null==o?void 0:o.verifyManagedIdentityEmail)||void 0===i?void 0:i.success)&&S(!0),B&&B!==_)return console.debug("email mismatch",{response:o}),console.debug("LOGOUT"),void setTimeout((()=>{G(),n(void 0),f(!1)}),3e3);console.debug("SUBMITTED",o)})()}),[D,P,M,A]),{states:{loading:I||L,success:C,error:(null===(x=null===(g=null===(y=null===(h=null==k?void 0:k.response)||void 0===h?void 0:h.errors)||void 0===y?void 0:y[0])||void 0===g?void 0:g.extensions)||void 0===x?void 0:x.message)||(null===(j=null===(b=null===(T=null==k?void 0:k.response)||void 0===T?void 0:T.errors)||void 0===b?void 0:b[0])||void 0===j?void 0:j.message)||(null==k?void 0:k.message)&&v,verified:D},data:{oobCode:U},callbacks:{failed:()=>s.push({pathname:i,search:O.toString()&&"?"+O.toString()}),gotoNextPage:G},content:{verifySuccessText:t,verifyEmailText:l,verifyInvalidText:d,continueText:u}}}const p=class{constructor(i){e(this,i),this.ignored=!0,this.nextPage="/",this.failedPage="/",this.verifyEmailText="Verify your email",this.verifySuccessText="Your email has been verified and you are being redirected. If you are not redirected, please click Continue.",this.verifyInvalidText="The email verification code is invalid or has expired, please try again.",this.continueText="Continue",this.networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.",t(this)}disconnectedCallback(){}render(){const{states:e,data:o,callbacks:a,content:t}=l()?(r=v(this),d({states:{error:"",loading:!1,verified:!0},data:{oobCode:"code"},callbacks:{failed:()=>{console.log("failed")},gotoNextPage:()=>{}},content:{verifySuccessText:r.verifySuccessText,verifyEmailText:r.verifyEmailText,verifyInvalidText:r.verifyInvalidText,continueText:r.continueText}},r.demoData||{},{arrayMerge:(e,i)=>i})):m(v(this));var r;return i(u,{states:e,data:o,callbacks:a,content:t})}};export{p as sqm_portal_verify_email}