@movmo_app/react-common 0.17.0 → 0.17.1
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +0 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -111,5 +111,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
111
111
|
Copyright (c) 2017 Jed Watson.
|
|
112
112
|
Licensed under the MIT License (MIT), see
|
|
113
113
|
http://jedwatson.github.io/classnames
|
|
114
|
-
*/(function(){var n={}.hasOwnProperty;function o(){for(var i=[],l=0;l<arguments.length;l++){var s=arguments[l];if(s){var c=typeof s;if(c==="string"||c==="number")i.push(s);else if(Array.isArray(s)&&s.length){var d=o.apply(null,s);d&&i.push(d)}else if(c==="object")for(var f in s)n.call(s,f)&&s[f]&&i.push(f)}}return i.join(" ")}e.exports?(o.default=o,e.exports=o):(a=(function(){return o}).apply(t,[]))===void 0||(e.exports=a)})()},function(e,t,r){(function(a){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c=typeof a=="object"&&a&&a.Object===Object&&a,d=typeof self=="object"&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),y=Object.prototype.toString,C=f.Symbol,b=C?C.prototype:void 0,h=b?b.toString:void 0;function p(A){if(typeof A=="string")return A;if(E(A))return h?h.call(A):"";var I=A+"";return I=="0"&&1/A==-1/0?"-0":I}function x(A){var I=typeof A;return!!A&&(I=="object"||I=="function")}function E(A){return typeof A=="symbol"||function(I){return!!I&&typeof I=="object"}(A)&&y.call(A)=="[object Symbol]"}function R(A){return A?(A=function(I){if(typeof I=="number")return I;if(E(I))return NaN;if(x(I)){var j=typeof I.valueOf=="function"?I.valueOf():I;I=x(j)?j+"":j}if(typeof I!="string")return I===0?I:+I;I=I.replace(n,"");var F=i.test(I);return F||l.test(I)?s(I.slice(2),F?2:8):o.test(I)?NaN:+I}(A))===1/0||A===-1/0?17976931348623157e292*(A<0?-1:1):A==A?A:0:A===0?A:0}e.exports=function(A,I,j){var F,M,oe,re;return A=(F=A)==null?"":p(F),M=function(ce){var z=R(ce),le=z%1;return z==z?le?z-le:z:0}(j),oe=0,re=A.length,M==M&&(re!==void 0&&(M=M<=re?M:re),oe!==void 0&&(M=M>=oe?M:oe)),j=M,I=p(I),A.slice(j,j+I.length)==I}}).call(this,r(3))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}e.exports=r},function(e,t,r){(function(a){var n=/^\[object .+?Constructor\]$/,o=typeof a=="object"&&a&&a.Object===Object&&a,i=typeof self=="object"&&self&&self.Object===Object&&self,l=o||i||Function("return this")(),s,c=Array.prototype,d=Function.prototype,f=Object.prototype,y=l["__core-js_shared__"],C=(s=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",b=d.toString,h=f.hasOwnProperty,p=f.toString,x=RegExp("^"+b.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=c.splice,R=ce(l,"Map"),A=ce(Object,"create");function I(G){var O=-1,V=G?G.length:0;for(this.clear();++O<V;){var $=G[O];this.set($[0],$[1])}}function j(G){var O=-1,V=G?G.length:0;for(this.clear();++O<V;){var $=G[O];this.set($[0],$[1])}}function F(G){var O=-1,V=G?G.length:0;for(this.clear();++O<V;){var $=G[O];this.set($[0],$[1])}}function M(G,O){for(var V,$,ne=G.length;ne--;)if((V=G[ne][0])===($=O)||V!=V&&$!=$)return ne;return-1}function oe(G){return!(!le(G)||(O=G,C&&C in O))&&(function(V){var $=le(V)?p.call(V):"";return $=="[object Function]"||$=="[object GeneratorFunction]"}(G)||function(V){var $=!1;if(V!=null&&typeof V.toString!="function")try{$=!!(V+"")}catch{}return $}(G)?x:n).test(function(V){if(V!=null){try{return b.call(V)}catch{}try{return V+""}catch{}}return""}(G));var O}function re(G,O){var V,$,ne=G.__data__;return(($=typeof(V=O))=="string"||$=="number"||$=="symbol"||$=="boolean"?V!=="__proto__":V===null)?ne[typeof O=="string"?"string":"hash"]:ne.map}function ce(G,O){var V=function($,ne){return $==null?void 0:$[ne]}(G,O);return oe(V)?V:void 0}function z(G,O){if(typeof G!="function"||O&&typeof O!="function")throw new TypeError("Expected a function");var V=function(){var $=arguments,ne=O?O.apply(this,$):$[0],Ie=V.cache;if(Ie.has(ne))return Ie.get(ne);var _=G.apply(this,$);return V.cache=Ie.set(ne,_),_};return V.cache=new(z.Cache||F),V}function le(G){var O=typeof G;return!!G&&(O=="object"||O=="function")}I.prototype.clear=function(){this.__data__=A?A(null):{}},I.prototype.delete=function(G){return this.has(G)&&delete this.__data__[G]},I.prototype.get=function(G){var O=this.__data__;if(A){var V=O[G];return V==="__lodash_hash_undefined__"?void 0:V}return h.call(O,G)?O[G]:void 0},I.prototype.has=function(G){var O=this.__data__;return A?O[G]!==void 0:h.call(O,G)},I.prototype.set=function(G,O){return this.__data__[G]=A&&O===void 0?"__lodash_hash_undefined__":O,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(G){var O=this.__data__,V=M(O,G);return!(V<0)&&(V==O.length-1?O.pop():E.call(O,V,1),!0)},j.prototype.get=function(G){var O=this.__data__,V=M(O,G);return V<0?void 0:O[V][1]},j.prototype.has=function(G){return M(this.__data__,G)>-1},j.prototype.set=function(G,O){var V=this.__data__,$=M(V,G);return $<0?V.push([G,O]):V[$][1]=O,this},F.prototype.clear=function(){this.__data__={hash:new I,map:new(R||j),string:new I}},F.prototype.delete=function(G){return re(this,G).delete(G)},F.prototype.get=function(G){return re(this,G).get(G)},F.prototype.has=function(G){return re(this,G).has(G)},F.prototype.set=function(G,O){return re(this,G).set(G,O),this},z.Cache=F,e.exports=z}).call(this,r(3))},function(e,t,r){(function(a){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c=typeof a=="object"&&a&&a.Object===Object&&a,d=typeof self=="object"&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),y=Object.prototype.toString,C=Math.max,b=Math.min,h=function(){return f.Date.now()};function p(E){var R=typeof E;return!!E&&(R=="object"||R=="function")}function x(E){if(typeof E=="number")return E;if(function(I){return typeof I=="symbol"||function(j){return!!j&&typeof j=="object"}(I)&&y.call(I)=="[object Symbol]"}(E))return NaN;if(p(E)){var R=typeof E.valueOf=="function"?E.valueOf():E;E=p(R)?R+"":R}if(typeof E!="string")return E===0?E:+E;E=E.replace(n,"");var A=i.test(E);return A||l.test(E)?s(E.slice(2),A?2:8):o.test(E)?NaN:+E}e.exports=function(E,R,A){var I,j,F,M,oe,re,ce=0,z=!1,le=!1,G=!0;if(typeof E!="function")throw new TypeError("Expected a function");function O(W){var Z=I,ae=j;return I=j=void 0,ce=W,M=E.apply(ae,Z)}function V(W){return ce=W,oe=setTimeout(ne,R),z?O(W):M}function $(W){var Z=W-re;return re===void 0||Z>=R||Z<0||le&&W-ce>=F}function ne(){var W=h();if($(W))return Ie(W);oe=setTimeout(ne,function(Z){var ae=R-(Z-re);return le?b(ae,F-(Z-ce)):ae}(W))}function Ie(W){return oe=void 0,G&&I?O(W):(I=j=void 0,M)}function _(){var W=h(),Z=$(W);if(I=arguments,j=this,re=W,Z){if(oe===void 0)return V(re);if(le)return oe=setTimeout(ne,R),O(re)}return oe===void 0&&(oe=setTimeout(ne,R)),M}return R=x(R)||0,p(A)&&(z=!!A.leading,F=(le="maxWait"in A)?C(x(A.maxWait)||0,R):F,G="trailing"in A?!!A.trailing:G),_.cancel=function(){oe!==void 0&&clearTimeout(oe),ce=0,I=re=j=oe=void 0},_.flush=function(){return oe===void 0?M:Ie(h())},_}}).call(this,r(3))},function(e,t,r){(function(a,n){var o="[object Arguments]",i="[object Map]",l="[object Object]",s="[object Set]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,f=/^\./,y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,C=/\\(\\)?/g,b=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,p={};p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p[o]=p["[object Array]"]=p["[object ArrayBuffer]"]=p["[object Boolean]"]=p["[object DataView]"]=p["[object Date]"]=p["[object Error]"]=p["[object Function]"]=p[i]=p["[object Number]"]=p[l]=p["[object RegExp]"]=p[s]=p["[object String]"]=p["[object WeakMap]"]=!1;var x=typeof a=="object"&&a&&a.Object===Object&&a,E=typeof self=="object"&&self&&self.Object===Object&&self,R=x||E||Function("return this")(),A=t&&!t.nodeType&&t,I=A&&typeof n=="object"&&n&&!n.nodeType&&n,j=I&&I.exports===A&&x.process,F=function(){try{return j&&j.binding("util")}catch{}}(),M=F&&F.isTypedArray;function oe(g,N,k,H){var te=-1,fe=g?g.length:0;for(H&&fe&&(k=g[++te]);++te<fe;)k=N(k,g[te],te,g);return k}function re(g,N){for(var k=-1,H=g?g.length:0;++k<H;)if(N(g[k],k,g))return!0;return!1}function ce(g,N,k,H,te){return te(g,function(fe,Ee,Ye){k=H?(H=!1,fe):N(k,fe,Ee,Ye)}),k}function z(g){var N=!1;if(g!=null&&typeof g.toString!="function")try{N=!!(g+"")}catch{}return N}function le(g){var N=-1,k=Array(g.size);return g.forEach(function(H,te){k[++N]=[te,H]}),k}function G(g){var N=-1,k=Array(g.size);return g.forEach(function(H){k[++N]=H}),k}var O,V,$,ne=Array.prototype,Ie=Function.prototype,_=Object.prototype,W=R["__core-js_shared__"],Z=(O=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",ae=Ie.toString,L=_.hasOwnProperty,m=_.toString,pe=RegExp("^"+ae.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=R.Symbol,K=R.Uint8Array,me=_.propertyIsEnumerable,ye=ne.splice,Te=(V=Object.keys,$=Object,function(g){return V($(g))}),X=Ct(R,"DataView"),je=Ct(R,"Map"),Ae=Ct(R,"Promise"),P=Ct(R,"Set"),D=Ct(R,"WeakMap"),Q=Ct(Object,"create"),be=ie(X),ue=ie(je),Ce=ie(Ae),we=ie(P),Re=ie(D),ee=Y?Y.prototype:void 0,de=ee?ee.valueOf:void 0,Se=ee?ee.toString:void 0;function q(g){var N=-1,k=g?g.length:0;for(this.clear();++N<k;){var H=g[N];this.set(H[0],H[1])}}function se(g){var N=-1,k=g?g.length:0;for(this.clear();++N<k;){var H=g[N];this.set(H[0],H[1])}}function _e(g){var N=-1,k=g?g.length:0;for(this.clear();++N<k;){var H=g[N];this.set(H[0],H[1])}}function ot(g){var N=-1,k=g?g.length:0;for(this.__data__=new _e;++N<k;)this.add(g[N])}function Ke(g){this.__data__=new se(g)}function lt(g,N){var k=v(g)||dt(g)?function(Ee,Ye){for(var $e=-1,ze=Array(Ee);++$e<Ee;)ze[$e]=Ye($e);return ze}(g.length,String):[],H=k.length,te=!!H;for(var fe in g)!L.call(g,fe)||te&&(fe=="length"||Zt(fe,H))||k.push(fe);return k}function gt(g,N){for(var k=g.length;k--;)if(rt(g[k][0],N))return k;return-1}q.prototype.clear=function(){this.__data__=Q?Q(null):{}},q.prototype.delete=function(g){return this.has(g)&&delete this.__data__[g]},q.prototype.get=function(g){var N=this.__data__;if(Q){var k=N[g];return k==="__lodash_hash_undefined__"?void 0:k}return L.call(N,g)?N[g]:void 0},q.prototype.has=function(g){var N=this.__data__;return Q?N[g]!==void 0:L.call(N,g)},q.prototype.set=function(g,N){return this.__data__[g]=Q&&N===void 0?"__lodash_hash_undefined__":N,this},se.prototype.clear=function(){this.__data__=[]},se.prototype.delete=function(g){var N=this.__data__,k=gt(N,g);return!(k<0)&&(k==N.length-1?N.pop():ye.call(N,k,1),!0)},se.prototype.get=function(g){var N=this.__data__,k=gt(N,g);return k<0?void 0:N[k][1]},se.prototype.has=function(g){return gt(this.__data__,g)>-1},se.prototype.set=function(g,N){var k=this.__data__,H=gt(k,g);return H<0?k.push([g,N]):k[H][1]=N,this},_e.prototype.clear=function(){this.__data__={hash:new q,map:new(je||se),string:new q}},_e.prototype.delete=function(g){return Ht(this,g).delete(g)},_e.prototype.get=function(g){return Ht(this,g).get(g)},_e.prototype.has=function(g){return Ht(this,g).has(g)},_e.prototype.set=function(g,N){return Ht(this,g).set(g,N),this},ot.prototype.add=ot.prototype.push=function(g){return this.__data__.set(g,"__lodash_hash_undefined__"),this},ot.prototype.has=function(g){return this.__data__.has(g)},Ke.prototype.clear=function(){this.__data__=new se},Ke.prototype.delete=function(g){return this.__data__.delete(g)},Ke.prototype.get=function(g){return this.__data__.get(g)},Ke.prototype.has=function(g){return this.__data__.has(g)},Ke.prototype.set=function(g,N){var k=this.__data__;if(k instanceof se){var H=k.__data__;if(!je||H.length<199)return H.push([g,N]),this;k=this.__data__=new _e(H)}return k.set(g,N),this};var It,Ue=(It=function(g,N){return g&&Nt(g,N,qe)},function(g,N){if(g==null)return g;if(!B(g))return It(g,N);for(var k=g.length,H=-1,te=Object(g);++H<k&&N(te[H],H,te)!==!1;);return g}),Nt=function(g){return function(N,k,H){for(var te=-1,fe=Object(N),Ee=H(N),Ye=Ee.length;Ye--;){var $e=Ee[++te];if(k(fe[$e],$e,fe)===!1)break}return N}}();function Mt(g,N){for(var k=0,H=(N=kt(N,g)?[N]:Xt(N)).length;g!=null&&k<H;)g=g[U(N[k++])];return k&&k==H?g:void 0}function an(g,N){return g!=null&&N in Object(g)}function St(g,N,k,H,te){return g===N||(g==null||N==null||!Oe(g)&&!ke(N)?g!=g&&N!=N:function(fe,Ee,Ye,$e,ze,Fe){var xt=v(fe),ut=v(Ee),it="[object Array]",st="[object Array]";xt||(it=(it=ht(fe))==o?l:it),ut||(st=(st=ht(Ee))==o?l:st);var At=it==l&&!z(fe),bn=st==l&&!z(Ee),zt=it==st;if(zt&&!At)return Fe||(Fe=new Ke),xt||Ge(fe)?sn(fe,Ee,Ye,$e,ze,Fe):function(Je,He,Dr,cn,Jn,vt,Ft){switch(Dr){case"[object DataView]":if(Je.byteLength!=He.byteLength||Je.byteOffset!=He.byteOffset)return!1;Je=Je.buffer,He=He.buffer;case"[object ArrayBuffer]":return!(Je.byteLength!=He.byteLength||!cn(new K(Je),new K(He)));case"[object Boolean]":case"[object Date]":case"[object Number]":return rt(+Je,+He);case"[object Error]":return Je.name==He.name&&Je.message==He.message;case"[object RegExp]":case"[object String]":return Je==He+"";case i:var Yt=le;case s:var Nn=2&vt;if(Yt||(Yt=G),Je.size!=He.size&&!Nn)return!1;var Un=Ft.get(Je);if(Un)return Un==He;vt|=1,Ft.set(Je,He);var hn=sn(Yt(Je),Yt(He),cn,Jn,vt,Ft);return Ft.delete(Je),hn;case"[object Symbol]":if(de)return de.call(Je)==de.call(He)}return!1}(fe,Ee,it,Ye,$e,ze,Fe);if(!(2&ze)){var uo=At&&L.call(fe,"__wrapped__"),co=bn&&L.call(Ee,"__wrapped__");if(uo||co){var ru=uo?fe.value():fe,au=co?Ee.value():Ee;return Fe||(Fe=new Ke),Ye(ru,au,$e,ze,Fe)}}return zt?(Fe||(Fe=new Ke),function(Je,He,Dr,cn,Jn,vt){var Ft=2&Jn,Yt=qe(Je),Nn=Yt.length,Un=qe(He).length;if(Nn!=Un&&!Ft)return!1;for(var hn=Nn;hn--;){var Jt=Yt[hn];if(!(Ft?Jt in He:L.call(He,Jt)))return!1}var fo=vt.get(Je);if(fo&&vt.get(He))return fo==He;var $n=!0;vt.set(Je,He),vt.set(He,Je);for(var Wr=Ft;++hn<Nn;){Jt=Yt[hn];var Qn=Je[Jt],Kn=He[Jt];if(cn)var po=Ft?cn(Kn,Qn,Jt,He,Je,vt):cn(Qn,Kn,Jt,Je,He,vt);if(!(po===void 0?Qn===Kn||Dr(Qn,Kn,cn,Jn,vt):po)){$n=!1;break}Wr||(Wr=Jt=="constructor")}if($n&&!Wr){var qn=Je.constructor,er=He.constructor;qn==er||!("constructor"in Je)||!("constructor"in He)||typeof qn=="function"&&qn instanceof qn&&typeof er=="function"&&er instanceof er||($n=!1)}return vt.delete(Je),vt.delete(He),$n}(fe,Ee,Ye,$e,ze,Fe)):!1}(g,N,St,k,H,te))}function Gt(g){return!(!Oe(g)||function(N){return!!Z&&Z in N}(g))&&(J(g)||z(g)?pe:b).test(ie(g))}function Pt(g){return typeof g=="function"?g:g==null?et:typeof g=="object"?v(g)?function(H,te){return kt(H)&&ln(te)?un(U(H),te):function(fe){var Ee=function(Ye,$e,ze){var Fe=Ye==null?void 0:Mt(Ye,$e);return Fe===void 0?ze:Fe}(fe,H);return Ee===void 0&&Ee===te?function(Ye,$e){return Ye!=null&&function(ze,Fe,xt){Fe=kt(Fe,ze)?[Fe]:Xt(Fe);for(var ut,it=-1,st=Fe.length;++it<st;){var At=U(Fe[it]);if(!(ut=ze!=null&&xt(ze,At)))break;ze=ze[At]}return ut||!!(st=ze?ze.length:0)&&he(st)&&Zt(At,st)&&(v(ze)||dt(ze))}(Ye,$e,an)}(fe,H):St(te,Ee,void 0,3)}}(g[0],g[1]):function(H){var te=function(fe){for(var Ee=qe(fe),Ye=Ee.length;Ye--;){var $e=Ee[Ye],ze=fe[$e];Ee[Ye]=[$e,ze,ln(ze)]}return Ee}(H);return te.length==1&&te[0][2]?un(te[0][0],te[0][1]):function(fe){return fe===H||function(Ee,Ye,$e,ze){var Fe=$e.length,xt=Fe;if(Ee==null)return!xt;for(Ee=Object(Ee);Fe--;){var ut=$e[Fe];if(ut[2]?ut[1]!==Ee[ut[0]]:!(ut[0]in Ee))return!1}for(;++Fe<xt;){var it=(ut=$e[Fe])[0],st=Ee[it],At=ut[1];if(ut[2]){if(st===void 0&&!(it in Ee))return!1}else{var bn=new Ke,zt;if(!(zt===void 0?St(At,st,ze,3,bn):zt))return!1}}return!0}(fe,H,te)}}(g):kt(N=g)?(k=U(N),function(H){return H==null?void 0:H[k]}):function(H){return function(te){return Mt(te,H)}}(N);var N,k}function on(g){if(k=(N=g)&&N.constructor,H=typeof k=="function"&&k.prototype||_,N!==H)return Te(g);var N,k,H,te=[];for(var fe in Object(g))L.call(g,fe)&&fe!="constructor"&&te.push(fe);return te}function Xt(g){return v(g)?g:T(g)}function sn(g,N,k,H,te,fe){var Ee=2&te,Ye=g.length,$e=N.length;if(Ye!=$e&&!(Ee&&$e>Ye))return!1;var ze=fe.get(g);if(ze&&fe.get(N))return ze==N;var Fe=-1,xt=!0,ut=1&te?new ot:void 0;for(fe.set(g,N),fe.set(N,g);++Fe<Ye;){var it=g[Fe],st=N[Fe];if(H)var At=Ee?H(st,it,Fe,N,g,fe):H(it,st,Fe,g,N,fe);if(At!==void 0){if(At)continue;xt=!1;break}if(ut){if(!re(N,function(bn,zt){if(!ut.has(zt)&&(it===bn||k(it,bn,H,te,fe)))return ut.add(zt)})){xt=!1;break}}else if(it!==st&&!k(it,st,H,te,fe)){xt=!1;break}}return fe.delete(g),fe.delete(N),xt}function Ht(g,N){var k,H,te=g.__data__;return((H=typeof(k=N))=="string"||H=="number"||H=="symbol"||H=="boolean"?k!=="__proto__":k===null)?te[typeof N=="string"?"string":"hash"]:te.map}function Ct(g,N){var k=function(H,te){return H==null?void 0:H[te]}(g,N);return Gt(k)?k:void 0}var ht=function(g){return m.call(g)};function Zt(g,N){return!!(N=N??9007199254740991)&&(typeof g=="number"||h.test(g))&&g>-1&&g%1==0&&g<N}function kt(g,N){if(v(g))return!1;var k=typeof g;return!(k!="number"&&k!="symbol"&&k!="boolean"&&g!=null&&!Ne(g))||d.test(g)||!c.test(g)||N!=null&&g in Object(N)}function ln(g){return g==g&&!Oe(g)}function un(g,N){return function(k){return k!=null&&k[g]===N&&(N!==void 0||g in Object(k))}}(X&&ht(new X(new ArrayBuffer(1)))!="[object DataView]"||je&&ht(new je)!=i||Ae&&ht(Ae.resolve())!="[object Promise]"||P&&ht(new P)!=s||D&&ht(new D)!="[object WeakMap]")&&(ht=function(g){var N=m.call(g),k=N==l?g.constructor:void 0,H=k?ie(k):void 0;if(H)switch(H){case be:return"[object DataView]";case ue:return i;case Ce:return"[object Promise]";case we:return s;case Re:return"[object WeakMap]"}return N});var T=Xe(function(g){var N;g=(N=g)==null?"":function(H){if(typeof H=="string")return H;if(Ne(H))return Se?Se.call(H):"";var te=H+"";return te=="0"&&1/H==-1/0?"-0":te}(N);var k=[];return f.test(g)&&k.push(""),g.replace(y,function(H,te,fe,Ee){k.push(fe?Ee.replace(C,"$1"):te||H)}),k});function U(g){if(typeof g=="string"||Ne(g))return g;var N=g+"";return N=="0"&&1/g==-1/0?"-0":N}function ie(g){if(g!=null){try{return ae.call(g)}catch{}try{return g+""}catch{}}return""}function Xe(g,N){if(typeof g!="function"||N&&typeof N!="function")throw new TypeError("Expected a function");var k=function(){var H=arguments,te=N?N.apply(this,H):H[0],fe=k.cache;if(fe.has(te))return fe.get(te);var Ee=g.apply(this,H);return k.cache=fe.set(te,Ee),Ee};return k.cache=new(Xe.Cache||_e),k}function rt(g,N){return g===N||g!=g&&N!=N}function dt(g){return function(N){return ke(N)&&B(N)}(g)&&L.call(g,"callee")&&(!me.call(g,"callee")||m.call(g)==o)}Xe.Cache=_e;var v=Array.isArray;function B(g){return g!=null&&he(g.length)&&!J(g)}function J(g){var N=Oe(g)?m.call(g):"";return N=="[object Function]"||N=="[object GeneratorFunction]"}function he(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=9007199254740991}function Oe(g){var N=typeof g;return!!g&&(N=="object"||N=="function")}function ke(g){return!!g&&typeof g=="object"}function Ne(g){return typeof g=="symbol"||ke(g)&&m.call(g)=="[object Symbol]"}var Ge=M?function(g){return function(N){return g(N)}}(M):function(g){return ke(g)&&he(g.length)&&!!p[m.call(g)]};function qe(g){return B(g)?lt(g):on(g)}function et(g){return g}n.exports=function(g,N,k){var H=v(g)?oe:ce,te=arguments.length<3;return H(g,Pt(N),k,te,Ue)}}).call(this,r(3),r(7)(e))},function(e,t){e.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),r.webpackPolyfill=1),r}},function(e,t){String.prototype.padEnd||(String.prototype.padEnd=function(r,a){return r>>=0,a=String(a!==void 0?a:" "),this.length>r?String(this):((r-=this.length)>a.length&&(a+=a.repeat(r/a.length)),String(this)+a.slice(0,r))})},function(e,t,r){function a(_,W,Z){return W in _?Object.defineProperty(_,W,{value:Z,enumerable:!0,configurable:!0,writable:!0}):_[W]=Z,_}function n(_){if(Symbol.iterator in Object(_)||Object.prototype.toString.call(_)==="[object Arguments]")return Array.from(_)}function o(_){return function(W){if(Array.isArray(W)){for(var Z=0,ae=new Array(W.length);Z<W.length;Z++)ae[Z]=W[Z];return ae}}(_)||n(_)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(_){if(Array.isArray(_))return _}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function s(_,W){if(!(_ instanceof W))throw new TypeError("Cannot call a class as a function")}function c(_,W){for(var Z=0;Z<W.length;Z++){var ae=W[Z];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(_,ae.key,ae)}}function d(_){return(d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W})(_)}function f(_){return(f=typeof Symbol=="function"&&d(Symbol.iterator)==="symbol"?function(W){return d(W)}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":d(W)})(_)}function y(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function C(_){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(W){return W.__proto__||Object.getPrototypeOf(W)})(_)}function b(_,W){return(b=Object.setPrototypeOf||function(Z,ae){return Z.__proto__=ae,Z})(_,W)}r.r(t);var h=r(0),p=r.n(h),x=r(5),E=r.n(x),R=r(4),A=r.n(R),I=r(6),j=r.n(I),F=r(2),M=r.n(F),oe=r(1),re=r.n(oe);r(8);function ce(_,W){return i(_)||function(Z,ae){var L=[],m=!0,pe=!1,Y=void 0;try{for(var K,me=Z[Symbol.iterator]();!(m=(K=me.next()).done)&&(L.push(K.value),!ae||L.length!==ae);m=!0);}catch(ye){pe=!0,Y=ye}finally{try{m||me.return==null||me.return()}finally{if(pe)throw Y}}return L}(_,W)||l()}var z=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61","(..) .... ....",0,["2","3","4","7","8","02","03","04","07","08"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","..-........."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d’Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2,["809","829","849"]],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",1,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["55","81","33","656","664","998","774","229"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3,["787","939"]],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",0],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["907","205","251","256","334","479","501","870","480","520","602","623","928","209","213","310","323","408","415","510","530","559","562","619","626","650","661","707","714","760","805","818","831","858","909","916","925","949","951","303","719","970","203","860","202","302","239","305","321","352","386","407","561","727","772","813","850","863","904","941","954","229","404","478","706","770","912","808","319","515","563","641","712","208","217","309","312","618","630","708","773","815","847","219","260","317","574","765","812","316","620","785","913","270","502","606","859","225","318","337","504","985","413","508","617","781","978","301","410","207","231","248","269","313","517","586","616","734","810","906","989","218","320","507","612","651","763","952","314","417","573","636","660","816","228","601","662","406","252","336","704","828","910","919","701","308","402","603","201","609","732","856","908","973","505","575","702","775","212","315","516","518","585","607","631","716","718","845","914","216","330","419","440","513","614","740","937","405","580","918","503","541","215","412","570","610","717","724","814","401","803","843","864","605","423","615","731","865","901","931","210","214","254","281","325","361","409","432","512","713","806","817","830","903","915","936","940","956","972","979","435","801","276","434","540","703","757","804","802","206","253","360","425","509","262","414","608","715","920","304","307"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]],le=[["American Samoa",["oceania"],"as","1684"],["Anguilla",["america","carribean"],"ai","1264"],["Bermuda",["america","north-america"],"bm","1441"],["British Virgin Islands",["america","carribean"],"vg","1284"],["Cayman Islands",["america","carribean"],"ky","1345"],["Cook Islands",["oceania"],"ck","682"],["Falkland Islands",["america","south-america"],"fk","500"],["Faroe Islands",["europe"],"fo","298"],["Gibraltar",["europe"],"gi","350"],["Greenland",["america"],"gl","299"],["Jersey",["europe","eu-union"],"je","44",".... ......"],["Montserrat",["america","carribean"],"ms","1664"],["Niue",["asia"],"nu","683"],["Norfolk Island",["oceania"],"nf","672"],["Northern Mariana Islands",["oceania"],"mp","1670"],["Saint Barthélemy",["america","carribean"],"bl","590","",1],["Saint Helena",["africa"],"sh","290"],["Saint Martin",["america","carribean"],"mf","590","",2],["Saint Pierre and Miquelon",["america","north-america"],"pm","508"],["Sint Maarten",["america","carribean"],"sx","1721"],["Tokelau",["oceania"],"tk","690"],["Turks and Caicos Islands",["america","carribean"],"tc","1649"],["U.S. Virgin Islands",["america","carribean"],"vi","1340"],["Wallis and Futuna",["oceania"],"wf","681"]];function G(_,W,Z,ae,L){return!Z||L?_+"".padEnd(W.length,".")+" "+ae:_+"".padEnd(W.length,".")+" "+Z}function O(_,W,Z,ae,L){var m,pe,Y=[];return pe=W===!0,[(m=[]).concat.apply(m,o(_.map(function(K){var me={name:K[0],regions:K[1],iso2:K[2],countryCode:K[3],dialCode:K[3],format:G(Z,K[3],K[4],ae,L),priority:K[5]||0},ye=[];return K[6]&&K[6].map(function(Te){var X=function(je){for(var Ae=1;Ae<arguments.length;Ae++){var P=arguments[Ae]!=null?arguments[Ae]:{},D=Object.keys(P);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(P).filter(function(Q){return Object.getOwnPropertyDescriptor(P,Q).enumerable}))),D.forEach(function(Q){a(je,Q,P[Q])})}return je}({},me);X.dialCode=K[3]+Te,X.isAreaCode=!0,X.areaCodeLength=Te.length,ye.push(X)}),ye.length>0?(me.mainCode=!0,pe||W.constructor.name==="Array"&&W.includes(K[2])?(me.hasAreaCodes=!0,[me].concat(ye)):(Y=Y.concat(ye),[me])):[me]}))),Y]}function V(_,W,Z,ae){if(Z!==null){var L=Object.keys(Z),m=Object.values(Z);L.forEach(function(pe,Y){if(ae)return _.push([pe,m[Y]]);var K=_.findIndex(function(ye){return ye[0]===pe});if(K===-1){var me=[pe];me[W]=m[Y],_.push(me)}else _[K][W]=m[Y]})}}function $(_,W){return W.length===0?_:_.map(function(Z){var ae=W.findIndex(function(m){return m[0]===Z[2]});if(ae===-1)return Z;var L=W[ae];return L[1]&&(Z[4]=L[1]),L[3]&&(Z[5]=L[3]),L[2]&&(Z[6]=L[2]),Z})}var ne=function _(W,Z,ae,L,m,pe,Y,K,me,ye,Te,X,je,Ae){s(this,_),this.filterRegions=function(ee,de){if(typeof ee=="string"){var Se=ee;return de.filter(function(q){return q.regions.some(function(se){return se===Se})})}return de.filter(function(q){return ee.map(function(se){return q.regions.some(function(_e){return _e===se})}).some(function(se){return se})})},this.sortTerritories=function(ee,de){var Se=[].concat(o(ee),o(de));return Se.sort(function(q,se){return q.name<se.name?-1:q.name>se.name?1:0}),Se},this.getFilteredCountryList=function(ee,de,Se){return ee.length===0?de:Se?ee.map(function(q){var se=de.find(function(_e){return _e.iso2===q});if(se)return se}).filter(function(q){return q}):de.filter(function(q){return ee.some(function(se){return se===q.iso2})})},this.localizeCountries=function(ee,de,Se){for(var q=0;q<ee.length;q++)de[ee[q].iso2]!==void 0?ee[q].localName=de[ee[q].iso2]:de[ee[q].name]!==void 0&&(ee[q].localName=de[ee[q].name]);return Se||ee.sort(function(se,_e){return se.localName<_e.localName?-1:se.localName>_e.localName?1:0}),ee},this.getCustomAreas=function(ee,de){for(var Se=[],q=0;q<de.length;q++){var se=JSON.parse(JSON.stringify(ee));se.dialCode+=de[q],Se.push(se)}return Se},this.excludeCountries=function(ee,de){return de.length===0?ee:ee.filter(function(Se){return!de.includes(Se.iso2)})};var P=function(ee,de,Se){var q=[];return V(q,1,ee,!0),V(q,3,de),V(q,2,Se),q}(K,me,ye),D=$(JSON.parse(JSON.stringify(z)),P),Q=$(JSON.parse(JSON.stringify(le)),P),be=ce(O(D,W,X,je,Ae),2),ue=be[0],Ce=be[1];if(Z){var we=ce(O(Q,W,X,je,Ae),2),Re=we[0];we[1],ue=this.sortTerritories(Re,ue)}ae&&(ue=this.filterRegions(ae,ue)),this.onlyCountries=this.localizeCountries(this.excludeCountries(this.getFilteredCountryList(L,ue,Y.includes("onlyCountries")),pe),Te,Y.includes("onlyCountries")),this.preferredCountries=m.length===0?[]:this.localizeCountries(this.getFilteredCountryList(m,ue,Y.includes("preferredCountries")),Te,Y.includes("preferredCountries")),this.hiddenAreaCodes=this.excludeCountries(this.getFilteredCountryList(L,Ce),pe)},Ie=function(_){function W(L){var m;s(this,W),(m=function(P,D){return!D||f(D)!=="object"&&typeof D!="function"?y(P):D}(this,C(W).call(this,L))).getProbableCandidate=A()(function(P){return P&&P.length!==0?m.state.onlyCountries.filter(function(D){return M()(D.name.toLowerCase(),P.toLowerCase())},y(y(m)))[0]:null}),m.guessSelectedCountry=A()(function(P,D,Q,be){var ue;if(m.props.enableAreaCodes===!1&&(be.some(function(Re){if(M()(P,Re.dialCode))return Q.some(function(ee){if(Re.iso2===ee.iso2&&ee.mainCode)return ue=ee,!0}),!0}),ue))return ue;var Ce=Q.find(function(Re){return Re.iso2==D});if(P.trim()==="")return Ce;var we=Q.reduce(function(Re,ee){return M()(P,ee.dialCode)&&(ee.dialCode.length>Re.dialCode.length||ee.dialCode.length===Re.dialCode.length&&ee.priority<Re.priority)?ee:Re},{dialCode:"",priority:10001},y(y(m)));return we.name?we:Ce}),m.updateCountry=function(P){var D,Q=m.state.onlyCountries;(D=P.indexOf(0)>="0"&&P.indexOf(0)<="9"?Q.find(function(be){return be.dialCode==+P}):Q.find(function(be){return be.iso2==P}))&&D.dialCode&&m.setState({selectedCountry:D,formattedNumber:m.props.disableCountryCode?"":m.formatNumber(D.dialCode,D)})},m.scrollTo=function(P,D){if(P){var Q=m.dropdownRef;if(Q&&document.body){var be=Q.offsetHeight,ue=Q.getBoundingClientRect().top+document.body.scrollTop,Ce=ue+be,we=P,Re=we.getBoundingClientRect(),ee=we.offsetHeight,de=Re.top+document.body.scrollTop,Se=de+ee,q=de-ue+Q.scrollTop,se=be/2-ee/2;if(m.props.enableSearch?de<ue+32:de<ue)D&&(q-=se),Q.scrollTop=q;else if(Se>Ce){D&&(q+=se);var _e=be-ee;Q.scrollTop=q-_e}}}},m.scrollToTop=function(){var P=m.dropdownRef;P&&document.body&&(P.scrollTop=0)},m.formatNumber=function(P,D){if(!D)return P;var Q,be=D.format,ue=m.props,Ce=ue.disableCountryCode,we=ue.enableAreaCodeStretch,Re=ue.enableLongNumbers,ee=ue.autoFormat;if(Ce?((Q=be.split(" ")).shift(),Q=Q.join(" ")):we&&D.isAreaCode?((Q=be.split(" "))[1]=Q[1].replace(/\.+/,"".padEnd(D.areaCodeLength,".")),Q=Q.join(" ")):Q=be,!P||P.length===0)return Ce?"":m.props.prefix;if(P&&P.length<2||!Q||!ee)return Ce?P:m.props.prefix+P;var de,Se=j()(Q,function(q,se){if(q.remainingText.length===0)return q;if(se!==".")return{formattedText:q.formattedText+se,remainingText:q.remainingText};var _e,ot=i(_e=q.remainingText)||n(_e)||l(),Ke=ot[0],lt=ot.slice(1);return{formattedText:q.formattedText+Ke,remainingText:lt}},{formattedText:"",remainingText:P.split("")});return(de=Re?Se.formattedText+Se.remainingText.join(""):Se.formattedText).includes("(")&&!de.includes(")")&&(de+=")"),de},m.cursorToEnd=function(){var P=m.numberInputRef;if(document.activeElement===P){P.focus();var D=P.value.length;P.value.charAt(D-1)===")"&&(D-=1),P.setSelectionRange(D,D)}},m.getElement=function(P){return m["flag_no_".concat(P)]},m.getCountryData=function(){return m.state.selectedCountry?{name:m.state.selectedCountry.name||"",dialCode:m.state.selectedCountry.dialCode||"",countryCode:m.state.selectedCountry.iso2||"",format:m.state.selectedCountry.format||""}:{}},m.handleFlagDropdownClick=function(P){if(P.preventDefault(),m.state.showDropdown||!m.props.disabled){var D=m.state,Q=D.preferredCountries,be=D.onlyCountries,ue=D.selectedCountry,Ce=m.concatPreferredCountries(Q,be).findIndex(function(we){return we.dialCode===ue.dialCode&&we.iso2===ue.iso2});m.setState({showDropdown:!m.state.showDropdown,highlightCountryIndex:Ce},function(){m.state.showDropdown&&m.scrollTo(m.getElement(m.state.highlightCountryIndex))})}},m.handleInput=function(P){var D=P.target.value,Q=m.props,be=Q.prefix,ue=Q.onChange,Ce=m.props.disableCountryCode?"":be,we=m.state.selectedCountry,Re=m.state.freezeSelection;if(!m.props.countryCodeEditable){var ee=be+(we.hasAreaCodes?m.state.onlyCountries.find(function(Ue){return Ue.iso2===we.iso2&&Ue.mainCode}).dialCode:we.dialCode);if(D.slice(0,ee.length)!==ee)return}if(D===be)return ue&&ue("",m.getCountryData(),P,""),m.setState({formattedNumber:""});if(!(D.replace(/\D/g,"").length>15&&(m.props.enableLongNumbers===!1||typeof m.props.enableLongNumbers=="number"&&D.replace(/\D/g,"").length>m.props.enableLongNumbers))&&D!==m.state.formattedNumber){P.preventDefault?P.preventDefault():P.returnValue=!1;var de=m.props.country,Se=m.state,q=Se.onlyCountries,se=Se.selectedCountry,_e=Se.hiddenAreaCodes;if(ue&&P.persist(),D.length>0){var ot=D.replace(/\D/g,"");(!m.state.freezeSelection||se&&se.dialCode.length>ot.length)&&(we=m.props.disableCountryGuess?se:m.guessSelectedCountry(ot.substring(0,6),de,q,_e)||se,Re=!1),Ce=m.formatNumber(ot,we),we=we.dialCode?we:se}var Ke=P.target.selectionStart,lt=P.target.selectionStart,gt=m.state.formattedNumber,It=Ce.length-gt.length;m.setState({formattedNumber:Ce,freezeSelection:Re,selectedCountry:we},function(){It>0&&(lt-=It),Ce.charAt(Ce.length-1)==")"?m.numberInputRef.setSelectionRange(Ce.length-1,Ce.length-1):lt>0&>.length>=Ce.length?m.numberInputRef.setSelectionRange(lt,lt):Ke<gt.length&&m.numberInputRef.setSelectionRange(Ke,Ke),ue&&ue(Ce.replace(/[^0-9]+/g,""),m.getCountryData(),P,Ce)})}},m.handleInputClick=function(P){m.setState({showDropdown:!1}),m.props.onClick&&m.props.onClick(P,m.getCountryData())},m.handleDoubleClick=function(P){var D=P.target.value.length;P.target.setSelectionRange(0,D)},m.handleFlagItemClick=function(P,D){var Q=m.state.selectedCountry,be=m.state.onlyCountries.find(function(Re){return Re==P});if(be){var ue=m.state.formattedNumber.replace(" ","").replace("(","").replace(")","").replace("-",""),Ce=ue.length>1?ue.replace(Q.dialCode,be.dialCode):be.dialCode,we=m.formatNumber(Ce.replace(/\D/g,""),be);m.setState({showDropdown:!1,selectedCountry:be,freezeSelection:!0,formattedNumber:we,searchValue:""},function(){m.cursorToEnd(),m.props.onChange&&m.props.onChange(we.replace(/[^0-9]+/g,""),m.getCountryData(),D,we)})}},m.handleInputFocus=function(P){m.numberInputRef&&m.numberInputRef.value===m.props.prefix&&m.state.selectedCountry&&!m.props.disableCountryCode&&m.setState({formattedNumber:m.props.prefix+m.state.selectedCountry.dialCode},function(){m.props.jumpCursorToEnd&&setTimeout(m.cursorToEnd,0)}),m.setState({placeholder:""}),m.props.onFocus&&m.props.onFocus(P,m.getCountryData()),m.props.jumpCursorToEnd&&setTimeout(m.cursorToEnd,0)},m.handleInputBlur=function(P){P.target.value||m.setState({placeholder:m.props.placeholder}),m.props.onBlur&&m.props.onBlur(P,m.getCountryData())},m.handleInputCopy=function(P){if(m.props.copyNumbersOnly){var D=window.getSelection().toString().replace(/[^0-9]+/g,"");P.clipboardData.setData("text/plain",D),P.preventDefault()}},m.getHighlightCountryIndex=function(P){var D=m.state.highlightCountryIndex+P;return D<0||D>=m.state.onlyCountries.length+m.state.preferredCountries.length?D-P:m.props.enableSearch&&D>m.getSearchFilteredCountries().length?0:D},m.searchCountry=function(){var P=m.getProbableCandidate(m.state.queryString)||m.state.onlyCountries[0],D=m.state.onlyCountries.findIndex(function(Q){return Q==P})+m.state.preferredCountries.length;m.scrollTo(m.getElement(D),!0),m.setState({queryString:"",highlightCountryIndex:D})},m.handleKeydown=function(P){var D=m.props.keys,Q=P.target.className;if(Q.includes("selected-flag")&&P.which===D.ENTER&&!m.state.showDropdown)return m.handleFlagDropdownClick(P);if(Q.includes("form-control")&&(P.which===D.ENTER||P.which===D.ESC))return P.target.blur();if(m.state.showDropdown&&!m.props.disabled&&(!Q.includes("search-box")||P.which===D.UP||P.which===D.DOWN||P.which===D.ENTER||P.which===D.ESC&&P.target.value==="")){P.preventDefault?P.preventDefault():P.returnValue=!1;var be=function(ue){m.setState({highlightCountryIndex:m.getHighlightCountryIndex(ue)},function(){m.scrollTo(m.getElement(m.state.highlightCountryIndex),!0)})};switch(P.which){case D.DOWN:be(1);break;case D.UP:be(-1);break;case D.ENTER:m.props.enableSearch?m.handleFlagItemClick(m.getSearchFilteredCountries()[m.state.highlightCountryIndex]||m.getSearchFilteredCountries()[0],P):m.handleFlagItemClick([].concat(o(m.state.preferredCountries),o(m.state.onlyCountries))[m.state.highlightCountryIndex],P);break;case D.ESC:case D.TAB:m.setState({showDropdown:!1},m.cursorToEnd);break;default:(P.which>=D.A&&P.which<=D.Z||P.which===D.SPACE)&&m.setState({queryString:m.state.queryString+String.fromCharCode(P.which)},m.state.debouncedQueryStingSearcher)}}},m.handleInputKeyDown=function(P){var D=m.props,Q=D.keys,be=D.onEnterKeyPress,ue=D.onKeyDown;P.which===Q.ENTER&&be&&be(P),ue&&ue(P)},m.handleClickOutside=function(P){m.dropdownRef&&!m.dropdownContainerRef.contains(P.target)&&m.state.showDropdown&&m.setState({showDropdown:!1})},m.handleSearchChange=function(P){var D=P.currentTarget.value,Q=m.state,be=Q.preferredCountries,ue=Q.selectedCountry,Ce=0;if(D===""&&ue){var we=m.state.onlyCountries;Ce=m.concatPreferredCountries(be,we).findIndex(function(Re){return Re==ue}),setTimeout(function(){return m.scrollTo(m.getElement(Ce))},100)}m.setState({searchValue:D,highlightCountryIndex:Ce})},m.concatPreferredCountries=function(P,D){return P.length>0?o(new Set(P.concat(D))):D},m.getDropdownCountryName=function(P){return P.localName||P.name},m.getSearchFilteredCountries=function(){var P=m.state,D=P.preferredCountries,Q=P.onlyCountries,be=P.searchValue,ue=m.props.enableSearch,Ce=m.concatPreferredCountries(D,Q),we=be.trim().toLowerCase().replace("+","");if(ue&&we){if(/^\d+$/.test(we))return Ce.filter(function(de){var Se=de.dialCode;return["".concat(Se)].some(function(q){return q.toLowerCase().includes(we)})});var Re=Ce.filter(function(de){var Se=de.iso2;return["".concat(Se)].some(function(q){return q.toLowerCase().includes(we)})}),ee=Ce.filter(function(de){var Se=de.name,q=de.localName;return de.iso2,["".concat(Se),"".concat(q||"")].some(function(se){return se.toLowerCase().includes(we)})});return m.scrollToTop(),o(new Set([].concat(Re,ee)))}return Ce},m.getCountryDropdownList=function(){var P=m.state,D=P.preferredCountries,Q=P.highlightCountryIndex,be=P.showDropdown,ue=P.searchValue,Ce=m.props,we=Ce.disableDropdown,Re=Ce.prefix,ee=m.props,de=ee.enableSearch,Se=ee.searchNotFound,q=ee.disableSearchIcon,se=ee.searchClass,_e=ee.searchStyle,ot=ee.searchPlaceholder,Ke=ee.autocompleteSearch,lt=m.getSearchFilteredCountries().map(function(Ue,Nt){var Mt=Q===Nt,an=re()({country:!0,preferred:Ue.iso2==="us"||Ue.iso2==="gb",active:Ue.iso2==="us",highlight:Mt}),St="flag ".concat(Ue.iso2);return p.a.createElement("li",Object.assign({ref:function(Gt){return m["flag_no_".concat(Nt)]=Gt},key:"flag_no_".concat(Nt),"data-flag-key":"flag_no_".concat(Nt),className:an,"data-dial-code":"1",tabIndex:we?"-1":"0","data-country-code":Ue.iso2,onClick:function(Gt){return m.handleFlagItemClick(Ue,Gt)},role:"option"},Mt?{"aria-selected":!0}:{}),p.a.createElement("div",{className:St}),p.a.createElement("span",{className:"country-name"},m.getDropdownCountryName(Ue)),p.a.createElement("span",{className:"dial-code"},Ue.format?m.formatNumber(Ue.dialCode,Ue):Re+Ue.dialCode))}),gt=p.a.createElement("li",{key:"dashes",className:"divider"});D.length>0&&(!de||de&&!ue.trim())&<.splice(D.length,0,gt);var It=re()(a({"country-list":!0,hide:!be},m.props.dropdownClass,!0));return p.a.createElement("ul",{ref:function(Ue){return!de&&Ue&&Ue.focus(),m.dropdownRef=Ue},className:It,style:m.props.dropdownStyle,role:"listbox",tabIndex:"0"},de&&p.a.createElement("li",{className:re()(a({search:!0},se,se))},!q&&p.a.createElement("span",{className:re()(a({"search-emoji":!0},"".concat(se,"-emoji"),se)),role:"img","aria-label":"Magnifying glass"},"🔎"),p.a.createElement("input",{className:re()(a({"search-box":!0},"".concat(se,"-box"),se)),style:_e,type:"search",placeholder:ot,autoFocus:!0,autoComplete:Ke?"on":"off",value:ue,onChange:m.handleSearchChange})),lt.length>0?lt:p.a.createElement("li",{className:"no-entries-message"},p.a.createElement("span",null,Se)))};var pe,Y=new ne(L.enableAreaCodes,L.enableTerritories,L.regions,L.onlyCountries,L.preferredCountries,L.excludeCountries,L.preserveOrder,L.masks,L.priority,L.areaCodes,L.localization,L.prefix,L.defaultMask,L.alwaysDefaultMask),K=Y.onlyCountries,me=Y.preferredCountries,ye=Y.hiddenAreaCodes,Te=L.value?L.value.replace(/\D/g,""):"";pe=L.disableInitialCountryGuess?0:Te.length>1?m.guessSelectedCountry(Te.substring(0,6),L.country,K,ye)||0:L.country&&K.find(function(P){return P.iso2==L.country})||0;var X,je=Te.length<2&&pe&&!M()(Te,pe.dialCode)?pe.dialCode:"";X=Te===""&&pe===0?"":m.formatNumber((L.disableCountryCode?"":je)+Te,pe.name?pe:void 0);var Ae=K.findIndex(function(P){return P==pe});return m.state={showDropdown:L.showDropdown,formattedNumber:X,onlyCountries:K,preferredCountries:me,hiddenAreaCodes:ye,selectedCountry:pe,highlightCountryIndex:Ae,queryString:"",freezeSelection:!1,debouncedQueryStingSearcher:E()(m.searchCountry,250),searchValue:""},m}var Z,ae;return function(L,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");L.prototype=Object.create(m&&m.prototype,{constructor:{value:L,writable:!0,configurable:!0}}),m&&b(L,m)}(W,_),Z=W,(ae=[{key:"componentDidMount",value:function(){document.addEventListener&&this.props.enableClickOutside&&document.addEventListener("mousedown",this.handleClickOutside),this.props.onMount&&this.props.onMount(this.state.formattedNumber.replace(/[^0-9]+/g,""),this.getCountryData(),this.state.formattedNumber)}},{key:"componentWillUnmount",value:function(){document.removeEventListener&&this.props.enableClickOutside&&document.removeEventListener("mousedown",this.handleClickOutside)}},{key:"componentDidUpdate",value:function(L,m,pe){L.country!==this.props.country?this.updateCountry(this.props.country):L.value!==this.props.value&&this.updateFormattedNumber(this.props.value)}},{key:"updateFormattedNumber",value:function(L){if(L===null)return this.setState({selectedCountry:0,formattedNumber:""});var m=this.state,pe=m.onlyCountries,Y=m.selectedCountry,K=m.hiddenAreaCodes,me=this.props,ye=me.country,Te=me.prefix;if(L==="")return this.setState({selectedCountry:Y,formattedNumber:""});var X,je,Ae=L.replace(/\D/g,"");if(Y&&M()(L,Te+Y.dialCode))je=this.formatNumber(Ae,Y),this.setState({formattedNumber:je});else{var P=(X=this.props.disableCountryGuess?Y:this.guessSelectedCountry(Ae.substring(0,6),ye,pe,K)||Y)&&M()(Ae,Te+X.dialCode)?X.dialCode:"";je=this.formatNumber((this.props.disableCountryCode?"":P)+Ae,X||void 0),this.setState({selectedCountry:X,formattedNumber:je})}}},{key:"render",value:function(){var L,m,pe,Y=this,K=this.state,me=K.onlyCountries,ye=K.selectedCountry,Te=K.showDropdown,X=K.formattedNumber,je=K.hiddenAreaCodes,Ae=this.props,P=Ae.disableDropdown,D=Ae.renderStringAsFlag,Q=Ae.isValid,be=Ae.defaultErrorMessage,ue=Ae.specialLabel;if(typeof Q=="boolean")m=Q;else{var Ce=Q(X.replace(/\D/g,""),ye,me,je);typeof Ce=="boolean"?(m=Ce)===!1&&(pe=be):(m=!1,pe=Ce)}var we=re()((a(L={},this.props.containerClass,!0),a(L,"react-tel-input",!0),L)),Re=re()({arrow:!0,up:Te}),ee=re()(a({"form-control":!0,"invalid-number":!m,open:Te},this.props.inputClass,!0)),de=re()({"selected-flag":!0,open:Te}),Se=re()(a({"flag-dropdown":!0,"invalid-number":!m,open:Te},this.props.buttonClass,!0)),q="flag ".concat(ye&&ye.iso2);return p.a.createElement("div",{className:"".concat(we," ").concat(this.props.className),style:this.props.style||this.props.containerStyle,onKeyDown:this.handleKeydown},ue&&p.a.createElement("div",{className:"special-label"},ue),pe&&p.a.createElement("div",{className:"invalid-number-message"},pe),p.a.createElement("input",Object.assign({className:ee,style:this.props.inputStyle,onChange:this.handleInput,onClick:this.handleInputClick,onDoubleClick:this.handleDoubleClick,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCopy:this.handleInputCopy,value:X,onKeyDown:this.handleInputKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,type:"tel"},this.props.inputProps,{ref:function(se){Y.numberInputRef=se,typeof Y.props.inputProps.ref=="function"?Y.props.inputProps.ref(se):typeof Y.props.inputProps.ref=="object"&&(Y.props.inputProps.ref.current=se)}})),p.a.createElement("div",{className:Se,style:this.props.buttonStyle,ref:function(se){return Y.dropdownContainerRef=se}},D?p.a.createElement("div",{className:de},D):p.a.createElement("div",{onClick:P?void 0:this.handleFlagDropdownClick,className:de,title:ye?"".concat(ye.localName||ye.name,": + ").concat(ye.dialCode):"",tabIndex:P?"-1":"0",role:"button","aria-haspopup":"listbox","aria-expanded":!!Te||void 0},p.a.createElement("div",{className:q},!P&&p.a.createElement("div",{className:Re}))),Te&&this.getCountryDropdownList()))}}])&&c(Z.prototype,ae),W}(p.a.Component);Ie.defaultProps={country:"",value:"",onlyCountries:[],preferredCountries:[],excludeCountries:[],placeholder:"1 (702) 123-4567",searchPlaceholder:"search",searchNotFound:"No entries to show",flagsImagePath:"./flags.png",disabled:!1,containerStyle:{},inputStyle:{},buttonStyle:{},dropdownStyle:{},searchStyle:{},containerClass:"",inputClass:"",buttonClass:"",dropdownClass:"",searchClass:"",className:"",autoFormat:!0,enableAreaCodes:!1,enableTerritories:!1,disableCountryCode:!1,disableDropdown:!1,enableLongNumbers:!1,countryCodeEditable:!0,enableSearch:!1,disableSearchIcon:!1,disableInitialCountryGuess:!1,disableCountryGuess:!1,regions:"",inputProps:{},localization:{},masks:null,priority:null,areaCodes:null,preserveOrder:[],defaultMask:"... ... ... ... ..",alwaysDefaultMask:!1,prefix:"+",copyNumbersOnly:!0,renderStringAsFlag:"",autocompleteSearch:!1,jumpCursorToEnd:!0,enableAreaCodeStretch:!1,enableClickOutside:!0,showDropdown:!1,isValid:!0,defaultErrorMessage:"",specialLabel:"Phone",onEnterKeyPress:null,keys:{UP:38,DOWN:40,RIGHT:39,LEFT:37,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9}},t.default=Ie}]);const Ym=uu(zm),Jm=({value:e,onChange:t,error:r,onBlur:a,id:n,name:o,required:i,defaultCountry:l="us",className:s,responsive:c=!1,enableSearch:d=!0,autoComplete:f})=>{const y=(C,b)=>{t("+"+C,b.countryCode)};return u.jsxs("div",{className:s,children:[u.jsx("div",{className:Me("movmo-phone-input flex items-center px-3.5 py-0 h-10 rounded-lg border",c&&"movmo-phone-input-responsive",r?"border-error-500 focus:ring-error-500":"border-grayWarm-300 focus-within:ring-2 focus-within:ring-grayWarm-950"),children:u.jsx(Ym,{country:l,value:e.replace("+",""),onChange:y,inputProps:{onBlur:a,required:i,id:n,name:o,...f&&{autoComplete:f}},enableSearch:d,autoFormat:!0})}),r&&u.jsx("p",{className:"text-error-500 text-xs mt-1",children:r})]})},ya=e=>`otp-input-${e}`,lr=e=>Et(document.getElementById(ya(e))),Um=e=>Array.from({length:e},()=>""),Ua=({length:e,onComplete:t,onChange:r,disabled:a=!1,autoFocus:n=!1})=>{const[o,i]=w.useState(()=>Um(e)),l=w.useRef(null),s=w.useRef(t);s.current=t;const c=b=>{i(b),r==null||r(b.join(""))},d=b=>{const h=[...o];for(let x=0;x<Math.min(b.length,e);x++)h[x]=b[x];c(h);const p=h.findIndex(x=>x==="");lr(p!==-1?p:e-1)},f=(b,h)=>{if(a||!/^\d*$/.test(b))return;if(b.length>=e){d(b);return}const p=[...o];p[h]=b.slice(-1),c(p),b&&h<e-1&&lr(h+1)},y=b=>{if(a)return;b.preventDefault();const h=b.clipboardData.getData("text/plain").replace(/\D/g,"");h&&d(h)},C=b=>{if(a)return;const h=[...o];h[b]="",c(h),b>0&&lr(b-1)};return w.useEffect(()=>{n&&lr(0)},[]),w.useEffect(()=>{if(a)return;const b=o.join("");if(o.some(h=>h==="")){l.current=null;return}l.current!==b&&(l.current=b,s.current(b))},[o,a]),u.jsx("div",{className:"flex justify-center gap-1.5 sm:gap-2",children:Array.from({length:e}).map((b,h)=>u.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:h===0?e:1,autoComplete:h===0?"one-time-code":"off","aria-label":`Digit ${h+1} of ${e}`,disabled:a,className:`w-full max-w-10 h-16 border border-grayWarm-300 shadow-xs rounded-md text-center text-lg focus:outline-none focus:ring-2 focus:ring-grayWarm-950${a?" bg-grayWarm-100 text-grayWarm-400 cursor-not-allowed":""}`,value:o[h]??"",onChange:p=>f(p.target.value,h),onPaste:y,id:ya(h),"data-testid":ya(h),onKeyDown:p=>{p.key==="Backspace"&&C(h)}},h))})};function $m(e){const t=Math.max(0,Math.ceil(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}const pr={didntGetIt:"Didn't get it?",resend:"Resend code",resendIn:e=>`Resend code in ${$m(e)}`,attemptsLeft:e=>`${e} ${e===1?"attempt":"attempts"} left.`},_l=({secondsLeft:e,onResend:t,disabled:r=!1,className:a=""})=>u.jsx("p",{className:`text-sm text-grayWarm-600 ${a}`,children:e>0?pr.resendIn(e):u.jsxs(u.Fragment,{children:[u.jsx("span",{children:pr.didntGetIt})," ",u.jsx("button",{type:"button",onClick:t,disabled:r,className:"font-semibold text-brand-600 hover:text-brand-700 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 disabled:opacity-60 disabled:cursor-not-allowed",children:pr.resend})]})}),Qm=({email:e,phone:t,otpLength:r,otpAction:a,onVerify:n,onClose:o,externalError:i,externalErrorVariant:l="error",disabled:s=!1,title:c,description:d,onOtpChange:f,onResend:y,resendAfter:C=0,attemptsRemaining:b})=>{const[h,p]=w.useState(C);w.useEffect(()=>{p(C)},[C]);const x=h>0;w.useEffect(()=>{if(!x)return;const A=setInterval(()=>p(I=>Math.max(0,I-1)),1e3);return()=>clearInterval(A)},[x]);const E=()=>{y==null||y(),p(C)};w.useEffect(()=>{const A=I=>{I.key==="Escape"&&o()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[o]);const R=l==="warning"?"text-warning-700":"text-error-500";return u.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-[110] px-4",children:u.jsxs(Aa,{className:"w-full max-w-[400px] rounded-lg bg-white",children:[u.jsx(wa,{className:"p-4 border-b border-grayWarm-200",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("button",{onClick:o,className:"w-8 h-8 flex items-center justify-center bg-grayWarm-100 hover:bg-grayWarm-200 rounded-lg transition-colors","aria-label":"Close modal",children:u.jsx("svg",{className:"w-4 h-4 text-grayWarm-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),u.jsx("h2",{className:"text-xl md:text-lg font-bold text-center flex-1",children:c||"Verify Account"}),u.jsx("div",{className:"w-8"})]})}),u.jsxs(Ea,{className:"p-4 text-center",children:[u.jsxs("div",{className:"text-center mb-3",children:[u.jsx("p",{className:"text-sm md:text-md text-grayWarm-600",children:d||"Enter the code we sent to"}),!d&&u.jsx("p",{className:"text-sm md:text-md text-grayWarm-600 mt-1",children:a===qt.OTPAction.EMAILED?e:t})]}),u.jsx("div",{className:"mb-6",children:u.jsx(Ua,{length:r,onComplete:n,onChange:f,disabled:s})}),i&&u.jsx("p",{className:`${R} text-center text-sm mb-4`,children:i}),b!==void 0&&u.jsx("p",{className:"text-error-500 text-center text-sm mb-4",children:pr.attemptsLeft(b)}),y&&u.jsx(_l,{secondsLeft:h,onResend:E,disabled:s,className:"text-center mb-2"})]})]})})};function $a(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}const Km=new Set(["invalid_email","rate_limited","resend_too_soon","flow_expired","invalid_code","too_many_attempts","invalid_request","invalid_credential","topOrigin_required","passkey_limit","credential_exists","not_found","reauth_required","movmo_session_required","first_party_only","issuer_unavailable","passkey_failed","sign_in_failed","recovery_required","recovery_blocked","recovery_cooldown","code_sends_paused"]);function qm(e){return Km.has(e)}class Rt extends Error{constructor(t,r,a,n,o){super(r),this.status=t,this.code=r,this.retryAfter=a,this.attemptsRemaining=n,this.until=o}}function eb(e){return typeof e=="object"&&e!==null?e:void 0}function ci(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function pt(e){if(e instanceof Rt)return e;const t=eb(e);if(t){const{response:r}=t;if(r&&typeof r=="object"){const a=typeof r.status=="number"?r.status:0,n=r.data&&typeof r.data=="object"?r.data:void 0,o=n==null?void 0:n.code,i=typeof o=="string"&&qm(o)?o:"unknown";return new Rt(a,i,ci(n==null?void 0:n.retry_after),ci(n==null?void 0:n.attempts_remaining),i==="recovery_cooldown"&&typeof(n==null?void 0:n.until)=="string"?n.until:void 0)}if(t.isAxiosError===!0||t.request!==void 0)return new Rt(0,"network")}return e instanceof TypeError&&/failed to fetch/i.test(e.message)?new Rt(0,"network"):new Rt(0,"unknown")}const tb=/^[A-Za-z0-9_-]{1,512}$/,nb=/^rc1\.[A-Za-z0-9_-]+$/,Dl=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}};function rb(e,t){const r=()=>{var n;return((n=t==null?void 0:t.locale)==null?void 0:n.call(t))??"en-US"};function a(n){const o=Dl();return o?{...n,time_zone:o}:n}return{async login(n){try{const{data:o}=await e.post("/v1/auth/login",a({email:n,locale:r()}));return o}catch(o){throw pt(o)}},async sendCode(n){try{const{data:o}=await e.post("/v1/auth/code",a({flow_id:n}));return o}catch(o){throw pt(o)}},async startRecovery(n){try{const{data:o}=await e.post("/v1/auth/recovery",a({flow_id:n}));return o}catch(o){throw pt(o)}},async cancelRecovery(n){if(!nb.test(n))throw new Rt(0,"invalid_request");try{await e.post("/v1/auth/recovery/cancel",{token:n})}catch(o){throw pt(o)}},async passkeyOptions(){try{const{data:n}=await e.post("/v1/auth/passkey/options",{});return n}catch(n){throw pt(n)}},async verifyCode(n,o){try{const{data:i}=await e.post("/v1/auth/verify",{flow_id:n,code:o});return i}catch(i){throw pt(i)}},async verifyPasskey(n,o){try{const{data:i}=await e.post("/v1/auth/verify",{flow_id:n,credential:o});return i}catch(i){throw pt(i)}},async listPasskeys(){try{const{data:n}=await e.get("/v1/users/me/passkeys");return n.passkeys??[]}catch(n){throw pt(n)}},async startRegistration(){try{const{data:n}=await e.post("/v1/users/me/passkeys/registration/start",{});return n}catch(n){throw pt(n)}},async completeRegistration(n,o){try{const{data:i}=await e.post("/v1/users/me/passkeys/registration/complete",a({flow_id:n,credential:o}));return i.passkey}catch(i){throw pt(i)}},async logout(){try{await e.post("/v1/auth/logout",{})}catch(n){pt(n)}},async deletePasskey(n){if(!tb.test(n))throw new Rt(0,"invalid_request");try{await e.delete(`/v1/users/me/passkeys/${encodeURIComponent(n)}`)}catch(o){throw pt(o)}}}}const tt={passkeyNotRecognized:"That passkey isn't recognized. We've sent you a code instead.",tooManyAttempts:"Too many attempts. Start again.",flowExpired:"That took too long. Start again.",codeSent:"Code sent",signedIn:"Signed in",generic:"Something went wrong. Try again.",accountMismatch:"That's a different account. Sign in with the account you're using.",passkeyExists:"This passkey is already on your account.",enrollExpired:"That took too long. Try again.",invalidEmail:"Enter a valid email address.",passkeyUnavailable:"This browser couldn't use a passkey. Choose 'I can't use my passkey' to sign in with a code.",discoverableNotRecognized:"That passkey isn't recognized. Continue with your email instead.",recoveryStarted:"Sign in without your passkey",recoveryBlocked:"We can't recover this account right now"};function Wl(e){return e===void 0?"Incorrect code.":`Incorrect code. ${e} ${e===1?"attempt":"attempts"} left.`}function Qa(e){const t=e!==void 0&&Number.isFinite(e)?Math.max(1,Math.ceil(e/60)):1;return`Too many requests. Try again in ${t} ${t===1?"minute":"minutes"}.`}const Ka="movmo_pk_prompt",ab=864e5,ob=14,ib=3,sb=99,lb=3456e4,qa=e=>Math.floor(e/ab),ub=/^\d{1,3}(\.\d{1,3}){3}$/;function Ll(e){if(!e||e.includes(":")||ub.test(e))return;const t=e.split(".");if(!(t.length<2))return"."+t.slice(-2).join(".")}function cb(e,t){const r=[];for(const a of e.split(";")){const n=a.indexOf("=");n!==-1&&a.slice(0,n).trim()===t&&r.push(a.slice(n+1))}return r}function db(e){if(typeof e!="object"||e===null)return!1;const{v:t,d:r,n:a,x:n}=e;return t===1&&typeof r=="number"&&Number.isInteger(r)&&r>=0&&typeof a=="number"&&Number.isInteger(a)&&a>=0&&(n===0||n===1)}function Yn(e=document.cookie,t=Date.now()){const r=cb(e,Ka);if(r.length!==1)return null;let a;try{a=JSON.parse(decodeURIComponent(r[0]))}catch{return null}return!db(a)||a.d>qa(t)?null:a}function Xl(e=Date.now(),t=Yn(document.cookie,e)){return t?t.x===1?!1:t.d===0?!0:qa(e)-t.d>=ob&&t.n>=ib:!0}function eo(e){try{const t=Ll(window.location.hostname),r={...e,n:Math.min(e.n,sb)};document.cookie=`${Ka}=${encodeURIComponent(JSON.stringify(r))}; Path=/; Max-Age=${lb}; SameSite=Lax; Secure${t?"; Domain="+t:""}`}catch{}}function Hl(){const e=Yn();!e||e.d<=0||e.x!==0||eo({v:1,d:e.d,n:e.n+1,x:e.x})}function Zl(e=Date.now()){eo({v:1,d:qa(e),n:0,x:0})}function zl(e){const t=Yn();eo({v:1,d:(t==null?void 0:t.d)??0,n:(t==null?void 0:t.n)??0,x:e?1:0})}function Yl(){var e;return((e=Yn())==null?void 0:e.x)===1}function _r(e){switch(e instanceof DOMException||typeof e=="object"&&e!==null&&"name"in e?e.name:void 0){case"NotAllowedError":return"cancelled";case"AbortError":return"aborted";case"InvalidStateError":return"exists";case"NotSupportedError":return"unsupported";case"SecurityError":return"security";default:return"unknown"}}function to(){if(!(typeof window>"u"||!window.PublicKeyCredential))return window.PublicKeyCredential}async function no(){const e=to();if(!e)return{webauthn:!1,conditional:!1,platform:!1};let t=!1;try{typeof e.isConditionalMediationAvailable=="function"&&(t=await e.isConditionalMediationAvailable())}catch{t=!1}let r=!1;try{typeof e.isUserVerifyingPlatformAuthenticatorAvailable=="function"&&(r=await e.isUserVerifyingPlatformAuthenticatorAvailable())}catch{r=!1}return{webauthn:!0,conditional:t,platform:r}}class ro{constructor(){go(this,"current",null)}begin(){return this.abortCurrent(),this.current=new AbortController,this.current.signal}abort(){this.abortCurrent()}abortCurrent(){this.current&&!this.current.signal.aborted&&this.current.abort(new DOMException("Superseded by a new ceremony","AbortError"))}}function fb(e){return ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function yn(e){const t=fb(e);let r="";for(let a=0;a<t.length;a++)r+=String.fromCharCode(t[a]);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ar(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;if(r===3)throw new Error("Invalid base64url string");const a=t+"=".repeat(r),n=atob(a),o=new Uint8Array(n.length);for(let i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return o.buffer}function Jl(e){if(Array.isArray(e))return e.map(t=>({...t,id:typeof t.id=="string"?Ar(t.id):t.id}))}function pb(e){const t={...e};typeof e.challenge=="string"&&(t.challenge=Ar(e.challenge));const r=Jl(e.allowCredentials);return r&&(t.allowCredentials=r),t}function gb(e){const t={...e};if(typeof e.challenge=="string"&&(t.challenge=Ar(e.challenge)),e.user&&typeof e.user=="object"){const a=e.user;t.user={...a,id:typeof a.id=="string"?Ar(a.id):a.id}}const r=Jl(e.excludeCredentials);return r&&(t.excludeCredentials=r),t}function mb(e){const t=to();return t&&typeof t.parseRequestOptionsFromJSON=="function"?t.parseRequestOptionsFromJSON(e.publicKey):pb(e.publicKey)}function bb(e){const t=to();return t&&typeof t.parseCreationOptionsFromJSON=="function"?t.parseCreationOptionsFromJSON(e.publicKey):gb(e.publicKey)}function hb(e){const t={clientDataJSON:yn(e.clientDataJSON)},r=e;r.authenticatorData&&(t.authenticatorData=yn(r.authenticatorData),t.signature=r.signature?yn(r.signature):void 0,t.userHandle=r.userHandle?yn(r.userHandle):void 0);const a=e;return a.attestationObject&&(t.attestationObject=yn(a.attestationObject),typeof a.getTransports=="function"&&(t.transports=a.getTransports())),t}function vb(e){return{id:e.id,rawId:yn(e.rawId),type:e.type,authenticatorAttachment:e.authenticatorAttachment??void 0,clientExtensionResults:e.getClientExtensionResults(),response:hb(e.response)}}function Ul(e){const t=e;if(typeof t.toJSON=="function")try{return t.toJSON()}catch{}return vb(e)}async function Ca(e,t){const a={publicKey:mb(e),signal:t.signal};t.conditional&&(a.mediation="conditional");const n=await navigator.credentials.get(a);if(!n)throw new DOMException("No credential returned","NotAllowedError");return Ul(n)}async function $l(e,t){let r=e.publicKey;if(t.securityKey){const o=r.authenticatorSelection??{};r={...r,hints:["security-key"],authenticatorSelection:{...o,authenticatorAttachment:"cross-platform"}}}const a=bb({publicKey:r}),n=await navigator.credentials.create({publicKey:a,signal:t.signal});if(!n)throw new DOMException("No credential returned","NotAllowedError");return Ul(n)}function di(e){if(e.aborted)throw new DOMException("Registration aborted","AbortError")}async function ao(e,t){const r=await e.startRegistration();di(t.signal);const a=await $l(r.options,{signal:t.signal,securityKey:t.securityKey});return di(t.signal),e.completeRegistration(r.flow_id,a)}function qr(e){switch(e.code){case"invalid_code":return{code:e.code,message:Wl(e.attemptsRemaining)};case"too_many_attempts":return{code:e.code,message:tt.tooManyAttempts};case"rate_limited":return{code:e.code,message:Qa(e.retryAfter)};case"flow_expired":return{code:e.code,message:tt.flowExpired};case"invalid_email":return{code:e.code,message:tt.invalidEmail};default:return{code:e.code,message:tt.generic}}}function yb(e){return e==="flow_expired"||e==="too_many_attempts"}function Cb(e){const t=e==="security"||e==="unsupported"?tt.passkeyUnavailable:tt.generic;return{code:e,message:t}}function xb(e){if(e instanceof Rt)switch(e.code){case"credential_exists":return{code:e.code,message:tt.passkeyExists};case"flow_expired":return{code:e.code,message:tt.enrollExpired};case"rate_limited":return{code:e.code,message:Qa(e.retryAfter)};default:return{code:e.code,message:tt.generic}}const t=_r(e);return t==="cancelled"||t==="aborted"?null:t==="exists"?{code:t,message:tt.passkeyExists}:{code:t,message:tt.generic}}async function Ib(e){return e.method!=="otp"||e.loginNext!=="code"||e.surface!=="top-level"||e.offerEnrollment===!1||!await e.platformAuthenticator()?!1:Xl()}const Ql=27e4,ea=6;function Kl(e){const t=w.useRef(e);t.current=e;const[r]=w.useState($a),a=e.surface==="top-level"&&!r,n=a?"top-level":"embedded",o=e.lockedEmail!==void 0||e.expectedUserId!==void 0,[i,l]=w.useState("email"),[s,c]=w.useState(e.lockedEmail??e.initialEmail??""),[d,f]=w.useState(!1),[y,C]=w.useState(null),[b,h]=w.useState(ea),[p,x]=w.useState(0),[E,R]=w.useState(void 0),[A,I]=w.useState(!1),[j,F]=w.useState(!1),[M,oe]=w.useState(!1),[re,ce]=w.useState(""),[z]=w.useState(()=>new ro),le=w.useRef(!1),G=w.useRef("email"),O=w.useRef(s),V=w.useRef(0);V.current=p;const $=w.useRef(0),ne=w.useRef(null),Ie=w.useRef(null),_=w.useRef(null),W=w.useRef(0),Z=w.useRef(null),ae=w.useRef(null),L=w.useRef(!1),m=w.useRef(null),pe=w.useRef(!1),Y=w.useRef(!1),K=w.useRef(!1),me=()=>ae.current??(ae.current=no()),ye=T=>{G.current=T,l(T),T!=="code"&&x(0),T!=="passkey"&&F(!1),T!=="recovery"&&oe(!1)},Te=T=>{C(T),T&&ce("")},X=T=>le.current&&$.current===T,je=T=>{const U=++$.current;return ne.current=T,f(!0),C(null),U},Ae=T=>{$.current===T&&(ne.current=null,f(!1))},P=()=>{$.current++,ne.current=null,f(!1)},D=()=>({surface:t.current.promptSurface??"modal"}),Q=T=>{var U,ie;return(ie=(U=t.current).onEvent)==null?void 0:ie.call(U,T,D())},be=()=>{Z.current!==null&&(clearTimeout(Z.current),Z.current=null),W.current++},ue=()=>{be(),z.abort()},Ce=async()=>{if(!a||o)return;be();const T=W.current,U=()=>le.current&&W.current===T&&G.current==="email"&&ne.current===null,{conditional:ie}=await me();if(!U()||!ie)return;const Xe=z.begin();Z.current=setTimeout(()=>void Ce(),Ql);let rt;try{rt=await t.current.api.passkeyOptions()}catch{return}if(!U()||Xe.aborted)return;const dt=rt.flow_id;Ca(rt.options,{signal:Xe,conditional:!0}).then(v=>{U()&&we(dt,v)},()=>{})},we=async(T,U)=>{be();const ie=je("request");let Xe;try{Xe=await t.current.api.verifyPasskey(T,U)}catch(rt){if(!X(ie))return;const dt=pt(rt).code==="invalid_credential";Re(ie,dt?{code:"invalid_credential",message:tt.discoverableNotRecognized}:null);return}X(ie)&&await Ke(ie,Xe,"passkey",null)},Re=(T,U)=>{Ae(T),Te(U),G.current==="passkey"&&F(!0),G.current==="email"&&Ce()},ee=(T,U)=>{const ie=G.current==="email";Ae(T),Ie.current=null,ye("email"),Te(U),ie&&Ce()},de=(T,U)=>{const ie=pt(U);if(ie.code==="recovery_required"){Ae(T),Te(null),ye("recovery"),ce(tt.recoveryStarted);return}if(ie.code==="recovery_blocked"){Ae(T),Te(null),oe(!0),ce(tt.recoveryBlocked);return}if(yb(ie.code)){ee(T,qr(ie));return}if(ie.code==="resend_too_soon"){Ae(T),x(Math.max(0,Math.ceil(ie.retryAfter??0)));return}ie.code==="invalid_code"&&R(ie.attemptsRemaining),Re(T,qr(ie))},Se=async(T,U)=>{ne.current="request";try{const ie=await U();return X(T)?ie:void 0}catch(ie){X(T)&&de(T,ie);return}},q=(T,U)=>{_.current=T.flow_id,h(T.code_length||ea),R(void 0),ye("code"),x(Math.max(0,T.resend_after??0)),ce(tt.codeSent),U&&C(U)},se=async(T,U,ie)=>{const Xe=await Se(T,()=>t.current.api.sendCode(U));Xe&&(Ae(T),q(Xe,ie))},_e=()=>{P(),ue(),Ie.current=null,ye("mismatch"),Te({code:"account_mismatch",message:tt.accountMismatch});const{api:T}=t.current;(async()=>{var U,ie;try{await T.logout()}catch{}(ie=(U=t.current).onAccountMismatch)==null||ie.call(U)})()},ot=(T,U)=>{pe.current||(pe.current=!0,m.current=null,ye("done"),ce(tt.signedIn),t.current.onSignedIn(T,U))},Ke=async(T,U,ie,Xe)=>{var Oe,ke,Ne,Ge;const rt=t.current,dt=rt.expectedUserId;if(dt!==void 0&&U.user_id!==dt){_e();return}let v;try{v=await rt.getCurrentUser()}catch{if(!X(T))return;const qe={code:"unknown",message:tt.generic};G.current==="passkey"?ee(T,qe):Re(T,qe);return}if(!X(T))return;if(dt!==void 0&&v.id!==dt){_e();return}const B=typeof U.recovery_until=="string"&&U.recovery_until!=="",J=B?{method:"recovery",newUser:U.new_user,recoveryUntil:U.recovery_until}:{method:ie,newUser:U.new_user};Y.current||(Y.current=!0,(ke=(Oe=t.current).onVerified)==null||ke.call(Oe,v,J)),J.method==="otp"&&a&&Hl(),B&&((Ge=(Ne=t.current).onEvent)==null||Ge.call(Ne,"sign_in",{...D(),method:"recovery"}));const he=await Ib({method:J.method,loginNext:Xe,surface:n,offerEnrollment:rt.offerEnrollment,platformAuthenticator:async()=>(await me()).platform});X(T)&&(Ae(T),he?(m.current={user:v,info:J},ye("enroll"),Q("passkey_prompt_shown")):ot(v,J))},lt=async(T,U,ie,Xe)=>{if(!a){Ae(T);return}ne.current="ceremony";let rt;try{rt=await Ca(U.options,{signal:ie})}catch(v){if(!X(T))return;const B=_r(v);Re(T,B==="cancelled"||B==="aborted"?null:Cb(B));return}if(!X(T))return;ne.current="request";let dt;try{dt=await t.current.api.verifyPasskey(U.flow_id,rt)}catch(v){if(!X(T))return;const B=pt(v);if(B.code==="invalid_credential"&&Xe){const J={code:"invalid_credential",message:tt.passkeyNotRecognized};await se(T,U.flow_id,J)}else B.code==="invalid_credential"?Re(T,{code:"invalid_credential",message:tt.discoverableNotRecognized}):Xe?ee(T,qr(B)):de(T,v);return}X(T)&&await Ke(T,dt,"passkey",Xe?"passkey":null)},gt=(T,U)=>(F(!1),lt(T,U,z.begin(),!0)),It=T=>{t.current.lockedEmail===void 0&&(O.current=T,c(T))},Ue=async()=>{if(ne.current||G.current!=="email")return;ue();const T=(t.current.lockedEmail??O.current).trim();if(!T){Te({code:"invalid_email",message:tt.invalidEmail}),Ce();return}O.current=T,c(T);const U=je("request"),ie=await Se(U,()=>t.current.api.login(T));ie&&await Nt(U,ie)},Nt=async(T,U)=>{Ie.current=U,U.next==="code"?(Ae(T),q(U)):a?(h(U.code_length||ea),ye("passkey"),await gt(T,U)):await se(T,U.flow_id)},Mt=async()=>{if(!a||o||!L.current||ne.current||G.current!=="email")return;ue();const T=je("ceremony"),U=z.begin(),ie=await Se(T,()=>t.current.api.passkeyOptions());ie&&await lt(T,ie,U,!1)},an=()=>{const T=Ie.current;!a||G.current!=="passkey"||ne.current||(T==null?void 0:T.next)!=="passkey"||gt(je("ceremony"),T)},St=()=>{o||G.current!=="passkey"||ne.current==="request"||!Ie.current||(P(),z.abort(),C(null),ye("recovery"),ce(tt.recoveryStarted))},Gt=async()=>{var Xe;const T=(Xe=Ie.current)==null?void 0:Xe.flow_id;if(G.current!=="recovery"||ne.current||!T||o)return;const U=je("request"),ie=await Se(U,()=>t.current.api.startRecovery(T));ie&&(Ae(U),Q("recovery_started"),q(ie))},Pt=()=>{var T;G.current!=="recovery"||ne.current||M||(C(null),a&&((T=Ie.current)==null?void 0:T.next)==="passkey"?ye("passkey"):(Ie.current=null,ye("email")))},on=()=>{G.current!=="passkey"&&G.current!=="code"||(P(),z.abort(),Ie.current=null,C(null),ye("email"))},Xt=async T=>{var rt;const U=_.current;if(G.current!=="code"||ne.current||!U)return;const ie=je("request"),Xe=await Se(ie,()=>t.current.api.verifyCode(U,T));Xe&&await Ke(ie,Xe,"otp",((rt=Ie.current)==null?void 0:rt.next)??null)},sn=async()=>{const T=_.current;if(G.current!=="code"||ne.current||V.current>0||!T)return;ce("");const U=je("request"),ie=await Se(U,()=>t.current.api.sendCode(T));ie&&(Ae(U),q(ie))},Ht=async()=>{if(!a||G.current!=="enroll"||ne.current)return;const T=je("ceremony"),U=z.begin();try{await ao(t.current.api,{signal:U})}catch(ie){X(T)&&Re(T,xb(ie));return}X(T)&&(Ae(T),ye("enrolled"),Q("passkey_prompt_accepted"))},Ct=()=>{const T=m.current;T&&ot(T.user,T.info)},ht=()=>{G.current==="enroll"&&(P(),z.abort(),C(null),Zl(),Q("passkey_prompt_declined"),Ct())},Zt=()=>{G.current==="enrolled"&&Ct()},kt=()=>{G.current==="enroll"?ht():G.current==="enrolled"?Zt():(P(),ue())};w.useEffect(()=>(le.current=!0,()=>{le.current=!1,ue()}),[]),w.useEffect(()=>{if(!a||o)return;let T=!1;return me().then(U=>{L.current=U.webauthn,T||I(U.webauthn)}),()=>{T=!0}},[a,o]);const ln=()=>{var Xe;const{autoContinue:T,lockedEmail:U,initialEmail:ie}=t.current;return!!(T&&((Xe=U??ie)!=null&&Xe.trim())&&!K.current)};w.useEffect(()=>{if(!(i!=="email"||ne.current||ln()))return Ce(),be},[i]),w.useEffect(()=>{ln()&&(K.current=!0,Ue())},[]);const un=i==="code"&&p>0;return w.useEffect(()=>{if(!un)return;const T=setInterval(()=>x(U=>Math.max(0,U-1)),1e3);return()=>clearInterval(T)},[un]),{step:i,email:s,setEmail:It,busy:d,error:(y==null?void 0:y.message)??null,errorCode:(y==null?void 0:y.code)??null,codeLength:b,resendIn:p,attemptsRemaining:E,canUsePasskeyButton:A,passkeyFailed:j,recoveryAvailable:!o,recoveryBlocked:M,liveMessage:re,submitEmail:()=>void Ue(),signInWithPasskey:()=>void Mt(),retryPasskey:an,cantUsePasskey:St,sendRecoveryCode:()=>void Gt(),back:Pt,changeEmail:on,submitCode:T=>void Xt(T),resendCode:()=>void sn(),acceptEnrollment:()=>void Ht(),declineEnrollment:ht,finish:Zt,close:kt}}const Qt={prompt:{heading:"Skip the code next time",body:"Set up a passkey and sign in with Face ID, your fingerprint or your screen lock.",accept:"Set up passkey",decline:"Not now",footnote:"You can manage passkeys anytime in Security."},added:{heading:"Passkey added",body:"Next time, sign in with Face ID, your fingerprint or your screen lock. We've emailed you a confirmation.",done:"Done"}},xa=({status:e="prompt",onAccept:t,onDecline:r,onDone:a,busy:n=!1,error:o=null})=>e==="added"?u.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-success-50",children:u.jsx(Ja,{size:24,className:"text-success-600"})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{tabIndex:-1,className:"text-lg font-semibold text-grayWarm-950 focus:outline-none",children:Qt.added.heading}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:Qt.added.body})]}),u.jsx("button",{type:"button",onClick:a,className:"w-full py-3 px-4 bg-gradient-to-r from-brand-500 to-brand-600 text-white font-semibold rounded-xl transition-opacity hover:opacity-90",children:Qt.added.done})]}):u.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-brand-50",children:u.jsx(Pl,{size:24,className:"text-brand-600"})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{tabIndex:-1,className:"text-lg font-semibold text-grayWarm-950 focus:outline-none",children:Qt.prompt.heading}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:Qt.prompt.body})]}),o&&u.jsxs("div",{role:"alert",className:"w-full flex items-start gap-2 rounded-lg bg-warning-50 border border-warning-200 p-3 text-left",children:[u.jsx(Rn,{size:20,className:"text-warning-700 flex-shrink-0 mt-0.5"}),u.jsx("p",{className:"text-sm text-warning-700",children:o})]}),u.jsxs("div",{className:"w-full flex flex-col gap-2",children:[u.jsx("button",{type:"button",onClick:t,disabled:n,"aria-busy":n,className:"w-full py-3 px-4 bg-gradient-to-r from-brand-500 to-brand-600 text-white font-semibold rounded-xl transition-opacity hover:opacity-90 disabled:opacity-70 disabled:cursor-not-allowed",children:Qt.prompt.accept}),u.jsx("button",{type:"button",onClick:r,className:"w-full py-3 px-4 bg-white border border-grayWarm-300 text-grayWarm-700 font-semibold rounded-xl transition-colors hover:bg-grayWarm-50",children:Qt.prompt.decline})]}),u.jsx("p",{className:"text-xs text-grayWarm-500",children:Qt.prompt.footnote})]}),oo="focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2",Ln=S.forwardRef(({className:e,type:t="button",...r},a)=>u.jsx("button",{ref:a,type:t,className:Me("w-full h-11 px-4 inline-flex items-center justify-center gap-2 rounded-xl bg-gradient-to-r from-brand-500 to-brand-600 text-white font-semibold shadow-sm transition-opacity hover:opacity-95 disabled:opacity-60 disabled:cursor-not-allowed",oo,e),...r})),mn=S.forwardRef(({className:e,type:t="button",...r},a)=>u.jsx("button",{ref:a,type:t,className:Me("w-full h-11 px-4 inline-flex items-center justify-center gap-2 rounded-xl bg-white border border-grayWarm-300 text-grayWarm-700 font-semibold shadow-sm transition-colors hover:bg-grayWarm-50 disabled:opacity-60 disabled:cursor-not-allowed",oo,e),...r})),wr=S.forwardRef(({className:e,type:t="button",...r},a)=>u.jsx("button",{ref:a,type:t,className:Me("text-sm font-semibold text-brand-600 hover:text-brand-700 rounded disabled:opacity-60 disabled:cursor-not-allowed",oo,e),...r}));Ln.displayName="PrimaryButton";mn.displayName="SecondaryButton";wr.displayName="LinkButton";const Ze={email:{title:"Sign in to Movmo",description:"Enter your email. New here? We'll create your account.",label:"Email",continue:"Continue",divider:"or",passkey:"Sign in with passkey"},passkey:{title:"Sign in with your passkey",description:"Use Face ID, your fingerprint or your screen lock.",change:"Change",changeLabel:"Change email",continue:"Continue",failed:"Your passkey didn't finish. Try again, or choose 'I can't use my passkey'.",tryAgain:"Try again",cantUse:"I can't use my passkey",reauthDescription:"Use your passkey to continue. Lost it? Recover your account from the sign-in page."},recovery:{title:"Sign in without your passkey",description:e=>`We'll email a code to ${e}. Signing in this way starts account recovery: everyone on your account is notified, and for 24 hours this session can't add passkeys, change contact details, add payment methods or connect airlines.`,send:"Send me a code",back:"Back",blockedTitle:"We can't recover this account right now",blockedDescription:"Too many recovery attempts, or recovery was recently cancelled from this account. Try again later or sign in with a passkey on another device.",close:"Close"},code:{title:"Check your email",description:e=>`Enter the code we sent to ${e}.`},cancel:"Cancel"},io=({flow:e,lockedEmail:t,title:r,description:a,onCancel:n,onClose:o,icon:i})=>{const l=n?()=>{e.close(),n()}:void 0;let s=null;switch(e.step){case"email":s=u.jsx(Sb,{flow:e,locked:t!==void 0,title:r,description:a,onCancel:l,icon:i});break;case"passkey":s=u.jsx(Ab,{flow:e,locked:t!==void 0,title:r,description:a,onCancel:l,icon:i});break;case"recovery":s=u.jsx(Eb,{flow:e,onCancel:l??o});break;case"code":s=u.jsx(Nb,{flow:e,title:r,onCancel:l});break;case"enroll":s=u.jsx(fi,{children:u.jsx(xa,{status:"prompt",onAccept:e.acceptEnrollment,onDecline:e.declineEnrollment,busy:e.busy,error:e.error})});break;case"enrolled":s=u.jsx(fi,{children:u.jsx(xa,{status:"added",onAccept:e.acceptEnrollment,onDecline:e.declineEnrollment,onDone:e.finish})});break;case"mismatch":s=u.jsx(Rb,{flow:e,title:r,onCancel:l,icon:i});break}return u.jsxs("div",{className:"text-left",children:[u.jsx("div",{"aria-live":"polite",className:"sr-only",children:e.error??e.liveMessage}),u.jsx("div",{"data-step":e.step,className:"motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-bottom-1 motion-safe:duration-200",children:s},e.step)]})},fi=({children:e})=>{const t=w.useRef(null);return w.useEffect(()=>{var r;Et((r=t.current)==null?void 0:r.querySelector("h2"))},[]),u.jsx("div",{ref:t,children:e})},An=({icon:e,title:t,description:r,headingRef:a})=>u.jsxs("div",{className:"flex flex-col gap-5 mb-5",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-[10px] border border-grayWarm-200 shadow-sm text-grayWarm-700",children:u.jsx(e,{size:24})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{ref:a,tabIndex:a?-1:void 0,className:"text-lg font-semibold text-grayWarm-950 focus:outline-none",children:t}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:r})]})]}),so=({children:e})=>u.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-warning-200 bg-warning-50 p-4",children:[u.jsx(Rn,{size:20,className:"flex-shrink-0 text-warning-700"}),u.jsx("p",{className:"text-sm text-warning-700",children:e})]}),ql=({primary:e,onCancel:t})=>t?u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(mn,{onClick:t,children:Ze.cancel}),e]}):u.jsx(u.Fragment,{children:e}),Sb=({flow:e,locked:t,title:r,description:a,onCancel:n,icon:o})=>{const i=w.useRef(null),l=w.useRef(null),s=w.useId(),c=w.useId();return w.useEffect(()=>{Et(t?l.current:i.current)},[t]),u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:o??Fl,title:r??Ze.email.title,description:a??Ze.email.description}),u.jsxs("form",{noValidate:!0,onSubmit:d=>{d.preventDefault(),e.submitEmail()},className:"flex flex-col gap-5",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:s,className:"text-sm font-medium text-grayWarm-700",children:Ze.email.label}),u.jsxs("div",{className:"relative",children:[u.jsx(Fr,{size:20,className:"pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-grayWarm-500"}),u.jsx(Vt,{ref:i,id:s,type:"email",name:"email",autoComplete:"username webauthn",value:e.email,onChange:d=>e.setEmail(d.target.value),disabled:t,"aria-invalid":e.error?!0:void 0,"aria-describedby":e.error?c:void 0,className:`h-11 pl-10 ${e.error?"border-error-500 focus:border-error-500":""} autofill:bg-white autofill:shadow-[inset_0_0_0px_1000px_white]`})]}),e.error&&u.jsx("p",{id:c,className:"text-sm text-error-500",children:e.error})]}),u.jsx(ql,{onCancel:n,primary:u.jsx(Ln,{ref:l,type:"submit",disabled:e.busy,"aria-busy":e.busy,children:Ze.email.continue})})]}),e.canUsePasskeyButton&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2 my-5","aria-hidden":"true",children:[u.jsx("div",{className:"h-px flex-1 bg-grayWarm-200"}),u.jsx("span",{className:"text-sm text-grayWarm-500",children:Ze.email.divider}),u.jsx("div",{className:"h-px flex-1 bg-grayWarm-200"})]}),u.jsxs(mn,{onClick:e.signInWithPasskey,disabled:e.busy,children:[u.jsx(za,{size:20}),Ze.email.passkey]})]})]})},Ab=({flow:e,locked:t,title:r,description:a,onCancel:n,icon:o})=>{const i=w.useRef(null);w.useEffect(()=>{Et(i.current)},[]);const l=e.error??(e.passkeyFailed?Ze.passkey.failed:null);return u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:o??Gl,title:r??Ze.passkey.title,description:e.recoveryAvailable?a??Ze.passkey.description:Ze.passkey.reauthDescription,headingRef:i}),u.jsxs("div",{className:"flex flex-col gap-5",children:[l?u.jsx(so,{children:l}):u.jsxs("div",{className:"flex items-center justify-between gap-3 h-11 rounded-lg border border-grayWarm-300 bg-grayWarm-50 px-3.5 shadow-sm",children:[u.jsx("span",{className:"truncate text-base text-grayWarm-700",children:e.email}),!t&&u.jsx(wr,{onClick:e.changeEmail,"aria-label":Ze.passkey.changeLabel,children:Ze.passkey.change})]}),u.jsx(ql,{onCancel:n,primary:u.jsx(Ln,{onClick:e.retryPasskey,disabled:e.busy,"aria-busy":e.busy,children:e.passkeyFailed?Ze.passkey.tryAgain:Ze.passkey.continue})}),e.recoveryAvailable&&u.jsx(wr,{onClick:e.cantUsePasskey,className:"self-center",children:Ze.passkey.cantUse})]})]})},wb=e=>{const t=e.lastIndexOf("@");return t<1?e:`${e.slice(0,1)}•••${e.slice(t)}`},Eb=({flow:e,onCancel:t})=>{const r=w.useRef(null);return w.useEffect(()=>{Et(r.current)},[e.recoveryBlocked]),e.recoveryBlocked?u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:Rn,title:Ze.recovery.blockedTitle,description:Ze.recovery.blockedDescription,headingRef:r}),u.jsx(Ln,{onClick:t??e.close,children:Ze.recovery.close})]}):u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:Fr,title:Ze.recovery.title,description:Ze.recovery.description(wb(e.email)),headingRef:r}),u.jsxs("div",{className:"flex flex-col gap-5",children:[e.error&&u.jsx(so,{children:e.error}),u.jsx(Ln,{onClick:e.sendRecoveryCode,disabled:e.busy,"aria-busy":e.busy,children:Ze.recovery.send}),u.jsx(wr,{onClick:e.back,disabled:e.busy,className:"self-center",children:Ze.recovery.back})]})]})},Rb=({flow:e,title:t,onCancel:r,icon:a})=>u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:a??Rn,title:t??Ze.email.title,description:e.error??""}),r&&u.jsx(mn,{onClick:r,children:Ze.cancel})]}),Nb=({flow:e,title:t,onCancel:r})=>u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:Fr,title:t??Ze.code.title,description:Ze.code.description(e.email)}),u.jsxs("div",{className:"flex flex-col gap-5",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(Ua,{length:e.codeLength,onComplete:e.submitCode,autoFocus:!0}),e.error&&e.errorCode!=="invalid_credential"&&u.jsx("p",{className:"text-error-500 text-center text-sm",children:e.error})]}),e.error&&e.errorCode==="invalid_credential"&&u.jsx(so,{children:e.error}),u.jsx(_l,{secondsLeft:e.resendIn,onResend:e.resendCode,disabled:e.busy}),r&&u.jsx(mn,{onClick:r,children:Ze.cancel})]})]});function lo(e){const t=Kl(e),r=w.useRef(t);return r.current=t,w.useEffect(()=>()=>{const{step:a,close:n}=r.current;(a==="enroll"||a==="enrolled")&&n()},[]),t}const Gb=({title:e,description:t,onCancel:r,...a})=>{const n=lo(a);return u.jsx(io,{flow:n,lockedEmail:a.lockedEmail,title:e,description:t,onCancel:r})},Pb=({isOpen:e,...t})=>e?u.jsx(Tb,{...t}):null,Tb=({onClose:e,hideCloseButton:t=!1,onLoginSuccess:r,...a})=>{const n=lo({...a,promptSurface:a.promptSurface??"modal",onSignedIn:r}),o=()=>{n.close(),e()};return u.jsx(gn,{isOpen:n.step!=="done",onClose:o,title:Ze.email.title,header:"none",maxWidthPx:400,hideCloseButton:t,children:u.jsx(io,{flow:n,lockedEmail:a.lockedEmail,onClose:o})})},dn={title:"Confirm it's you",framed:"Manage passkeys on the Movmo Security page.",cancel:"Cancel",description:{add:"For your security, sign in again to add a passkey.",remove:"For your security, sign in again to remove this passkey."}},eu=({isOpen:e,...t})=>e?u.jsx(Ob,{...t}):null,Ob=e=>{const[t]=w.useState($a);return t?u.jsx(jb,{onCancel:e.onCancel}):u.jsx(Mb,{...e})},jb=({onCancel:e})=>u.jsx(gn,{isOpen:!0,onClose:e,title:dn.title,header:"none",maxWidthPx:400,children:u.jsxs("div",{className:"flex flex-col gap-5 text-left",children:[u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{className:"text-lg font-semibold text-grayWarm-950",children:dn.title}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:dn.framed})]}),u.jsx(mn,{onClick:e,children:dn.cancel})]})}),Mb=({action:e,account:t,api:r,getCurrentUser:a,onConfirmed:n,onCancel:o,onMismatch:i})=>{const l=lo({api:r,surface:"top-level",getCurrentUser:a,lockedEmail:t.email,expectedUserId:t.id,autoContinue:!0,offerEnrollment:!1,onSignedIn:()=>n(),onAccountMismatch:i}),s=()=>{l.close(),o()};return u.jsx(gn,{isOpen:l.step!=="done",onClose:s,title:dn.title,header:"none",maxWidthPx:400,children:u.jsx(io,{flow:l,lockedEmail:t.email,title:dn.title,description:dn.description[e],onCancel:o,icon:jl})})},Le={loading:"Loading passkeys",framed:"Manage passkeys on the Movmo Security page.",empty:"Passkeys let you sign in with Face ID, your fingerprint, your screen lock or a security key. No code to wait for.",addPasskey:"Passkey",addPasskeyLabel:"Add passkey",addSecurityKey:"Security key",addSecurityKeyLabel:"Add security key",suggestToggle:"Suggest a passkey after I sign in with a code",limit:"You've reached the limit of 10 passkeys. Remove one to add another.",unsupported:"This browser doesn't support passkeys. You can still remove them here.",added:"Passkey added. We've emailed you a confirmation.",exists:"This passkey is already on your account.",expired:"That took too long. Try again.",generic:"Something went wrong. Try again.",confirmedAdd:"You're confirmed. Select + Passkey again to finish.",confirmedAddKey:"You're confirmed. Select + Security key again to finish.",recoveryInProgress:e=>e?`Account recovery is in progress. You can change passkeys after ${e}.`:"Account recovery is in progress. You can change passkeys once it ends.",retry:"Retry",sessionRequired:"Sign in again to manage passkeys",signIn:"Sign in",kind:{synced:"Synced",device:"This device",security_key:"Security key"},securityKeyTitle:"Security key",addedOn:e=>`Added ${e}`,lastUsed:e=>`Last used ${e}`,neverUsed:"Never used",removeLabel:e=>`Remove ${e}`,remove:{title:e=>`Remove ${e}?`,body:"You won't be able to sign in with it anymore. You can still sign in with a code.",cancel:"Cancel",confirm:"Remove"}},kb=10,Fb=6e3,Bb=new Set(["confirmedAdd","confirmedAddKey"]),Vb={synced:za,device:Ol,security_key:Tl},_b=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),Db=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}),Wb=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?void 0:Db.format(t)},pi=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:_b.format(t)};function tu(e){const t=e.kind??(e.synced?"synced":"device"),r=e.provider==="Passkey"&&t==="security_key"?Le.securityKeyTitle:e.provider,a=Le.kind[t]===r?null:Le.kind[t],n=`${Le.addedOn(pi(e.created_at))} · ${e.last_used_at?Le.lastUsed(pi(e.last_used_at)):Le.neverUsed}`;return{kind:t,title:r,badge:a,meta:n,Icon:Vb[t]}}const Lb=e=>{const t=w.useRef(e);t.current=e;const[r]=w.useState($a),[a,n]=w.useState("loading"),[o,i]=w.useState([]),[l,s]=w.useState(!1),[c,d]=w.useState(!1),[f,y]=w.useState(!1),[C,b]=w.useState(null),[h,p]=w.useState(0),[x,E]=w.useState(!1),[R,A]=w.useState(null),[I,j]=w.useState(null),[F,M]=w.useState(()=>!Yl()),[oe,re]=w.useState(null),[ce]=w.useState(()=>new ro),z=w.useRef(!1),le=w.useRef(!1),G=w.useRef(0),O=w.useId(),V=w.useCallback(async()=>{const Y=++G.current;n("loading");try{const[K,me]=await Promise.all([t.current.api.listPasskeys(),no()]);if(!le.current||Y!==G.current)return;i(K),s(me.webauthn),n("ready")}catch(K){if(!le.current||Y!==G.current)return;const me=K instanceof Rt&&K.code==="movmo_session_required";n(me?"sessionRequired":"error")}},[]);w.useEffect(()=>(le.current=!0,r||V(),()=>{le.current=!1,ce.abort()}),[r,ce,V]),w.useEffect(()=>{if(h===0)return;E(!0);const Y=setTimeout(()=>E(!1),Fb);return()=>clearTimeout(Y)},[h]);const $=Y=>{i(K=>K.filter(me=>me.id!==Y)),d(!1)},ne=(Y,K,me)=>{if(K instanceof Rt){switch(K.code){case"recovery_cooldown":re(K.until??"");return;case"reauth_required":me?b("generic"):j(Y);return;case"movmo_session_required":b("sessionRequired"),t.current.onSessionRequired();return;case"credential_exists":b("exists");return;case"passkey_limit":d(!0);return;case"flow_expired":b("expired");return;case"not_found":if(Y.type==="remove"){$(Y.passkey.id);return}break}b("generic");return}switch(_r(K)){case"cancelled":case"aborted":me&&Y.type==="add"&&b(Y.securityKey?"confirmedAddKey":"confirmedAdd");return;case"exists":b("exists");return;default:b("generic")}},Ie=async(Y,K=!1)=>{if(!z.current){z.current=!0,y(!0),b(null);try{if(Y.type==="add"){const me=await ao(t.current.api,{securityKey:Y.securityKey,signal:ce.begin()});if(!le.current)return;i(ye=>[me,...ye.filter(Te=>Te.id!==me.id)]),p(ye=>ye+1)}else{if(await t.current.api.deletePasskey(Y.passkey.id),!le.current)return;$(Y.passkey.id)}}catch(me){le.current&&ne(Y,me,K)}finally{z.current=!1,le.current&&(y(!1),A(null))}}},_=()=>{const Y=I;j(null),Y&&Ie(Y,!0)},W=()=>{j(null),t.current.onAccountMismatch()};if(r)return u.jsx(Kt,{tone:"neutral",children:Le.framed});if(a==="loading")return u.jsx(Hb,{});if(a==="error")return u.jsxs(Kt,{tone:"neutral",role:"alert",children:[u.jsx("span",{children:Le.generic}),u.jsx(nu,{onClick:()=>void V(),children:Le.retry})]});if(a==="sessionRequired")return u.jsx(mi,{onSignIn:()=>t.current.onSessionRequired()});const Z=oe??e.recoveryUntil??null,ae=Z?new Date(Z).getTime():Number.NaN,L=Z!==null&&(Number.isNaN(ae)||ae>Date.now()),m=c||o.length>=kb,pe=o.length===0;return u.jsxs("div",{className:"flex flex-col gap-4",children:[pe?u.jsx("p",{className:"text-sm text-grayWarm-600",children:Le.empty}):u.jsx("ul",{className:"flex flex-col divide-y divide-grayWarm-200 -my-3",children:o.map(Y=>u.jsx(Xb,{passkey:Y,disabled:f||L,onRemove:()=>A(Y)},Y.id))}),L&&u.jsx(Kt,{tone:"neutral",role:"status",children:Le.recoveryInProgress(Z?Wb(Z):void 0)}),u.jsx("div",{role:"status","aria-live":"polite",children:x&&u.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-grayWarm-700",children:[u.jsx(Ja,{size:20,className:"flex-shrink-0 text-success-600"}),Le.added]})}),l?m&&u.jsx(Kt,{tone:"neutral",children:Le.limit}):u.jsx(Kt,{tone:"neutral",children:Le.unsupported}),C==="sessionRequired"?u.jsx(mi,{onSignIn:()=>t.current.onSessionRequired()}):C&&Bb.has(C)?u.jsx(Kt,{tone:"neutral",role:"status",children:Le[C]}):C&&u.jsx(Kt,{tone:"warning",role:"alert",children:Le[C]}),l&&u.jsxs("div",{className:"flex flex-wrap gap-3",children:[u.jsx(gi,{label:Le.addPasskeyLabel,disabled:f||m||L,onClick:()=>void Ie({type:"add",securityKey:!1}),children:Le.addPasskey}),u.jsx(gi,{label:Le.addSecurityKeyLabel,disabled:f||m||L,onClick:()=>void Ie({type:"add",securityKey:!0}),children:Le.addSecurityKey})]}),pe&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Xa,{id:O,checked:F,onCheckedChange:Y=>{M(Y),zl(!Y)}}),u.jsx("label",{htmlFor:O,className:"text-sm font-medium text-grayWarm-700",children:Le.suggestToggle})]}),R&&u.jsx(Zb,{title:tu(R).title,busy:f,onCancel:()=>A(null),onConfirm:()=>void Ie({type:"remove",passkey:R})}),u.jsx(eu,{isOpen:I!==null,action:(I==null?void 0:I.type)??"add",account:e.account,api:e.api,getCurrentUser:e.getCurrentUser,onConfirmed:_,onCancel:()=>j(null),onMismatch:W})]})},Xb=({passkey:e,disabled:t,onRemove:r})=>{const{title:a,badge:n,meta:o,Icon:i}=tu(e);return u.jsxs("li",{className:"flex items-center gap-3 py-3",children:[u.jsx("div",{className:"flex items-center justify-center flex-shrink-0 w-10 h-10 rounded-lg bg-grayWarm-100 text-grayWarm-700",children:u.jsx(i,{size:20})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-base font-semibold text-grayWarm-950",children:a}),n&&u.jsx(_a,{variant:n===Le.kind.synced?"info":"default",children:n})]}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:o})]}),u.jsx("button",{type:"button","aria-label":Le.removeLabel(a),disabled:t,onClick:r,className:"flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-lg bg-grayWarm-100 text-grayWarm-600 transition-colors hover:bg-grayWarm-200 hover:text-grayWarm-800 disabled:opacity-60 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-grayWarm-950",children:u.jsx(Ya,{size:18})})]})},gi=({label:e,disabled:t,onClick:r,children:a})=>u.jsxs("button",{type:"button","aria-label":e,disabled:t,onClick:r,className:"inline-flex items-center gap-2 px-3.5 py-2.5 rounded-lg bg-grayWarm-100 text-sm font-semibold text-grayWarm-950 transition-colors hover:bg-grayWarm-200 disabled:bg-transparent disabled:text-grayWarm-400 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-grayWarm-950",children:[u.jsx(Ml,{size:20}),a]}),Kt=({tone:e,role:t,children:r})=>u.jsxs("div",{role:t,className:Me("flex items-start gap-3 rounded-xl border p-4 text-sm",e==="warning"?"border-warning-200 bg-warning-50 text-warning-700":"border-grayWarm-200 bg-grayWarm-50 text-grayWarm-700"),children:[u.jsx(Rn,{size:20,className:Me("flex-shrink-0",e==="warning"?"text-warning-700":"text-grayWarm-500")}),u.jsx("div",{className:"flex flex-1 flex-wrap items-center justify-between gap-3",children:r})]}),nu=({onClick:e,children:t})=>u.jsx("button",{type:"button",onClick:e,className:"px-3 py-2 rounded-lg bg-grayWarm-100 text-sm font-semibold text-grayWarm-950 transition-colors hover:bg-grayWarm-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-grayWarm-950",children:t}),mi=({onSignIn:e})=>u.jsxs(Kt,{tone:"neutral",children:[u.jsx("span",{children:Le.sessionRequired}),u.jsx(nu,{onClick:e,children:Le.signIn})]}),Hb=()=>u.jsxs("div",{"aria-busy":"true",className:"flex flex-col gap-3",children:[u.jsx("span",{className:"sr-only",children:Le.loading}),[0,1].map(e=>u.jsxs("div",{"aria-hidden":"true",className:"flex items-center gap-3 py-1",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-grayWarm-100 motion-safe:animate-pulse"}),u.jsxs("div",{className:"flex-1 flex flex-col gap-2",children:[u.jsx("div",{className:"h-4 w-40 rounded bg-grayWarm-100 motion-safe:animate-pulse"}),u.jsx("div",{className:"h-3 w-56 rounded bg-grayWarm-100 motion-safe:animate-pulse"})]})]},e))]}),Zb=({title:e,busy:t,onCancel:r,onConfirm:a})=>{const n=Le.remove.title(e);return u.jsx(gn,{isOpen:!0,onClose:r,title:n,header:"none",maxWidthPx:400,children:u.jsxs("div",{className:"flex flex-col gap-5 text-left",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-error-100 text-error-600",children:u.jsx(Ya,{size:24})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{className:"text-lg font-semibold text-grayWarm-950",children:n}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:Le.remove.body})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(mn,{onClick:r,children:Le.remove.cancel}),u.jsx("button",{type:"button",disabled:t,"aria-busy":t||void 0,onClick:a,className:"w-full h-11 px-4 inline-flex items-center justify-center rounded-xl bg-error-600 text-white font-semibold shadow-sm transition-colors hover:bg-error-700 disabled:opacity-60 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:ring-offset-2",children:Le.remove.confirm})]})]})})},zb={us:{dialCode:"1",lengths:[10]},ca:{dialCode:"1",lengths:[10]},gb:{dialCode:"44",lengths:[10]},au:{dialCode:"61",lengths:[9]},de:{dialCode:"49",lengths:[10,11]},fr:{dialCode:"33",lengths:[9]},it:{dialCode:"39",lengths:[9,10]},es:{dialCode:"34",lengths:[9]},jp:{dialCode:"81",lengths:[10,11]},kr:{dialCode:"82",lengths:[10,11]},in:{dialCode:"91",lengths:[10]},br:{dialCode:"55",lengths:[10,11]},mx:{dialCode:"52",lengths:[10]},cn:{dialCode:"86",lengths:[11]}};function Yb(e,t){if(!e||!e.startsWith("+"))return!1;const r=e.slice(1);if(!/^\d+$/.test(r))return!1;if(t){const a=zb[t.toLowerCase()];if(a){if(!r.startsWith(a.dialCode))return!1;const n=r.slice(a.dialCode.length);return a.lengths.includes(n.length)}}return r.length>=7&&r.length<=15}const Jb=e=>/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/.test(e),Ub=new RegExp("^[\\p{L} '-]{2,100}$","u");function $b(e){return Ub.test(e)?{isValid:!0}:{isValid:!1,message:"must contain only letters, spaces, hyphens, and apostrophes (2-100 characters)"}}exports.AUTOFILL_REFRESH_MS=Ql;exports.AlertCircleIcon=Rn;exports.AuthError=Rt;exports.Avatar=Ds;exports.AvatarFallback=Ls;exports.AvatarImage=Ws;exports.Badge=_a;exports.Button=Ii;exports.COUNTRY_OPTIONS=va;exports.CURRENCY_OPTIONS=Vr;exports.Card=Aa;exports.CardContent=Ea;exports.CardDescription=Pi;exports.CardFooter=Ti;exports.CardHeader=wa;exports.CardTitle=Gi;exports.CeremonyGate=ro;exports.CheckCircleIcon=Ja;exports.Checkbox=Ps;exports.Chip=gl;exports.CloudIcon=jm;exports.CurrencyModal=Zm;exports.DEFAULT_LOCALE=Bl;exports.DateDropdowns=ha;exports.FaceIdIcon=Gl;exports.FingerprintIcon=Pl;exports.IconButton=Ts;exports.Input=Vt;exports.KeyIcon=za;exports.LOCALE_OPTIONS=Br;exports.LOCALE_STORAGE_KEY=Vm;exports.LaptopIcon=Ol;exports.LocaleModal=Lm;exports.LogInIcon=Fl;exports.MailIcon=Fr;exports.Modal=gn;exports.OTPModal=Qm;exports.OtpCodeInput=Ua;exports.PROMPT_COOKIE=Ka;exports.Pagination=fl;exports.PasscodeIcon=Mm;exports.PassengerForm=Gm;exports.PassengerFormSkeleton=Om;exports.PasskeyEnrollPrompt=xa;exports.PasskeyList=Lb;exports.PhoneInput=Jm;exports.PlusIcon=Ml;exports.ReauthDialog=eu;exports.SearchInput=pl;exports.SelectDropdown=Dn;exports.Separator=Ni;exports.ShieldTickIcon=jl;exports.SignInFlow=Gb;exports.SignInModal=Pb;exports.Textarea=dl;exports.Toggle=Xa;exports.ToggleGroup=ul;exports.ToggleGroupItem=cl;exports.TrashIcon=Ya;exports.UsbKeyIcon=Tl;exports.XCloseIcon=kl;exports.classifyWebAuthnError=_r;exports.cookieDomain=Ll;exports.createMovmoAuthApi=rb;exports.createPasskey=$l;exports.detectSupport=no;exports.dismissPrompt=Zl;exports.findCurrencyOption=Hm;exports.findLocaleOption=_m;exports.getCurrencyDisplayText=Vl;exports.getLanguageDisplayName=Dm;exports.getPasskey=Ca;exports.incorrectCode=Wl;exports.neverAsk=Yl;exports.rateLimited=Qa;exports.readPromptState=Yn;exports.recordCodeSignIn=Hl;exports.registerPasskey=ao;exports.safeFocus=Et;exports.setNeverAsk=zl;exports.shouldOfferPasskey=Xl;exports.signInCopy=tt;exports.timeZone=Dl;exports.toAuthError=pt;exports.useMovmoSignIn=Kl;exports.validateEmail=Jb;exports.validateName=$b;exports.validatePhoneNumber=Yb;
|
|
114
|
+
*/(function(){var n={}.hasOwnProperty;function o(){for(var i=[],l=0;l<arguments.length;l++){var s=arguments[l];if(s){var c=typeof s;if(c==="string"||c==="number")i.push(s);else if(Array.isArray(s)&&s.length){var d=o.apply(null,s);d&&i.push(d)}else if(c==="object")for(var f in s)n.call(s,f)&&s[f]&&i.push(f)}}return i.join(" ")}e.exports?(o.default=o,e.exports=o):(a=(function(){return o}).apply(t,[]))===void 0||(e.exports=a)})()},function(e,t,r){(function(a){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c=typeof a=="object"&&a&&a.Object===Object&&a,d=typeof self=="object"&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),y=Object.prototype.toString,C=f.Symbol,b=C?C.prototype:void 0,h=b?b.toString:void 0;function p(A){if(typeof A=="string")return A;if(E(A))return h?h.call(A):"";var I=A+"";return I=="0"&&1/A==-1/0?"-0":I}function x(A){var I=typeof A;return!!A&&(I=="object"||I=="function")}function E(A){return typeof A=="symbol"||function(I){return!!I&&typeof I=="object"}(A)&&y.call(A)=="[object Symbol]"}function R(A){return A?(A=function(I){if(typeof I=="number")return I;if(E(I))return NaN;if(x(I)){var j=typeof I.valueOf=="function"?I.valueOf():I;I=x(j)?j+"":j}if(typeof I!="string")return I===0?I:+I;I=I.replace(n,"");var F=i.test(I);return F||l.test(I)?s(I.slice(2),F?2:8):o.test(I)?NaN:+I}(A))===1/0||A===-1/0?17976931348623157e292*(A<0?-1:1):A==A?A:0:A===0?A:0}e.exports=function(A,I,j){var F,M,oe,re;return A=(F=A)==null?"":p(F),M=function(ce){var z=R(ce),le=z%1;return z==z?le?z-le:z:0}(j),oe=0,re=A.length,M==M&&(re!==void 0&&(M=M<=re?M:re),oe!==void 0&&(M=M>=oe?M:oe)),j=M,I=p(I),A.slice(j,j+I.length)==I}}).call(this,r(3))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}e.exports=r},function(e,t,r){(function(a){var n=/^\[object .+?Constructor\]$/,o=typeof a=="object"&&a&&a.Object===Object&&a,i=typeof self=="object"&&self&&self.Object===Object&&self,l=o||i||Function("return this")(),s,c=Array.prototype,d=Function.prototype,f=Object.prototype,y=l["__core-js_shared__"],C=(s=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",b=d.toString,h=f.hasOwnProperty,p=f.toString,x=RegExp("^"+b.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=c.splice,R=ce(l,"Map"),A=ce(Object,"create");function I(G){var O=-1,V=G?G.length:0;for(this.clear();++O<V;){var $=G[O];this.set($[0],$[1])}}function j(G){var O=-1,V=G?G.length:0;for(this.clear();++O<V;){var $=G[O];this.set($[0],$[1])}}function F(G){var O=-1,V=G?G.length:0;for(this.clear();++O<V;){var $=G[O];this.set($[0],$[1])}}function M(G,O){for(var V,$,ne=G.length;ne--;)if((V=G[ne][0])===($=O)||V!=V&&$!=$)return ne;return-1}function oe(G){return!(!le(G)||(O=G,C&&C in O))&&(function(V){var $=le(V)?p.call(V):"";return $=="[object Function]"||$=="[object GeneratorFunction]"}(G)||function(V){var $=!1;if(V!=null&&typeof V.toString!="function")try{$=!!(V+"")}catch{}return $}(G)?x:n).test(function(V){if(V!=null){try{return b.call(V)}catch{}try{return V+""}catch{}}return""}(G));var O}function re(G,O){var V,$,ne=G.__data__;return(($=typeof(V=O))=="string"||$=="number"||$=="symbol"||$=="boolean"?V!=="__proto__":V===null)?ne[typeof O=="string"?"string":"hash"]:ne.map}function ce(G,O){var V=function($,ne){return $==null?void 0:$[ne]}(G,O);return oe(V)?V:void 0}function z(G,O){if(typeof G!="function"||O&&typeof O!="function")throw new TypeError("Expected a function");var V=function(){var $=arguments,ne=O?O.apply(this,$):$[0],Ie=V.cache;if(Ie.has(ne))return Ie.get(ne);var _=G.apply(this,$);return V.cache=Ie.set(ne,_),_};return V.cache=new(z.Cache||F),V}function le(G){var O=typeof G;return!!G&&(O=="object"||O=="function")}I.prototype.clear=function(){this.__data__=A?A(null):{}},I.prototype.delete=function(G){return this.has(G)&&delete this.__data__[G]},I.prototype.get=function(G){var O=this.__data__;if(A){var V=O[G];return V==="__lodash_hash_undefined__"?void 0:V}return h.call(O,G)?O[G]:void 0},I.prototype.has=function(G){var O=this.__data__;return A?O[G]!==void 0:h.call(O,G)},I.prototype.set=function(G,O){return this.__data__[G]=A&&O===void 0?"__lodash_hash_undefined__":O,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(G){var O=this.__data__,V=M(O,G);return!(V<0)&&(V==O.length-1?O.pop():E.call(O,V,1),!0)},j.prototype.get=function(G){var O=this.__data__,V=M(O,G);return V<0?void 0:O[V][1]},j.prototype.has=function(G){return M(this.__data__,G)>-1},j.prototype.set=function(G,O){var V=this.__data__,$=M(V,G);return $<0?V.push([G,O]):V[$][1]=O,this},F.prototype.clear=function(){this.__data__={hash:new I,map:new(R||j),string:new I}},F.prototype.delete=function(G){return re(this,G).delete(G)},F.prototype.get=function(G){return re(this,G).get(G)},F.prototype.has=function(G){return re(this,G).has(G)},F.prototype.set=function(G,O){return re(this,G).set(G,O),this},z.Cache=F,e.exports=z}).call(this,r(3))},function(e,t,r){(function(a){var n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c=typeof a=="object"&&a&&a.Object===Object&&a,d=typeof self=="object"&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),y=Object.prototype.toString,C=Math.max,b=Math.min,h=function(){return f.Date.now()};function p(E){var R=typeof E;return!!E&&(R=="object"||R=="function")}function x(E){if(typeof E=="number")return E;if(function(I){return typeof I=="symbol"||function(j){return!!j&&typeof j=="object"}(I)&&y.call(I)=="[object Symbol]"}(E))return NaN;if(p(E)){var R=typeof E.valueOf=="function"?E.valueOf():E;E=p(R)?R+"":R}if(typeof E!="string")return E===0?E:+E;E=E.replace(n,"");var A=i.test(E);return A||l.test(E)?s(E.slice(2),A?2:8):o.test(E)?NaN:+E}e.exports=function(E,R,A){var I,j,F,M,oe,re,ce=0,z=!1,le=!1,G=!0;if(typeof E!="function")throw new TypeError("Expected a function");function O(W){var Z=I,ae=j;return I=j=void 0,ce=W,M=E.apply(ae,Z)}function V(W){return ce=W,oe=setTimeout(ne,R),z?O(W):M}function $(W){var Z=W-re;return re===void 0||Z>=R||Z<0||le&&W-ce>=F}function ne(){var W=h();if($(W))return Ie(W);oe=setTimeout(ne,function(Z){var ae=R-(Z-re);return le?b(ae,F-(Z-ce)):ae}(W))}function Ie(W){return oe=void 0,G&&I?O(W):(I=j=void 0,M)}function _(){var W=h(),Z=$(W);if(I=arguments,j=this,re=W,Z){if(oe===void 0)return V(re);if(le)return oe=setTimeout(ne,R),O(re)}return oe===void 0&&(oe=setTimeout(ne,R)),M}return R=x(R)||0,p(A)&&(z=!!A.leading,F=(le="maxWait"in A)?C(x(A.maxWait)||0,R):F,G="trailing"in A?!!A.trailing:G),_.cancel=function(){oe!==void 0&&clearTimeout(oe),ce=0,I=re=j=oe=void 0},_.flush=function(){return oe===void 0?M:Ie(h())},_}}).call(this,r(3))},function(e,t,r){(function(a,n){var o="[object Arguments]",i="[object Map]",l="[object Object]",s="[object Set]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,d=/^\w*$/,f=/^\./,y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,C=/\\(\\)?/g,b=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,p={};p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p[o]=p["[object Array]"]=p["[object ArrayBuffer]"]=p["[object Boolean]"]=p["[object DataView]"]=p["[object Date]"]=p["[object Error]"]=p["[object Function]"]=p[i]=p["[object Number]"]=p[l]=p["[object RegExp]"]=p[s]=p["[object String]"]=p["[object WeakMap]"]=!1;var x=typeof a=="object"&&a&&a.Object===Object&&a,E=typeof self=="object"&&self&&self.Object===Object&&self,R=x||E||Function("return this")(),A=t&&!t.nodeType&&t,I=A&&typeof n=="object"&&n&&!n.nodeType&&n,j=I&&I.exports===A&&x.process,F=function(){try{return j&&j.binding("util")}catch{}}(),M=F&&F.isTypedArray;function oe(g,N,k,H){var te=-1,fe=g?g.length:0;for(H&&fe&&(k=g[++te]);++te<fe;)k=N(k,g[te],te,g);return k}function re(g,N){for(var k=-1,H=g?g.length:0;++k<H;)if(N(g[k],k,g))return!0;return!1}function ce(g,N,k,H,te){return te(g,function(fe,Ee,Ye){k=H?(H=!1,fe):N(k,fe,Ee,Ye)}),k}function z(g){var N=!1;if(g!=null&&typeof g.toString!="function")try{N=!!(g+"")}catch{}return N}function le(g){var N=-1,k=Array(g.size);return g.forEach(function(H,te){k[++N]=[te,H]}),k}function G(g){var N=-1,k=Array(g.size);return g.forEach(function(H){k[++N]=H}),k}var O,V,$,ne=Array.prototype,Ie=Function.prototype,_=Object.prototype,W=R["__core-js_shared__"],Z=(O=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+O:"",ae=Ie.toString,L=_.hasOwnProperty,m=_.toString,pe=RegExp("^"+ae.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=R.Symbol,K=R.Uint8Array,me=_.propertyIsEnumerable,ye=ne.splice,Te=(V=Object.keys,$=Object,function(g){return V($(g))}),X=Ct(R,"DataView"),je=Ct(R,"Map"),Ae=Ct(R,"Promise"),P=Ct(R,"Set"),D=Ct(R,"WeakMap"),Q=Ct(Object,"create"),be=ie(X),ue=ie(je),Ce=ie(Ae),we=ie(P),Re=ie(D),ee=Y?Y.prototype:void 0,de=ee?ee.valueOf:void 0,Se=ee?ee.toString:void 0;function q(g){var N=-1,k=g?g.length:0;for(this.clear();++N<k;){var H=g[N];this.set(H[0],H[1])}}function se(g){var N=-1,k=g?g.length:0;for(this.clear();++N<k;){var H=g[N];this.set(H[0],H[1])}}function _e(g){var N=-1,k=g?g.length:0;for(this.clear();++N<k;){var H=g[N];this.set(H[0],H[1])}}function ot(g){var N=-1,k=g?g.length:0;for(this.__data__=new _e;++N<k;)this.add(g[N])}function Ke(g){this.__data__=new se(g)}function lt(g,N){var k=v(g)||dt(g)?function(Ee,Ye){for(var $e=-1,ze=Array(Ee);++$e<Ee;)ze[$e]=Ye($e);return ze}(g.length,String):[],H=k.length,te=!!H;for(var fe in g)!L.call(g,fe)||te&&(fe=="length"||Zt(fe,H))||k.push(fe);return k}function gt(g,N){for(var k=g.length;k--;)if(rt(g[k][0],N))return k;return-1}q.prototype.clear=function(){this.__data__=Q?Q(null):{}},q.prototype.delete=function(g){return this.has(g)&&delete this.__data__[g]},q.prototype.get=function(g){var N=this.__data__;if(Q){var k=N[g];return k==="__lodash_hash_undefined__"?void 0:k}return L.call(N,g)?N[g]:void 0},q.prototype.has=function(g){var N=this.__data__;return Q?N[g]!==void 0:L.call(N,g)},q.prototype.set=function(g,N){return this.__data__[g]=Q&&N===void 0?"__lodash_hash_undefined__":N,this},se.prototype.clear=function(){this.__data__=[]},se.prototype.delete=function(g){var N=this.__data__,k=gt(N,g);return!(k<0)&&(k==N.length-1?N.pop():ye.call(N,k,1),!0)},se.prototype.get=function(g){var N=this.__data__,k=gt(N,g);return k<0?void 0:N[k][1]},se.prototype.has=function(g){return gt(this.__data__,g)>-1},se.prototype.set=function(g,N){var k=this.__data__,H=gt(k,g);return H<0?k.push([g,N]):k[H][1]=N,this},_e.prototype.clear=function(){this.__data__={hash:new q,map:new(je||se),string:new q}},_e.prototype.delete=function(g){return Ht(this,g).delete(g)},_e.prototype.get=function(g){return Ht(this,g).get(g)},_e.prototype.has=function(g){return Ht(this,g).has(g)},_e.prototype.set=function(g,N){return Ht(this,g).set(g,N),this},ot.prototype.add=ot.prototype.push=function(g){return this.__data__.set(g,"__lodash_hash_undefined__"),this},ot.prototype.has=function(g){return this.__data__.has(g)},Ke.prototype.clear=function(){this.__data__=new se},Ke.prototype.delete=function(g){return this.__data__.delete(g)},Ke.prototype.get=function(g){return this.__data__.get(g)},Ke.prototype.has=function(g){return this.__data__.has(g)},Ke.prototype.set=function(g,N){var k=this.__data__;if(k instanceof se){var H=k.__data__;if(!je||H.length<199)return H.push([g,N]),this;k=this.__data__=new _e(H)}return k.set(g,N),this};var It,Ue=(It=function(g,N){return g&&Nt(g,N,qe)},function(g,N){if(g==null)return g;if(!B(g))return It(g,N);for(var k=g.length,H=-1,te=Object(g);++H<k&&N(te[H],H,te)!==!1;);return g}),Nt=function(g){return function(N,k,H){for(var te=-1,fe=Object(N),Ee=H(N),Ye=Ee.length;Ye--;){var $e=Ee[++te];if(k(fe[$e],$e,fe)===!1)break}return N}}();function Mt(g,N){for(var k=0,H=(N=kt(N,g)?[N]:Xt(N)).length;g!=null&&k<H;)g=g[U(N[k++])];return k&&k==H?g:void 0}function an(g,N){return g!=null&&N in Object(g)}function St(g,N,k,H,te){return g===N||(g==null||N==null||!Oe(g)&&!ke(N)?g!=g&&N!=N:function(fe,Ee,Ye,$e,ze,Fe){var xt=v(fe),ut=v(Ee),it="[object Array]",st="[object Array]";xt||(it=(it=ht(fe))==o?l:it),ut||(st=(st=ht(Ee))==o?l:st);var At=it==l&&!z(fe),bn=st==l&&!z(Ee),zt=it==st;if(zt&&!At)return Fe||(Fe=new Ke),xt||Ge(fe)?sn(fe,Ee,Ye,$e,ze,Fe):function(Je,He,Dr,cn,Jn,vt,Ft){switch(Dr){case"[object DataView]":if(Je.byteLength!=He.byteLength||Je.byteOffset!=He.byteOffset)return!1;Je=Je.buffer,He=He.buffer;case"[object ArrayBuffer]":return!(Je.byteLength!=He.byteLength||!cn(new K(Je),new K(He)));case"[object Boolean]":case"[object Date]":case"[object Number]":return rt(+Je,+He);case"[object Error]":return Je.name==He.name&&Je.message==He.message;case"[object RegExp]":case"[object String]":return Je==He+"";case i:var Yt=le;case s:var Nn=2&vt;if(Yt||(Yt=G),Je.size!=He.size&&!Nn)return!1;var Un=Ft.get(Je);if(Un)return Un==He;vt|=1,Ft.set(Je,He);var hn=sn(Yt(Je),Yt(He),cn,Jn,vt,Ft);return Ft.delete(Je),hn;case"[object Symbol]":if(de)return de.call(Je)==de.call(He)}return!1}(fe,Ee,it,Ye,$e,ze,Fe);if(!(2&ze)){var uo=At&&L.call(fe,"__wrapped__"),co=bn&&L.call(Ee,"__wrapped__");if(uo||co){var ru=uo?fe.value():fe,au=co?Ee.value():Ee;return Fe||(Fe=new Ke),Ye(ru,au,$e,ze,Fe)}}return zt?(Fe||(Fe=new Ke),function(Je,He,Dr,cn,Jn,vt){var Ft=2&Jn,Yt=qe(Je),Nn=Yt.length,Un=qe(He).length;if(Nn!=Un&&!Ft)return!1;for(var hn=Nn;hn--;){var Jt=Yt[hn];if(!(Ft?Jt in He:L.call(He,Jt)))return!1}var fo=vt.get(Je);if(fo&&vt.get(He))return fo==He;var $n=!0;vt.set(Je,He),vt.set(He,Je);for(var Wr=Ft;++hn<Nn;){Jt=Yt[hn];var Qn=Je[Jt],Kn=He[Jt];if(cn)var po=Ft?cn(Kn,Qn,Jt,He,Je,vt):cn(Qn,Kn,Jt,Je,He,vt);if(!(po===void 0?Qn===Kn||Dr(Qn,Kn,cn,Jn,vt):po)){$n=!1;break}Wr||(Wr=Jt=="constructor")}if($n&&!Wr){var qn=Je.constructor,er=He.constructor;qn==er||!("constructor"in Je)||!("constructor"in He)||typeof qn=="function"&&qn instanceof qn&&typeof er=="function"&&er instanceof er||($n=!1)}return vt.delete(Je),vt.delete(He),$n}(fe,Ee,Ye,$e,ze,Fe)):!1}(g,N,St,k,H,te))}function Gt(g){return!(!Oe(g)||function(N){return!!Z&&Z in N}(g))&&(J(g)||z(g)?pe:b).test(ie(g))}function Pt(g){return typeof g=="function"?g:g==null?et:typeof g=="object"?v(g)?function(H,te){return kt(H)&&ln(te)?un(U(H),te):function(fe){var Ee=function(Ye,$e,ze){var Fe=Ye==null?void 0:Mt(Ye,$e);return Fe===void 0?ze:Fe}(fe,H);return Ee===void 0&&Ee===te?function(Ye,$e){return Ye!=null&&function(ze,Fe,xt){Fe=kt(Fe,ze)?[Fe]:Xt(Fe);for(var ut,it=-1,st=Fe.length;++it<st;){var At=U(Fe[it]);if(!(ut=ze!=null&&xt(ze,At)))break;ze=ze[At]}return ut||!!(st=ze?ze.length:0)&&he(st)&&Zt(At,st)&&(v(ze)||dt(ze))}(Ye,$e,an)}(fe,H):St(te,Ee,void 0,3)}}(g[0],g[1]):function(H){var te=function(fe){for(var Ee=qe(fe),Ye=Ee.length;Ye--;){var $e=Ee[Ye],ze=fe[$e];Ee[Ye]=[$e,ze,ln(ze)]}return Ee}(H);return te.length==1&&te[0][2]?un(te[0][0],te[0][1]):function(fe){return fe===H||function(Ee,Ye,$e,ze){var Fe=$e.length,xt=Fe;if(Ee==null)return!xt;for(Ee=Object(Ee);Fe--;){var ut=$e[Fe];if(ut[2]?ut[1]!==Ee[ut[0]]:!(ut[0]in Ee))return!1}for(;++Fe<xt;){var it=(ut=$e[Fe])[0],st=Ee[it],At=ut[1];if(ut[2]){if(st===void 0&&!(it in Ee))return!1}else{var bn=new Ke,zt;if(!(zt===void 0?St(At,st,ze,3,bn):zt))return!1}}return!0}(fe,H,te)}}(g):kt(N=g)?(k=U(N),function(H){return H==null?void 0:H[k]}):function(H){return function(te){return Mt(te,H)}}(N);var N,k}function on(g){if(k=(N=g)&&N.constructor,H=typeof k=="function"&&k.prototype||_,N!==H)return Te(g);var N,k,H,te=[];for(var fe in Object(g))L.call(g,fe)&&fe!="constructor"&&te.push(fe);return te}function Xt(g){return v(g)?g:T(g)}function sn(g,N,k,H,te,fe){var Ee=2&te,Ye=g.length,$e=N.length;if(Ye!=$e&&!(Ee&&$e>Ye))return!1;var ze=fe.get(g);if(ze&&fe.get(N))return ze==N;var Fe=-1,xt=!0,ut=1&te?new ot:void 0;for(fe.set(g,N),fe.set(N,g);++Fe<Ye;){var it=g[Fe],st=N[Fe];if(H)var At=Ee?H(st,it,Fe,N,g,fe):H(it,st,Fe,g,N,fe);if(At!==void 0){if(At)continue;xt=!1;break}if(ut){if(!re(N,function(bn,zt){if(!ut.has(zt)&&(it===bn||k(it,bn,H,te,fe)))return ut.add(zt)})){xt=!1;break}}else if(it!==st&&!k(it,st,H,te,fe)){xt=!1;break}}return fe.delete(g),fe.delete(N),xt}function Ht(g,N){var k,H,te=g.__data__;return((H=typeof(k=N))=="string"||H=="number"||H=="symbol"||H=="boolean"?k!=="__proto__":k===null)?te[typeof N=="string"?"string":"hash"]:te.map}function Ct(g,N){var k=function(H,te){return H==null?void 0:H[te]}(g,N);return Gt(k)?k:void 0}var ht=function(g){return m.call(g)};function Zt(g,N){return!!(N=N??9007199254740991)&&(typeof g=="number"||h.test(g))&&g>-1&&g%1==0&&g<N}function kt(g,N){if(v(g))return!1;var k=typeof g;return!(k!="number"&&k!="symbol"&&k!="boolean"&&g!=null&&!Ne(g))||d.test(g)||!c.test(g)||N!=null&&g in Object(N)}function ln(g){return g==g&&!Oe(g)}function un(g,N){return function(k){return k!=null&&k[g]===N&&(N!==void 0||g in Object(k))}}(X&&ht(new X(new ArrayBuffer(1)))!="[object DataView]"||je&&ht(new je)!=i||Ae&&ht(Ae.resolve())!="[object Promise]"||P&&ht(new P)!=s||D&&ht(new D)!="[object WeakMap]")&&(ht=function(g){var N=m.call(g),k=N==l?g.constructor:void 0,H=k?ie(k):void 0;if(H)switch(H){case be:return"[object DataView]";case ue:return i;case Ce:return"[object Promise]";case we:return s;case Re:return"[object WeakMap]"}return N});var T=Xe(function(g){var N;g=(N=g)==null?"":function(H){if(typeof H=="string")return H;if(Ne(H))return Se?Se.call(H):"";var te=H+"";return te=="0"&&1/H==-1/0?"-0":te}(N);var k=[];return f.test(g)&&k.push(""),g.replace(y,function(H,te,fe,Ee){k.push(fe?Ee.replace(C,"$1"):te||H)}),k});function U(g){if(typeof g=="string"||Ne(g))return g;var N=g+"";return N=="0"&&1/g==-1/0?"-0":N}function ie(g){if(g!=null){try{return ae.call(g)}catch{}try{return g+""}catch{}}return""}function Xe(g,N){if(typeof g!="function"||N&&typeof N!="function")throw new TypeError("Expected a function");var k=function(){var H=arguments,te=N?N.apply(this,H):H[0],fe=k.cache;if(fe.has(te))return fe.get(te);var Ee=g.apply(this,H);return k.cache=fe.set(te,Ee),Ee};return k.cache=new(Xe.Cache||_e),k}function rt(g,N){return g===N||g!=g&&N!=N}function dt(g){return function(N){return ke(N)&&B(N)}(g)&&L.call(g,"callee")&&(!me.call(g,"callee")||m.call(g)==o)}Xe.Cache=_e;var v=Array.isArray;function B(g){return g!=null&&he(g.length)&&!J(g)}function J(g){var N=Oe(g)?m.call(g):"";return N=="[object Function]"||N=="[object GeneratorFunction]"}function he(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=9007199254740991}function Oe(g){var N=typeof g;return!!g&&(N=="object"||N=="function")}function ke(g){return!!g&&typeof g=="object"}function Ne(g){return typeof g=="symbol"||ke(g)&&m.call(g)=="[object Symbol]"}var Ge=M?function(g){return function(N){return g(N)}}(M):function(g){return ke(g)&&he(g.length)&&!!p[m.call(g)]};function qe(g){return B(g)?lt(g):on(g)}function et(g){return g}n.exports=function(g,N,k){var H=v(g)?oe:ce,te=arguments.length<3;return H(g,Pt(N),k,te,Ue)}}).call(this,r(3),r(7)(e))},function(e,t){e.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),r.webpackPolyfill=1),r}},function(e,t){String.prototype.padEnd||(String.prototype.padEnd=function(r,a){return r>>=0,a=String(a!==void 0?a:" "),this.length>r?String(this):((r-=this.length)>a.length&&(a+=a.repeat(r/a.length)),String(this)+a.slice(0,r))})},function(e,t,r){function a(_,W,Z){return W in _?Object.defineProperty(_,W,{value:Z,enumerable:!0,configurable:!0,writable:!0}):_[W]=Z,_}function n(_){if(Symbol.iterator in Object(_)||Object.prototype.toString.call(_)==="[object Arguments]")return Array.from(_)}function o(_){return function(W){if(Array.isArray(W)){for(var Z=0,ae=new Array(W.length);Z<W.length;Z++)ae[Z]=W[Z];return ae}}(_)||n(_)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(_){if(Array.isArray(_))return _}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function s(_,W){if(!(_ instanceof W))throw new TypeError("Cannot call a class as a function")}function c(_,W){for(var Z=0;Z<W.length;Z++){var ae=W[Z];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(_,ae.key,ae)}}function d(_){return(d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W})(_)}function f(_){return(f=typeof Symbol=="function"&&d(Symbol.iterator)==="symbol"?function(W){return d(W)}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":d(W)})(_)}function y(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function C(_){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(W){return W.__proto__||Object.getPrototypeOf(W)})(_)}function b(_,W){return(b=Object.setPrototypeOf||function(Z,ae){return Z.__proto__=ae,Z})(_,W)}r.r(t);var h=r(0),p=r.n(h),x=r(5),E=r.n(x),R=r(4),A=r.n(R),I=r(6),j=r.n(I),F=r(2),M=r.n(F),oe=r(1),re=r.n(oe);r(8);function ce(_,W){return i(_)||function(Z,ae){var L=[],m=!0,pe=!1,Y=void 0;try{for(var K,me=Z[Symbol.iterator]();!(m=(K=me.next()).done)&&(L.push(K.value),!ae||L.length!==ae);m=!0);}catch(ye){pe=!0,Y=ye}finally{try{m||me.return==null||me.return()}finally{if(pe)throw Y}}return L}(_,W)||l()}var z=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61","(..) .... ....",0,["2","3","4","7","8","02","03","04","07","08"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","..-........."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d’Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2,["809","829","849"]],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",1,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["55","81","33","656","664","998","774","229"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3,["787","939"]],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",0],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["907","205","251","256","334","479","501","870","480","520","602","623","928","209","213","310","323","408","415","510","530","559","562","619","626","650","661","707","714","760","805","818","831","858","909","916","925","949","951","303","719","970","203","860","202","302","239","305","321","352","386","407","561","727","772","813","850","863","904","941","954","229","404","478","706","770","912","808","319","515","563","641","712","208","217","309","312","618","630","708","773","815","847","219","260","317","574","765","812","316","620","785","913","270","502","606","859","225","318","337","504","985","413","508","617","781","978","301","410","207","231","248","269","313","517","586","616","734","810","906","989","218","320","507","612","651","763","952","314","417","573","636","660","816","228","601","662","406","252","336","704","828","910","919","701","308","402","603","201","609","732","856","908","973","505","575","702","775","212","315","516","518","585","607","631","716","718","845","914","216","330","419","440","513","614","740","937","405","580","918","503","541","215","412","570","610","717","724","814","401","803","843","864","605","423","615","731","865","901","931","210","214","254","281","325","361","409","432","512","713","806","817","830","903","915","936","940","956","972","979","435","801","276","434","540","703","757","804","802","206","253","360","425","509","262","414","608","715","920","304","307"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]],le=[["American Samoa",["oceania"],"as","1684"],["Anguilla",["america","carribean"],"ai","1264"],["Bermuda",["america","north-america"],"bm","1441"],["British Virgin Islands",["america","carribean"],"vg","1284"],["Cayman Islands",["america","carribean"],"ky","1345"],["Cook Islands",["oceania"],"ck","682"],["Falkland Islands",["america","south-america"],"fk","500"],["Faroe Islands",["europe"],"fo","298"],["Gibraltar",["europe"],"gi","350"],["Greenland",["america"],"gl","299"],["Jersey",["europe","eu-union"],"je","44",".... ......"],["Montserrat",["america","carribean"],"ms","1664"],["Niue",["asia"],"nu","683"],["Norfolk Island",["oceania"],"nf","672"],["Northern Mariana Islands",["oceania"],"mp","1670"],["Saint Barthélemy",["america","carribean"],"bl","590","",1],["Saint Helena",["africa"],"sh","290"],["Saint Martin",["america","carribean"],"mf","590","",2],["Saint Pierre and Miquelon",["america","north-america"],"pm","508"],["Sint Maarten",["america","carribean"],"sx","1721"],["Tokelau",["oceania"],"tk","690"],["Turks and Caicos Islands",["america","carribean"],"tc","1649"],["U.S. Virgin Islands",["america","carribean"],"vi","1340"],["Wallis and Futuna",["oceania"],"wf","681"]];function G(_,W,Z,ae,L){return!Z||L?_+"".padEnd(W.length,".")+" "+ae:_+"".padEnd(W.length,".")+" "+Z}function O(_,W,Z,ae,L){var m,pe,Y=[];return pe=W===!0,[(m=[]).concat.apply(m,o(_.map(function(K){var me={name:K[0],regions:K[1],iso2:K[2],countryCode:K[3],dialCode:K[3],format:G(Z,K[3],K[4],ae,L),priority:K[5]||0},ye=[];return K[6]&&K[6].map(function(Te){var X=function(je){for(var Ae=1;Ae<arguments.length;Ae++){var P=arguments[Ae]!=null?arguments[Ae]:{},D=Object.keys(P);typeof Object.getOwnPropertySymbols=="function"&&(D=D.concat(Object.getOwnPropertySymbols(P).filter(function(Q){return Object.getOwnPropertyDescriptor(P,Q).enumerable}))),D.forEach(function(Q){a(je,Q,P[Q])})}return je}({},me);X.dialCode=K[3]+Te,X.isAreaCode=!0,X.areaCodeLength=Te.length,ye.push(X)}),ye.length>0?(me.mainCode=!0,pe||W.constructor.name==="Array"&&W.includes(K[2])?(me.hasAreaCodes=!0,[me].concat(ye)):(Y=Y.concat(ye),[me])):[me]}))),Y]}function V(_,W,Z,ae){if(Z!==null){var L=Object.keys(Z),m=Object.values(Z);L.forEach(function(pe,Y){if(ae)return _.push([pe,m[Y]]);var K=_.findIndex(function(ye){return ye[0]===pe});if(K===-1){var me=[pe];me[W]=m[Y],_.push(me)}else _[K][W]=m[Y]})}}function $(_,W){return W.length===0?_:_.map(function(Z){var ae=W.findIndex(function(m){return m[0]===Z[2]});if(ae===-1)return Z;var L=W[ae];return L[1]&&(Z[4]=L[1]),L[3]&&(Z[5]=L[3]),L[2]&&(Z[6]=L[2]),Z})}var ne=function _(W,Z,ae,L,m,pe,Y,K,me,ye,Te,X,je,Ae){s(this,_),this.filterRegions=function(ee,de){if(typeof ee=="string"){var Se=ee;return de.filter(function(q){return q.regions.some(function(se){return se===Se})})}return de.filter(function(q){return ee.map(function(se){return q.regions.some(function(_e){return _e===se})}).some(function(se){return se})})},this.sortTerritories=function(ee,de){var Se=[].concat(o(ee),o(de));return Se.sort(function(q,se){return q.name<se.name?-1:q.name>se.name?1:0}),Se},this.getFilteredCountryList=function(ee,de,Se){return ee.length===0?de:Se?ee.map(function(q){var se=de.find(function(_e){return _e.iso2===q});if(se)return se}).filter(function(q){return q}):de.filter(function(q){return ee.some(function(se){return se===q.iso2})})},this.localizeCountries=function(ee,de,Se){for(var q=0;q<ee.length;q++)de[ee[q].iso2]!==void 0?ee[q].localName=de[ee[q].iso2]:de[ee[q].name]!==void 0&&(ee[q].localName=de[ee[q].name]);return Se||ee.sort(function(se,_e){return se.localName<_e.localName?-1:se.localName>_e.localName?1:0}),ee},this.getCustomAreas=function(ee,de){for(var Se=[],q=0;q<de.length;q++){var se=JSON.parse(JSON.stringify(ee));se.dialCode+=de[q],Se.push(se)}return Se},this.excludeCountries=function(ee,de){return de.length===0?ee:ee.filter(function(Se){return!de.includes(Se.iso2)})};var P=function(ee,de,Se){var q=[];return V(q,1,ee,!0),V(q,3,de),V(q,2,Se),q}(K,me,ye),D=$(JSON.parse(JSON.stringify(z)),P),Q=$(JSON.parse(JSON.stringify(le)),P),be=ce(O(D,W,X,je,Ae),2),ue=be[0],Ce=be[1];if(Z){var we=ce(O(Q,W,X,je,Ae),2),Re=we[0];we[1],ue=this.sortTerritories(Re,ue)}ae&&(ue=this.filterRegions(ae,ue)),this.onlyCountries=this.localizeCountries(this.excludeCountries(this.getFilteredCountryList(L,ue,Y.includes("onlyCountries")),pe),Te,Y.includes("onlyCountries")),this.preferredCountries=m.length===0?[]:this.localizeCountries(this.getFilteredCountryList(m,ue,Y.includes("preferredCountries")),Te,Y.includes("preferredCountries")),this.hiddenAreaCodes=this.excludeCountries(this.getFilteredCountryList(L,Ce),pe)},Ie=function(_){function W(L){var m;s(this,W),(m=function(P,D){return!D||f(D)!=="object"&&typeof D!="function"?y(P):D}(this,C(W).call(this,L))).getProbableCandidate=A()(function(P){return P&&P.length!==0?m.state.onlyCountries.filter(function(D){return M()(D.name.toLowerCase(),P.toLowerCase())},y(y(m)))[0]:null}),m.guessSelectedCountry=A()(function(P,D,Q,be){var ue;if(m.props.enableAreaCodes===!1&&(be.some(function(Re){if(M()(P,Re.dialCode))return Q.some(function(ee){if(Re.iso2===ee.iso2&&ee.mainCode)return ue=ee,!0}),!0}),ue))return ue;var Ce=Q.find(function(Re){return Re.iso2==D});if(P.trim()==="")return Ce;var we=Q.reduce(function(Re,ee){return M()(P,ee.dialCode)&&(ee.dialCode.length>Re.dialCode.length||ee.dialCode.length===Re.dialCode.length&&ee.priority<Re.priority)?ee:Re},{dialCode:"",priority:10001},y(y(m)));return we.name?we:Ce}),m.updateCountry=function(P){var D,Q=m.state.onlyCountries;(D=P.indexOf(0)>="0"&&P.indexOf(0)<="9"?Q.find(function(be){return be.dialCode==+P}):Q.find(function(be){return be.iso2==P}))&&D.dialCode&&m.setState({selectedCountry:D,formattedNumber:m.props.disableCountryCode?"":m.formatNumber(D.dialCode,D)})},m.scrollTo=function(P,D){if(P){var Q=m.dropdownRef;if(Q&&document.body){var be=Q.offsetHeight,ue=Q.getBoundingClientRect().top+document.body.scrollTop,Ce=ue+be,we=P,Re=we.getBoundingClientRect(),ee=we.offsetHeight,de=Re.top+document.body.scrollTop,Se=de+ee,q=de-ue+Q.scrollTop,se=be/2-ee/2;if(m.props.enableSearch?de<ue+32:de<ue)D&&(q-=se),Q.scrollTop=q;else if(Se>Ce){D&&(q+=se);var _e=be-ee;Q.scrollTop=q-_e}}}},m.scrollToTop=function(){var P=m.dropdownRef;P&&document.body&&(P.scrollTop=0)},m.formatNumber=function(P,D){if(!D)return P;var Q,be=D.format,ue=m.props,Ce=ue.disableCountryCode,we=ue.enableAreaCodeStretch,Re=ue.enableLongNumbers,ee=ue.autoFormat;if(Ce?((Q=be.split(" ")).shift(),Q=Q.join(" ")):we&&D.isAreaCode?((Q=be.split(" "))[1]=Q[1].replace(/\.+/,"".padEnd(D.areaCodeLength,".")),Q=Q.join(" ")):Q=be,!P||P.length===0)return Ce?"":m.props.prefix;if(P&&P.length<2||!Q||!ee)return Ce?P:m.props.prefix+P;var de,Se=j()(Q,function(q,se){if(q.remainingText.length===0)return q;if(se!==".")return{formattedText:q.formattedText+se,remainingText:q.remainingText};var _e,ot=i(_e=q.remainingText)||n(_e)||l(),Ke=ot[0],lt=ot.slice(1);return{formattedText:q.formattedText+Ke,remainingText:lt}},{formattedText:"",remainingText:P.split("")});return(de=Re?Se.formattedText+Se.remainingText.join(""):Se.formattedText).includes("(")&&!de.includes(")")&&(de+=")"),de},m.cursorToEnd=function(){var P=m.numberInputRef;if(document.activeElement===P){P.focus();var D=P.value.length;P.value.charAt(D-1)===")"&&(D-=1),P.setSelectionRange(D,D)}},m.getElement=function(P){return m["flag_no_".concat(P)]},m.getCountryData=function(){return m.state.selectedCountry?{name:m.state.selectedCountry.name||"",dialCode:m.state.selectedCountry.dialCode||"",countryCode:m.state.selectedCountry.iso2||"",format:m.state.selectedCountry.format||""}:{}},m.handleFlagDropdownClick=function(P){if(P.preventDefault(),m.state.showDropdown||!m.props.disabled){var D=m.state,Q=D.preferredCountries,be=D.onlyCountries,ue=D.selectedCountry,Ce=m.concatPreferredCountries(Q,be).findIndex(function(we){return we.dialCode===ue.dialCode&&we.iso2===ue.iso2});m.setState({showDropdown:!m.state.showDropdown,highlightCountryIndex:Ce},function(){m.state.showDropdown&&m.scrollTo(m.getElement(m.state.highlightCountryIndex))})}},m.handleInput=function(P){var D=P.target.value,Q=m.props,be=Q.prefix,ue=Q.onChange,Ce=m.props.disableCountryCode?"":be,we=m.state.selectedCountry,Re=m.state.freezeSelection;if(!m.props.countryCodeEditable){var ee=be+(we.hasAreaCodes?m.state.onlyCountries.find(function(Ue){return Ue.iso2===we.iso2&&Ue.mainCode}).dialCode:we.dialCode);if(D.slice(0,ee.length)!==ee)return}if(D===be)return ue&&ue("",m.getCountryData(),P,""),m.setState({formattedNumber:""});if(!(D.replace(/\D/g,"").length>15&&(m.props.enableLongNumbers===!1||typeof m.props.enableLongNumbers=="number"&&D.replace(/\D/g,"").length>m.props.enableLongNumbers))&&D!==m.state.formattedNumber){P.preventDefault?P.preventDefault():P.returnValue=!1;var de=m.props.country,Se=m.state,q=Se.onlyCountries,se=Se.selectedCountry,_e=Se.hiddenAreaCodes;if(ue&&P.persist(),D.length>0){var ot=D.replace(/\D/g,"");(!m.state.freezeSelection||se&&se.dialCode.length>ot.length)&&(we=m.props.disableCountryGuess?se:m.guessSelectedCountry(ot.substring(0,6),de,q,_e)||se,Re=!1),Ce=m.formatNumber(ot,we),we=we.dialCode?we:se}var Ke=P.target.selectionStart,lt=P.target.selectionStart,gt=m.state.formattedNumber,It=Ce.length-gt.length;m.setState({formattedNumber:Ce,freezeSelection:Re,selectedCountry:we},function(){It>0&&(lt-=It),Ce.charAt(Ce.length-1)==")"?m.numberInputRef.setSelectionRange(Ce.length-1,Ce.length-1):lt>0&>.length>=Ce.length?m.numberInputRef.setSelectionRange(lt,lt):Ke<gt.length&&m.numberInputRef.setSelectionRange(Ke,Ke),ue&&ue(Ce.replace(/[^0-9]+/g,""),m.getCountryData(),P,Ce)})}},m.handleInputClick=function(P){m.setState({showDropdown:!1}),m.props.onClick&&m.props.onClick(P,m.getCountryData())},m.handleDoubleClick=function(P){var D=P.target.value.length;P.target.setSelectionRange(0,D)},m.handleFlagItemClick=function(P,D){var Q=m.state.selectedCountry,be=m.state.onlyCountries.find(function(Re){return Re==P});if(be){var ue=m.state.formattedNumber.replace(" ","").replace("(","").replace(")","").replace("-",""),Ce=ue.length>1?ue.replace(Q.dialCode,be.dialCode):be.dialCode,we=m.formatNumber(Ce.replace(/\D/g,""),be);m.setState({showDropdown:!1,selectedCountry:be,freezeSelection:!0,formattedNumber:we,searchValue:""},function(){m.cursorToEnd(),m.props.onChange&&m.props.onChange(we.replace(/[^0-9]+/g,""),m.getCountryData(),D,we)})}},m.handleInputFocus=function(P){m.numberInputRef&&m.numberInputRef.value===m.props.prefix&&m.state.selectedCountry&&!m.props.disableCountryCode&&m.setState({formattedNumber:m.props.prefix+m.state.selectedCountry.dialCode},function(){m.props.jumpCursorToEnd&&setTimeout(m.cursorToEnd,0)}),m.setState({placeholder:""}),m.props.onFocus&&m.props.onFocus(P,m.getCountryData()),m.props.jumpCursorToEnd&&setTimeout(m.cursorToEnd,0)},m.handleInputBlur=function(P){P.target.value||m.setState({placeholder:m.props.placeholder}),m.props.onBlur&&m.props.onBlur(P,m.getCountryData())},m.handleInputCopy=function(P){if(m.props.copyNumbersOnly){var D=window.getSelection().toString().replace(/[^0-9]+/g,"");P.clipboardData.setData("text/plain",D),P.preventDefault()}},m.getHighlightCountryIndex=function(P){var D=m.state.highlightCountryIndex+P;return D<0||D>=m.state.onlyCountries.length+m.state.preferredCountries.length?D-P:m.props.enableSearch&&D>m.getSearchFilteredCountries().length?0:D},m.searchCountry=function(){var P=m.getProbableCandidate(m.state.queryString)||m.state.onlyCountries[0],D=m.state.onlyCountries.findIndex(function(Q){return Q==P})+m.state.preferredCountries.length;m.scrollTo(m.getElement(D),!0),m.setState({queryString:"",highlightCountryIndex:D})},m.handleKeydown=function(P){var D=m.props.keys,Q=P.target.className;if(Q.includes("selected-flag")&&P.which===D.ENTER&&!m.state.showDropdown)return m.handleFlagDropdownClick(P);if(Q.includes("form-control")&&(P.which===D.ENTER||P.which===D.ESC))return P.target.blur();if(m.state.showDropdown&&!m.props.disabled&&(!Q.includes("search-box")||P.which===D.UP||P.which===D.DOWN||P.which===D.ENTER||P.which===D.ESC&&P.target.value==="")){P.preventDefault?P.preventDefault():P.returnValue=!1;var be=function(ue){m.setState({highlightCountryIndex:m.getHighlightCountryIndex(ue)},function(){m.scrollTo(m.getElement(m.state.highlightCountryIndex),!0)})};switch(P.which){case D.DOWN:be(1);break;case D.UP:be(-1);break;case D.ENTER:m.props.enableSearch?m.handleFlagItemClick(m.getSearchFilteredCountries()[m.state.highlightCountryIndex]||m.getSearchFilteredCountries()[0],P):m.handleFlagItemClick([].concat(o(m.state.preferredCountries),o(m.state.onlyCountries))[m.state.highlightCountryIndex],P);break;case D.ESC:case D.TAB:m.setState({showDropdown:!1},m.cursorToEnd);break;default:(P.which>=D.A&&P.which<=D.Z||P.which===D.SPACE)&&m.setState({queryString:m.state.queryString+String.fromCharCode(P.which)},m.state.debouncedQueryStingSearcher)}}},m.handleInputKeyDown=function(P){var D=m.props,Q=D.keys,be=D.onEnterKeyPress,ue=D.onKeyDown;P.which===Q.ENTER&&be&&be(P),ue&&ue(P)},m.handleClickOutside=function(P){m.dropdownRef&&!m.dropdownContainerRef.contains(P.target)&&m.state.showDropdown&&m.setState({showDropdown:!1})},m.handleSearchChange=function(P){var D=P.currentTarget.value,Q=m.state,be=Q.preferredCountries,ue=Q.selectedCountry,Ce=0;if(D===""&&ue){var we=m.state.onlyCountries;Ce=m.concatPreferredCountries(be,we).findIndex(function(Re){return Re==ue}),setTimeout(function(){return m.scrollTo(m.getElement(Ce))},100)}m.setState({searchValue:D,highlightCountryIndex:Ce})},m.concatPreferredCountries=function(P,D){return P.length>0?o(new Set(P.concat(D))):D},m.getDropdownCountryName=function(P){return P.localName||P.name},m.getSearchFilteredCountries=function(){var P=m.state,D=P.preferredCountries,Q=P.onlyCountries,be=P.searchValue,ue=m.props.enableSearch,Ce=m.concatPreferredCountries(D,Q),we=be.trim().toLowerCase().replace("+","");if(ue&&we){if(/^\d+$/.test(we))return Ce.filter(function(de){var Se=de.dialCode;return["".concat(Se)].some(function(q){return q.toLowerCase().includes(we)})});var Re=Ce.filter(function(de){var Se=de.iso2;return["".concat(Se)].some(function(q){return q.toLowerCase().includes(we)})}),ee=Ce.filter(function(de){var Se=de.name,q=de.localName;return de.iso2,["".concat(Se),"".concat(q||"")].some(function(se){return se.toLowerCase().includes(we)})});return m.scrollToTop(),o(new Set([].concat(Re,ee)))}return Ce},m.getCountryDropdownList=function(){var P=m.state,D=P.preferredCountries,Q=P.highlightCountryIndex,be=P.showDropdown,ue=P.searchValue,Ce=m.props,we=Ce.disableDropdown,Re=Ce.prefix,ee=m.props,de=ee.enableSearch,Se=ee.searchNotFound,q=ee.disableSearchIcon,se=ee.searchClass,_e=ee.searchStyle,ot=ee.searchPlaceholder,Ke=ee.autocompleteSearch,lt=m.getSearchFilteredCountries().map(function(Ue,Nt){var Mt=Q===Nt,an=re()({country:!0,preferred:Ue.iso2==="us"||Ue.iso2==="gb",active:Ue.iso2==="us",highlight:Mt}),St="flag ".concat(Ue.iso2);return p.a.createElement("li",Object.assign({ref:function(Gt){return m["flag_no_".concat(Nt)]=Gt},key:"flag_no_".concat(Nt),"data-flag-key":"flag_no_".concat(Nt),className:an,"data-dial-code":"1",tabIndex:we?"-1":"0","data-country-code":Ue.iso2,onClick:function(Gt){return m.handleFlagItemClick(Ue,Gt)},role:"option"},Mt?{"aria-selected":!0}:{}),p.a.createElement("div",{className:St}),p.a.createElement("span",{className:"country-name"},m.getDropdownCountryName(Ue)),p.a.createElement("span",{className:"dial-code"},Ue.format?m.formatNumber(Ue.dialCode,Ue):Re+Ue.dialCode))}),gt=p.a.createElement("li",{key:"dashes",className:"divider"});D.length>0&&(!de||de&&!ue.trim())&<.splice(D.length,0,gt);var It=re()(a({"country-list":!0,hide:!be},m.props.dropdownClass,!0));return p.a.createElement("ul",{ref:function(Ue){return!de&&Ue&&Ue.focus(),m.dropdownRef=Ue},className:It,style:m.props.dropdownStyle,role:"listbox",tabIndex:"0"},de&&p.a.createElement("li",{className:re()(a({search:!0},se,se))},!q&&p.a.createElement("span",{className:re()(a({"search-emoji":!0},"".concat(se,"-emoji"),se)),role:"img","aria-label":"Magnifying glass"},"🔎"),p.a.createElement("input",{className:re()(a({"search-box":!0},"".concat(se,"-box"),se)),style:_e,type:"search",placeholder:ot,autoFocus:!0,autoComplete:Ke?"on":"off",value:ue,onChange:m.handleSearchChange})),lt.length>0?lt:p.a.createElement("li",{className:"no-entries-message"},p.a.createElement("span",null,Se)))};var pe,Y=new ne(L.enableAreaCodes,L.enableTerritories,L.regions,L.onlyCountries,L.preferredCountries,L.excludeCountries,L.preserveOrder,L.masks,L.priority,L.areaCodes,L.localization,L.prefix,L.defaultMask,L.alwaysDefaultMask),K=Y.onlyCountries,me=Y.preferredCountries,ye=Y.hiddenAreaCodes,Te=L.value?L.value.replace(/\D/g,""):"";pe=L.disableInitialCountryGuess?0:Te.length>1?m.guessSelectedCountry(Te.substring(0,6),L.country,K,ye)||0:L.country&&K.find(function(P){return P.iso2==L.country})||0;var X,je=Te.length<2&&pe&&!M()(Te,pe.dialCode)?pe.dialCode:"";X=Te===""&&pe===0?"":m.formatNumber((L.disableCountryCode?"":je)+Te,pe.name?pe:void 0);var Ae=K.findIndex(function(P){return P==pe});return m.state={showDropdown:L.showDropdown,formattedNumber:X,onlyCountries:K,preferredCountries:me,hiddenAreaCodes:ye,selectedCountry:pe,highlightCountryIndex:Ae,queryString:"",freezeSelection:!1,debouncedQueryStingSearcher:E()(m.searchCountry,250),searchValue:""},m}var Z,ae;return function(L,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");L.prototype=Object.create(m&&m.prototype,{constructor:{value:L,writable:!0,configurable:!0}}),m&&b(L,m)}(W,_),Z=W,(ae=[{key:"componentDidMount",value:function(){document.addEventListener&&this.props.enableClickOutside&&document.addEventListener("mousedown",this.handleClickOutside),this.props.onMount&&this.props.onMount(this.state.formattedNumber.replace(/[^0-9]+/g,""),this.getCountryData(),this.state.formattedNumber)}},{key:"componentWillUnmount",value:function(){document.removeEventListener&&this.props.enableClickOutside&&document.removeEventListener("mousedown",this.handleClickOutside)}},{key:"componentDidUpdate",value:function(L,m,pe){L.country!==this.props.country?this.updateCountry(this.props.country):L.value!==this.props.value&&this.updateFormattedNumber(this.props.value)}},{key:"updateFormattedNumber",value:function(L){if(L===null)return this.setState({selectedCountry:0,formattedNumber:""});var m=this.state,pe=m.onlyCountries,Y=m.selectedCountry,K=m.hiddenAreaCodes,me=this.props,ye=me.country,Te=me.prefix;if(L==="")return this.setState({selectedCountry:Y,formattedNumber:""});var X,je,Ae=L.replace(/\D/g,"");if(Y&&M()(L,Te+Y.dialCode))je=this.formatNumber(Ae,Y),this.setState({formattedNumber:je});else{var P=(X=this.props.disableCountryGuess?Y:this.guessSelectedCountry(Ae.substring(0,6),ye,pe,K)||Y)&&M()(Ae,Te+X.dialCode)?X.dialCode:"";je=this.formatNumber((this.props.disableCountryCode?"":P)+Ae,X||void 0),this.setState({selectedCountry:X,formattedNumber:je})}}},{key:"render",value:function(){var L,m,pe,Y=this,K=this.state,me=K.onlyCountries,ye=K.selectedCountry,Te=K.showDropdown,X=K.formattedNumber,je=K.hiddenAreaCodes,Ae=this.props,P=Ae.disableDropdown,D=Ae.renderStringAsFlag,Q=Ae.isValid,be=Ae.defaultErrorMessage,ue=Ae.specialLabel;if(typeof Q=="boolean")m=Q;else{var Ce=Q(X.replace(/\D/g,""),ye,me,je);typeof Ce=="boolean"?(m=Ce)===!1&&(pe=be):(m=!1,pe=Ce)}var we=re()((a(L={},this.props.containerClass,!0),a(L,"react-tel-input",!0),L)),Re=re()({arrow:!0,up:Te}),ee=re()(a({"form-control":!0,"invalid-number":!m,open:Te},this.props.inputClass,!0)),de=re()({"selected-flag":!0,open:Te}),Se=re()(a({"flag-dropdown":!0,"invalid-number":!m,open:Te},this.props.buttonClass,!0)),q="flag ".concat(ye&&ye.iso2);return p.a.createElement("div",{className:"".concat(we," ").concat(this.props.className),style:this.props.style||this.props.containerStyle,onKeyDown:this.handleKeydown},ue&&p.a.createElement("div",{className:"special-label"},ue),pe&&p.a.createElement("div",{className:"invalid-number-message"},pe),p.a.createElement("input",Object.assign({className:ee,style:this.props.inputStyle,onChange:this.handleInput,onClick:this.handleInputClick,onDoubleClick:this.handleDoubleClick,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCopy:this.handleInputCopy,value:X,onKeyDown:this.handleInputKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,type:"tel"},this.props.inputProps,{ref:function(se){Y.numberInputRef=se,typeof Y.props.inputProps.ref=="function"?Y.props.inputProps.ref(se):typeof Y.props.inputProps.ref=="object"&&(Y.props.inputProps.ref.current=se)}})),p.a.createElement("div",{className:Se,style:this.props.buttonStyle,ref:function(se){return Y.dropdownContainerRef=se}},D?p.a.createElement("div",{className:de},D):p.a.createElement("div",{onClick:P?void 0:this.handleFlagDropdownClick,className:de,title:ye?"".concat(ye.localName||ye.name,": + ").concat(ye.dialCode):"",tabIndex:P?"-1":"0",role:"button","aria-haspopup":"listbox","aria-expanded":!!Te||void 0},p.a.createElement("div",{className:q},!P&&p.a.createElement("div",{className:Re}))),Te&&this.getCountryDropdownList()))}}])&&c(Z.prototype,ae),W}(p.a.Component);Ie.defaultProps={country:"",value:"",onlyCountries:[],preferredCountries:[],excludeCountries:[],placeholder:"1 (702) 123-4567",searchPlaceholder:"search",searchNotFound:"No entries to show",flagsImagePath:"./flags.png",disabled:!1,containerStyle:{},inputStyle:{},buttonStyle:{},dropdownStyle:{},searchStyle:{},containerClass:"",inputClass:"",buttonClass:"",dropdownClass:"",searchClass:"",className:"",autoFormat:!0,enableAreaCodes:!1,enableTerritories:!1,disableCountryCode:!1,disableDropdown:!1,enableLongNumbers:!1,countryCodeEditable:!0,enableSearch:!1,disableSearchIcon:!1,disableInitialCountryGuess:!1,disableCountryGuess:!1,regions:"",inputProps:{},localization:{},masks:null,priority:null,areaCodes:null,preserveOrder:[],defaultMask:"... ... ... ... ..",alwaysDefaultMask:!1,prefix:"+",copyNumbersOnly:!0,renderStringAsFlag:"",autocompleteSearch:!1,jumpCursorToEnd:!0,enableAreaCodeStretch:!1,enableClickOutside:!0,showDropdown:!1,isValid:!0,defaultErrorMessage:"",specialLabel:"Phone",onEnterKeyPress:null,keys:{UP:38,DOWN:40,RIGHT:39,LEFT:37,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9}},t.default=Ie}]);const Ym=uu(zm),Jm=({value:e,onChange:t,error:r,onBlur:a,id:n,name:o,required:i,defaultCountry:l="us",className:s,responsive:c=!1,enableSearch:d=!0,autoComplete:f})=>{const y=(C,b)=>{t("+"+C,b.countryCode)};return u.jsxs("div",{className:s,children:[u.jsx("div",{className:Me("movmo-phone-input flex items-center px-3.5 py-0 h-10 rounded-lg border",c&&"movmo-phone-input-responsive",r?"border-error-500 focus:ring-error-500":"border-grayWarm-300 focus-within:ring-2 focus-within:ring-grayWarm-950"),children:u.jsx(Ym,{country:l,value:e.replace("+",""),onChange:y,inputProps:{onBlur:a,required:i,id:n,name:o,...f&&{autoComplete:f}},enableSearch:d,autoFormat:!0})}),r&&u.jsx("p",{className:"text-error-500 text-xs mt-1",children:r})]})},ya=e=>`otp-input-${e}`,lr=e=>Et(document.getElementById(ya(e))),Um=e=>Array.from({length:e},()=>""),Ua=({length:e,onComplete:t,onChange:r,disabled:a=!1,autoFocus:n=!1})=>{const[o,i]=w.useState(()=>Um(e)),l=w.useRef(null),s=w.useRef(t);s.current=t;const c=b=>{i(b),r==null||r(b.join(""))},d=b=>{const h=[...o];for(let x=0;x<Math.min(b.length,e);x++)h[x]=b[x];c(h);const p=h.findIndex(x=>x==="");lr(p!==-1?p:e-1)},f=(b,h)=>{if(a||!/^\d*$/.test(b))return;if(b.length>=e){d(b);return}const p=[...o];p[h]=b.slice(-1),c(p),b&&h<e-1&&lr(h+1)},y=b=>{if(a)return;b.preventDefault();const h=b.clipboardData.getData("text/plain").replace(/\D/g,"");h&&d(h)},C=b=>{if(a)return;const h=[...o];h[b]="",c(h),b>0&&lr(b-1)};return w.useEffect(()=>{n&&lr(0)},[]),w.useEffect(()=>{if(a)return;const b=o.join("");if(o.some(h=>h==="")){l.current=null;return}l.current!==b&&(l.current=b,s.current(b))},[o,a]),u.jsx("div",{className:"flex justify-center gap-1.5 sm:gap-2",children:Array.from({length:e}).map((b,h)=>u.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:h===0?e:1,autoComplete:h===0?"one-time-code":"off","aria-label":`Digit ${h+1} of ${e}`,disabled:a,className:`w-full max-w-10 h-16 border border-grayWarm-300 shadow-xs rounded-md text-center text-lg focus:outline-none focus:ring-2 focus:ring-grayWarm-950${a?" bg-grayWarm-100 text-grayWarm-400 cursor-not-allowed":""}`,value:o[h]??"",onChange:p=>f(p.target.value,h),onPaste:y,id:ya(h),"data-testid":ya(h),onKeyDown:p=>{p.key==="Backspace"&&C(h)}},h))})};function $m(e){const t=Math.max(0,Math.ceil(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}const pr={didntGetIt:"Didn't get it?",resend:"Resend code",resendIn:e=>`Resend code in ${$m(e)}`,attemptsLeft:e=>`${e} ${e===1?"attempt":"attempts"} left.`},_l=({secondsLeft:e,onResend:t,disabled:r=!1,className:a=""})=>u.jsx("p",{className:`text-sm text-grayWarm-600 ${a}`,children:e>0?pr.resendIn(e):u.jsxs(u.Fragment,{children:[u.jsx("span",{children:pr.didntGetIt})," ",u.jsx("button",{type:"button",onClick:t,disabled:r,className:"font-semibold text-brand-600 hover:text-brand-700 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 disabled:opacity-60 disabled:cursor-not-allowed",children:pr.resend})]})}),Qm=({email:e,phone:t,otpLength:r,otpAction:a,onVerify:n,onClose:o,externalError:i,externalErrorVariant:l="error",disabled:s=!1,title:c,description:d,onOtpChange:f,onResend:y,resendAfter:C=0,attemptsRemaining:b})=>{const[h,p]=w.useState(C);w.useEffect(()=>{p(C)},[C]);const x=h>0;w.useEffect(()=>{if(!x)return;const A=setInterval(()=>p(I=>Math.max(0,I-1)),1e3);return()=>clearInterval(A)},[x]);const E=()=>{y==null||y(),p(C)};w.useEffect(()=>{const A=I=>{I.key==="Escape"&&o()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[o]);const R=l==="warning"?"text-warning-700":"text-error-500";return u.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-[110] px-4",children:u.jsxs(Aa,{className:"w-full max-w-[400px] rounded-lg bg-white",children:[u.jsx(wa,{className:"p-4 border-b border-grayWarm-200",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("button",{onClick:o,className:"w-8 h-8 flex items-center justify-center bg-grayWarm-100 hover:bg-grayWarm-200 rounded-lg transition-colors","aria-label":"Close modal",children:u.jsx("svg",{className:"w-4 h-4 text-grayWarm-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),u.jsx("h2",{className:"text-xl md:text-lg font-bold text-center flex-1",children:c||"Verify Account"}),u.jsx("div",{className:"w-8"})]})}),u.jsxs(Ea,{className:"p-4 text-center",children:[u.jsxs("div",{className:"text-center mb-3",children:[u.jsx("p",{className:"text-sm md:text-md text-grayWarm-600",children:d||"Enter the code we sent to"}),!d&&u.jsx("p",{className:"text-sm md:text-md text-grayWarm-600 mt-1",children:a===qt.OTPAction.EMAILED?e:t})]}),u.jsx("div",{className:"mb-6",children:u.jsx(Ua,{length:r,onComplete:n,onChange:f,disabled:s})}),i&&u.jsx("p",{className:`${R} text-center text-sm mb-4`,children:i}),b!==void 0&&u.jsx("p",{className:"text-error-500 text-center text-sm mb-4",children:pr.attemptsLeft(b)}),y&&u.jsx(_l,{secondsLeft:h,onResend:E,disabled:s,className:"text-center mb-2"})]})]})})};function $a(){if(typeof window>"u")return!1;try{return window.self!==window.top}catch{return!0}}const Km=new Set(["invalid_email","rate_limited","resend_too_soon","flow_expired","invalid_code","too_many_attempts","invalid_request","invalid_credential","passkey_limit","credential_exists","not_found","reauth_required","movmo_session_required","first_party_only","issuer_unavailable","passkey_failed","sign_in_failed","recovery_required","recovery_blocked","recovery_cooldown","code_sends_paused"]);function qm(e){return Km.has(e)}class Rt extends Error{constructor(t,r,a,n,o){super(r),this.status=t,this.code=r,this.retryAfter=a,this.attemptsRemaining=n,this.until=o}}function eb(e){return typeof e=="object"&&e!==null?e:void 0}function ci(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function pt(e){if(e instanceof Rt)return e;const t=eb(e);if(t){const{response:r}=t;if(r&&typeof r=="object"){const a=typeof r.status=="number"?r.status:0,n=r.data&&typeof r.data=="object"?r.data:void 0,o=n==null?void 0:n.code,i=typeof o=="string"&&qm(o)?o:"unknown";return new Rt(a,i,ci(n==null?void 0:n.retry_after),ci(n==null?void 0:n.attempts_remaining),i==="recovery_cooldown"&&typeof(n==null?void 0:n.until)=="string"?n.until:void 0)}if(t.isAxiosError===!0||t.request!==void 0)return new Rt(0,"network")}return e instanceof TypeError&&/failed to fetch/i.test(e.message)?new Rt(0,"network"):new Rt(0,"unknown")}const tb=/^[A-Za-z0-9_-]{1,512}$/,nb=/^rc1\.[A-Za-z0-9_-]+$/,Dl=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}};function rb(e,t){const r=()=>{var n;return((n=t==null?void 0:t.locale)==null?void 0:n.call(t))??"en-US"};function a(n){const o=Dl();return o?{...n,time_zone:o}:n}return{async login(n){try{const{data:o}=await e.post("/v1/auth/login",a({email:n,locale:r()}));return o}catch(o){throw pt(o)}},async sendCode(n){try{const{data:o}=await e.post("/v1/auth/code",a({flow_id:n}));return o}catch(o){throw pt(o)}},async startRecovery(n){try{const{data:o}=await e.post("/v1/auth/recovery",a({flow_id:n}));return o}catch(o){throw pt(o)}},async cancelRecovery(n){if(!nb.test(n))throw new Rt(0,"invalid_request");try{await e.post("/v1/auth/recovery/cancel",{token:n})}catch(o){throw pt(o)}},async passkeyOptions(){try{const{data:n}=await e.post("/v1/auth/passkey/options",{});return n}catch(n){throw pt(n)}},async verifyCode(n,o){try{const{data:i}=await e.post("/v1/auth/verify",{flow_id:n,code:o});return i}catch(i){throw pt(i)}},async verifyPasskey(n,o){try{const{data:i}=await e.post("/v1/auth/verify",{flow_id:n,credential:o});return i}catch(i){throw pt(i)}},async listPasskeys(){try{const{data:n}=await e.get("/v1/users/me/passkeys");return n.passkeys??[]}catch(n){throw pt(n)}},async startRegistration(){try{const{data:n}=await e.post("/v1/users/me/passkeys/registration/start",{});return n}catch(n){throw pt(n)}},async completeRegistration(n,o){try{const{data:i}=await e.post("/v1/users/me/passkeys/registration/complete",a({flow_id:n,credential:o}));return i.passkey}catch(i){throw pt(i)}},async logout(){try{await e.post("/v1/auth/logout",{})}catch(n){pt(n)}},async deletePasskey(n){if(!tb.test(n))throw new Rt(0,"invalid_request");try{await e.delete(`/v1/users/me/passkeys/${encodeURIComponent(n)}`)}catch(o){throw pt(o)}}}}const tt={passkeyNotRecognized:"That passkey isn't recognized. We've sent you a code instead.",tooManyAttempts:"Too many attempts. Start again.",flowExpired:"That took too long. Start again.",codeSent:"Code sent",signedIn:"Signed in",generic:"Something went wrong. Try again.",accountMismatch:"That's a different account. Sign in with the account you're using.",passkeyExists:"This passkey is already on your account.",enrollExpired:"That took too long. Try again.",invalidEmail:"Enter a valid email address.",passkeyUnavailable:"This browser couldn't use a passkey. Choose 'I can't use my passkey' to sign in with a code.",discoverableNotRecognized:"That passkey isn't recognized. Continue with your email instead.",recoveryStarted:"Sign in without your passkey",recoveryBlocked:"We can't recover this account right now"};function Wl(e){return e===void 0?"Incorrect code.":`Incorrect code. ${e} ${e===1?"attempt":"attempts"} left.`}function Qa(e){const t=e!==void 0&&Number.isFinite(e)?Math.max(1,Math.ceil(e/60)):1;return`Too many requests. Try again in ${t} ${t===1?"minute":"minutes"}.`}const Ka="movmo_pk_prompt",ab=864e5,ob=14,ib=3,sb=99,lb=3456e4,qa=e=>Math.floor(e/ab),ub=/^\d{1,3}(\.\d{1,3}){3}$/;function Ll(e){if(!e||e.includes(":")||ub.test(e))return;const t=e.split(".");if(!(t.length<2))return"."+t.slice(-2).join(".")}function cb(e,t){const r=[];for(const a of e.split(";")){const n=a.indexOf("=");n!==-1&&a.slice(0,n).trim()===t&&r.push(a.slice(n+1))}return r}function db(e){if(typeof e!="object"||e===null)return!1;const{v:t,d:r,n:a,x:n}=e;return t===1&&typeof r=="number"&&Number.isInteger(r)&&r>=0&&typeof a=="number"&&Number.isInteger(a)&&a>=0&&(n===0||n===1)}function Yn(e=document.cookie,t=Date.now()){const r=cb(e,Ka);if(r.length!==1)return null;let a;try{a=JSON.parse(decodeURIComponent(r[0]))}catch{return null}return!db(a)||a.d>qa(t)?null:a}function Xl(e=Date.now(),t=Yn(document.cookie,e)){return t?t.x===1?!1:t.d===0?!0:qa(e)-t.d>=ob&&t.n>=ib:!0}function eo(e){try{const t=Ll(window.location.hostname),r={...e,n:Math.min(e.n,sb)};document.cookie=`${Ka}=${encodeURIComponent(JSON.stringify(r))}; Path=/; Max-Age=${lb}; SameSite=Lax; Secure${t?"; Domain="+t:""}`}catch{}}function Hl(){const e=Yn();!e||e.d<=0||e.x!==0||eo({v:1,d:e.d,n:e.n+1,x:e.x})}function Zl(e=Date.now()){eo({v:1,d:qa(e),n:0,x:0})}function zl(e){const t=Yn();eo({v:1,d:(t==null?void 0:t.d)??0,n:(t==null?void 0:t.n)??0,x:e?1:0})}function Yl(){var e;return((e=Yn())==null?void 0:e.x)===1}function _r(e){switch(e instanceof DOMException||typeof e=="object"&&e!==null&&"name"in e?e.name:void 0){case"NotAllowedError":return"cancelled";case"AbortError":return"aborted";case"InvalidStateError":return"exists";case"NotSupportedError":return"unsupported";case"SecurityError":return"security";default:return"unknown"}}function to(){if(!(typeof window>"u"||!window.PublicKeyCredential))return window.PublicKeyCredential}async function no(){const e=to();if(!e)return{webauthn:!1,conditional:!1,platform:!1};let t=!1;try{typeof e.isConditionalMediationAvailable=="function"&&(t=await e.isConditionalMediationAvailable())}catch{t=!1}let r=!1;try{typeof e.isUserVerifyingPlatformAuthenticatorAvailable=="function"&&(r=await e.isUserVerifyingPlatformAuthenticatorAvailable())}catch{r=!1}return{webauthn:!0,conditional:t,platform:r}}class ro{constructor(){go(this,"current",null)}begin(){return this.abortCurrent(),this.current=new AbortController,this.current.signal}abort(){this.abortCurrent()}abortCurrent(){this.current&&!this.current.signal.aborted&&this.current.abort(new DOMException("Superseded by a new ceremony","AbortError"))}}function fb(e){return ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function yn(e){const t=fb(e);let r="";for(let a=0;a<t.length;a++)r+=String.fromCharCode(t[a]);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ar(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;if(r===3)throw new Error("Invalid base64url string");const a=t+"=".repeat(r),n=atob(a),o=new Uint8Array(n.length);for(let i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return o.buffer}function Jl(e){if(Array.isArray(e))return e.map(t=>({...t,id:typeof t.id=="string"?Ar(t.id):t.id}))}function pb(e){const t={...e};typeof e.challenge=="string"&&(t.challenge=Ar(e.challenge));const r=Jl(e.allowCredentials);return r&&(t.allowCredentials=r),t}function gb(e){const t={...e};if(typeof e.challenge=="string"&&(t.challenge=Ar(e.challenge)),e.user&&typeof e.user=="object"){const a=e.user;t.user={...a,id:typeof a.id=="string"?Ar(a.id):a.id}}const r=Jl(e.excludeCredentials);return r&&(t.excludeCredentials=r),t}function mb(e){const t=to();return t&&typeof t.parseRequestOptionsFromJSON=="function"?t.parseRequestOptionsFromJSON(e.publicKey):pb(e.publicKey)}function bb(e){const t=to();return t&&typeof t.parseCreationOptionsFromJSON=="function"?t.parseCreationOptionsFromJSON(e.publicKey):gb(e.publicKey)}function hb(e){const t={clientDataJSON:yn(e.clientDataJSON)},r=e;r.authenticatorData&&(t.authenticatorData=yn(r.authenticatorData),t.signature=r.signature?yn(r.signature):void 0,t.userHandle=r.userHandle?yn(r.userHandle):void 0);const a=e;return a.attestationObject&&(t.attestationObject=yn(a.attestationObject),typeof a.getTransports=="function"&&(t.transports=a.getTransports())),t}function vb(e){return{id:e.id,rawId:yn(e.rawId),type:e.type,authenticatorAttachment:e.authenticatorAttachment??void 0,clientExtensionResults:e.getClientExtensionResults(),response:hb(e.response)}}function Ul(e){const t=e;if(typeof t.toJSON=="function")try{return t.toJSON()}catch{}return vb(e)}async function Ca(e,t){const a={publicKey:mb(e),signal:t.signal};t.conditional&&(a.mediation="conditional");const n=await navigator.credentials.get(a);if(!n)throw new DOMException("No credential returned","NotAllowedError");return Ul(n)}async function $l(e,t){let r=e.publicKey;if(t.securityKey){const o=r.authenticatorSelection??{};r={...r,hints:["security-key"],authenticatorSelection:{...o,authenticatorAttachment:"cross-platform"}}}const a=bb({publicKey:r}),n=await navigator.credentials.create({publicKey:a,signal:t.signal});if(!n)throw new DOMException("No credential returned","NotAllowedError");return Ul(n)}function di(e){if(e.aborted)throw new DOMException("Registration aborted","AbortError")}async function ao(e,t){const r=await e.startRegistration();di(t.signal);const a=await $l(r.options,{signal:t.signal,securityKey:t.securityKey});return di(t.signal),e.completeRegistration(r.flow_id,a)}function qr(e){switch(e.code){case"invalid_code":return{code:e.code,message:Wl(e.attemptsRemaining)};case"too_many_attempts":return{code:e.code,message:tt.tooManyAttempts};case"rate_limited":return{code:e.code,message:Qa(e.retryAfter)};case"flow_expired":return{code:e.code,message:tt.flowExpired};case"invalid_email":return{code:e.code,message:tt.invalidEmail};default:return{code:e.code,message:tt.generic}}}function yb(e){return e==="flow_expired"||e==="too_many_attempts"}function Cb(e){const t=e==="security"||e==="unsupported"?tt.passkeyUnavailable:tt.generic;return{code:e,message:t}}function xb(e){if(e instanceof Rt)switch(e.code){case"credential_exists":return{code:e.code,message:tt.passkeyExists};case"flow_expired":return{code:e.code,message:tt.enrollExpired};case"rate_limited":return{code:e.code,message:Qa(e.retryAfter)};default:return{code:e.code,message:tt.generic}}const t=_r(e);return t==="cancelled"||t==="aborted"?null:t==="exists"?{code:t,message:tt.passkeyExists}:{code:t,message:tt.generic}}async function Ib(e){return e.method!=="otp"||e.loginNext!=="code"||e.surface!=="top-level"||e.offerEnrollment===!1||!await e.platformAuthenticator()?!1:Xl()}const Ql=27e4,ea=6;function Kl(e){const t=w.useRef(e);t.current=e;const[r]=w.useState($a),a=e.surface==="top-level"&&!r,n=a?"top-level":"embedded",o=e.lockedEmail!==void 0||e.expectedUserId!==void 0,[i,l]=w.useState("email"),[s,c]=w.useState(e.lockedEmail??e.initialEmail??""),[d,f]=w.useState(!1),[y,C]=w.useState(null),[b,h]=w.useState(ea),[p,x]=w.useState(0),[E,R]=w.useState(void 0),[A,I]=w.useState(!1),[j,F]=w.useState(!1),[M,oe]=w.useState(!1),[re,ce]=w.useState(""),[z]=w.useState(()=>new ro),le=w.useRef(!1),G=w.useRef("email"),O=w.useRef(s),V=w.useRef(0);V.current=p;const $=w.useRef(0),ne=w.useRef(null),Ie=w.useRef(null),_=w.useRef(null),W=w.useRef(0),Z=w.useRef(null),ae=w.useRef(null),L=w.useRef(!1),m=w.useRef(null),pe=w.useRef(!1),Y=w.useRef(!1),K=w.useRef(!1),me=()=>ae.current??(ae.current=no()),ye=T=>{G.current=T,l(T),T!=="code"&&x(0),T!=="passkey"&&F(!1),T!=="recovery"&&oe(!1)},Te=T=>{C(T),T&&ce("")},X=T=>le.current&&$.current===T,je=T=>{const U=++$.current;return ne.current=T,f(!0),C(null),U},Ae=T=>{$.current===T&&(ne.current=null,f(!1))},P=()=>{$.current++,ne.current=null,f(!1)},D=()=>({surface:t.current.promptSurface??"modal"}),Q=T=>{var U,ie;return(ie=(U=t.current).onEvent)==null?void 0:ie.call(U,T,D())},be=()=>{Z.current!==null&&(clearTimeout(Z.current),Z.current=null),W.current++},ue=()=>{be(),z.abort()},Ce=async()=>{if(!a||o)return;be();const T=W.current,U=()=>le.current&&W.current===T&&G.current==="email"&&ne.current===null,{conditional:ie}=await me();if(!U()||!ie)return;const Xe=z.begin();Z.current=setTimeout(()=>void Ce(),Ql);let rt;try{rt=await t.current.api.passkeyOptions()}catch{return}if(!U()||Xe.aborted)return;const dt=rt.flow_id;Ca(rt.options,{signal:Xe,conditional:!0}).then(v=>{U()&&we(dt,v)},()=>{})},we=async(T,U)=>{be();const ie=je("request");let Xe;try{Xe=await t.current.api.verifyPasskey(T,U)}catch(rt){if(!X(ie))return;const dt=pt(rt).code==="invalid_credential";Re(ie,dt?{code:"invalid_credential",message:tt.discoverableNotRecognized}:null);return}X(ie)&&await Ke(ie,Xe,"passkey",null)},Re=(T,U)=>{Ae(T),Te(U),G.current==="passkey"&&F(!0),G.current==="email"&&Ce()},ee=(T,U)=>{const ie=G.current==="email";Ae(T),Ie.current=null,ye("email"),Te(U),ie&&Ce()},de=(T,U)=>{const ie=pt(U);if(ie.code==="recovery_required"){Ae(T),Te(null),ye("recovery"),ce(tt.recoveryStarted);return}if(ie.code==="recovery_blocked"){Ae(T),Te(null),oe(!0),ce(tt.recoveryBlocked);return}if(yb(ie.code)){ee(T,qr(ie));return}if(ie.code==="resend_too_soon"){Ae(T),x(Math.max(0,Math.ceil(ie.retryAfter??0)));return}ie.code==="invalid_code"&&R(ie.attemptsRemaining),Re(T,qr(ie))},Se=async(T,U)=>{ne.current="request";try{const ie=await U();return X(T)?ie:void 0}catch(ie){X(T)&&de(T,ie);return}},q=(T,U)=>{_.current=T.flow_id,h(T.code_length||ea),R(void 0),ye("code"),x(Math.max(0,T.resend_after??0)),ce(tt.codeSent),U&&C(U)},se=async(T,U,ie)=>{const Xe=await Se(T,()=>t.current.api.sendCode(U));Xe&&(Ae(T),q(Xe,ie))},_e=()=>{P(),ue(),Ie.current=null,ye("mismatch"),Te({code:"account_mismatch",message:tt.accountMismatch});const{api:T}=t.current;(async()=>{var U,ie;try{await T.logout()}catch{}(ie=(U=t.current).onAccountMismatch)==null||ie.call(U)})()},ot=(T,U)=>{pe.current||(pe.current=!0,m.current=null,ye("done"),ce(tt.signedIn),t.current.onSignedIn(T,U))},Ke=async(T,U,ie,Xe)=>{var Oe,ke,Ne,Ge;const rt=t.current,dt=rt.expectedUserId;if(dt!==void 0&&U.user_id!==dt){_e();return}let v;try{v=await rt.getCurrentUser()}catch{if(!X(T))return;const qe={code:"unknown",message:tt.generic};G.current==="passkey"?ee(T,qe):Re(T,qe);return}if(!X(T))return;if(dt!==void 0&&v.id!==dt){_e();return}const B=typeof U.recovery_until=="string"&&U.recovery_until!=="",J=B?{method:"recovery",newUser:U.new_user,recoveryUntil:U.recovery_until}:{method:ie,newUser:U.new_user};Y.current||(Y.current=!0,(ke=(Oe=t.current).onVerified)==null||ke.call(Oe,v,J)),J.method==="otp"&&a&&Hl(),B&&((Ge=(Ne=t.current).onEvent)==null||Ge.call(Ne,"sign_in",{...D(),method:"recovery"}));const he=await Ib({method:J.method,loginNext:Xe,surface:n,offerEnrollment:rt.offerEnrollment,platformAuthenticator:async()=>(await me()).platform});X(T)&&(Ae(T),he?(m.current={user:v,info:J},ye("enroll"),Q("passkey_prompt_shown")):ot(v,J))},lt=async(T,U,ie,Xe)=>{if(!a){Ae(T);return}ne.current="ceremony";let rt;try{rt=await Ca(U.options,{signal:ie})}catch(v){if(!X(T))return;const B=_r(v);Re(T,B==="cancelled"||B==="aborted"?null:Cb(B));return}if(!X(T))return;ne.current="request";let dt;try{dt=await t.current.api.verifyPasskey(U.flow_id,rt)}catch(v){if(!X(T))return;const B=pt(v);if(B.code==="invalid_credential"&&Xe){const J={code:"invalid_credential",message:tt.passkeyNotRecognized};await se(T,U.flow_id,J)}else B.code==="invalid_credential"?Re(T,{code:"invalid_credential",message:tt.discoverableNotRecognized}):Xe?ee(T,qr(B)):de(T,v);return}X(T)&&await Ke(T,dt,"passkey",Xe?"passkey":null)},gt=(T,U)=>(F(!1),lt(T,U,z.begin(),!0)),It=T=>{t.current.lockedEmail===void 0&&(O.current=T,c(T))},Ue=async()=>{if(ne.current||G.current!=="email")return;ue();const T=(t.current.lockedEmail??O.current).trim();if(!T){Te({code:"invalid_email",message:tt.invalidEmail}),Ce();return}O.current=T,c(T);const U=je("request"),ie=await Se(U,()=>t.current.api.login(T));ie&&await Nt(U,ie)},Nt=async(T,U)=>{Ie.current=U,U.next==="code"?(Ae(T),q(U)):a?(h(U.code_length||ea),ye("passkey"),await gt(T,U)):await se(T,U.flow_id)},Mt=async()=>{if(!a||o||!L.current||ne.current||G.current!=="email")return;ue();const T=je("ceremony"),U=z.begin(),ie=await Se(T,()=>t.current.api.passkeyOptions());ie&&await lt(T,ie,U,!1)},an=()=>{const T=Ie.current;!a||G.current!=="passkey"||ne.current||(T==null?void 0:T.next)!=="passkey"||gt(je("ceremony"),T)},St=()=>{o||G.current!=="passkey"||ne.current==="request"||!Ie.current||(P(),z.abort(),C(null),ye("recovery"),ce(tt.recoveryStarted))},Gt=async()=>{var Xe;const T=(Xe=Ie.current)==null?void 0:Xe.flow_id;if(G.current!=="recovery"||ne.current||!T||o)return;const U=je("request"),ie=await Se(U,()=>t.current.api.startRecovery(T));ie&&(Ae(U),Q("recovery_started"),q(ie))},Pt=()=>{var T;G.current!=="recovery"||ne.current||M||(C(null),a&&((T=Ie.current)==null?void 0:T.next)==="passkey"?ye("passkey"):(Ie.current=null,ye("email")))},on=()=>{G.current!=="passkey"&&G.current!=="code"||(P(),z.abort(),Ie.current=null,C(null),ye("email"))},Xt=async T=>{var rt;const U=_.current;if(G.current!=="code"||ne.current||!U)return;const ie=je("request"),Xe=await Se(ie,()=>t.current.api.verifyCode(U,T));Xe&&await Ke(ie,Xe,"otp",((rt=Ie.current)==null?void 0:rt.next)??null)},sn=async()=>{const T=_.current;if(G.current!=="code"||ne.current||V.current>0||!T)return;ce("");const U=je("request"),ie=await Se(U,()=>t.current.api.sendCode(T));ie&&(Ae(U),q(ie))},Ht=async()=>{if(!a||G.current!=="enroll"||ne.current)return;const T=je("ceremony"),U=z.begin();try{await ao(t.current.api,{signal:U})}catch(ie){X(T)&&Re(T,xb(ie));return}X(T)&&(Ae(T),ye("enrolled"),Q("passkey_prompt_accepted"))},Ct=()=>{const T=m.current;T&&ot(T.user,T.info)},ht=()=>{G.current==="enroll"&&(P(),z.abort(),C(null),Zl(),Q("passkey_prompt_declined"),Ct())},Zt=()=>{G.current==="enrolled"&&Ct()},kt=()=>{G.current==="enroll"?ht():G.current==="enrolled"?Zt():(P(),ue())};w.useEffect(()=>(le.current=!0,()=>{le.current=!1,ue()}),[]),w.useEffect(()=>{if(!a||o)return;let T=!1;return me().then(U=>{L.current=U.webauthn,T||I(U.webauthn)}),()=>{T=!0}},[a,o]);const ln=()=>{var Xe;const{autoContinue:T,lockedEmail:U,initialEmail:ie}=t.current;return!!(T&&((Xe=U??ie)!=null&&Xe.trim())&&!K.current)};w.useEffect(()=>{if(!(i!=="email"||ne.current||ln()))return Ce(),be},[i]),w.useEffect(()=>{ln()&&(K.current=!0,Ue())},[]);const un=i==="code"&&p>0;return w.useEffect(()=>{if(!un)return;const T=setInterval(()=>x(U=>Math.max(0,U-1)),1e3);return()=>clearInterval(T)},[un]),{step:i,email:s,setEmail:It,busy:d,error:(y==null?void 0:y.message)??null,errorCode:(y==null?void 0:y.code)??null,codeLength:b,resendIn:p,attemptsRemaining:E,canUsePasskeyButton:A,passkeyFailed:j,recoveryAvailable:!o,recoveryBlocked:M,liveMessage:re,submitEmail:()=>void Ue(),signInWithPasskey:()=>void Mt(),retryPasskey:an,cantUsePasskey:St,sendRecoveryCode:()=>void Gt(),back:Pt,changeEmail:on,submitCode:T=>void Xt(T),resendCode:()=>void sn(),acceptEnrollment:()=>void Ht(),declineEnrollment:ht,finish:Zt,close:kt}}const Qt={prompt:{heading:"Skip the code next time",body:"Set up a passkey and sign in with Face ID, your fingerprint or your screen lock.",accept:"Set up passkey",decline:"Not now",footnote:"You can manage passkeys anytime in Security."},added:{heading:"Passkey added",body:"Next time, sign in with Face ID, your fingerprint or your screen lock. We've emailed you a confirmation.",done:"Done"}},xa=({status:e="prompt",onAccept:t,onDecline:r,onDone:a,busy:n=!1,error:o=null})=>e==="added"?u.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-success-50",children:u.jsx(Ja,{size:24,className:"text-success-600"})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{tabIndex:-1,className:"text-lg font-semibold text-grayWarm-950 focus:outline-none",children:Qt.added.heading}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:Qt.added.body})]}),u.jsx("button",{type:"button",onClick:a,className:"w-full py-3 px-4 bg-gradient-to-r from-brand-500 to-brand-600 text-white font-semibold rounded-xl transition-opacity hover:opacity-90",children:Qt.added.done})]}):u.jsxs("div",{className:"flex flex-col items-center text-center gap-4",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-brand-50",children:u.jsx(Pl,{size:24,className:"text-brand-600"})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{tabIndex:-1,className:"text-lg font-semibold text-grayWarm-950 focus:outline-none",children:Qt.prompt.heading}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:Qt.prompt.body})]}),o&&u.jsxs("div",{role:"alert",className:"w-full flex items-start gap-2 rounded-lg bg-warning-50 border border-warning-200 p-3 text-left",children:[u.jsx(Rn,{size:20,className:"text-warning-700 flex-shrink-0 mt-0.5"}),u.jsx("p",{className:"text-sm text-warning-700",children:o})]}),u.jsxs("div",{className:"w-full flex flex-col gap-2",children:[u.jsx("button",{type:"button",onClick:t,disabled:n,"aria-busy":n,className:"w-full py-3 px-4 bg-gradient-to-r from-brand-500 to-brand-600 text-white font-semibold rounded-xl transition-opacity hover:opacity-90 disabled:opacity-70 disabled:cursor-not-allowed",children:Qt.prompt.accept}),u.jsx("button",{type:"button",onClick:r,className:"w-full py-3 px-4 bg-white border border-grayWarm-300 text-grayWarm-700 font-semibold rounded-xl transition-colors hover:bg-grayWarm-50",children:Qt.prompt.decline})]}),u.jsx("p",{className:"text-xs text-grayWarm-500",children:Qt.prompt.footnote})]}),oo="focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2",Ln=S.forwardRef(({className:e,type:t="button",...r},a)=>u.jsx("button",{ref:a,type:t,className:Me("w-full h-11 px-4 inline-flex items-center justify-center gap-2 rounded-xl bg-gradient-to-r from-brand-500 to-brand-600 text-white font-semibold shadow-sm transition-opacity hover:opacity-95 disabled:opacity-60 disabled:cursor-not-allowed",oo,e),...r})),mn=S.forwardRef(({className:e,type:t="button",...r},a)=>u.jsx("button",{ref:a,type:t,className:Me("w-full h-11 px-4 inline-flex items-center justify-center gap-2 rounded-xl bg-white border border-grayWarm-300 text-grayWarm-700 font-semibold shadow-sm transition-colors hover:bg-grayWarm-50 disabled:opacity-60 disabled:cursor-not-allowed",oo,e),...r})),wr=S.forwardRef(({className:e,type:t="button",...r},a)=>u.jsx("button",{ref:a,type:t,className:Me("text-sm font-semibold text-brand-600 hover:text-brand-700 rounded disabled:opacity-60 disabled:cursor-not-allowed",oo,e),...r}));Ln.displayName="PrimaryButton";mn.displayName="SecondaryButton";wr.displayName="LinkButton";const Ze={email:{title:"Sign in to Movmo",description:"Enter your email. New here? We'll create your account.",label:"Email",continue:"Continue",divider:"or",passkey:"Sign in with passkey"},passkey:{title:"Sign in with your passkey",description:"Use Face ID, your fingerprint or your screen lock.",change:"Change",changeLabel:"Change email",continue:"Continue",failed:"Your passkey didn't finish. Try again, or choose 'I can't use my passkey'.",tryAgain:"Try again",cantUse:"I can't use my passkey",reauthDescription:"Use your passkey to continue. Lost it? Recover your account from the sign-in page."},recovery:{title:"Sign in without your passkey",description:e=>`We'll email a code to ${e}. Signing in this way starts account recovery: everyone on your account is notified, and for 24 hours this session can't add passkeys, change contact details, add payment methods or connect airlines.`,send:"Send me a code",back:"Back",blockedTitle:"We can't recover this account right now",blockedDescription:"Too many recovery attempts, or recovery was recently cancelled from this account. Try again later or sign in with a passkey on another device.",close:"Close"},code:{title:"Check your email",description:e=>`Enter the code we sent to ${e}.`},cancel:"Cancel"},io=({flow:e,lockedEmail:t,title:r,description:a,onCancel:n,onClose:o,icon:i})=>{const l=n?()=>{e.close(),n()}:void 0;let s=null;switch(e.step){case"email":s=u.jsx(Sb,{flow:e,locked:t!==void 0,title:r,description:a,onCancel:l,icon:i});break;case"passkey":s=u.jsx(Ab,{flow:e,locked:t!==void 0,title:r,description:a,onCancel:l,icon:i});break;case"recovery":s=u.jsx(Eb,{flow:e,onCancel:l??o});break;case"code":s=u.jsx(Nb,{flow:e,title:r,onCancel:l});break;case"enroll":s=u.jsx(fi,{children:u.jsx(xa,{status:"prompt",onAccept:e.acceptEnrollment,onDecline:e.declineEnrollment,busy:e.busy,error:e.error})});break;case"enrolled":s=u.jsx(fi,{children:u.jsx(xa,{status:"added",onAccept:e.acceptEnrollment,onDecline:e.declineEnrollment,onDone:e.finish})});break;case"mismatch":s=u.jsx(Rb,{flow:e,title:r,onCancel:l,icon:i});break}return u.jsxs("div",{className:"text-left",children:[u.jsx("div",{"aria-live":"polite",className:"sr-only",children:e.error??e.liveMessage}),u.jsx("div",{"data-step":e.step,className:"motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-bottom-1 motion-safe:duration-200",children:s},e.step)]})},fi=({children:e})=>{const t=w.useRef(null);return w.useEffect(()=>{var r;Et((r=t.current)==null?void 0:r.querySelector("h2"))},[]),u.jsx("div",{ref:t,children:e})},An=({icon:e,title:t,description:r,headingRef:a})=>u.jsxs("div",{className:"flex flex-col gap-5 mb-5",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-[10px] border border-grayWarm-200 shadow-sm text-grayWarm-700",children:u.jsx(e,{size:24})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{ref:a,tabIndex:a?-1:void 0,className:"text-lg font-semibold text-grayWarm-950 focus:outline-none",children:t}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:r})]})]}),so=({children:e})=>u.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-warning-200 bg-warning-50 p-4",children:[u.jsx(Rn,{size:20,className:"flex-shrink-0 text-warning-700"}),u.jsx("p",{className:"text-sm text-warning-700",children:e})]}),ql=({primary:e,onCancel:t})=>t?u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(mn,{onClick:t,children:Ze.cancel}),e]}):u.jsx(u.Fragment,{children:e}),Sb=({flow:e,locked:t,title:r,description:a,onCancel:n,icon:o})=>{const i=w.useRef(null),l=w.useRef(null),s=w.useId(),c=w.useId();return w.useEffect(()=>{Et(t?l.current:i.current)},[t]),u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:o??Fl,title:r??Ze.email.title,description:a??Ze.email.description}),u.jsxs("form",{noValidate:!0,onSubmit:d=>{d.preventDefault(),e.submitEmail()},className:"flex flex-col gap-5",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:s,className:"text-sm font-medium text-grayWarm-700",children:Ze.email.label}),u.jsxs("div",{className:"relative",children:[u.jsx(Fr,{size:20,className:"pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-grayWarm-500"}),u.jsx(Vt,{ref:i,id:s,type:"email",name:"email",autoComplete:"username webauthn",value:e.email,onChange:d=>e.setEmail(d.target.value),disabled:t,"aria-invalid":e.error?!0:void 0,"aria-describedby":e.error?c:void 0,className:`h-11 pl-10 ${e.error?"border-error-500 focus:border-error-500":""} autofill:bg-white autofill:shadow-[inset_0_0_0px_1000px_white]`})]}),e.error&&u.jsx("p",{id:c,className:"text-sm text-error-500",children:e.error})]}),u.jsx(ql,{onCancel:n,primary:u.jsx(Ln,{ref:l,type:"submit",disabled:e.busy,"aria-busy":e.busy,children:Ze.email.continue})})]}),e.canUsePasskeyButton&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2 my-5","aria-hidden":"true",children:[u.jsx("div",{className:"h-px flex-1 bg-grayWarm-200"}),u.jsx("span",{className:"text-sm text-grayWarm-500",children:Ze.email.divider}),u.jsx("div",{className:"h-px flex-1 bg-grayWarm-200"})]}),u.jsxs(mn,{onClick:e.signInWithPasskey,disabled:e.busy,children:[u.jsx(za,{size:20}),Ze.email.passkey]})]})]})},Ab=({flow:e,locked:t,title:r,description:a,onCancel:n,icon:o})=>{const i=w.useRef(null);w.useEffect(()=>{Et(i.current)},[]);const l=e.error??(e.passkeyFailed?Ze.passkey.failed:null);return u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:o??Gl,title:r??Ze.passkey.title,description:e.recoveryAvailable?a??Ze.passkey.description:Ze.passkey.reauthDescription,headingRef:i}),u.jsxs("div",{className:"flex flex-col gap-5",children:[l?u.jsx(so,{children:l}):u.jsxs("div",{className:"flex items-center justify-between gap-3 h-11 rounded-lg border border-grayWarm-300 bg-grayWarm-50 px-3.5 shadow-sm",children:[u.jsx("span",{className:"truncate text-base text-grayWarm-700",children:e.email}),!t&&u.jsx(wr,{onClick:e.changeEmail,"aria-label":Ze.passkey.changeLabel,children:Ze.passkey.change})]}),u.jsx(ql,{onCancel:n,primary:u.jsx(Ln,{onClick:e.retryPasskey,disabled:e.busy,"aria-busy":e.busy,children:e.passkeyFailed?Ze.passkey.tryAgain:Ze.passkey.continue})}),e.recoveryAvailable&&u.jsx(wr,{onClick:e.cantUsePasskey,className:"self-center",children:Ze.passkey.cantUse})]})]})},wb=e=>{const t=e.lastIndexOf("@");return t<1?e:`${e.slice(0,1)}•••${e.slice(t)}`},Eb=({flow:e,onCancel:t})=>{const r=w.useRef(null);return w.useEffect(()=>{Et(r.current)},[e.recoveryBlocked]),e.recoveryBlocked?u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:Rn,title:Ze.recovery.blockedTitle,description:Ze.recovery.blockedDescription,headingRef:r}),u.jsx(Ln,{onClick:t??e.close,children:Ze.recovery.close})]}):u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:Fr,title:Ze.recovery.title,description:Ze.recovery.description(wb(e.email)),headingRef:r}),u.jsxs("div",{className:"flex flex-col gap-5",children:[e.error&&u.jsx(so,{children:e.error}),u.jsx(Ln,{onClick:e.sendRecoveryCode,disabled:e.busy,"aria-busy":e.busy,children:Ze.recovery.send}),u.jsx(wr,{onClick:e.back,disabled:e.busy,className:"self-center",children:Ze.recovery.back})]})]})},Rb=({flow:e,title:t,onCancel:r,icon:a})=>u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:a??Rn,title:t??Ze.email.title,description:e.error??""}),r&&u.jsx(mn,{onClick:r,children:Ze.cancel})]}),Nb=({flow:e,title:t,onCancel:r})=>u.jsxs(u.Fragment,{children:[u.jsx(An,{icon:Fr,title:t??Ze.code.title,description:Ze.code.description(e.email)}),u.jsxs("div",{className:"flex flex-col gap-5",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(Ua,{length:e.codeLength,onComplete:e.submitCode,autoFocus:!0}),e.error&&e.errorCode!=="invalid_credential"&&u.jsx("p",{className:"text-error-500 text-center text-sm",children:e.error})]}),e.error&&e.errorCode==="invalid_credential"&&u.jsx(so,{children:e.error}),u.jsx(_l,{secondsLeft:e.resendIn,onResend:e.resendCode,disabled:e.busy}),r&&u.jsx(mn,{onClick:r,children:Ze.cancel})]})]});function lo(e){const t=Kl(e),r=w.useRef(t);return r.current=t,w.useEffect(()=>()=>{const{step:a,close:n}=r.current;(a==="enroll"||a==="enrolled")&&n()},[]),t}const Gb=({title:e,description:t,onCancel:r,...a})=>{const n=lo(a);return u.jsx(io,{flow:n,lockedEmail:a.lockedEmail,title:e,description:t,onCancel:r})},Pb=({isOpen:e,...t})=>e?u.jsx(Tb,{...t}):null,Tb=({onClose:e,hideCloseButton:t=!1,onLoginSuccess:r,...a})=>{const n=lo({...a,promptSurface:a.promptSurface??"modal",onSignedIn:r}),o=()=>{n.close(),e()};return u.jsx(gn,{isOpen:n.step!=="done",onClose:o,title:Ze.email.title,header:"none",maxWidthPx:400,hideCloseButton:t,children:u.jsx(io,{flow:n,lockedEmail:a.lockedEmail,onClose:o})})},dn={title:"Confirm it's you",framed:"Manage passkeys on the Movmo Security page.",cancel:"Cancel",description:{add:"For your security, sign in again to add a passkey.",remove:"For your security, sign in again to remove this passkey."}},eu=({isOpen:e,...t})=>e?u.jsx(Ob,{...t}):null,Ob=e=>{const[t]=w.useState($a);return t?u.jsx(jb,{onCancel:e.onCancel}):u.jsx(Mb,{...e})},jb=({onCancel:e})=>u.jsx(gn,{isOpen:!0,onClose:e,title:dn.title,header:"none",maxWidthPx:400,children:u.jsxs("div",{className:"flex flex-col gap-5 text-left",children:[u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{className:"text-lg font-semibold text-grayWarm-950",children:dn.title}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:dn.framed})]}),u.jsx(mn,{onClick:e,children:dn.cancel})]})}),Mb=({action:e,account:t,api:r,getCurrentUser:a,onConfirmed:n,onCancel:o,onMismatch:i})=>{const l=lo({api:r,surface:"top-level",getCurrentUser:a,lockedEmail:t.email,expectedUserId:t.id,autoContinue:!0,offerEnrollment:!1,onSignedIn:()=>n(),onAccountMismatch:i}),s=()=>{l.close(),o()};return u.jsx(gn,{isOpen:l.step!=="done",onClose:s,title:dn.title,header:"none",maxWidthPx:400,children:u.jsx(io,{flow:l,lockedEmail:t.email,title:dn.title,description:dn.description[e],onCancel:o,icon:jl})})},Le={loading:"Loading passkeys",framed:"Manage passkeys on the Movmo Security page.",empty:"Passkeys let you sign in with Face ID, your fingerprint, your screen lock or a security key. No code to wait for.",addPasskey:"Passkey",addPasskeyLabel:"Add passkey",addSecurityKey:"Security key",addSecurityKeyLabel:"Add security key",suggestToggle:"Suggest a passkey after I sign in with a code",limit:"You've reached the limit of 10 passkeys. Remove one to add another.",unsupported:"This browser doesn't support passkeys. You can still remove them here.",added:"Passkey added. We've emailed you a confirmation.",exists:"This passkey is already on your account.",expired:"That took too long. Try again.",generic:"Something went wrong. Try again.",confirmedAdd:"You're confirmed. Select + Passkey again to finish.",confirmedAddKey:"You're confirmed. Select + Security key again to finish.",recoveryInProgress:e=>e?`Account recovery is in progress. You can change passkeys after ${e}.`:"Account recovery is in progress. You can change passkeys once it ends.",retry:"Retry",sessionRequired:"Sign in again to manage passkeys",signIn:"Sign in",kind:{synced:"Synced",device:"This device",security_key:"Security key"},securityKeyTitle:"Security key",addedOn:e=>`Added ${e}`,lastUsed:e=>`Last used ${e}`,neverUsed:"Never used",removeLabel:e=>`Remove ${e}`,remove:{title:e=>`Remove ${e}?`,body:"You won't be able to sign in with it anymore. You can still sign in with a code.",cancel:"Cancel",confirm:"Remove"}},kb=10,Fb=6e3,Bb=new Set(["confirmedAdd","confirmedAddKey"]),Vb={synced:za,device:Ol,security_key:Tl},_b=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}),Db=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}),Wb=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?void 0:Db.format(t)},pi=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?e:_b.format(t)};function tu(e){const t=e.kind??(e.synced?"synced":"device"),r=e.provider==="Passkey"&&t==="security_key"?Le.securityKeyTitle:e.provider,a=Le.kind[t]===r?null:Le.kind[t],n=`${Le.addedOn(pi(e.created_at))} · ${e.last_used_at?Le.lastUsed(pi(e.last_used_at)):Le.neverUsed}`;return{kind:t,title:r,badge:a,meta:n,Icon:Vb[t]}}const Lb=e=>{const t=w.useRef(e);t.current=e;const[r]=w.useState($a),[a,n]=w.useState("loading"),[o,i]=w.useState([]),[l,s]=w.useState(!1),[c,d]=w.useState(!1),[f,y]=w.useState(!1),[C,b]=w.useState(null),[h,p]=w.useState(0),[x,E]=w.useState(!1),[R,A]=w.useState(null),[I,j]=w.useState(null),[F,M]=w.useState(()=>!Yl()),[oe,re]=w.useState(null),[ce]=w.useState(()=>new ro),z=w.useRef(!1),le=w.useRef(!1),G=w.useRef(0),O=w.useId(),V=w.useCallback(async()=>{const Y=++G.current;n("loading");try{const[K,me]=await Promise.all([t.current.api.listPasskeys(),no()]);if(!le.current||Y!==G.current)return;i(K),s(me.webauthn),n("ready")}catch(K){if(!le.current||Y!==G.current)return;const me=K instanceof Rt&&K.code==="movmo_session_required";n(me?"sessionRequired":"error")}},[]);w.useEffect(()=>(le.current=!0,r||V(),()=>{le.current=!1,ce.abort()}),[r,ce,V]),w.useEffect(()=>{if(h===0)return;E(!0);const Y=setTimeout(()=>E(!1),Fb);return()=>clearTimeout(Y)},[h]);const $=Y=>{i(K=>K.filter(me=>me.id!==Y)),d(!1)},ne=(Y,K,me)=>{if(K instanceof Rt){switch(K.code){case"recovery_cooldown":re(K.until??"");return;case"reauth_required":me?b("generic"):j(Y);return;case"movmo_session_required":b("sessionRequired"),t.current.onSessionRequired();return;case"credential_exists":b("exists");return;case"passkey_limit":d(!0);return;case"flow_expired":b("expired");return;case"not_found":if(Y.type==="remove"){$(Y.passkey.id);return}break}b("generic");return}switch(_r(K)){case"cancelled":case"aborted":me&&Y.type==="add"&&b(Y.securityKey?"confirmedAddKey":"confirmedAdd");return;case"exists":b("exists");return;default:b("generic")}},Ie=async(Y,K=!1)=>{if(!z.current){z.current=!0,y(!0),b(null);try{if(Y.type==="add"){const me=await ao(t.current.api,{securityKey:Y.securityKey,signal:ce.begin()});if(!le.current)return;i(ye=>[me,...ye.filter(Te=>Te.id!==me.id)]),p(ye=>ye+1)}else{if(await t.current.api.deletePasskey(Y.passkey.id),!le.current)return;$(Y.passkey.id)}}catch(me){le.current&&ne(Y,me,K)}finally{z.current=!1,le.current&&(y(!1),A(null))}}},_=()=>{const Y=I;j(null),Y&&Ie(Y,!0)},W=()=>{j(null),t.current.onAccountMismatch()};if(r)return u.jsx(Kt,{tone:"neutral",children:Le.framed});if(a==="loading")return u.jsx(Hb,{});if(a==="error")return u.jsxs(Kt,{tone:"neutral",role:"alert",children:[u.jsx("span",{children:Le.generic}),u.jsx(nu,{onClick:()=>void V(),children:Le.retry})]});if(a==="sessionRequired")return u.jsx(mi,{onSignIn:()=>t.current.onSessionRequired()});const Z=oe??e.recoveryUntil??null,ae=Z?new Date(Z).getTime():Number.NaN,L=Z!==null&&(Number.isNaN(ae)||ae>Date.now()),m=c||o.length>=kb,pe=o.length===0;return u.jsxs("div",{className:"flex flex-col gap-4",children:[pe?u.jsx("p",{className:"text-sm text-grayWarm-600",children:Le.empty}):u.jsx("ul",{className:"flex flex-col divide-y divide-grayWarm-200 -my-3",children:o.map(Y=>u.jsx(Xb,{passkey:Y,disabled:f||L,onRemove:()=>A(Y)},Y.id))}),L&&u.jsx(Kt,{tone:"neutral",role:"status",children:Le.recoveryInProgress(Z?Wb(Z):void 0)}),u.jsx("div",{role:"status","aria-live":"polite",children:x&&u.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-grayWarm-700",children:[u.jsx(Ja,{size:20,className:"flex-shrink-0 text-success-600"}),Le.added]})}),l?m&&u.jsx(Kt,{tone:"neutral",children:Le.limit}):u.jsx(Kt,{tone:"neutral",children:Le.unsupported}),C==="sessionRequired"?u.jsx(mi,{onSignIn:()=>t.current.onSessionRequired()}):C&&Bb.has(C)?u.jsx(Kt,{tone:"neutral",role:"status",children:Le[C]}):C&&u.jsx(Kt,{tone:"warning",role:"alert",children:Le[C]}),l&&u.jsxs("div",{className:"flex flex-wrap gap-3",children:[u.jsx(gi,{label:Le.addPasskeyLabel,disabled:f||m||L,onClick:()=>void Ie({type:"add",securityKey:!1}),children:Le.addPasskey}),u.jsx(gi,{label:Le.addSecurityKeyLabel,disabled:f||m||L,onClick:()=>void Ie({type:"add",securityKey:!0}),children:Le.addSecurityKey})]}),pe&&u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Xa,{id:O,checked:F,onCheckedChange:Y=>{M(Y),zl(!Y)}}),u.jsx("label",{htmlFor:O,className:"text-sm font-medium text-grayWarm-700",children:Le.suggestToggle})]}),R&&u.jsx(Zb,{title:tu(R).title,busy:f,onCancel:()=>A(null),onConfirm:()=>void Ie({type:"remove",passkey:R})}),u.jsx(eu,{isOpen:I!==null,action:(I==null?void 0:I.type)??"add",account:e.account,api:e.api,getCurrentUser:e.getCurrentUser,onConfirmed:_,onCancel:()=>j(null),onMismatch:W})]})},Xb=({passkey:e,disabled:t,onRemove:r})=>{const{title:a,badge:n,meta:o,Icon:i}=tu(e);return u.jsxs("li",{className:"flex items-center gap-3 py-3",children:[u.jsx("div",{className:"flex items-center justify-center flex-shrink-0 w-10 h-10 rounded-lg bg-grayWarm-100 text-grayWarm-700",children:u.jsx(i,{size:20})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-base font-semibold text-grayWarm-950",children:a}),n&&u.jsx(_a,{variant:n===Le.kind.synced?"info":"default",children:n})]}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:o})]}),u.jsx("button",{type:"button","aria-label":Le.removeLabel(a),disabled:t,onClick:r,className:"flex items-center justify-center flex-shrink-0 w-9 h-9 rounded-lg bg-grayWarm-100 text-grayWarm-600 transition-colors hover:bg-grayWarm-200 hover:text-grayWarm-800 disabled:opacity-60 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-grayWarm-950",children:u.jsx(Ya,{size:18})})]})},gi=({label:e,disabled:t,onClick:r,children:a})=>u.jsxs("button",{type:"button","aria-label":e,disabled:t,onClick:r,className:"inline-flex items-center gap-2 px-3.5 py-2.5 rounded-lg bg-grayWarm-100 text-sm font-semibold text-grayWarm-950 transition-colors hover:bg-grayWarm-200 disabled:bg-transparent disabled:text-grayWarm-400 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-grayWarm-950",children:[u.jsx(Ml,{size:20}),a]}),Kt=({tone:e,role:t,children:r})=>u.jsxs("div",{role:t,className:Me("flex items-start gap-3 rounded-xl border p-4 text-sm",e==="warning"?"border-warning-200 bg-warning-50 text-warning-700":"border-grayWarm-200 bg-grayWarm-50 text-grayWarm-700"),children:[u.jsx(Rn,{size:20,className:Me("flex-shrink-0",e==="warning"?"text-warning-700":"text-grayWarm-500")}),u.jsx("div",{className:"flex flex-1 flex-wrap items-center justify-between gap-3",children:r})]}),nu=({onClick:e,children:t})=>u.jsx("button",{type:"button",onClick:e,className:"px-3 py-2 rounded-lg bg-grayWarm-100 text-sm font-semibold text-grayWarm-950 transition-colors hover:bg-grayWarm-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-grayWarm-950",children:t}),mi=({onSignIn:e})=>u.jsxs(Kt,{tone:"neutral",children:[u.jsx("span",{children:Le.sessionRequired}),u.jsx(nu,{onClick:e,children:Le.signIn})]}),Hb=()=>u.jsxs("div",{"aria-busy":"true",className:"flex flex-col gap-3",children:[u.jsx("span",{className:"sr-only",children:Le.loading}),[0,1].map(e=>u.jsxs("div",{"aria-hidden":"true",className:"flex items-center gap-3 py-1",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-grayWarm-100 motion-safe:animate-pulse"}),u.jsxs("div",{className:"flex-1 flex flex-col gap-2",children:[u.jsx("div",{className:"h-4 w-40 rounded bg-grayWarm-100 motion-safe:animate-pulse"}),u.jsx("div",{className:"h-3 w-56 rounded bg-grayWarm-100 motion-safe:animate-pulse"})]})]},e))]}),Zb=({title:e,busy:t,onCancel:r,onConfirm:a})=>{const n=Le.remove.title(e);return u.jsx(gn,{isOpen:!0,onClose:r,title:n,header:"none",maxWidthPx:400,children:u.jsxs("div",{className:"flex flex-col gap-5 text-left",children:[u.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-error-100 text-error-600",children:u.jsx(Ya,{size:24})}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("h2",{className:"text-lg font-semibold text-grayWarm-950",children:n}),u.jsx("p",{className:"text-sm text-grayWarm-600",children:Le.remove.body})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(mn,{onClick:r,children:Le.remove.cancel}),u.jsx("button",{type:"button",disabled:t,"aria-busy":t||void 0,onClick:a,className:"w-full h-11 px-4 inline-flex items-center justify-center rounded-xl bg-error-600 text-white font-semibold shadow-sm transition-colors hover:bg-error-700 disabled:opacity-60 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:ring-offset-2",children:Le.remove.confirm})]})]})})},zb={us:{dialCode:"1",lengths:[10]},ca:{dialCode:"1",lengths:[10]},gb:{dialCode:"44",lengths:[10]},au:{dialCode:"61",lengths:[9]},de:{dialCode:"49",lengths:[10,11]},fr:{dialCode:"33",lengths:[9]},it:{dialCode:"39",lengths:[9,10]},es:{dialCode:"34",lengths:[9]},jp:{dialCode:"81",lengths:[10,11]},kr:{dialCode:"82",lengths:[10,11]},in:{dialCode:"91",lengths:[10]},br:{dialCode:"55",lengths:[10,11]},mx:{dialCode:"52",lengths:[10]},cn:{dialCode:"86",lengths:[11]}};function Yb(e,t){if(!e||!e.startsWith("+"))return!1;const r=e.slice(1);if(!/^\d+$/.test(r))return!1;if(t){const a=zb[t.toLowerCase()];if(a){if(!r.startsWith(a.dialCode))return!1;const n=r.slice(a.dialCode.length);return a.lengths.includes(n.length)}}return r.length>=7&&r.length<=15}const Jb=e=>/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/.test(e),Ub=new RegExp("^[\\p{L} '-]{2,100}$","u");function $b(e){return Ub.test(e)?{isValid:!0}:{isValid:!1,message:"must contain only letters, spaces, hyphens, and apostrophes (2-100 characters)"}}exports.AUTOFILL_REFRESH_MS=Ql;exports.AlertCircleIcon=Rn;exports.AuthError=Rt;exports.Avatar=Ds;exports.AvatarFallback=Ls;exports.AvatarImage=Ws;exports.Badge=_a;exports.Button=Ii;exports.COUNTRY_OPTIONS=va;exports.CURRENCY_OPTIONS=Vr;exports.Card=Aa;exports.CardContent=Ea;exports.CardDescription=Pi;exports.CardFooter=Ti;exports.CardHeader=wa;exports.CardTitle=Gi;exports.CeremonyGate=ro;exports.CheckCircleIcon=Ja;exports.Checkbox=Ps;exports.Chip=gl;exports.CloudIcon=jm;exports.CurrencyModal=Zm;exports.DEFAULT_LOCALE=Bl;exports.DateDropdowns=ha;exports.FaceIdIcon=Gl;exports.FingerprintIcon=Pl;exports.IconButton=Ts;exports.Input=Vt;exports.KeyIcon=za;exports.LOCALE_OPTIONS=Br;exports.LOCALE_STORAGE_KEY=Vm;exports.LaptopIcon=Ol;exports.LocaleModal=Lm;exports.LogInIcon=Fl;exports.MailIcon=Fr;exports.Modal=gn;exports.OTPModal=Qm;exports.OtpCodeInput=Ua;exports.PROMPT_COOKIE=Ka;exports.Pagination=fl;exports.PasscodeIcon=Mm;exports.PassengerForm=Gm;exports.PassengerFormSkeleton=Om;exports.PasskeyEnrollPrompt=xa;exports.PasskeyList=Lb;exports.PhoneInput=Jm;exports.PlusIcon=Ml;exports.ReauthDialog=eu;exports.SearchInput=pl;exports.SelectDropdown=Dn;exports.Separator=Ni;exports.ShieldTickIcon=jl;exports.SignInFlow=Gb;exports.SignInModal=Pb;exports.Textarea=dl;exports.Toggle=Xa;exports.ToggleGroup=ul;exports.ToggleGroupItem=cl;exports.TrashIcon=Ya;exports.UsbKeyIcon=Tl;exports.XCloseIcon=kl;exports.classifyWebAuthnError=_r;exports.cookieDomain=Ll;exports.createMovmoAuthApi=rb;exports.createPasskey=$l;exports.detectSupport=no;exports.dismissPrompt=Zl;exports.findCurrencyOption=Hm;exports.findLocaleOption=_m;exports.getCurrencyDisplayText=Vl;exports.getLanguageDisplayName=Dm;exports.getPasskey=Ca;exports.incorrectCode=Wl;exports.neverAsk=Yl;exports.rateLimited=Qa;exports.readPromptState=Yn;exports.recordCodeSignIn=Hl;exports.registerPasskey=ao;exports.safeFocus=Et;exports.setNeverAsk=zl;exports.shouldOfferPasskey=Xl;exports.signInCopy=tt;exports.timeZone=Dl;exports.toAuthError=pt;exports.useMovmoSignIn=Kl;exports.validateEmail=Jb;exports.validateName=$b;exports.validatePhoneNumber=Yb;
|
|
115
115
|
//# sourceMappingURL=index.cjs.map
|