@aws-amplify/ui-vue 3.1.13 → 3.1.14

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.
package/dist/index.cjs CHANGED
@@ -35,4 +35,4 @@ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var ab
35
35
  The chosen QR Code version cannot contain this amount of data.
36
36
  Minimum version required to store current data is: `+a+`.
37
37
  `);const s=wb(t,n,i),l=Tn.getSymbolSize(t),u=new lb(l);return mb(u,t),hb(u),gb(u,t),Vn(u,n,0),t>=7&&yb(u,t),vb(u,s),isNaN(o)&&(o=or.getBestMask(u,Vn.bind(null,u,n))),or.applyMask(o,u),Vn(u,n,o),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:o,segments:i}}ja.create=function(t,n){if(typeof t=="undefined"||t==="")throw new Error("No input text");let o=Mn.M,i,a;return typeof n!="undefined"&&(o=Mn.from(n.errorCorrectionLevel,Mn.M),i=rn.from(n.version),a=or.from(n.maskPattern),n.toSJISFunc&&Tn.setToSJISFunction(n.toSJISFunc)),_b(t,i,o,a)};var ts={},Qr={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let o=n.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+n);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(a){return[a,a]}))),o.length===6&&o.push("F","F");const i=parseInt(o.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const i=typeof o.margin=="undefined"||o.margin===null||o.margin<0?4:o.margin,a=o.width&&o.width>=21?o.width:void 0,s=o.scale||4;return{width:a,scale:a?4:s,margin:i,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,i){return i.width&&i.width>=o+i.margin*2?i.width/(o+i.margin*2):i.scale},e.getImageWidth=function(o,i){const a=e.getScale(o,i);return Math.floor((o+i.margin*2)*a)},e.qrToImageData=function(o,i,a){const s=i.modules.size,l=i.modules.data,u=e.getScale(s,a),c=Math.floor((s+a.margin*2)*u),d=a.margin*u,m=[a.color.light,a.color.dark];for(let f=0;f<c;f++)for(let h=0;h<c;h++){let v=(f*c+h)*4,p=a.color.light;if(f>=d&&h>=d&&f<c-d&&h<c-d){const S=Math.floor((f-d)/u),w=Math.floor((h-d)/u);p=m[l[S*s+w]?1:0]}o[v++]=p.r,o[v++]=p.g,o[v++]=p.b,o[v]=p.a}}})(Qr);(function(e){const t=Qr;function n(i,a,s){i.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=s,a.width=s,a.style.height=s+"px",a.style.width=s+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,s,l){let u=l,c=s;typeof u=="undefined"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=o()),u=t.getOptions(u);const d=t.getImageWidth(a.modules.size,u),m=c.getContext("2d"),f=m.createImageData(d,d);return t.qrToImageData(f.data,a,u),n(m,c,d),m.putImageData(f,0,0),c},e.renderToDataURL=function(a,s,l){let u=l;typeof u=="undefined"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=e.render(a,s,u),d=u.type||"image/png",m=u.rendererOpts||{};return c.toDataURL(d,m.quality)}})(ts);var ns={};const bb=Qr;function Ai(e,t){const n=e.a/255,o=t+'="'+e.hex+'"';return n<1?o+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':o}function Fn(e,t,n){let o=e+t;return typeof n!="undefined"&&(o+=" "+n),o}function Cb(e,t,n){let o="",i=0,a=!1,s=0;for(let l=0;l<e.length;l++){const u=Math.floor(l%t),c=Math.floor(l/t);!u&&!a&&(a=!0),e[l]?(s++,l>0&&u>0&&e[l-1]||(o+=a?Fn("M",u+n,.5+c+n):Fn("m",i,0),i=0,a=!1),u+1<t&&e[l+1]||(o+=Fn("h",s),s=0)):i++}return o}ns.render=function(t,n,o){const i=bb.getOptions(n),a=t.modules.size,s=t.modules.data,l=a+i.margin*2,u=i.color.light.a?"<path "+Ai(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",c="<path "+Ai(i.color.dark,"stroke")+' d="'+Cb(s,a,i.margin)+'"/>',d='viewBox="0 0 '+l+" "+l+'"',m=i.width?'width="'+i.width+'" height="'+i.width+'" ':"",f='<svg xmlns="http://www.w3.org/2000/svg" '+m+d+' shape-rendering="crispEdges">'+u+c+`</svg>
38
- `;return typeof o=="function"&&o(null,f),f};const Eb=V_,ar=ja,rs=ts,Ab=ns;function Xr(e,t,n,o,i){const a=[].slice.call(arguments,1),s=a.length,l=typeof a[s-1]=="function";if(!l&&!Eb())throw new Error("Callback required as last argument");if(l){if(s<2)throw new Error("Too few arguments provided");s===2?(i=n,n=t,t=o=void 0):s===3&&(t.getContext&&typeof i=="undefined"?(i=o,o=void 0):(i=o,o=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=o=void 0):s===2&&!t.getContext&&(o=n,n=t,t=void 0),new Promise(function(u,c){try{const d=ar.create(n,o);u(e(d,t,o))}catch(d){c(d)}})}try{const u=ar.create(n,o);i(null,e(u,t,o))}catch(u){i(u)}}Tt.create=ar.create;Tt.toCanvas=Xr.bind(null,rs.render);Tt.toDataURL=Xr.bind(null,rs.renderToDataURL);Tt.toString=Xr.bind(null,function(e,t,n){return Ab.render(e,n)});const Tb={key:0},Ib=["src"],Pb={"data-amplify-copy-tooltip":""},Nb=r.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})],-1),kb=r.defineComponent({__name:"setup-totp",emits:["confirmSetupTOTPSubmit","backToSignInClicked"],setup(e,{emit:t}){var $,z,K;const n=new H.Logger("SetupTOTP-logger"),i=pe(le)(),a=r.useAttrs(),{state:s,send:l}=me(),{value:{context:u}}=s,c=r.computed(()=>ae(s.value)),{totpSecretCode:d,user:m}=c.value.context,f=(z=($=u==null?void 0:u.config)==null?void 0:$.formFields)==null?void 0:z.setupTOTP,{totpIssuer:h="AWSCognito",totpUsername:v=m==null?void 0:m.username}=(K=f==null?void 0:f.QR)!=null?K:{},p=typeof d=="string"&&typeof v=="string"?fl(h,v,d):null,S=r.reactive({qrCodeImageSource:"",isLoading:!0}),{getCopyText:w,getCopiedText:y,getBackToSignInText:g,getConfirmText:_}=fe,b=r.ref(w());function E(){typeof d=="string"&&navigator.clipboard.writeText(d),b.value=y()}r.onMounted(async()=>{if(!(!m||!p))try{S.qrCodeImageSource=await Tt.toDataURL(p)}catch(q){n.error(q)}finally{S.isLoading=!1}});const A=r.computed(()=>g()),P=r.computed(()=>_()),N=q=>{const{name:oe,value:ie}=q.target;l({type:"CHANGE",data:{name:oe,value:ie}})},T=q=>{a!=null&&a.onConfirmSetupTOTPSubmit?t("confirmSetupTOTPSubmit",q):x(q)},x=q=>{i.submitForm(Se(q))},O=()=>{a!=null&&a.onBackToSignInClicked?t("backToSignInClicked"):l({type:"SIGN_IN"})};return(q,oe)=>{const ie=Oe,Q=ne,ze=be,re=se,ct=Ee,dt=we,J=Ce;return r.renderSlot(q.$slots,"confirmSetupTOTPI",r.normalizeProps(r.guardReactiveProps(q.$attrs)),()=>[r.createVNode(Q,r.normalizeProps(r.guardReactiveProps(q.$attrs)),{default:r.withCtx(()=>[r.createVNode(J,{"data-amplify-authenticator-setup-totp":"",onInput:N,onSubmit:r.withModifiers(T,["prevent"])},{default:r.withCtx(()=>[r.createVNode(dt,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(c).matches("confirmSignIn.pending")},{default:r.withCtx(()=>[r.createVNode(Q,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(q.$slots,"header",{},()=>[r.createVNode(ie,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(" Setup TOTP ")]),_:1})]),r.createVNode(Q,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[S.isLoading?(r.openBlock(),r.createElementBlock("p",Tb,"Loading...")):(r.openBlock(),r.createElementBlock("img",{key:1,class:"amplify-image","data-amplify-qrcode":"",src:S.qrCodeImageSource,alt:"qr code",width:"228",height:"228"},null,8,Ib)),r.createVNode(Q,{class:"amplify-flex","data-amplify-copy":""},{default:r.withCtx(()=>[r.createElementVNode("div",null,r.toDisplayString(r.unref(d)),1),r.createVNode(Q,{"data-amplify-copy-svg":"",onClick:E},{default:r.withCtx(()=>[r.createElementVNode("div",Pb,r.toDisplayString(b.value),1),Nb]),_:1})]),_:1}),r.createVNode(Ae,{route:"setupTOTP"})]),_:1}),r.createVNode(ct,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var he;return[(he=r.unref(c).context)!=null&&he.remoteError?(r.openBlock(),r.createBlock(ze,{key:0},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(k)(r.unref(c).context.remoteError)),1)]),_:1})):r.createCommentVNode("",!0),r.createVNode(re,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,loading:!1,variation:"primary",type:"submit",disabled:r.unref(c).matches("confirmSignIn.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(P)),1)]),_:1},8,["disabled"]),r.createVNode(re,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(O,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(A)),1)]),_:1},8,["onClick"]),r.renderSlot(q.$slots,"footer",{onBackToSignInClicked:O,onSetupTOTPSubmit:T})]}),_:3})]),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),eo=r.defineComponent({__name:"authenticator-force-new-password-form-fields",setup(e){return(t,n)=>(r.openBlock(),r.createBlock(Ae,{route:"forceNewPassword"}))}}),to=r.defineComponent({__name:"force-new-password",emits:["haveAccountClicked","forceNewPasswordSubmit"],setup(e,{emit:t}){const n=r.useAttrs(),{state:o,send:i}=me(),s=pe(le)(),l=r.computed(()=>ae(o.value)),{getChangePasswordText:u,getChangingText:c,getBackToSignInText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=()=>{n!=null&&n.onHaveAccountClicked?t("haveAccountClicked"):i({type:"SIGN_IN"})},p=g=>{n!=null&&n.onForceNewPasswordSubmit?t("forceNewPasswordSubmit",g):S(g)},S=g=>{s.submitForm(Se(g))},w=g=>{const{name:_,value:b}=g.target;i({type:"CHANGE",data:{name:_,value:b}})};function y(g){const{name:_}=g.target;s.updateBlur({name:_})}return(g,_)=>{const b=Oe,E=ne,A=be,P=se,N=Ee,T=we,x=Ce;return r.renderSlot(g.$slots,"forceNewPasswordI",r.normalizeProps(r.guardReactiveProps(g.$attrs)),()=>[r.createVNode(E,r.normalizeProps(r.guardReactiveProps(g.$attrs)),{default:r.withCtx(()=>[r.createVNode(x,{"data-amplify-authenticator-forcenewpassword":"",onInput:w,onBlurCapture:y,onSubmit:r.withModifiers(p,["prevent"])},{default:r.withCtx(()=>[r.createVNode(T,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l).matches("forceNewPassword.pending")},{default:r.withCtx(()=>[r.renderSlot(g.$slots,"header",{},()=>[r.createVNode(b,{level:3,class:"amplify-heading"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1})]),r.createVNode(E,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(g.$slots,"force-new-password-form-fields",{},()=>[r.createVNode(eo)])]),_:3}),r.createVNode(N,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.unref(l).context.remoteError?(r.openBlock(),r.createBlock(A,{key:0,"data-ui-error":""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(k)(r.unref(l).context.remoteError)),1)]),_:1})):r.createCommentVNode("",!0),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,loading:!1,variation:"primary",style:{"font-weight":"normal"},disabled:r.unref(l).matches("signUp.submit")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(l).matches("forceNewPassword.pending")?r.unref(f)+"\u2026":r.unref(m)),1)]),_:1},8,["disabled"]),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(v,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["onClick"]),r.renderSlot(g.$slots,"footer",{onHaveAccountClicked:v,onForceNewPasswordSubmit:p})]),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),no=r.defineComponent({__name:"reset-password",emits:["resetPasswordSubmit","backToSignInClicked"],setup(e,{emit:t}){const n=r.useAttrs(),o=pe(le),{send:i,submitForm:a}=o(),{error:s,isPending:l}=r.toRefs(o()),{getBackToSignInText:u,getResetYourPasswordText:c,getSendCodeText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=y=>{n!=null&&n.onResetPasswordSubmit?t("resetPasswordSubmit",y):p(y)},p=y=>{a(Se(y))},S=y=>{const{name:g,value:_}=y.target;i({type:"CHANGE",data:{name:g,value:_}})},w=()=>{n!=null&&n.onBackToSignInClicked?t("backToSignInClicked"):i({type:"SIGN_IN"})};return(y,g)=>{const _=Oe,b=we,E=be,A=se,P=Ee,N=ne,T=Ce;return r.renderSlot(y.$slots,"resetPasswordSlotI",r.normalizeProps(r.guardReactiveProps(y.$attrs)),()=>[r.createVNode(T,r.mergeProps(y.$attrs,{"data-amplify-authenticator-resetpassword":"",onInput:S,onSubmit:r.withModifiers(v,["prevent"])}),{default:r.withCtx(()=>[r.createVNode(N,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(y.$slots,"header",{},()=>[r.createVNode(_,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(f)),1)]),_:1})]),r.createVNode(b,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l)},{default:r.withCtx(()=>[r.createVNode(Ae,{route:"resetPassword"})]),_:1},8,["disabled"]),r.createVNode(P,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.unref(s)?(r.openBlock(),r.createBlock(E,{key:0},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(k)(r.unref(s))),1)]),_:1})):r.createCommentVNode("",!0),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,variation:"primary",type:"submit",disabled:r.unref(l)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["disabled"]),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(w,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1},8,["onClick"]),r.renderSlot(y.$slots,"footer",{onBackToSignInClicked:w,onResetPasswordSubmit:v})]),_:3})]),_:3})]),_:3},16,["onSubmit"])])}}}),ro=r.defineComponent({__name:"confirm-reset-password",emits:["confirmResetPasswordSubmit","backToSignInClicked"],setup(e,{emit:t}){const{state:n,send:o}=me(),a=pe(le)(),s=r.useAttrs(),l=r.computed(()=>ae(n.value)),{getResendCodeText:u,getResetYourPasswordText:c,getSubmitText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=g=>{s!=null&&s.onConfirmResetPasswordSubmit?t("confirmResetPasswordSubmit",g):p(g)},p=g=>{a.submitForm(Se(g))},S=()=>{o({type:"RESEND"})},w=g=>{const{name:_,value:b}=g.target;o({type:"CHANGE",data:{name:_,value:b}})};function y(g){const{name:_}=g.target;a.updateBlur({name:_})}return(g,_)=>{const b=Oe,E=ne,A=be,P=se,N=Ee,T=we,x=Ce;return r.renderSlot(g.$slots,"confirmResetPasswordSlotI",r.normalizeProps(r.guardReactiveProps(g.$attrs)),()=>[r.createVNode(E,r.normalizeProps(r.guardReactiveProps(g.$attrs)),{default:r.withCtx(()=>[r.createVNode(x,{"data-amplify-authenticator-confirmResetpassword":"",onInput:w,onBlurCapture:y,onSubmit:r.withModifiers(v,["prevent"])},{default:r.withCtx(()=>[r.createVNode(T,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l).matches("confirmResetPassword.pending")},{default:r.withCtx(()=>[r.renderSlot(g.$slots,"header",{},()=>[r.createVNode(b,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(f)),1)]),_:1})]),r.createVNode(E,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.createVNode(Ae,{route:"confirmResetPassword"})]),_:1}),r.createVNode(N,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var O,$;return[($=(O=r.unref(l))==null?void 0:O.context)!=null&&$.remoteError?(r.openBlock(),r.createBlock(A,{key:0},{default:r.withCtx(()=>{var z,K;return[r.createTextVNode(r.toDisplayString(r.unref(k)((K=(z=r.unref(l))==null?void 0:z.context)==null?void 0:K.remoteError)),1)]}),_:1})):r.createCommentVNode("",!0),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",variation:"primary",fullwidth:!1,type:"submit",disabled:r.unref(l).matches("confirmResetPassword.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["disabled"]),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",variation:"link",fullwidth:!1,size:"small",type:"button",onClick:r.withModifiers(S,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1},8,["onClick"]),r.renderSlot(g.$slots,"footer",{onConfirmResetPasswordSubmit:v,onLostYourCodeClicked:S})]}),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),oo=r.defineComponent({__name:"verify-user",emits:["verifyUserSubmit","skipClicked"],setup(e,{emit:t}){const o=pe(le)(),i=r.useAttrs(),{state:a,send:s}=me(),l=r.computed(()=>ae(a.value)),{unverifiedContactMethods:u}=l.value.context,{getAccountRecoveryInfoText:c,getSkipText:d,getVerifyText:m,getVerifyContactText:f}=fe,h=r.computed(()=>c()),v=r.computed(()=>d()),p=r.computed(()=>m()),S=r.computed(()=>f()),w=b=>{const{name:E,value:A}=b.target;s({type:"CHANGE",data:{name:E,value:A}})},y=b=>{i!=null&&i.onVerifyUserSubmit?t("verifyUserSubmit",b):g(b)},g=b=>{o.submitForm(Se(b))},_=()=>{i!=null&&i.onSkipClicked?t("skipClicked"):s("SKIP")};return(b,E)=>{const A=Oe,P=_n,N=bn,T=La,x=ne,O=be,$=se,z=Ee,K=we,q=Ce;return r.renderSlot(b.$slots,"verifyUserSlotI",{},()=>[r.createVNode(x,null,{default:r.withCtx(()=>[r.createVNode(q,{onInput:w,onSubmit:r.withModifiers(y,["prevent"])},{default:r.withCtx(()=>[r.createVNode(K,{disabled:r.unref(l).matches("verifyUser.pending"),class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(b.$slots,"header",{},()=>[r.createVNode(A,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1})]),r.createVNode(x,{class:"amplify-flex amplify-field amplify-radiogroupfield amplify-authenticator__column"},{default:r.withCtx(()=>[r.createVNode(P,{class:"amplify-visually-hidden amplify-label",id:"amplify-field-493c"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(S)),1)]),_:1}),r.createVNode(x,{class:"amplify-flex amplify-field amplify-radiogroupfield amplify-authenticator__column","aria-labelledby":"amplify-field-493c"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u),(oe,ie)=>(r.openBlock(),r.createBlock(P,{class:"amplify-flex amplify-radio","data-amplify-verify-label":"",id:"verify",key:oe},{default:r.withCtx(()=>[r.createVNode(N,{class:"amplify-input amplify-field-group__control amplify-visually-hidden amplify-radio__input","aria-invalid":"false","data-amplify-verify-input":"",id:"verify",name:"unverifiedAttr",type:"radio",value:ie},null,8,["value"]),r.createVNode(T,{class:"amplify-flex amplify-radio__button","aria-hidden":"true"}),r.createVNode(T,{class:"amplify-text amplify-radio__label"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(on)[ie].label),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1}),r.createVNode(z,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var oe,ie;return[(ie=(oe=r.unref(l))==null?void 0:oe.context)!=null&&ie.remoteError?(r.openBlock(),r.createBlock(O,{key:0},{default:r.withCtx(()=>{var Q;return[r.createTextVNode(r.toDisplayString(r.unref(k)((Q=r.unref(l))==null?void 0:Q.context.remoteError)),1)]}),_:1})):r.createCommentVNode("",!0),r.createVNode($,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,variation:"primary",type:"submit",disabled:r.unref(l).matches("verifyUser.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(p)),1)]),_:1},8,["disabled"]),r.createVNode($,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(_,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(v)),1)]),_:1},8,["onClick"]),r.renderSlot(b.$slots,"footer",{onSkipClicked:_,onVerifyUserSubmit:y})]}),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3})])}}}),io=r.defineComponent({__name:"confirm-verify-user",emits:["confirmVerifyUserSubmit","skipClicked"],setup(e,{emit:t}){const o=pe(le)(),i=r.useAttrs(),{state:a,send:s}=me(),l=r.computed(()=>ae(a.value)),{getAccountRecoveryInfoText:u,getSkipText:c,getSubmitText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=y=>{const{name:g,value:_}=y.target;s({type:"CHANGE",data:{name:g,value:_}})},p=y=>{i!=null&&i.onConfirmVerifyUserSubmit?t("confirmVerifyUserSubmit",y):S(y)},S=y=>{o.submitForm(Se(y))},w=()=>{i!=null&&i.onSkipClicked?t("skipClicked"):s({type:"SKIP"})};return(y,g)=>{const _=Oe,b=ne,E=be,A=se,P=Ee,N=we,T=Ce;return r.renderSlot(y.$slots,"confirmVerifyUserSlotI",r.normalizeProps(r.guardReactiveProps(y.$attrs)),()=>[r.createVNode(b,r.normalizeProps(r.guardReactiveProps(y.$attrs)),{default:r.withCtx(()=>[r.createVNode(T,{onInput:v,onSubmit:r.withModifiers(p,["prevent"])},{default:r.withCtx(()=>[r.createVNode(N,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l).matches("confirmVerifyUser.pending")},{default:r.withCtx(()=>[r.renderSlot(y.$slots,"header",{},()=>[r.createVNode(_,{level:3,class:"amplify-heading"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1})]),r.createVNode(b,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.createVNode(Ae,{route:"confirmVerifyUser"})]),_:1}),r.createVNode(P,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var x,O;return[(O=(x=r.unref(l))==null?void 0:x.context)!=null&&O.remoteError?(r.openBlock(),r.createBlock(E,{key:0},{default:r.withCtx(()=>{var $;return[r.createTextVNode(r.toDisplayString(r.unref(k)(($=r.unref(l))==null?void 0:$.context.remoteError)),1)]}),_:1})):r.createCommentVNode("",!0),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,variation:"primary",type:"submit",disabled:r.unref(l).matches("confirmVerifyUser.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["disabled"]),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(w,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(f)),1)]),_:1},8,["onClick"]),r.renderSlot(y.$slots,"footer",{onSkipClicked:w,onConfirmVerifyUserSubmit:p})]}),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),xb="3.1.13",$b=["data-variation"],Ob={"data-amplify-container":""},Rb=["data-amplify-router-content"],Ub={key:1,"data-amplify-router-content":""},os=r.defineComponent({__name:"authenticator",props:{hideSignUp:{type:Boolean},initialState:null,loginMechanisms:null,services:null,signUpAttributes:null,variation:{default:"default"},socialProviders:null,formFields:null},emits:["signInSubmit","confirmSignUpSubmit","resetPasswordSubmit","confirmResetPasswordSubmit","confirmSignInSubmit","mSetupTOTPSubmit","forceNewPasswordSubmit","signUpSubmit","verifyUserSubmit","confirmVerifyUserSubmit"],setup(e,{emit:t}){const n=e,o=r.useAttrs(),{initialState:i,loginMechanisms:a,variation:s,services:l,signUpAttributes:u,socialProviders:c,hideSignUp:d,formFields:m}=r.toRefs(n),f=GS(),h=t_(f);let v,p;const{state:S,send:w}=Va(h);me(h);const y=r.ref(!1);p=h.subscribe(I=>{I.matches("setup")&&!y.value&&(w({type:"INIT",data:{initialState:i==null?void 0:i.value,loginMechanisms:a==null?void 0:a.value,socialProviders:c==null?void 0:c.value,signUpAttributes:u==null?void 0:u.value,services:l==null?void 0:l.value,formFields:m==null?void 0:m.value}}),y.value=!0)}).unsubscribe,r.onMounted(()=>{v=cl(h),ll({packageName:"@aws-amplify/ui-vue",version:xb})}),r.onUnmounted(()=>{v&&v(),p&&p()});const g=r.computed(()=>ae(S.value)),_=r.ref(),b=r.ref(),E=r.ref(),A=r.ref(),P=r.ref(),N=r.ref(),T=r.ref(),x=r.ref(),O=r.ref(),$=r.ref(),{getSignInTabText:z,getSignUpTabText:K}=fe,q=r.computed(()=>z()),oe=r.computed(()=>K()),ie=I=>{var ce;o!=null&&o.onSignInSubmit?t("signInSubmit",I):(ce=_.value)==null||ce.submit(I)},Q=I=>{o!=null&&o.onConfirmSignUpSubmit?t("confirmSignUpSubmit",I):E.value.submit(I)},ze=I=>{o!=null&&o.onResetPasswordSubmit?t("resetPasswordSubmit",I):T.value.submit(I)},re=I=>{o!=null&&o.onConfirmResetPasswordSubmit?t("confirmResetPasswordSubmit",I):x.value.submit(I)},ct=I=>{o!=null&&o.onConfirmSignInSubmit?t("confirmSignInSubmit",I):A.value.submit(I)},dt=I=>{o!=null&&o.onForceNewPasswordSubmit?t("mSetupTOTPSubmit",I):P.value.submit(I)},J=I=>{o!=null&&o.onForceNewPasswordSubmit?t("forceNewPasswordSubmit",I):N.value.submit(I)},he=I=>{o!=null&&o.onSignUpSubmit?t("signUpSubmit",I):b.value.submit()},ls=I=>{o!=null&&o.onVerifyUserSubmit?t("verifyUserSubmit",I):O.value.submit(I)},us=I=>{o!=null&&o.onConfirmVerifyUserSubmit?t("confirmVerifyUserSubmit",I):$.value.submit(I)},ao=r.ref(null),so=r.ref();r.watch(()=>S.value.context,()=>{const{user:I,signOut:ce}=Ii({send:w,state:S.value});ao.value=I,so.value=ce});const In=r.computed(()=>{var I,ce;return((I=g.value)==null?void 0:I.matches("signIn"))||((ce=g.value)==null?void 0:ce.matches("signUp"))}),cs=r.computed(()=>{var I;return!(S.value.matches("authenticated")||S.value.matches("idle")||S.value.matches("setup")||S.value.matches("signOut")||((I=g.value)==null?void 0:I.matches("autoSignIn")))});return(I,ce)=>{var uo,co,fo,po,mo,ho,go,yo,vo,wo,So,_o;const lo=$_,ds=U_;return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(cs)?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},I.$attrs,{"data-amplify-authenticator":"","data-variation":r.unref(s)}),[r.createElementVNode("div",Ob,[r.renderSlot(I.$slots,"header"),r.createElementVNode("div",{"data-amplify-router":"","data-amplify-router-content":r.unref(In)?void 0:""},[r.unref(In)&&!r.unref(d)?(r.openBlock(),r.createBlock(ds,{key:0},{default:r.withCtx(()=>{var Y,Z;return[r.createVNode(lo,{active:(Y=r.unref(g))==null?void 0:Y.matches("signIn"),id:44472,label:r.unref(q),onClick:ce[0]||(ce[0]=Pn=>r.unref(w)("SIGN_IN"))},null,8,["active","label"]),r.createVNode(lo,{active:(Z=r.unref(g))==null?void 0:Z.matches("signUp"),id:44471,label:r.unref(oe),onClick:ce[1]||(ce[1]=Pn=>r.unref(w)("SIGN_UP"))},null,8,["active","label"])]}),_:1})):r.createCommentVNode("",!0),r.unref(In)?(r.openBlock(),r.createElementBlock("div",Ub,[(uo=r.unref(g))!=null&&uo.matches("signIn")?(r.openBlock(),r.createBlock(Gr,{key:0,onSignInSubmit:ie,ref_key:"signInComponent",ref:_},{signInSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-in")]),form:r.withCtx(({info:Y,onSignInSubmit:Z,onForgotPasswordClicked:Pn,onInput:fs})=>[r.renderSlot(I.$slots,"sign-in-form",{info:Y,onInput:fs,onSignInSubmit:Z,onForgotPasswordClicked:Pn})]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-in-header")]),footer:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-in-footer")]),_:3},512)):r.createCommentVNode("",!0),((co=r.unref(g))==null?void 0:co.matches("signUp"))&&!r.unref(d)?(r.openBlock(),r.createBlock(Wr,{key:1,onSignUpSubmit:he,ref_key:"signUpComponent",ref:b},{signUpSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-up")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-up-header")]),"signup-fields":r.withCtx(({info:Y})=>[r.renderSlot(I.$slots,"sign-up-fields",{info:Y})]),footer:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-up-footer")]),_:3},512)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),(fo=r.unref(g))!=null&&fo.matches("confirmSignUp")?(r.openBlock(),r.createBlock(Yr,{key:2,onConfirmSignUpSubmit:Q,ref_key:"confirmSignUpComponent",ref:E},{confirmSignUpSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-up")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-up-header")]),footer:r.withCtx(({onConfirmSignUpSubmit:Y,onLostCodeClicked:Z})=>[r.renderSlot(I.$slots,"confirm-sign-up-footer",{onConfirmSignUpSubmit:Y,onLostCodeClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(po=r.unref(g))!=null&&po.matches("resetPassword")?(r.openBlock(),r.createBlock(no,{key:3,onResetPasswordSubmit:ze,ref_key:"resetPasswordComponent",ref:T},{resetPasswordSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"reset-password")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"reset-password-header")]),footer:r.withCtx(({onResetPasswordSubmit:Y,onBackToSignInClicked:Z})=>[r.renderSlot(I.$slots,"reset-password-footer",{onResetPasswordSubmit:Y,onBackToSignInClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(mo=r.unref(g))!=null&&mo.matches("confirmResetPassword")?(r.openBlock(),r.createBlock(ro,{key:4,onConfirmResetPasswordSubmit:re,ref_key:"confirmResetPasswordComponent",ref:x},{confirmResetPasswordSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-reset-password")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-reset-password-header")]),footer:r.withCtx(({onConfirmResetPasswordSubmit:Y,onLostYourCodeClicked:Z})=>[r.renderSlot(I.$slots,"confirm-reset-password-footer",{onConfirmResetPasswordSubmit:Y,onLostYourCodeClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(ho=r.unref(g))!=null&&ho.matches("confirmSignIn")?(r.openBlock(),r.createBlock(Kr,{key:5,onConfirmSignInSubmit:ct,ref_key:"confirmSignInComponent",ref:A},{confirmSignInSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-in")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-in-header")]),footer:r.withCtx(({onConfirmSignInSubmit:Y,onBackToSignInClicked:Z})=>[r.renderSlot(I.$slots,"confirm-sign-in-footer",{onConfirmSignInSubmit:Y,onBackToSignInClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),((go=r.unref(g))==null?void 0:go.matches("setupTOTP.edit"))||((yo=r.unref(g))==null?void 0:yo.matches("setupTOTP.submit"))?(r.openBlock(),r.createBlock(kb,{key:6,onConfirmSetupTotpSubmit:dt,ref_key:"confirmSetupTOTPComponent",ref:P},{confirmSetupTOTPI:r.withCtx(()=>[r.renderSlot(I.$slots,"setup-totp")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"setup-totp-header")]),footer:r.withCtx(({onSetupTOTPSubmit:Y,onBackToSignInClicked:Z})=>[r.renderSlot(I.$slots,"setup-totp-footer",{onSetupTOTPSubmit:Y,onBackToSignInClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(vo=r.unref(g))!=null&&vo.matches("forceNewPassword")?(r.openBlock(),r.createBlock(to,{key:7,onForceNewPasswordSubmit:J,ref_key:"forceNewPasswordComponent",ref:N},{forceNewPasswordI:r.withCtx(()=>[r.renderSlot(I.$slots,"force-new-password")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"force-new-password-header")]),"force-new-password-form-fields":r.withCtx(()=>[r.renderSlot(I.$slots,"force-new-password-form-fields")]),footer:r.withCtx(({onHaveAccountClicked:Y,onForceNewPasswordSubmit:Z})=>[r.renderSlot(I.$slots,"force-new-password-footer",{onForceNewPasswordSubmit:Z,onBackToSignInClicked:Y})]),_:3},512)):r.createCommentVNode("",!0),(wo=r.unref(g))!=null&&wo.matches("verifyUser")?(r.openBlock(),r.createBlock(oo,{key:8,onVerifyUserSubmit:ls,ref_key:"verifyUserComponent",ref:O},{verifyUserSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"verify-user")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"verify-user-header")]),footer:r.withCtx(({onVerifyUserSubmit:Y,onSkipClicked:Z})=>[r.renderSlot(I.$slots,"verify-user-footer",{onVerifyUserSubmit:Y,onSkipClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(So=r.unref(g))!=null&&So.matches("confirmVerifyUser")?(r.openBlock(),r.createBlock(io,{key:9,onConfirmVerifyUserSubmit:us,ref_key:"confirmVerifyUserComponent",ref:$},{confirmVerifyUserSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-verify-user")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-verify-user-header")]),footer:r.withCtx(({onConfirmVerifyUserSubmit:Y,onSkipClicked:Z})=>[r.renderSlot(I.$slots,"confirm-verify-user-footer",{onConfirmVerifyUserSubmit:Y,onSkipClicked:Z})]),_:3},512)):r.createCommentVNode("",!0)],8,Rb),r.renderSlot(I.$slots,"footer")])],16,$b)):r.createCommentVNode("",!0),(_o=r.unref(S))!=null&&_o.matches("authenticated")?r.renderSlot(I.$slots,"default",{key:1,user:ao.value,state:r.unref(S),signOut:so.value,send:r.unref(w)}):r.createCommentVNode("",!0)],64)}}}),is=r.defineComponent({props:{info:{type:Object}},setup(e){return()=>e.info}}),as=r.defineComponent({__name:"amplify-text-field",props:{label:{default:""},id:{default:""},autocomplete:{default:""},placeholder:{default:""},required:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},name:{default:""},type:{default:"text"},hideLabel:{type:Boolean,default:!0}},setup(e){const t=e,{label:n,id:o,autocomplete:i,placeholder:a,required:s,name:l,type:u}=r.toRefs(t);return(c,d)=>{const m=_n,f=bn,h=ne;return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(m,{class:r.normalizeClass(["amplify-label",{"amplify-visually-hidden":e.hideLabel}]),for:r.unref(o)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)),1)]),_:1},8,["class","for"]),r.createVNode(h,{class:"amplify-field-group__field-wrapper"},{default:r.withCtx(()=>[r.createVNode(f,{class:"amplify-input amplify-field-group__control",id:r.unref(o),"aria-invalid":"false",autocomplete:r.unref(i),placeholder:r.unref(a),required:r.unref(s),name:r.unref(l),disabled:e.disabled,type:r.unref(u)},null,8,["id","autocomplete","placeholder","required","name","disabled","type"])]),_:1})],64)}}}),Mb={class:"amplify-flex amplify-field amplify-checkboxfield"},Bb={class:"amplify-flex amplify-checkbox"},Vb={class:"amplify-visually-hidden"},Fb=["data-error","data-checked"],Db=["data-checked"],Lb=r.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"},null,-1),jb=[Lb],zb=r.createElementVNode("span",{class:"amplify-text amplify-checkbox__label"}," I agree with the Terms & Conditions",-1),Gb={key:0,class:"amplify-text amplify-field__error-message"},ss=r.defineComponent({__name:"amplify-check-box",props:{errorMessage:{default:""}},setup(e){const t=e,n=r.ref(!1),{errorMessage:o}=r.toRefs(t);return(i,a)=>(r.openBlock(),r.createElementBlock("div",Mb,[r.createElementVNode("label",Bb,[r.createElementVNode("span",Vb,[r.createElementVNode("input",{onClick:a[0]||(a[0]=s=>n.value=!n.value),class:"amplify-input amplify-field-group__control amplify-checkbox__input","aria-invalid":"false",type:"checkbox",name:"acknowledgement",value:"yes"})]),r.createElementVNode("span",{class:r.normalizeClass(["amplify-flex amplify-checkbox__button",{"amplify-checkbox__button--error":!n.value}]),"aria-hidden":"true","data-focus":"false","data-error":!n.value,"data-checked":n.value},[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:r.normalizeClass(["amplify-icon amplify-checkbox__icon",{"amplify-checkbox__icon--checked":n.value}]),viewBox:"0 0 24 24",fill:"currentColor","data-checked":n.value},jb,10,Db))],10,Fb),zb]),n.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("p",Gb,r.toDisplayString(r.unref(o)),1))]))}});var Hb={install:e=>{e.component("SignIn",Gr),e.component("SignUp",Wr),e.component("FederatedSignIn",Sn),e.component("Authenticator",os),e.component("RenderInfo",is),e.component("PasswordControl",zr),e.component("ForceNewPassword",to),e.component("ResetPassword",no),e.component("ConfirmResetPassword",ro),e.component("ConfirmSignUp",Yr),e.component("ConfirmSignIn",Kr),e.component("VerifyUser",oo),e.component("ConfirmVerifyUser",io),e.component("AmplifyTextField",as),e.component("AmplifyCheckBox",ss),e.component("AmplifyButton",se),e.component("BaseFormField",Da),e.component("BaseFormFields",Ae),e.component("AuthenticatorSignUpFormFields",Hr),e.component("AuthenticatorForceNewPasswordFormFields",eo)}};exports.AmplifyButton=se;exports.AmplifyCheckBox=ss;exports.AmplifyTextField=as;exports.Authenticator=os;exports.AuthenticatorForceNewPasswordFormFields=eo;exports.AuthenticatorSignUpFormFields=Hr;exports.ConfirmResetPassword=ro;exports.ConfirmSignIn=Kr;exports.ConfirmSignUp=Yr;exports.ConfirmVerifyUser=io;exports.FederatedSignIn=Sn;exports.ForceNewPassword=to;exports.PasswordControl=zr;exports.RenderInfo=is;exports.ResetPassword=no;exports.SignIn=Gr;exports.SignUp=Wr;exports.VerifyUser=oo;exports.default=Hb;exports.translations=nl;exports.useAuthenticator=le;
38
+ `;return typeof o=="function"&&o(null,f),f};const Eb=V_,ar=ja,rs=ts,Ab=ns;function Xr(e,t,n,o,i){const a=[].slice.call(arguments,1),s=a.length,l=typeof a[s-1]=="function";if(!l&&!Eb())throw new Error("Callback required as last argument");if(l){if(s<2)throw new Error("Too few arguments provided");s===2?(i=n,n=t,t=o=void 0):s===3&&(t.getContext&&typeof i=="undefined"?(i=o,o=void 0):(i=o,o=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=o=void 0):s===2&&!t.getContext&&(o=n,n=t,t=void 0),new Promise(function(u,c){try{const d=ar.create(n,o);u(e(d,t,o))}catch(d){c(d)}})}try{const u=ar.create(n,o);i(null,e(u,t,o))}catch(u){i(u)}}Tt.create=ar.create;Tt.toCanvas=Xr.bind(null,rs.render);Tt.toDataURL=Xr.bind(null,rs.renderToDataURL);Tt.toString=Xr.bind(null,function(e,t,n){return Ab.render(e,n)});const Tb={key:0},Ib=["src"],Pb={"data-amplify-copy-tooltip":""},Nb=r.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})],-1),kb=r.defineComponent({__name:"setup-totp",emits:["confirmSetupTOTPSubmit","backToSignInClicked"],setup(e,{emit:t}){var $,z,K;const n=new H.Logger("SetupTOTP-logger"),i=pe(le)(),a=r.useAttrs(),{state:s,send:l}=me(),{value:{context:u}}=s,c=r.computed(()=>ae(s.value)),{totpSecretCode:d,user:m}=c.value.context,f=(z=($=u==null?void 0:u.config)==null?void 0:$.formFields)==null?void 0:z.setupTOTP,{totpIssuer:h="AWSCognito",totpUsername:v=m==null?void 0:m.username}=(K=f==null?void 0:f.QR)!=null?K:{},p=typeof d=="string"&&typeof v=="string"?fl(h,v,d):null,S=r.reactive({qrCodeImageSource:"",isLoading:!0}),{getCopyText:w,getCopiedText:y,getBackToSignInText:g,getConfirmText:_}=fe,b=r.ref(w());function E(){typeof d=="string"&&navigator.clipboard.writeText(d),b.value=y()}r.onMounted(async()=>{if(!(!m||!p))try{S.qrCodeImageSource=await Tt.toDataURL(p)}catch(q){n.error(q)}finally{S.isLoading=!1}});const A=r.computed(()=>g()),P=r.computed(()=>_()),N=q=>{const{name:oe,value:ie}=q.target;l({type:"CHANGE",data:{name:oe,value:ie}})},T=q=>{a!=null&&a.onConfirmSetupTOTPSubmit?t("confirmSetupTOTPSubmit",q):x(q)},x=q=>{i.submitForm(Se(q))},O=()=>{a!=null&&a.onBackToSignInClicked?t("backToSignInClicked"):l({type:"SIGN_IN"})};return(q,oe)=>{const ie=Oe,Q=ne,ze=be,re=se,ct=Ee,dt=we,J=Ce;return r.renderSlot(q.$slots,"confirmSetupTOTPI",r.normalizeProps(r.guardReactiveProps(q.$attrs)),()=>[r.createVNode(Q,r.normalizeProps(r.guardReactiveProps(q.$attrs)),{default:r.withCtx(()=>[r.createVNode(J,{"data-amplify-authenticator-setup-totp":"",onInput:N,onSubmit:r.withModifiers(T,["prevent"])},{default:r.withCtx(()=>[r.createVNode(dt,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(c).matches("confirmSignIn.pending")},{default:r.withCtx(()=>[r.createVNode(Q,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(q.$slots,"header",{},()=>[r.createVNode(ie,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(" Setup TOTP ")]),_:1})]),r.createVNode(Q,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[S.isLoading?(r.openBlock(),r.createElementBlock("p",Tb,"Loading...")):(r.openBlock(),r.createElementBlock("img",{key:1,class:"amplify-image","data-amplify-qrcode":"",src:S.qrCodeImageSource,alt:"qr code",width:"228",height:"228"},null,8,Ib)),r.createVNode(Q,{class:"amplify-flex","data-amplify-copy":""},{default:r.withCtx(()=>[r.createElementVNode("div",null,r.toDisplayString(r.unref(d)),1),r.createVNode(Q,{"data-amplify-copy-svg":"",onClick:E},{default:r.withCtx(()=>[r.createElementVNode("div",Pb,r.toDisplayString(b.value),1),Nb]),_:1})]),_:1}),r.createVNode(Ae,{route:"setupTOTP"})]),_:1}),r.createVNode(ct,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var he;return[(he=r.unref(c).context)!=null&&he.remoteError?(r.openBlock(),r.createBlock(ze,{key:0},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(k)(r.unref(c).context.remoteError)),1)]),_:1})):r.createCommentVNode("",!0),r.createVNode(re,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,loading:!1,variation:"primary",type:"submit",disabled:r.unref(c).matches("confirmSignIn.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(P)),1)]),_:1},8,["disabled"]),r.createVNode(re,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(O,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(A)),1)]),_:1},8,["onClick"]),r.renderSlot(q.$slots,"footer",{onBackToSignInClicked:O,onSetupTOTPSubmit:T})]}),_:3})]),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),eo=r.defineComponent({__name:"authenticator-force-new-password-form-fields",setup(e){return(t,n)=>(r.openBlock(),r.createBlock(Ae,{route:"forceNewPassword"}))}}),to=r.defineComponent({__name:"force-new-password",emits:["haveAccountClicked","forceNewPasswordSubmit"],setup(e,{emit:t}){const n=r.useAttrs(),{state:o,send:i}=me(),s=pe(le)(),l=r.computed(()=>ae(o.value)),{getChangePasswordText:u,getChangingText:c,getBackToSignInText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=()=>{n!=null&&n.onHaveAccountClicked?t("haveAccountClicked"):i({type:"SIGN_IN"})},p=g=>{n!=null&&n.onForceNewPasswordSubmit?t("forceNewPasswordSubmit",g):S(g)},S=g=>{s.submitForm(Se(g))},w=g=>{const{name:_,value:b}=g.target;i({type:"CHANGE",data:{name:_,value:b}})};function y(g){const{name:_}=g.target;s.updateBlur({name:_})}return(g,_)=>{const b=Oe,E=ne,A=be,P=se,N=Ee,T=we,x=Ce;return r.renderSlot(g.$slots,"forceNewPasswordI",r.normalizeProps(r.guardReactiveProps(g.$attrs)),()=>[r.createVNode(E,r.normalizeProps(r.guardReactiveProps(g.$attrs)),{default:r.withCtx(()=>[r.createVNode(x,{"data-amplify-authenticator-forcenewpassword":"",onInput:w,onBlurCapture:y,onSubmit:r.withModifiers(p,["prevent"])},{default:r.withCtx(()=>[r.createVNode(T,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l).matches("forceNewPassword.pending")},{default:r.withCtx(()=>[r.renderSlot(g.$slots,"header",{},()=>[r.createVNode(b,{level:3,class:"amplify-heading"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1})]),r.createVNode(E,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(g.$slots,"force-new-password-form-fields",{},()=>[r.createVNode(eo)])]),_:3}),r.createVNode(N,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.unref(l).context.remoteError?(r.openBlock(),r.createBlock(A,{key:0,"data-ui-error":""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(k)(r.unref(l).context.remoteError)),1)]),_:1})):r.createCommentVNode("",!0),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,loading:!1,variation:"primary",style:{"font-weight":"normal"},disabled:r.unref(l).matches("signUp.submit")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(l).matches("forceNewPassword.pending")?r.unref(f)+"\u2026":r.unref(m)),1)]),_:1},8,["disabled"]),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(v,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["onClick"]),r.renderSlot(g.$slots,"footer",{onHaveAccountClicked:v,onForceNewPasswordSubmit:p})]),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),no=r.defineComponent({__name:"reset-password",emits:["resetPasswordSubmit","backToSignInClicked"],setup(e,{emit:t}){const n=r.useAttrs(),o=pe(le),{send:i,submitForm:a}=o(),{error:s,isPending:l}=r.toRefs(o()),{getBackToSignInText:u,getResetYourPasswordText:c,getSendCodeText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=y=>{n!=null&&n.onResetPasswordSubmit?t("resetPasswordSubmit",y):p(y)},p=y=>{a(Se(y))},S=y=>{const{name:g,value:_}=y.target;i({type:"CHANGE",data:{name:g,value:_}})},w=()=>{n!=null&&n.onBackToSignInClicked?t("backToSignInClicked"):i({type:"SIGN_IN"})};return(y,g)=>{const _=Oe,b=we,E=be,A=se,P=Ee,N=ne,T=Ce;return r.renderSlot(y.$slots,"resetPasswordSlotI",r.normalizeProps(r.guardReactiveProps(y.$attrs)),()=>[r.createVNode(T,r.mergeProps(y.$attrs,{"data-amplify-authenticator-resetpassword":"",onInput:S,onSubmit:r.withModifiers(v,["prevent"])}),{default:r.withCtx(()=>[r.createVNode(N,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(y.$slots,"header",{},()=>[r.createVNode(_,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(f)),1)]),_:1})]),r.createVNode(b,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l)},{default:r.withCtx(()=>[r.createVNode(Ae,{route:"resetPassword"})]),_:1},8,["disabled"]),r.createVNode(P,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.unref(s)?(r.openBlock(),r.createBlock(E,{key:0},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(k)(r.unref(s))),1)]),_:1})):r.createCommentVNode("",!0),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,variation:"primary",type:"submit",disabled:r.unref(l)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["disabled"]),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(w,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1},8,["onClick"]),r.renderSlot(y.$slots,"footer",{onBackToSignInClicked:w,onResetPasswordSubmit:v})]),_:3})]),_:3})]),_:3},16,["onSubmit"])])}}}),ro=r.defineComponent({__name:"confirm-reset-password",emits:["confirmResetPasswordSubmit","backToSignInClicked"],setup(e,{emit:t}){const{state:n,send:o}=me(),a=pe(le)(),s=r.useAttrs(),l=r.computed(()=>ae(n.value)),{getResendCodeText:u,getResetYourPasswordText:c,getSubmitText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=g=>{s!=null&&s.onConfirmResetPasswordSubmit?t("confirmResetPasswordSubmit",g):p(g)},p=g=>{a.submitForm(Se(g))},S=()=>{o({type:"RESEND"})},w=g=>{const{name:_,value:b}=g.target;o({type:"CHANGE",data:{name:_,value:b}})};function y(g){const{name:_}=g.target;a.updateBlur({name:_})}return(g,_)=>{const b=Oe,E=ne,A=be,P=se,N=Ee,T=we,x=Ce;return r.renderSlot(g.$slots,"confirmResetPasswordSlotI",r.normalizeProps(r.guardReactiveProps(g.$attrs)),()=>[r.createVNode(E,r.normalizeProps(r.guardReactiveProps(g.$attrs)),{default:r.withCtx(()=>[r.createVNode(x,{"data-amplify-authenticator-confirmResetpassword":"",onInput:w,onBlurCapture:y,onSubmit:r.withModifiers(v,["prevent"])},{default:r.withCtx(()=>[r.createVNode(T,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l).matches("confirmResetPassword.pending")},{default:r.withCtx(()=>[r.renderSlot(g.$slots,"header",{},()=>[r.createVNode(b,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(f)),1)]),_:1})]),r.createVNode(E,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.createVNode(Ae,{route:"confirmResetPassword"})]),_:1}),r.createVNode(N,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var O,$;return[($=(O=r.unref(l))==null?void 0:O.context)!=null&&$.remoteError?(r.openBlock(),r.createBlock(A,{key:0},{default:r.withCtx(()=>{var z,K;return[r.createTextVNode(r.toDisplayString(r.unref(k)((K=(z=r.unref(l))==null?void 0:z.context)==null?void 0:K.remoteError)),1)]}),_:1})):r.createCommentVNode("",!0),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",variation:"primary",fullwidth:!1,type:"submit",disabled:r.unref(l).matches("confirmResetPassword.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["disabled"]),r.createVNode(P,{class:"amplify-field-group__control amplify-authenticator__font",variation:"link",fullwidth:!1,size:"small",type:"button",onClick:r.withModifiers(S,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1},8,["onClick"]),r.renderSlot(g.$slots,"footer",{onConfirmResetPasswordSubmit:v,onLostYourCodeClicked:S})]}),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),oo=r.defineComponent({__name:"verify-user",emits:["verifyUserSubmit","skipClicked"],setup(e,{emit:t}){const o=pe(le)(),i=r.useAttrs(),{state:a,send:s}=me(),l=r.computed(()=>ae(a.value)),{unverifiedContactMethods:u}=l.value.context,{getAccountRecoveryInfoText:c,getSkipText:d,getVerifyText:m,getVerifyContactText:f}=fe,h=r.computed(()=>c()),v=r.computed(()=>d()),p=r.computed(()=>m()),S=r.computed(()=>f()),w=b=>{const{name:E,value:A}=b.target;s({type:"CHANGE",data:{name:E,value:A}})},y=b=>{i!=null&&i.onVerifyUserSubmit?t("verifyUserSubmit",b):g(b)},g=b=>{o.submitForm(Se(b))},_=()=>{i!=null&&i.onSkipClicked?t("skipClicked"):s("SKIP")};return(b,E)=>{const A=Oe,P=_n,N=bn,T=La,x=ne,O=be,$=se,z=Ee,K=we,q=Ce;return r.renderSlot(b.$slots,"verifyUserSlotI",{},()=>[r.createVNode(x,null,{default:r.withCtx(()=>[r.createVNode(q,{onInput:w,onSubmit:r.withModifiers(y,["prevent"])},{default:r.withCtx(()=>[r.createVNode(K,{disabled:r.unref(l).matches("verifyUser.pending"),class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.renderSlot(b.$slots,"header",{},()=>[r.createVNode(A,{class:"amplify-heading",level:3},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1})]),r.createVNode(x,{class:"amplify-flex amplify-field amplify-radiogroupfield amplify-authenticator__column"},{default:r.withCtx(()=>[r.createVNode(P,{class:"amplify-visually-hidden amplify-label",id:"amplify-field-493c"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(S)),1)]),_:1}),r.createVNode(x,{class:"amplify-flex amplify-field amplify-radiogroupfield amplify-authenticator__column","aria-labelledby":"amplify-field-493c"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u),(oe,ie)=>(r.openBlock(),r.createBlock(P,{class:"amplify-flex amplify-radio","data-amplify-verify-label":"",id:"verify",key:oe},{default:r.withCtx(()=>[r.createVNode(N,{class:"amplify-input amplify-field-group__control amplify-visually-hidden amplify-radio__input","aria-invalid":"false","data-amplify-verify-input":"",id:"verify",name:"unverifiedAttr",type:"radio",value:ie},null,8,["value"]),r.createVNode(T,{class:"amplify-flex amplify-radio__button","aria-hidden":"true"}),r.createVNode(T,{class:"amplify-text amplify-radio__label"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(on)[ie].label),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1}),r.createVNode(z,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var oe,ie;return[(ie=(oe=r.unref(l))==null?void 0:oe.context)!=null&&ie.remoteError?(r.openBlock(),r.createBlock(O,{key:0},{default:r.withCtx(()=>{var Q;return[r.createTextVNode(r.toDisplayString(r.unref(k)((Q=r.unref(l))==null?void 0:Q.context.remoteError)),1)]}),_:1})):r.createCommentVNode("",!0),r.createVNode($,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,variation:"primary",type:"submit",disabled:r.unref(l).matches("verifyUser.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(p)),1)]),_:1},8,["disabled"]),r.createVNode($,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(_,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(v)),1)]),_:1},8,["onClick"]),r.renderSlot(b.$slots,"footer",{onSkipClicked:_,onVerifyUserSubmit:y})]}),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3})])}}}),io=r.defineComponent({__name:"confirm-verify-user",emits:["confirmVerifyUserSubmit","skipClicked"],setup(e,{emit:t}){const o=pe(le)(),i=r.useAttrs(),{state:a,send:s}=me(),l=r.computed(()=>ae(a.value)),{getAccountRecoveryInfoText:u,getSkipText:c,getSubmitText:d}=fe,m=r.computed(()=>u()),f=r.computed(()=>c()),h=r.computed(()=>d()),v=y=>{const{name:g,value:_}=y.target;s({type:"CHANGE",data:{name:g,value:_}})},p=y=>{i!=null&&i.onConfirmVerifyUserSubmit?t("confirmVerifyUserSubmit",y):S(y)},S=y=>{o.submitForm(Se(y))},w=()=>{i!=null&&i.onSkipClicked?t("skipClicked"):s({type:"SKIP"})};return(y,g)=>{const _=Oe,b=ne,E=be,A=se,P=Ee,N=we,T=Ce;return r.renderSlot(y.$slots,"confirmVerifyUserSlotI",r.normalizeProps(r.guardReactiveProps(y.$attrs)),()=>[r.createVNode(b,r.normalizeProps(r.guardReactiveProps(y.$attrs)),{default:r.withCtx(()=>[r.createVNode(T,{onInput:v,onSubmit:r.withModifiers(p,["prevent"])},{default:r.withCtx(()=>[r.createVNode(N,{class:"amplify-flex amplify-authenticator__column",disabled:r.unref(l).matches("confirmVerifyUser.pending")},{default:r.withCtx(()=>[r.renderSlot(y.$slots,"header",{},()=>[r.createVNode(_,{level:3,class:"amplify-heading"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(m)),1)]),_:1})]),r.createVNode(b,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>[r.createVNode(Ae,{route:"confirmVerifyUser"})]),_:1}),r.createVNode(P,{class:"amplify-flex amplify-authenticator__column"},{default:r.withCtx(()=>{var x,O;return[(O=(x=r.unref(l))==null?void 0:x.context)!=null&&O.remoteError?(r.openBlock(),r.createBlock(E,{key:0},{default:r.withCtx(()=>{var $;return[r.createTextVNode(r.toDisplayString(r.unref(k)(($=r.unref(l))==null?void 0:$.context.remoteError)),1)]}),_:1})):r.createCommentVNode("",!0),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,variation:"primary",type:"submit",disabled:r.unref(l).matches("confirmVerifyUser.pending")},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(h)),1)]),_:1},8,["disabled"]),r.createVNode(A,{class:"amplify-field-group__control amplify-authenticator__font",fullwidth:!1,size:"small",variation:"link",style:{"font-weight":"normal"},type:"button",onClick:r.withModifiers(w,["prevent"])},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(f)),1)]),_:1},8,["onClick"]),r.renderSlot(y.$slots,"footer",{onSkipClicked:w,onConfirmVerifyUserSubmit:p})]}),_:3})]),_:3},8,["disabled"])]),_:3},8,["onSubmit"])]),_:3},16)])}}}),xb="3.1.14",$b=["data-variation"],Ob={"data-amplify-container":""},Rb=["data-amplify-router-content"],Ub={key:1,"data-amplify-router-content":""},os=r.defineComponent({__name:"authenticator",props:{hideSignUp:{type:Boolean},initialState:null,loginMechanisms:null,services:null,signUpAttributes:null,variation:{default:"default"},socialProviders:null,formFields:null},emits:["signInSubmit","confirmSignUpSubmit","resetPasswordSubmit","confirmResetPasswordSubmit","confirmSignInSubmit","mSetupTOTPSubmit","forceNewPasswordSubmit","signUpSubmit","verifyUserSubmit","confirmVerifyUserSubmit"],setup(e,{emit:t}){const n=e,o=r.useAttrs(),{initialState:i,loginMechanisms:a,variation:s,services:l,signUpAttributes:u,socialProviders:c,hideSignUp:d,formFields:m}=r.toRefs(n),f=GS(),h=t_(f);let v,p;const{state:S,send:w}=Va(h);me(h);const y=r.ref(!1);p=h.subscribe(I=>{I.matches("setup")&&!y.value&&(w({type:"INIT",data:{initialState:i==null?void 0:i.value,loginMechanisms:a==null?void 0:a.value,socialProviders:c==null?void 0:c.value,signUpAttributes:u==null?void 0:u.value,services:l==null?void 0:l.value,formFields:m==null?void 0:m.value}}),y.value=!0)}).unsubscribe,r.onMounted(()=>{v=cl(h),ll({packageName:"@aws-amplify/ui-vue",version:xb})}),r.onUnmounted(()=>{v&&v(),p&&p()});const g=r.computed(()=>ae(S.value)),_=r.ref(),b=r.ref(),E=r.ref(),A=r.ref(),P=r.ref(),N=r.ref(),T=r.ref(),x=r.ref(),O=r.ref(),$=r.ref(),{getSignInTabText:z,getSignUpTabText:K}=fe,q=r.computed(()=>z()),oe=r.computed(()=>K()),ie=I=>{var ce;o!=null&&o.onSignInSubmit?t("signInSubmit",I):(ce=_.value)==null||ce.submit(I)},Q=I=>{o!=null&&o.onConfirmSignUpSubmit?t("confirmSignUpSubmit",I):E.value.submit(I)},ze=I=>{o!=null&&o.onResetPasswordSubmit?t("resetPasswordSubmit",I):T.value.submit(I)},re=I=>{o!=null&&o.onConfirmResetPasswordSubmit?t("confirmResetPasswordSubmit",I):x.value.submit(I)},ct=I=>{o!=null&&o.onConfirmSignInSubmit?t("confirmSignInSubmit",I):A.value.submit(I)},dt=I=>{o!=null&&o.onForceNewPasswordSubmit?t("mSetupTOTPSubmit",I):P.value.submit(I)},J=I=>{o!=null&&o.onForceNewPasswordSubmit?t("forceNewPasswordSubmit",I):N.value.submit(I)},he=I=>{o!=null&&o.onSignUpSubmit?t("signUpSubmit",I):b.value.submit()},ls=I=>{o!=null&&o.onVerifyUserSubmit?t("verifyUserSubmit",I):O.value.submit(I)},us=I=>{o!=null&&o.onConfirmVerifyUserSubmit?t("confirmVerifyUserSubmit",I):$.value.submit(I)},ao=r.ref(null),so=r.ref();r.watch(()=>S.value.context,()=>{const{user:I,signOut:ce}=Ii({send:w,state:S.value});ao.value=I,so.value=ce});const In=r.computed(()=>{var I,ce;return((I=g.value)==null?void 0:I.matches("signIn"))||((ce=g.value)==null?void 0:ce.matches("signUp"))}),cs=r.computed(()=>{var I;return!(S.value.matches("authenticated")||S.value.matches("idle")||S.value.matches("setup")||S.value.matches("signOut")||((I=g.value)==null?void 0:I.matches("autoSignIn")))});return(I,ce)=>{var uo,co,fo,po,mo,ho,go,yo,vo,wo,So,_o;const lo=$_,ds=U_;return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.unref(cs)?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},I.$attrs,{"data-amplify-authenticator":"","data-variation":r.unref(s)}),[r.createElementVNode("div",Ob,[r.renderSlot(I.$slots,"header"),r.createElementVNode("div",{"data-amplify-router":"","data-amplify-router-content":r.unref(In)?void 0:""},[r.unref(In)&&!r.unref(d)?(r.openBlock(),r.createBlock(ds,{key:0},{default:r.withCtx(()=>{var Y,Z;return[r.createVNode(lo,{active:(Y=r.unref(g))==null?void 0:Y.matches("signIn"),id:44472,label:r.unref(q),onClick:ce[0]||(ce[0]=Pn=>r.unref(w)("SIGN_IN"))},null,8,["active","label"]),r.createVNode(lo,{active:(Z=r.unref(g))==null?void 0:Z.matches("signUp"),id:44471,label:r.unref(oe),onClick:ce[1]||(ce[1]=Pn=>r.unref(w)("SIGN_UP"))},null,8,["active","label"])]}),_:1})):r.createCommentVNode("",!0),r.unref(In)?(r.openBlock(),r.createElementBlock("div",Ub,[(uo=r.unref(g))!=null&&uo.matches("signIn")?(r.openBlock(),r.createBlock(Gr,{key:0,onSignInSubmit:ie,ref_key:"signInComponent",ref:_},{signInSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-in")]),form:r.withCtx(({info:Y,onSignInSubmit:Z,onForgotPasswordClicked:Pn,onInput:fs})=>[r.renderSlot(I.$slots,"sign-in-form",{info:Y,onInput:fs,onSignInSubmit:Z,onForgotPasswordClicked:Pn})]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-in-header")]),footer:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-in-footer")]),_:3},512)):r.createCommentVNode("",!0),((co=r.unref(g))==null?void 0:co.matches("signUp"))&&!r.unref(d)?(r.openBlock(),r.createBlock(Wr,{key:1,onSignUpSubmit:he,ref_key:"signUpComponent",ref:b},{signUpSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-up")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-up-header")]),"signup-fields":r.withCtx(({info:Y})=>[r.renderSlot(I.$slots,"sign-up-fields",{info:Y})]),footer:r.withCtx(()=>[r.renderSlot(I.$slots,"sign-up-footer")]),_:3},512)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),(fo=r.unref(g))!=null&&fo.matches("confirmSignUp")?(r.openBlock(),r.createBlock(Yr,{key:2,onConfirmSignUpSubmit:Q,ref_key:"confirmSignUpComponent",ref:E},{confirmSignUpSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-up")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-up-header")]),footer:r.withCtx(({onConfirmSignUpSubmit:Y,onLostCodeClicked:Z})=>[r.renderSlot(I.$slots,"confirm-sign-up-footer",{onConfirmSignUpSubmit:Y,onLostCodeClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(po=r.unref(g))!=null&&po.matches("resetPassword")?(r.openBlock(),r.createBlock(no,{key:3,onResetPasswordSubmit:ze,ref_key:"resetPasswordComponent",ref:T},{resetPasswordSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"reset-password")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"reset-password-header")]),footer:r.withCtx(({onResetPasswordSubmit:Y,onBackToSignInClicked:Z})=>[r.renderSlot(I.$slots,"reset-password-footer",{onResetPasswordSubmit:Y,onBackToSignInClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(mo=r.unref(g))!=null&&mo.matches("confirmResetPassword")?(r.openBlock(),r.createBlock(ro,{key:4,onConfirmResetPasswordSubmit:re,ref_key:"confirmResetPasswordComponent",ref:x},{confirmResetPasswordSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-reset-password")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-reset-password-header")]),footer:r.withCtx(({onConfirmResetPasswordSubmit:Y,onLostYourCodeClicked:Z})=>[r.renderSlot(I.$slots,"confirm-reset-password-footer",{onConfirmResetPasswordSubmit:Y,onLostYourCodeClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(ho=r.unref(g))!=null&&ho.matches("confirmSignIn")?(r.openBlock(),r.createBlock(Kr,{key:5,onConfirmSignInSubmit:ct,ref_key:"confirmSignInComponent",ref:A},{confirmSignInSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-in")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-sign-in-header")]),footer:r.withCtx(({onConfirmSignInSubmit:Y,onBackToSignInClicked:Z})=>[r.renderSlot(I.$slots,"confirm-sign-in-footer",{onConfirmSignInSubmit:Y,onBackToSignInClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),((go=r.unref(g))==null?void 0:go.matches("setupTOTP.edit"))||((yo=r.unref(g))==null?void 0:yo.matches("setupTOTP.submit"))?(r.openBlock(),r.createBlock(kb,{key:6,onConfirmSetupTotpSubmit:dt,ref_key:"confirmSetupTOTPComponent",ref:P},{confirmSetupTOTPI:r.withCtx(()=>[r.renderSlot(I.$slots,"setup-totp")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"setup-totp-header")]),footer:r.withCtx(({onSetupTOTPSubmit:Y,onBackToSignInClicked:Z})=>[r.renderSlot(I.$slots,"setup-totp-footer",{onSetupTOTPSubmit:Y,onBackToSignInClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(vo=r.unref(g))!=null&&vo.matches("forceNewPassword")?(r.openBlock(),r.createBlock(to,{key:7,onForceNewPasswordSubmit:J,ref_key:"forceNewPasswordComponent",ref:N},{forceNewPasswordI:r.withCtx(()=>[r.renderSlot(I.$slots,"force-new-password")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"force-new-password-header")]),"force-new-password-form-fields":r.withCtx(()=>[r.renderSlot(I.$slots,"force-new-password-form-fields")]),footer:r.withCtx(({onHaveAccountClicked:Y,onForceNewPasswordSubmit:Z})=>[r.renderSlot(I.$slots,"force-new-password-footer",{onForceNewPasswordSubmit:Z,onBackToSignInClicked:Y})]),_:3},512)):r.createCommentVNode("",!0),(wo=r.unref(g))!=null&&wo.matches("verifyUser")?(r.openBlock(),r.createBlock(oo,{key:8,onVerifyUserSubmit:ls,ref_key:"verifyUserComponent",ref:O},{verifyUserSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"verify-user")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"verify-user-header")]),footer:r.withCtx(({onVerifyUserSubmit:Y,onSkipClicked:Z})=>[r.renderSlot(I.$slots,"verify-user-footer",{onVerifyUserSubmit:Y,onSkipClicked:Z})]),_:3},512)):r.createCommentVNode("",!0),(So=r.unref(g))!=null&&So.matches("confirmVerifyUser")?(r.openBlock(),r.createBlock(io,{key:9,onConfirmVerifyUserSubmit:us,ref_key:"confirmVerifyUserComponent",ref:$},{confirmVerifyUserSlotI:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-verify-user")]),header:r.withCtx(()=>[r.renderSlot(I.$slots,"confirm-verify-user-header")]),footer:r.withCtx(({onConfirmVerifyUserSubmit:Y,onSkipClicked:Z})=>[r.renderSlot(I.$slots,"confirm-verify-user-footer",{onConfirmVerifyUserSubmit:Y,onSkipClicked:Z})]),_:3},512)):r.createCommentVNode("",!0)],8,Rb),r.renderSlot(I.$slots,"footer")])],16,$b)):r.createCommentVNode("",!0),(_o=r.unref(S))!=null&&_o.matches("authenticated")?r.renderSlot(I.$slots,"default",{key:1,user:ao.value,state:r.unref(S),signOut:so.value,send:r.unref(w)}):r.createCommentVNode("",!0)],64)}}}),is=r.defineComponent({props:{info:{type:Object}},setup(e){return()=>e.info}}),as=r.defineComponent({__name:"amplify-text-field",props:{label:{default:""},id:{default:""},autocomplete:{default:""},placeholder:{default:""},required:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},name:{default:""},type:{default:"text"},hideLabel:{type:Boolean,default:!0}},setup(e){const t=e,{label:n,id:o,autocomplete:i,placeholder:a,required:s,name:l,type:u}=r.toRefs(t);return(c,d)=>{const m=_n,f=bn,h=ne;return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(m,{class:r.normalizeClass(["amplify-label",{"amplify-visually-hidden":e.hideLabel}]),for:r.unref(o)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)),1)]),_:1},8,["class","for"]),r.createVNode(h,{class:"amplify-field-group__field-wrapper"},{default:r.withCtx(()=>[r.createVNode(f,{class:"amplify-input amplify-field-group__control",id:r.unref(o),"aria-invalid":"false",autocomplete:r.unref(i),placeholder:r.unref(a),required:r.unref(s),name:r.unref(l),disabled:e.disabled,type:r.unref(u)},null,8,["id","autocomplete","placeholder","required","name","disabled","type"])]),_:1})],64)}}}),Mb={class:"amplify-flex amplify-field amplify-checkboxfield"},Bb={class:"amplify-flex amplify-checkbox"},Vb={class:"amplify-visually-hidden"},Fb=["data-error","data-checked"],Db=["data-checked"],Lb=r.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"},null,-1),jb=[Lb],zb=r.createElementVNode("span",{class:"amplify-text amplify-checkbox__label"}," I agree with the Terms & Conditions",-1),Gb={key:0,class:"amplify-text amplify-field__error-message"},ss=r.defineComponent({__name:"amplify-check-box",props:{errorMessage:{default:""}},setup(e){const t=e,n=r.ref(!1),{errorMessage:o}=r.toRefs(t);return(i,a)=>(r.openBlock(),r.createElementBlock("div",Mb,[r.createElementVNode("label",Bb,[r.createElementVNode("span",Vb,[r.createElementVNode("input",{onClick:a[0]||(a[0]=s=>n.value=!n.value),class:"amplify-input amplify-field-group__control amplify-checkbox__input","aria-invalid":"false",type:"checkbox",name:"acknowledgement",value:"yes"})]),r.createElementVNode("span",{class:r.normalizeClass(["amplify-flex amplify-checkbox__button",{"amplify-checkbox__button--error":!n.value}]),"aria-hidden":"true","data-focus":"false","data-error":!n.value,"data-checked":n.value},[(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:r.normalizeClass(["amplify-icon amplify-checkbox__icon",{"amplify-checkbox__icon--checked":n.value}]),viewBox:"0 0 24 24",fill:"currentColor","data-checked":n.value},jb,10,Db))],10,Fb),zb]),n.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("p",Gb,r.toDisplayString(r.unref(o)),1))]))}});var Hb={install:e=>{e.component("SignIn",Gr),e.component("SignUp",Wr),e.component("FederatedSignIn",Sn),e.component("Authenticator",os),e.component("RenderInfo",is),e.component("PasswordControl",zr),e.component("ForceNewPassword",to),e.component("ResetPassword",no),e.component("ConfirmResetPassword",ro),e.component("ConfirmSignUp",Yr),e.component("ConfirmSignIn",Kr),e.component("VerifyUser",oo),e.component("ConfirmVerifyUser",io),e.component("AmplifyTextField",as),e.component("AmplifyCheckBox",ss),e.component("AmplifyButton",se),e.component("BaseFormField",Da),e.component("BaseFormFields",Ae),e.component("AuthenticatorSignUpFormFields",Hr),e.component("AuthenticatorForceNewPasswordFormFields",eo)}};exports.AmplifyButton=se;exports.AmplifyCheckBox=ss;exports.AmplifyTextField=as;exports.Authenticator=os;exports.AuthenticatorForceNewPasswordFormFields=eo;exports.AuthenticatorSignUpFormFields=Hr;exports.ConfirmResetPassword=ro;exports.ConfirmSignIn=Kr;exports.ConfirmSignUp=Yr;exports.ConfirmVerifyUser=io;exports.FederatedSignIn=Sn;exports.ForceNewPassword=to;exports.PasswordControl=zr;exports.RenderInfo=is;exports.ResetPassword=no;exports.SignIn=Gr;exports.SignUp=Wr;exports.VerifyUser=oo;exports.default=Hb;exports.translations=nl;exports.useAuthenticator=le;
package/dist/index.js CHANGED
@@ -10770,7 +10770,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
10770
10770
  };
10771
10771
  }
10772
10772
  });
10773
- const VERSION = "3.1.13";
10773
+ const VERSION = "3.1.14";
10774
10774
  const _hoisted_1$1 = ["data-variation"];
10775
10775
  const _hoisted_2$1 = { "data-amplify-container": "" };
10776
10776
  const _hoisted_3$1 = ["data-amplify-router-content"];
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.1.13";
1
+ export declare const VERSION = "3.1.14";
2
2
  //# sourceMappingURL=version.d.ts.map