ab-ecosystem-sso 0.1.16 → 0.1.17

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.
@@ -38,7 +38,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
38
38
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uf(e,t){if(e){if(typeof e=="string")return vi(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vi(e,t):void 0}}function vi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gf(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,s,d=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(l=(r=i.call(n)).done)&&(d.push(r.value),d.length!==t);l=!0);}catch(f){u=!0,a=f}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw a}}return d}}function Wf(e){if(Array.isArray(e))return e}function Vf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zf(r.key),r)}}function Hf(e,t,n){return t&&Kf(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zf(e){var t=qf(e,"string");return Rt(t)=="symbol"?t:t+""}function qf(e,t){if(Rt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ct=function(){function e(t,n){Vf(this,e),this.metadata=new re(n);var r=this.getCountryAndCallingCode(t),a=Df(r,2),i=a[0],s=a[1];this.defaultCountry=i,this.defaultCallingCode=s,this.reset()}return Hf(e,[{key:"getCountryAndCallingCode",value:function(n){var r,a;return n&&(Ke(n)?(r=n.defaultCountry,a=n.defaultCallingCode):r=n),r&&!this.metadata.hasCountry(r)&&(r=void 0),[r,a]}},{key:"input",value:function(n){var r=this.parser.input(n,this.state),a=r.digits,i=r.justLeadingPlus;if(i)this.formattedOutput="+";else if(a){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var s;if(this.metadata.hasSelectedNumberingPlan()&&(s=this.formatter.format(a,this.state)),s===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var d=this.state.getNationalDigits();d&&(s=this.formatter.format(d,this.state))}this.formattedOutput=s?this.getFullNumber(s):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var n=this;return this.state=new kc({onCountryChange:function(a){n.country=a},onCallingCodeChange:function(a,i){n.metadata.selectNumberingPlan(i,a),n.formatter.reset(n.metadata.numberingPlan,n.state),n.parser.reset(n.metadata.numberingPlan)}}),this.formatter=new vf({state:this.state,metadata:this.metadata}),this.parser=new _f({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){n.determineTheCountryIfNeeded(),n.formatter.reset(n.metadata.numberingPlan,n.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var n=this.state.digits;if(n)return this._getCountry()}},{key:"_getCountry",value:function(){var n=this.state.country;return n}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(n){var r=this;if(this.isInternational()){var a=function(d){return r.formatter.getInternationalPrefixBeforeCountryCallingCode(r.state,{spacing:!!d})+d},i=this.state.callingCode;return a(i?n?"".concat(i," ").concat(n):i:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return n}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var n=this.state,r=n.nationalSignificantNumber,a=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,i=n.nationalPrefix,s=r,d=a||i;return d&&(s=d+s),s}},{key:"getNonFormattedNumber",value:function(){var n=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(n?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var n=this.getNonFormattedNumber();if(n)return n.replace(/[\+\d]/g,Ce)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var n=this.state.callingCode,r=this.metadata.getCountryCodesForCallingCode(n);return r&&r.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(Dr(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var n=this.state,r=n.digits,a=n.callingCode,i=n.country,s=n.nationalSignificantNumber;if(r){if(this.isInternational())return a?"+"+a+s:"+"+r;if(i||a){var d=i?this.metadata.countryCallingCode():a;return"+"+d+s}}}},{key:"getNumber",value:function(){var n=this.state,r=n.nationalSignificantNumber,a=n.carrierCode,i=n.callingCode,s=this._getCountry();if(r&&!(!s&&!i)){if(s&&s===this.defaultCountry){var d=new re(this.metadata.metadata);d.selectNumberingPlan(s);var l=d.numberingPlan.callingCode(),u=this.metadata.getCountryCodesForCallingCode(l);if(u.length>1){var f=oo(r,{countries:u,metadata:this.metadata.metadata});f&&(s=f)}}var h=new ho(s||i,r,this.metadata.metadata);return a&&(h.carrierCode=a),h}}},{key:"isPossible",value:function(){var n=this.getNumber();return n?n.isPossible():!1}},{key:"isValid",value:function(){var n=this.getNumber();return n?n.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])}();function xi(e){return new re(e).getCountries()}function Yf(e,t,n){return n||(n=t,t=void 0),new ct(t,n).input(e)}function vo(e){var t=e.inputFormat,n=e.country,r=e.metadata;return t==="NATIONAL_PART_OF_INTERNATIONAL"?"+".concat(Ge(n,r)):""}function xr(e,t){return t&&(e=e.slice(t.length),e[0]===" "&&(e=e.slice(1))),e}function Zf(e,t,n){if(!(n&&n.ignoreRest)){var r=function(i){if(n)switch(i){case"end":n.ignoreRest=!0;break}};return $o(e,t,r)}}function xo(e){var t=e.onKeyDown,n=e.inputFormat;return c.useCallback(function(r){if(r.keyCode===Xf&&n==="INTERNATIONAL"&&r.target instanceof HTMLInputElement&&Jf(r.target)===Qf.length){r.preventDefault();return}t&&t(r)},[t,n])}function Jf(e){return e.selectionStart}var Xf=8,Qf="+",e0=["onKeyDown","country","inputFormat","metadata","international","withCountryCallingCode"];function Cr(){return Cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cr.apply(this,arguments)}function t0(e,t){if(e==null)return{};var n=n0(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function n0(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function r0(e){function t(n,r){var a=n.onKeyDown,i=n.country,s=n.inputFormat,d=n.metadata,l=d===void 0?e:d;n.international,n.withCountryCallingCode;var u=t0(n,e0),f=c.useCallback(function($){var v=new ct(i,l),b=vo({inputFormat:s,country:i,metadata:l}),g=v.input(b+$),m=v.getTemplate();return b&&(g=xr(g,b),m&&(m=xr(m,b))),{text:g,template:m}},[i,l]),h=xo({onKeyDown:a,inputFormat:s});return c.createElement(fn,Cr({},u,{ref:r,parse:Zf,format:f,onKeyDown:h}))}return t=c.forwardRef(t),t.propTypes={value:j.string.isRequired,onChange:j.func.isRequired,onKeyDown:j.func,country:j.string,inputFormat:j.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:j.object},t}const a0=r0();var i0=["value","onChange","onKeyDown","country","inputFormat","metadata","inputComponent","international","withCountryCallingCode"];function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wr.apply(this,arguments)}function o0(e,t){if(e==null)return{};var n=s0(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function s0(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function d0(e){function t(n,r){var a=n.value,i=n.onChange,s=n.onKeyDown,d=n.country,l=n.inputFormat,u=n.metadata,f=u===void 0?e:u,h=n.inputComponent,$=h===void 0?"input":h;n.international,n.withCountryCallingCode;var v=o0(n,i0),b=vo({inputFormat:l,country:d,metadata:f}),g=c.useCallback(function(y){var S=$r(y.target.value);if(S===a){var T=Ci(b,S,d,f);T.indexOf(y.target.value)===0&&(S=S.slice(0,-1))}i(S)},[b,a,i,d,f]),m=xo({onKeyDown:s,inputFormat:l});return c.createElement($,wr({},v,{ref:r,value:Ci(b,a,d,f),onChange:g,onKeyDown:m}))}return t=c.forwardRef(t),t.propTypes={value:j.string.isRequired,onChange:j.func.isRequired,onKeyDown:j.func,country:j.string,inputFormat:j.oneOf(["INTERNATIONAL","NATIONAL_PART_OF_INTERNATIONAL","NATIONAL","INTERNATIONAL_OR_NATIONAL"]).isRequired,metadata:j.object,inputComponent:j.elementType},t}const l0=d0();function Ci(e,t,n,r){return xr(Yf(e+t,n,r),e)}function u0(e){return wi(e[0])+wi(e[1])}function wi(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var c0=["value","onChange","options","disabled","readOnly"],f0=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function p0(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=h0(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
39
39
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h0(e,t){if(e){if(typeof e=="string")return Si(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Si(e,t)}}function Si(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(this,arguments)}function Co(e,t){if(e==null)return{};var n=m0(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function m0(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function wo(e){var t=e.value,n=e.onChange,r=e.options,a=e.disabled,i=e.readOnly,s=Co(e,c0),d=c.useCallback(function(l){var u=l.target.value;n(u==="ZZ"?void 0:u)},[n]);return c.useMemo(function(){return Po(r,t)},[r,t]),c.createElement("select",mn({},s,{disabled:a||i,readOnly:i,value:t||"ZZ",onChange:d}),r.map(function(l){var u=l.value,f=l.label,h=l.divider;return c.createElement("option",{key:h?"|":u||"ZZ",value:h?"|":u||"ZZ",disabled:!!h,style:h?$0:void 0},f)}))}wo.propTypes={value:j.string,onChange:j.func.isRequired,options:j.arrayOf(j.shape({value:j.string,label:j.string,divider:j.bool})).isRequired,disabled:j.bool,readOnly:j.bool};var $0={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function So(e){var t=e.value,n=e.options,r=e.className,a=e.iconComponent;e.getIconAspectRatio;var i=e.arrowComponent,s=i===void 0?g0:i,d=e.unicodeFlags,l=Co(e,f0),u=c.useMemo(function(){return Po(n,t)},[n,t]);return c.createElement("div",{className:"PhoneInputCountry"},c.createElement(wo,mn({},l,{value:t,options:n,className:cn("PhoneInputCountrySelect",r)})),u&&(d&&t?c.createElement("div",{className:"PhoneInputCountryIconUnicode"},u0(t)):c.createElement(a,{"aria-hidden":!0,country:t,label:u.label,aspectRatio:d?1:void 0})),c.createElement(s,null))}So.propTypes={iconComponent:j.elementType,arrowComponent:j.elementType,unicodeFlags:j.bool};function g0(){return c.createElement("div",{className:"PhoneInputCountrySelectArrow"})}function Po(e,t){for(var n=p0(e),r;!(r=n()).done;){var a=r.value;if(!a.divider&&y0(a.value,t))return a}}function y0(e,t){return e==null?t==null:e===t}var b0=["country","countryName","flags","flagUrl"];function Sr(){return Sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sr.apply(this,arguments)}function v0(e,t){if(e==null)return{};var n=x0(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x0(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Gr(e){var t=e.country,n=e.countryName,r=e.flags,a=e.flagUrl,i=v0(e,b0);return r&&r[t]?r[t]({title:n}):c.createElement("img",Sr({},i,{alt:n,role:n?void 0:"presentation",src:a.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}Gr.propTypes={country:j.string.isRequired,countryName:j.string.isRequired,flags:j.objectOf(j.elementType),flagUrl:j.string.isRequired};var C0=["aspectRatio"],w0=["title"],S0=["title"];function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$n.apply(this,arguments)}function Wr(e,t){if(e==null)return{};var n=P0(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function P0(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Pn(e){var t=e.aspectRatio,n=Wr(e,C0);return t===1?c.createElement(jo,n):c.createElement(No,n)}Pn.propTypes={title:j.string.isRequired,aspectRatio:j.number};function No(e){var t=e.title,n=Wr(e,w0);return c.createElement("svg",$n({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),c.createElement("title",null,t),c.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},c.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),c.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),c.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),c.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),c.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),c.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),c.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}No.propTypes={title:j.string.isRequired};function jo(e){var t=e.title,n=Wr(e,S0);return c.createElement("svg",$n({},n,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),c.createElement("title",null,t),c.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},c.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),c.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),c.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),c.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),c.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),c.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),c.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}jo.propTypes={title:j.string.isRequired};function N0(e){if(e.length<2||e[0]!=="+")return!1;for(var t=1;t<e.length;){var n=e.charCodeAt(t);if(!(n>=48&&n<=57))return!1;t++}return!0}function Ao(e){N0(e)||console.error("[react-phone-number-input] Expected the initial `value` to be a E.164 phone number. Got",e)}function j0(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=A0(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
40
40
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A0(e,t){if(e){if(typeof e=="string")return Pi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pi(e,t)}}function Pi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E0(e,t){if(!t)return e;for(var n=[],r=[],a=n,i=function(){var u=d.value;if(u==="|")a.push({divider:!0});else if(u==="..."||u==="…")a=r;else{var f;u==="🌐"?f=void 0:f=u;var h=e.indexOf(e.filter(function(v){return v.value===f})[0]),$=e[h];e.splice(h,1),a.push($)}},s=j0(t),d;!(d=s()).done;)i();return n.concat(e).concat(r)}function O0(e,t){if(e&&(e=e.filter(function(n){switch(n){case"🌐":case"|":case"...":case"…":return!0;default:return Nn(n,t)}}),e.length>0))return e}function Nn(e,t){return no(e,t)?!0:(console.error("Country not found: ".concat(e)),!1)}function Eo(e,t){return e&&(e=e.filter(function(n){return Nn(n,t)}),e.length===0&&(e=void 0)),e}var T0=["country","label","aspectRatio"];function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}function I0(e,t){if(e==null)return{};var n=R0(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function R0(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Oo(e){var t=e.flags,n=e.flagUrl,r=e.flagComponent,a=e.internationalIcon;function i(s){var d=s.country,l=s.label,u=s.aspectRatio,f=I0(s,T0),h=a===Pn?u:void 0;return c.createElement("div",Pr({},f,{className:cn("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":h===1,"PhoneInputCountryIcon--border":d})}),d?c.createElement(r,{country:d,countryName:l,flags:t,flagUrl:n,className:"PhoneInputCountryIconImg"}):c.createElement(a,{title:l,aspectRatio:h,className:"PhoneInputCountryIconImg"}))}return i.propTypes={country:j.string,label:j.string.isRequired,aspectRatio:j.number},i}Oo({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:Gr,internationalIcon:Pn});function F0(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=_0(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _0(e,t){if(e){if(typeof e=="string")return Ni(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ni(e,t)}}function Ni(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k0(e,t){for(var n=F0(e),r;!(r=n()).done;){var a=r.value;a&&L0(a,t)}}function L0(e,t){typeof e=="function"?e(t):e.current=t}var To=j.shape({country_calling_codes:j.object.isRequired,countries:j.object.isRequired}),Io=j.objectOf(j.string);function Oe(e,t){var n="+"+Ge(e,t);return n}function M0(e){var t=e.value,n=e.phoneNumber,r=e.defaultCountry,a=e.getAnyCountry,i=e.countries,s=e.required,d=e.metadata,l;return n&&n.country?l=n.country:r&&(!t||it(t,r,d))&&(l=r),i&&i.indexOf(l)<0&&(l=void 0),!l&&s&&i&&i.length>0&&(l=a()),l}function D0(e){var t=e.countries,n=e.countryNames,r=e.addInternationalOption,a=e.compareStringsLocales,i=e.compareStrings;i||(i=H0);var s=t.map(function(d){return{value:d,label:n[d]||d}});return s.sort(function(d,l){return i(d.label,l.label,a)}),r&&s.unshift({label:n.ZZ}),s}function Ro(e,t){return yo(e||"",t)}function B0(e){return e.formatNational().replace(/\D/g,"")}function U0(e,t){var n=t.prevCountry,r=t.newCountry,a=t.metadata,i=t.useNationalFormat;if(n===r)return e;if(!e)return i?"":r?Oe(r,a):"";if(r){if(e[0]==="+"){if(i)return e.indexOf("+"+Ge(r,a))===0?z0(e,r,a):"";if(n){var s=Oe(r,a);return e.indexOf(s)===0?e:s}else{var d=Oe(r,a);return e.indexOf(d)===0?e:d}}}else if(e[0]!=="+")return rt(e,n,a)||"";return e}function rt(e,t,n){if(e){if(e[0]==="+"){if(e==="+")return;var r=new ct(t,n);return r.input(e),r.getNumberValue()}if(t){var a=_o(e,t,n);return"+".concat(Ge(t,n)).concat(a||"")}}}function G0(e,t,n){var r=_o(e,t,n);if(r){var a=r.length-W0(t,n);if(a>0)return e.slice(0,e.length-a)}return e}function W0(e,t){return t=new re(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}function Fo(e,t){var n=t.country,r=t.countries,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.required,d=t.metadata;if(e==="+")return n;var l=K0(e,d);if(l)return!r||r.indexOf(l)>=0?l:void 0;if(n){if(it(e,n,d)){if(i&&it(e,i,d))return i;if(a&&it(e,a,d))return a;if(!s)return}else if(!s)return}return n}function V0(e,t){var n=t.prevPhoneDigits,r=t.country,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.countryRequired,d=t.getAnyCountry,l=t.countries,u=t.international,f=t.limitMaxLength,h=t.countryCallingCodeEditable,$=t.metadata;if(u&&h===!1&&r){var v=Oe(r,$);if(e.indexOf(v)!==0){var b,g=e&&e[0]!=="+";return g?(e=v+e,b=rt(e,r,$)):e=v,{phoneDigits:e,value:b,country:r}}}u===!1&&r&&e&&e[0]==="+"&&(e=ji(e,r,$)),e&&r&&f&&(e=G0(e,r,$)),e&&e[0]!=="+"&&(!r||u)&&(e="+"+e),!e&&n&&n[0]==="+"&&(u?r=void 0:r=a),e==="+"&&n&&n[0]==="+"&&n.length>1&&(r=void 0);var m;return e&&(e[0]==="+"&&(e==="+"||r&&Oe(r,$).indexOf(e)===0)?m=void 0:m=rt(e,r,$)),m&&(r=Fo(m,{country:r,countries:l,defaultCountry:a,latestCountrySelectedByUser:i,required:!1,metadata:$}),u===!1&&r&&e&&e[0]==="+"&&(e=ji(e,r,$),m=rt(e,r,$))),!r&&s&&(r=a||d()),{phoneDigits:e,country:r,value:m}}function ji(e,t,n){if(e.indexOf(Oe(t,n))===0){var r=new ct(t,n);r.input(e);var a=r.getNumber();return a?a.formatNational().replace(/\D/g,""):""}else return e.replace(/\D/g,"")}function K0(e,t){var n=new ct(null,t);return n.input(e),n.getCountry()}function H0(e,t,n){return String.prototype.localeCompare?e.localeCompare(t,n):e<t?-1:e>t?1:0}function z0(e,t,n){if(t){var r="+"+Ge(t,n);if(e.length<r.length){if(r.indexOf(e)===0)return""}else if(e.indexOf(r)===0)return e.slice(r.length)}for(var a=0,i=Object.keys(n.country_calling_codes);a<i.length;a++){var s=i[a];if(e.indexOf(s)===1)return e.slice(1+s.length)}return""}function _o(e,t,n){var r=new ct(t,n);r.input(e);var a=r.getNumber();return a&&a.nationalNumber}function it(e,t,n){for(var r=Oe(t,n),a=0;a<e.length&&a<r.length;){if(e[a]!==r[a])return!1;a++}return!0}function ko(e){var t=e.value,n=e.phoneNumber,r=e.defaultCountry,a=e.international,i=e.useNationalFormat,s=e.metadata;return(a===!1||i)&&n&&n.country?B0(n):!t&&a&&r?Oe(r,s):t}function Ft(e){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(e)}function Ai(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ai(Object(n),!0).forEach(function(r){q0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ai(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q0(e,t,n){return t=Y0(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y0(e){var t=Z0(e,"string");return Ft(t)=="symbol"?t:t+""}function Z0(e,t){if(Ft(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ft(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function J0(e,t,n){var r=e.metadata,a=e.countries,i=e.defaultCountry,s=e.value,d=e.reset,l=e.international,u=e.displayInitialValueAsLocalNumber,f=e.initialValueFormat,h=t.defaultCountry,$=t.value,v=t.reset;n.country;var b=n.value,g=n.hasUserSelectedACountry,m=n.latestCountrySelectedByUser,y=function(I){return ko(dn(dn({},I),{},{international:l,useNationalFormat:u||f==="national",metadata:r}))};if(d!==v)return{phoneDigits:y({value:void 0,defaultCountry:i}),value:void 0,country:i,latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};if(i!==h){var S=!i||Nn(i,r),T=!b||l&&b===y({value:void 0,defaultCountry:h}),P=!s&&T;if(!g&&S&&P)return{country:i,phoneDigits:y({value:void 0,defaultCountry:i}),value:void 0}}if(!Ei(s,$)&&!Ei(s,b)){var w,A;if(s){s&&Ao(s),w=Ro(s,r);var H=Eo(a,r);w&&w.country?(!H||H.indexOf(w.country)>=0)&&(A=w.country):(A=Fo(s,{country:void 0,countries:H,metadata:r}),A||i&&s.indexOf(Oe(i,r))===0&&(A=i))}var G;if(s){if(m){var x=A?m===A:it(s,m,r);x?A||(A=m):G={latestCountrySelectedByUser:void 0}}}else G={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};return dn(dn({},G),{},{phoneDigits:y({phoneNumber:w,value:s,defaultCountry:i}),value:s,country:s?A:i})}}function Ei(e,t){return e===null&&(e=void 0),t===null&&(t=void 0),e===t}var X0=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function dt(e){"@babel/helpers - typeof";return dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(e)}function Oi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oi(Object(n),!0).forEach(function(r){xe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}function Q0(e,t){if(e==null)return{};var n=e1(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function e1(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function t1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ti(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Do(r.key),r)}}function n1(e,t,n){return t&&Ti(e.prototype,t),n&&Ti(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function r1(e,t,n){return t=gn(t),a1(e,Mo()?Reflect.construct(t,n||[],gn(e).constructor):t.apply(e,n))}function a1(e,t){if(t&&(dt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i1(e)}function i1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mo=function(){return!!e})()}function gn(e){return gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gn(e)}function o1(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nr(e,t)}function Nr(e,t){return Nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Nr(e,t)}function xe(e,t,n){return t=Do(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e){var t=s1(e,"string");return dt(t)=="symbol"?t:t+""}function s1(e,t){if(dt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var d1=function(e){function t(n){var r;t1(this,t),r=r1(this,t,[n]),xe(r,"setInputRef",function(m){k0([r.props.inputRef,r.inputRef],m)}),xe(r,"isCountrySupportedWithError",function(m){var y=r.props.metadata;return Nn(m,y)}),xe(r,"onCountryChange",function(m){var y=r.props,S=y.international,T=y.metadata,P=y.onChange,w=y.focusInputOnCountrySelection,A=r.state,H=A.phoneDigits,G=A.country,x=U0(H,{prevCountry:G,newCountry:m,metadata:T,useNationalFormat:!S}),B=rt(x,m,T);w&&r.inputRef.current.focus(),r.setState({country:m,latestCountrySelectedByUser:m,hasUserSelectedACountry:!0,phoneDigits:x,value:B},function(){P(B)})}),xe(r,"onChange",function(m){var y=r.props,S=y.defaultCountry,T=y.onChange,P=y.addInternationalOption,w=y.international,A=y.limitMaxLength,H=y.countryCallingCodeEditable,G=y.metadata,x=r.state,B=x.countries,I=x.phoneDigits,D=x.country,ie=x.latestCountrySelectedByUser,ne=V0(m,{prevPhoneDigits:I,country:D,countryRequired:!P,defaultCountry:S,latestCountrySelectedByUser:ie,getAnyCountry:function(){return r.getFirstSupportedCountry({countries:B})},countries:B,international:w,limitMaxLength:A,countryCallingCodeEditable:H,metadata:G}),ce=ne.phoneDigits,Q=ne.country,te=ne.value,de={phoneDigits:ce,value:te,country:Q};ie&&te&&!it(te,ie,G)&&(de.latestCountrySelectedByUser=void 0),H===!1&&!te&&ce===r.state.phoneDigits&&(de.forceRerender={}),r.setState(de,function(){return T(te)})}),xe(r,"_onFocus",function(){return r.setState({isFocused:!0})}),xe(r,"_onBlur",function(){return r.setState({isFocused:!1})}),xe(r,"onFocus",function(m){r._onFocus();var y=r.props.onFocus;y&&y(m)}),xe(r,"onBlur",function(m){var y=r.props.onBlur;r._onBlur(),y&&y(m)}),xe(r,"onCountryFocus",function(m){r._onFocus();var y=r.props.countrySelectProps;if(y){var S=y.onFocus;S&&S(m)}}),xe(r,"onCountryBlur",function(m){r._onBlur();var y=r.props.countrySelectProps;if(y){var S=y.onBlur;S&&S(m)}}),r.inputRef=c.createRef();var a=r.props,i=a.value;a.labels;var s=a.international,d=a.addInternationalOption,l=a.displayInitialValueAsLocalNumber,u=a.initialValueFormat,f=a.metadata,h=r.props,$=h.defaultCountry,v=h.countries;$&&(r.isCountrySupportedWithError($)||($=void 0)),i&&Ao(i),v=Eo(v,f);var b=Ro(i,f);r.CountryIcon=Oo(r.props);var g=M0({value:i,phoneNumber:b,defaultCountry:$,required:!d,countries:v||xi(f),getAnyCountry:function(){return r.getFirstSupportedCountry({countries:v})},metadata:f});return r.state={props:r.props,country:g,countries:v,phoneDigits:ko({value:i,phoneNumber:b,defaultCountry:$,international:s,useNationalFormat:l||u==="national",metadata:f}),value:i},r}return o1(t,e),n1(t,[{key:"componentDidMount",value:function(){var r=this.props.onCountryChange,a=this.props.defaultCountry,i=this.state.country;r&&(a&&(this.isCountrySupportedWithError(a)||(a=void 0)),i!==a&&r(i))}},{key:"componentDidUpdate",value:function(r,a){var i=this.props.onCountryChange,s=this.state.country;i&&s!==a.country&&i(s)}},{key:"getCountrySelectOptions",value:function(r){var a=r.countries,i=this.props,s=i.international,d=i.countryCallingCodeEditable,l=i.countryOptionsOrder,u=i.addInternationalOption,f=i.labels,h=i.locales,$=i.metadata;return this.useMemoCountrySelectOptions(function(){return E0(D0({countries:a||xi($),countryNames:f,addInternationalOption:s&&d===!1?!1:u,compareStringsLocales:h}),O0(l,$))},[a,l,u,f,$])}},{key:"useMemoCountrySelectOptions",value:function(r,a){return(!this.countrySelectOptionsMemoDependencies||!u1(a,this.countrySelectOptionsMemoDependencies))&&(this.countrySelectOptionsMemo=r(),this.countrySelectOptionsMemoDependencies=a),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(r){var a=r.countries,i=this.getCountrySelectOptions({countries:a});return i[0].value}},{key:"render",value:function(){var r=this.props,a=r.name,i=r.disabled,s=r.readOnly,d=r.autoComplete,l=r.style,u=r.className;r.inputRef;var f=r.inputComponent,h=r.numberInputProps,$=r.smartCaret,v=r.countrySelectComponent,b=r.countrySelectProps,g=r.containerComponent,m=r.containerComponentProps;r.defaultCountry,r.countries,r.countryOptionsOrder;var y=r.labels;r.flags,r.flagComponent,r.flagUrl,r.addInternationalOption,r.internationalIcon,r.displayInitialValueAsLocalNumber,r.initialValueFormat,r.onCountryChange,r.limitMaxLength,r.countryCallingCodeEditable,r.focusInputOnCountrySelection,r.reset;var S=r.metadata,T=r.international;r.locales;var P=Q0(r,X0),w=this.state,A=w.country,H=w.countries,G=w.phoneDigits,x=w.isFocused,B=$?a0:l0,I=this.getCountrySelectOptions({countries:H});return c.createElement(g,ot({style:l,className:cn(u,"PhoneInput",{"PhoneInput--focus":x,"PhoneInput--disabled":i,"PhoneInput--readOnly":s})},m),c.createElement(v,ot({name:a?"".concat(a,"Country"):void 0,"aria-label":y.country},b,{value:A,options:I,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:i||b&&b.disabled,readOnly:s||b&&b.readOnly,iconComponent:this.CountryIcon})),c.createElement(B,ot({ref:this.setInputRef,type:"tel",autoComplete:d},h,P,{inputFormat:T===!0?"INTERNATIONAL":T===!1?"NATIONAL":"INTERNATIONAL_OR_NATIONAL",international:T?!0:void 0,withCountryCallingCode:T?!0:void 0,name:a,metadata:S,country:A,value:G||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:i,readOnly:s,inputComponent:f,className:cn("PhoneInputInput",h&&h.className,P.className)})))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return Lo({props:r},J0(r,a.props,a))}}])}(c.PureComponent),Bo=c.forwardRef(function(e,t){return c.createElement(d1,ot({},l1(e),{inputRef:t}))});Bo.propTypes={value:j.string,onChange:j.func.isRequired,onFocus:j.func,onBlur:j.func,disabled:j.bool,readOnly:j.bool,autoComplete:j.string,initialValueFormat:j.oneOf(["national"]),displayInitialValueAsLocalNumber:j.bool,defaultCountry:j.string,countries:j.arrayOf(j.string),labels:Io,locales:j.oneOfType([j.string,j.arrayOf(j.string)]),flagUrl:j.string,flags:j.objectOf(j.elementType),flagComponent:j.elementType,addInternationalOption:j.bool,internationalIcon:j.elementType,countryOptionsOrder:j.arrayOf(j.string),style:j.object,className:j.string,countrySelectComponent:j.elementType,countrySelectProps:j.object,inputComponent:j.elementType,numberInputProps:j.object,containerComponent:j.elementType,containerComponentProps:j.object,smartCaret:j.bool,international:j.bool,limitMaxLength:j.bool,countryCallingCodeEditable:j.bool,metadata:To,onCountryChange:j.func,focusInputOnCountrySelection:j.bool};var Ii={autoComplete:"tel",countrySelectComponent:So,flagComponent:Gr,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:Pn,inputComponent:"input",containerComponent:"div",reset:j.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};function l1(e){e=Lo({},e);for(var t in Ii)e[t]===void 0&&(e[t]=Ii[t]);return e}function u1(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;){if(e[n]!==t[n])return!1;n++}return!0}const c1={ext:"ext.",country:"Phone number country",phone:"Phone",AC:"Ascension Island",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin (French Part)",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TA:"Tristan da Cunha",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XA:"Abkhazia",XK:"Kosovo",XO:"South Ossetia",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"International"};var f1=["metadata","labels"];function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}function p1(e,t){if(e==null)return{};var n=h1(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function h1(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Uo(e){var t=c.forwardRef(function(n,r){var a=n.metadata,i=a===void 0?e:a,s=n.labels,d=s===void 0?c1:s,l=p1(n,f1);return c.createElement(Bo,jr({},l,{ref:r,metadata:i,labels:d}))});return t.propTypes={metadata:To,labels:Io},t}Uo();function m1(e,t){var n=Array.prototype.slice.call(t);return n.push(Yi),e.apply(this,n)}const Ar=Uo(Yi);function $1(){return m1(yo,arguments)}const ar={US:"USD",GB:"GBP",CA:"CAD",AU:"AUD",DE:"EUR",FR:"EUR",IN:"INR",JP:"JPY",BR:"BRL",MX:"MXN",SG:"SGD",AE:"AED",ZA:"ZAR",NG:"NGN",KE:"KES",ES:"EUR",IT:"EUR",NL:"EUR",PT:"EUR",BE:"EUR",AT:"EUR",IE:"EUR",FI:"EUR",GR:"EUR",NZ:"NZD",CH:"CHF",SE:"SEK",NO:"NOK",DK:"DKK",PL:"PLN",CZ:"CZK",HU:"HUF",RO:"RON",BG:"BGN",HR:"EUR",SK:"EUR",SI:"EUR",LT:"EUR",LV:"EUR",EE:"EUR",CY:"EUR",MT:"EUR",LU:"EUR",CN:"CNY",KR:"KRW",TW:"TWD",HK:"HKD",TH:"THB",MY:"MYR",ID:"IDR",PH:"PHP",VN:"VND",PK:"PKR",BD:"BDT",LK:"LKR",EG:"EGP",SA:"SAR",QA:"QAR",KW:"KWD",BH:"BHD",OM:"OMR",JO:"JOD",IL:"ILS",TR:"TRY",RU:"RUB",UA:"UAH",CL:"CLP",CO:"COP",PE:"PEN",AR:"ARS",UY:"UYU",GH:"GHS",TZ:"TZS",UG:"UGX",RW:"RWF",ET:"ETB",MA:"MAD",TN:"TND"},Go=[{code:"US",name:"United States"},{code:"GB",name:"United Kingdom"},{code:"CA",name:"Canada"},{code:"AU",name:"Australia"},{code:"NZ",name:"New Zealand"},{code:"DE",name:"Germany"},{code:"FR",name:"France"},{code:"ES",name:"Spain"},{code:"IT",name:"Italy"},{code:"NL",name:"Netherlands"},{code:"BE",name:"Belgium"},{code:"AT",name:"Austria"},{code:"CH",name:"Switzerland"},{code:"IE",name:"Ireland"},{code:"PT",name:"Portugal"},{code:"SE",name:"Sweden"},{code:"NO",name:"Norway"},{code:"DK",name:"Denmark"},{code:"FI",name:"Finland"},{code:"PL",name:"Poland"},{code:"CZ",name:"Czech Republic"},{code:"IN",name:"India"},{code:"JP",name:"Japan"},{code:"CN",name:"China"},{code:"KR",name:"South Korea"},{code:"TW",name:"Taiwan"},{code:"HK",name:"Hong Kong"},{code:"SG",name:"Singapore"},{code:"MY",name:"Malaysia"},{code:"TH",name:"Thailand"},{code:"ID",name:"Indonesia"},{code:"PH",name:"Philippines"},{code:"VN",name:"Vietnam"},{code:"PK",name:"Pakistan"},{code:"BD",name:"Bangladesh"},{code:"LK",name:"Sri Lanka"},{code:"BR",name:"Brazil"},{code:"MX",name:"Mexico"},{code:"AR",name:"Argentina"},{code:"CL",name:"Chile"},{code:"CO",name:"Colombia"},{code:"PE",name:"Peru"},{code:"AE",name:"United Arab Emirates"},{code:"SA",name:"Saudi Arabia"},{code:"QA",name:"Qatar"},{code:"KW",name:"Kuwait"},{code:"IL",name:"Israel"},{code:"TR",name:"Turkey"},{code:"EG",name:"Egypt"},{code:"ZA",name:"South Africa"},{code:"NG",name:"Nigeria"},{code:"KE",name:"Kenya"},{code:"GH",name:"Ghana"},{code:"TZ",name:"Tanzania"},{code:"UG",name:"Uganda"},{code:"MA",name:"Morocco"},{code:"RU",name:"Russia"},{code:"UA",name:"Ukraine"}];function g1(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return e?{"America/New_York":"US","America/Chicago":"US","America/Denver":"US","America/Los_Angeles":"US","America/Phoenix":"US","America/Anchorage":"US","Pacific/Honolulu":"US","America/Toronto":"CA","America/Vancouver":"CA","America/Edmonton":"CA","America/Winnipeg":"CA","America/Halifax":"CA","Europe/London":"GB","Europe/Dublin":"IE","Europe/Berlin":"DE","Europe/Paris":"FR","Europe/Madrid":"ES","Europe/Rome":"IT","Europe/Amsterdam":"NL","Europe/Brussels":"BE","Europe/Vienna":"AT","Europe/Zurich":"CH","Europe/Lisbon":"PT","Europe/Stockholm":"SE","Europe/Oslo":"NO","Europe/Copenhagen":"DK","Europe/Helsinki":"FI","Europe/Warsaw":"PL","Europe/Prague":"CZ","Europe/Budapest":"HU","Europe/Bucharest":"RO","Europe/Sofia":"BG","Europe/Athens":"GR","Europe/Istanbul":"TR","Europe/Moscow":"RU","Europe/Kiev":"UA","Asia/Kolkata":"IN","Asia/Calcutta":"IN","Asia/Mumbai":"IN","Asia/Tokyo":"JP","Asia/Shanghai":"CN","Asia/Hong_Kong":"HK","Asia/Seoul":"KR","Asia/Taipei":"TW","Asia/Singapore":"SG","Asia/Kuala_Lumpur":"MY","Asia/Bangkok":"TH","Asia/Jakarta":"ID","Asia/Manila":"PH","Asia/Ho_Chi_Minh":"VN","Asia/Karachi":"PK","Asia/Dhaka":"BD","Asia/Colombo":"LK","Asia/Dubai":"AE","Asia/Riyadh":"SA","Asia/Qatar":"QA","Asia/Kuwait":"KW","Asia/Jerusalem":"IL","Australia/Sydney":"AU","Australia/Melbourne":"AU","Australia/Brisbane":"AU","Australia/Perth":"AU","Australia/Adelaide":"AU","Pacific/Auckland":"NZ","America/Sao_Paulo":"BR","America/Mexico_City":"MX","America/Argentina/Buenos_Aires":"AR","America/Santiago":"CL","America/Bogota":"CO","America/Lima":"PE","Africa/Johannesburg":"ZA","Africa/Lagos":"NG","Africa/Nairobi":"KE","Africa/Accra":"GH","Africa/Cairo":"EG","Africa/Casablanca":"MA","Africa/Dar_es_Salaam":"TZ","Africa/Kampala":"UG"}[e]:void 0}catch{return}}function y1({projectId:e,classNames:t,onSuccess:n,onError:r,onLoginClick:a,apiBaseUrl:i}){const{config:s,isLoading:d,error:l}=lt(),[u,f]=c.useState(""),[h,$]=c.useState(""),v=c.useRef(null),[b,g]=c.useState(),[m,y]=c.useState(),[S,T]=c.useState(null),P=vn({firstName:"",lastName:"",email:"",password:"",phoneNumber:"",country:"",currency:""});c.useEffect(()=>{const x=g1();if(x){y(x),P.setValue("country",x);const B=ar[x];B&&P.setValue("currency",B)}},[]),c.useEffect(()=>{let x=!1;return ki(e,i).then(B=>{x||T(B)}).catch(()=>{x||T([])}),()=>{x=!0}},[e,i]),c.useEffect(()=>{if(!S)return;const x=P.values.currency;x&&!S.some(B=>B.code===x)&&P.setValue("currency","")},[S]);const w=x=>{if(y(x),x){P.setValue("country",x);const B=ar[x];B&&P.setValue("currency",B)}},A=x=>{if(P.setValue("country",x),x){y(x);const B=ar[x];B&&P.setValue("currency",B)}},H={firstName:x=>{if(!x)return"First name is required"},lastName:x=>{if(!x)return"Last name is required"},email:x=>{if(!x)return"Email is required";if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x))return"Invalid email"},password:x=>{if(!x)return"Password is required";if(x.length<8)return"Password must be at least 8 characters"}},G=async x=>{var B;if(s!=null&&s.captcha.enabled&&!u){$("Please complete the captcha verification");return}$("");try{const I=await qs(e,{firstName:x.firstName,lastName:x.lastName,email:x.email,password:x.password,phoneNumber:b||void 0,country:x.country||void 0,currency:x.currency||void 0,captchaToken:u||void 0},i);n==null||n(I)}catch(I){(B=v.current)==null||B.reset(),f("");const D=I instanceof ae||I instanceof Error?I:new Error("Signup failed");throw r==null||r(D),D}};return d||l||!s?o.jsx(xt,{type:"signup",classNames:t,isLoading:d,error:l}):o.jsx(Ue,{config:s,title:"Create Account",description:"Fill in your details to get started",classNames:t,children:o.jsxs("form",{onSubmit:P.handleSubmit(G,H),children:[o.jsxs("div",{className:"aas-row",children:[o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-firstName",className:t==null?void 0:t.label,children:"First Name"}),o.jsx(Be,{id:"signup-firstName",type:"text",placeholder:"John",value:P.values.firstName,onChange:x=>P.setValue("firstName",x.target.value),className:t==null?void 0:t.input,autoComplete:"given-name"}),P.errors.firstName&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.firstName})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-lastName",className:t==null?void 0:t.label,children:"Last Name"}),o.jsx(Be,{id:"signup-lastName",type:"text",placeholder:"Doe",value:P.values.lastName,onChange:x=>P.setValue("lastName",x.target.value),className:t==null?void 0:t.input,autoComplete:"family-name"}),P.errors.lastName&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.lastName})]})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-email",className:t==null?void 0:t.label,children:"Email"}),o.jsx(Be,{id:"signup-email",type:"email",placeholder:"you@example.com",value:P.values.email,onChange:x=>P.setValue("email",x.target.value),className:t==null?void 0:t.input,autoComplete:"email"}),P.errors.email&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.email})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-password",className:t==null?void 0:t.label,children:"Password"}),o.jsx(Be,{id:"signup-password",type:"password",placeholder:"••••••••",value:P.values.password,onChange:x=>P.setValue("password",x.target.value),className:t==null?void 0:t.input,autoComplete:"new-password"}),P.errors.password&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.password})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{className:t==null?void 0:t.label,children:"Phone Number"}),o.jsx(Ar,{international:!0,defaultCountry:m,countryCallingCodeEditable:!1,value:b,onChange:x=>g(x),onCountryChange:w,className:"aas-phone-input"}),P.errors.phoneNumber&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.phoneNumber})]}),o.jsxs("div",{className:"aas-row",children:[o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-country",className:t==null?void 0:t.label,children:"Country"}),o.jsxs("select",{id:"signup-country",value:P.values.country,onChange:x=>A(x.target.value),className:"aas-select",children:[o.jsx("option",{value:"",children:"Select country"}),Go.map(x=>o.jsx("option",{value:x.code,children:x.name},x.code))]}),P.errors.country&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.country})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-currency",className:t==null?void 0:t.label,children:"Currency"}),o.jsxs("select",{id:"signup-currency",value:P.values.currency,onChange:x=>P.setValue("currency",x.target.value),className:"aas-select",disabled:!S,children:[o.jsx("option",{value:"",children:S?"Select currency":"Loading currencies…"}),(S??[]).map(x=>o.jsxs("option",{value:x.code,children:[x.name," (",x.code,")"]},x.code))]}),P.errors.currency&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.currency})]})]}),s.captcha.enabled&&o.jsxs("div",{className:"aas-field",children:[o.jsx(He,{ref:v,captcha:s.captcha,onVerify:x=>{f(x),$("")},onExpire:()=>f(""),className:t==null?void 0:t.captcha}),h&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:h})]}),P.submitError&&o.jsx("p",{className:E("aas-error-submit",t==null?void 0:t.error),children:P.submitError}),o.jsx(Ee,{type:"submit",className:E("sso:w-full",t==null?void 0:t.button),disabled:P.isSubmitting,children:P.isSubmitting?"Creating account...":"Create Account"}),o.jsxs("div",{style:{textAlign:"center",fontSize:"0.875rem"},children:[o.jsx("span",{className:"aas-info",children:"Already have an account? "}),o.jsx("button",{type:"button",onClick:a,className:t==null?void 0:t.link,style:{fontWeight:500},children:"Sign in"})]})]})})}function b1(e){return o.jsx(kt,{projectId:e.projectId,config:e.config,apiBaseUrl:e.apiBaseUrl,children:o.jsx(y1,{...e})})}function v1({projectId:e,classNames:t,onError:n,onBackToLogin:r,apiBaseUrl:a}){const{config:i,isLoading:s,error:d}=lt(),[l,u]=c.useState(""),[f,h]=c.useState(""),$=c.useRef(null),[v,b]=c.useState(!1),g=vn({email:""}),m={email:S=>{if(!S)return"Email is required";if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S))return"Invalid email"}},y=async S=>{var T;if(i!=null&&i.captcha.enabled&&!l){h("Please complete the captcha verification");return}h("");try{await Ys(e,{email:S.email,captchaToken:l||void 0},a),b(!0)}catch(P){(T=$.current)==null||T.reset(),u("");const w=P instanceof ae||P instanceof Error?P:new Error("Request failed");throw n==null||n(w),w}};return s||d||!i?o.jsx(xt,{type:"forgot-password",classNames:t,isLoading:s,error:d}):v?o.jsx(Ue,{config:i,title:"Check Your Email",description:"We've sent password reset instructions to your email address",classNames:t,footer:o.jsx("button",{type:"button",onClick:r,className:t==null?void 0:t.link,children:"Back to sign in"}),children:o.jsx("div",{className:"aas-info",children:"If you don't see the email, check your spam folder."})}):o.jsx(Ue,{config:i,title:"Reset Password",description:"Enter your email and we'll send you reset instructions",classNames:t,children:o.jsxs("form",{onSubmit:g.handleSubmit(y,m),children:[o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"forgot-email",className:t==null?void 0:t.label,children:"Email"}),o.jsx(Be,{id:"forgot-email",type:"email",placeholder:"you@example.com",value:g.values.email,onChange:S=>g.setValue("email",S.target.value),className:t==null?void 0:t.input,autoComplete:"email"}),g.errors.email&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:g.errors.email})]}),i.captcha.enabled&&o.jsxs("div",{className:"aas-field",children:[o.jsx(He,{ref:$,captcha:i.captcha,onVerify:S=>{u(S),h("")},onExpire:()=>u(""),className:t==null?void 0:t.captcha}),f&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:f})]}),g.submitError&&o.jsx("p",{className:E("aas-error-submit",t==null?void 0:t.error),children:g.submitError}),o.jsx(Ee,{type:"submit",className:E("sso:w-full",t==null?void 0:t.button),disabled:g.isSubmitting,children:g.isSubmitting?"Sending...":"Send Reset Instructions"}),o.jsx("div",{style:{textAlign:"center"},children:o.jsx("button",{type:"button",onClick:r,className:t==null?void 0:t.link,children:"Back to sign in"})})]})})}function x1(e){return o.jsx(kt,{projectId:e.projectId,config:e.config,apiBaseUrl:e.apiBaseUrl,children:o.jsx(v1,{...e})})}function C1(){if(typeof window>"u")return"";const e=window.location.pathname.split("/").filter(Boolean),t=e[e.length-1]??"";return t.toLowerCase()==="verify"?"":decodeURIComponent(t)}function w1({projectId:e,classNames:t,token:n,onVerified:r,onLoginClick:a,onSignupClick:i,onError:s,apiBaseUrl:d}){const{config:l,isLoading:u,error:f}=lt(),[h,$]=c.useState(""),[v,b]=c.useState(""),g=c.useRef(null),[m,y]=c.useState("idle"),[S,T]=c.useState(""),P=n??C1(),w=async()=>{var A;if(!P){y("failed"),T("This verification link is invalid or incomplete.");return}if(l!=null&&l.captcha.enabled&&!h){b("Please complete the captcha verification");return}b(""),y("verifying");try{await Li(e,{token:P,captchaToken:h||void 0},d),y("verified"),r==null||r()}catch(H){(A=g.current)==null||A.reset(),$("");const G=H instanceof ae||H instanceof Error?H:new Error("Email verification failed");T(G.message),y("failed"),s==null||s(G)}};return u||f||!l?o.jsx(xt,{type:"verify-email",classNames:t,isLoading:u,error:f}):m==="verified"?o.jsxs(Ue,{config:l,title:"Email Verified",description:"Your email address has been confirmed. You can now sign in.",classNames:t,children:[o.jsx("div",{className:"aas-info",children:"Thanks for confirming your email address."}),o.jsx(Ee,{type:"button",className:E("sso:w-full",t==null?void 0:t.button),onClick:a??r,children:"Continue to sign in"})]}):m==="failed"?o.jsxs(Ue,{config:l,title:"Verification Failed",description:"We couldn't verify your email address.",classNames:t,children:[o.jsx("p",{className:E("aas-error-submit",t==null?void 0:t.error),children:S||"Email verification failed"}),o.jsx("div",{className:"aas-info",children:"The link may have expired or already been used. Try signing in — your email may already be verified — or sign up again to get a new link."}),o.jsxs("div",{className:"sso:flex sso:flex-col sso:gap-2",children:[o.jsx(Ee,{type:"button",className:E("sso:w-full",t==null?void 0:t.button),onClick:a,children:"Go to sign in"}),o.jsx(Ee,{type:"button",variant:"outline",className:E("sso:w-full",t==null?void 0:t.button),onClick:i,children:"Go to sign up"})]})]}):o.jsx(Ue,{config:l,title:"Verify Your Email",description:"Complete the check below to confirm your email address",classNames:t,children:o.jsxs("form",{onSubmit:A=>{A.preventDefault(),w()},children:[l.captcha.enabled&&o.jsxs("div",{className:"aas-field",children:[o.jsx(He,{ref:g,captcha:l.captcha,action:"verify_email",onVerify:A=>{$(A),b("")},onExpire:()=>$(""),className:t==null?void 0:t.captcha}),v&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:v})]}),o.jsx(Ee,{type:"submit",className:E("sso:w-full",t==null?void 0:t.button),disabled:m==="verifying",children:m==="verifying"?"Verifying...":"Verify email"}),o.jsx("div",{style:{textAlign:"center"},children:o.jsx("button",{type:"button",onClick:a,className:t==null?void 0:t.link,children:"Back to sign in"})})]})})}function S1(e){return o.jsx(kt,{projectId:e.projectId,config:e.config,apiBaseUrl:e.apiBaseUrl,children:o.jsx(w1,{...e})})}class Wo extends Error{constructor(n,r){super(n);Hn(this,"status");this.name="AccountApiError",this.status=r}}function se(e){return e??"http://localhost:3000"??""}function Vo(e){return{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}async function ue(e,t,n){var i;const r=await fetch(e,{...n,headers:{...Vo(t),...(n==null?void 0:n.headers)??{}}});let a=null;try{a=await r.json()}catch{}if(!r.ok||(a==null?void 0:a.success)===!1)throw new Wo(((i=a==null?void 0:a.data)==null?void 0:i.toString())||`Request failed (${r.status})`,r.status);return(a==null?void 0:a.data)??a}async function P1(e,t){const n=await fetch(e,{headers:Vo(t)});let r=null;try{r=await n.json()}catch{}if(!n.ok)throw new Wo((r==null?void 0:r.message)||`Request failed (${n.status})`,n.status);return{enabled:(r==null?void 0:r.success)===!0,data:(r==null?void 0:r.data)??{}}}function Ko(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/me`,t)}function N1(e){return{first_name:e.firstName??"",last_name:e.lastName??"",email:e.email??"",address:{city:e.city??"",state:e.state??"",country:e.country??"",code:e.zip??""},timezone:e.timezone??"",language:e.language??"en",phone_number:{number:e.phone}}}function j1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/profile`,n,{method:"PUT",body:JSON.stringify(N1(t))})}function A1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/account`,n,{method:"PUT",body:JSON.stringify({password:t.password,oldPassword:t.oldPassword,captchaToken:t.captchaToken})})}async function E1(e,t,n){const{enabled:r}=await P1(`${se(n)}/api/v1/projects/${e}/2fa/status`,t);return{enabled:r}}async function O1(e,t,n){const r=await ue(`${se(n)}/api/v1/projects/${e}/2fa/enable`,t,{method:"POST",body:JSON.stringify({})});return{secret:typeof r.secret=="string"?r.secret:void 0,qrCodeUrl:(typeof r.qrCode=="string"?r.qrCode:void 0)??(typeof r.qrCodeUrl=="string"?r.qrCodeUrl:void 0),otpauthUrl:typeof r.otpauthUrl=="string"?r.otpauthUrl:void 0}}function T1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/2fa/verify`,n,{method:"POST",body:JSON.stringify({otp:t})})}function I1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/2fa/disable`,n,{method:"POST",body:JSON.stringify({otp:t})})}function R1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/whatsapp/enable`,n,{method:"POST",body:JSON.stringify({number:t})})}function F1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/whatsapp/verify`,n,{method:"POST",body:JSON.stringify(t)})}function _1(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/plans`,t)}function k1(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/recharge-links`,t)}function L1(e,t,n,r){const a=t==="coin"?"?wallet=coin":"";return ue(`${se(r)}/api/v1/projects/${e}/wallet/logs${a}`,n)}function Ho(e){const t=e.transaction??{},n=(e.type??"").toLowerCase(),r=n==="credit"?!0:n==="debit"?!1:e.in===!0,a=typeof e.amount=="number"?e.amount:0,i=e.currency||t.sender_currency||t.receiver_currency||"",s=i?` ${i}`:"",d=e.createdAt?new Date(e.createdAt).getTime():e.created_on;return{id:e.id||e._id||"",description:e.note||e.category||t.category||"Transaction",date:d?new Date(d).toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"",amount:`${r?"+":"-"}${a.toLocaleString()}${s}`,type:r?"credit":"debit"}}function M1(e){const t=e??{},n=t.inclusion??{},r=typeof t.credit=="number"?t.credit:typeof t.balance=="number"?t.balance:Number(t.credit??t.balance)||0,a=k(t.unit)||k(t.creditUnit)||k(t.credit_unit)||k(n.slug),i=(k(t.fundSource)||k(t.fund_source)||k(t.source)).toLowerCase(),s=/coin/.test(i)?"coin":/main/.test(i)?"main":"";return{id:k(t.id)||k(t._id),label:k(n.name)||k(t.label)||k(t.name)||k(t.title)||k(t.walletSlug)||"Credit wallet",balance:r,balanceFormatted:k(t.balanceFormatted)||`${r.toLocaleString()}${a?` ${a}`:""}`.trim(),creditUnit:a,currency:k(t.currency),fundSource:s,rechargeable:t.rechargeable!==!1}}async function zo(e,t,n){const r=await ue(`${se(n)}/api/v1/projects/${e}/credit-wallets`,t);return(Array.isArray(r)?r:Array.isArray(r==null?void 0:r.data)?r.data:[]).map(M1)}async function D1(e,t,n,r){const a=await ue(`${se(r)}/api/v1/projects/${e}/credit-wallets/${t}/logs`,n);return Array.isArray(a)?a.map(Ho):[]}function B1(e,t,n,r,a){return ue(`${se(a)}/api/v1/projects/${e}/credit-wallets/${t}/recharge`,r,{method:"POST",body:JSON.stringify({credits:n.credits,captchaToken:n.captchaToken})})}function U1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/subscribe`,n,{method:"POST",body:JSON.stringify(t)})}function _t(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/subscription`,t)}function ir(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;const n=t??{};return k(n.id)||k(n._id)||k(n.plan_id)||k(n.planId)}).filter(Boolean):[]}function yn(e){const t=(e==null?void 0:e.data)??e??{},n=t.plan,r=n&&typeof n=="object"?n:{},a=k(t.plan_id)||k(t.planId)||(typeof n=="string"?n:"")||k(r.id)||k(r._id),i=ir(t.package),s={};for(const f of i)s[f]=(s[f]??0)+1;const d=Array.from(new Set([a,...i,...ir(t.add_on),...ir(t.addons)].filter(Boolean))),l=t.expiry??t.expiresAt??t.endDate;let u="";return typeof l=="number"&&l>0?u=new Date(l).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"2-digit"}):typeof l=="string"&&l?u=l:u=k(t.renewsAt)||k(t.nextBillingDate),{planId:a,duration:k(t.validity)||k(t.duration)||k(t.billingCycle),status:k(t.status)||k(t.type),renewsAt:u,subscribedIds:d,packageCounts:s}}function k(e){return typeof e=="string"?e:""}function qo(e){const t=(e==null?void 0:e.data)??e??{},n=t.profile??{},r=n.name??{},a=n.address??{},i=n.phone_number??{},s=n.whatsapp??{};return{id:k(t.id),username:k(t.username),firstName:k(r.first),lastName:k(r.last),email:k(n.email)||k(t.username),phone:k(i.number),whatsapp:k(s.number),whatsappVerified:!!s.verified,city:k(a.city),state:k(a.state),country:k(a.country),zip:k(a.code),timezone:k(n.timezone),language:k(n.language)||"en",emailVerified:!!(n.emailVerified??n.email_verified??(k(n.email)||k(t.username))),avatarUrl:k(n.profile_picture)||void 0,mainWallet:t.mainWallet,coinWallet:t.coinWallet}}async function Yo(e,t,n){const r=await Ko(e,t,n);return qo(r)}async function G1(e,t,n){const r=await Yo(e,t,n);return{mainWallet:r.mainWallet,coinWallet:r.coinWallet}}function W1(e,t,n){return zo(e,t,n)}function V1(e,t,n){return _t(e,t,n)}function K1(e){const t=e.trim();return/^(https?:|mailto:|\/|#)/i.test(t)?t:null}function De(e,t){const n=[],r=/(`[^`]+`)|(\*\*[^*]+\*\*|__[^_]+__)|(~~[^~]+~~)|(\*[^*]+\*|_[^_]+_)|(\[[^\]]+\]\([^)]+\))/g;let a=0,i,s=0;for(;(i=r.exec(e))!==null;){i.index>a&&n.push(e.slice(a,i.index));const d=i[0],l=`${t}-${s}`;if(i[1])n.push(o.jsx("code",{className:"aas-md-code",children:d.slice(1,-1)},l));else if(i[2])n.push(o.jsx("strong",{children:De(d.slice(2,-2),l)},l));else if(i[3])n.push(o.jsx("del",{children:De(d.slice(2,-2),l)},l));else if(i[4])n.push(o.jsx("em",{children:De(d.slice(1,-1),l)},l));else if(i[5]){const u=/\[([^\]]+)\]\(([^)]+)\)/.exec(d),f=u?K1(u[2]):null;u&&f?n.push(o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:u[1]},l)):n.push(d)}a=r.lastIndex,s++}return a<e.length&&n.push(e.slice(a)),n}const H1=/^(#{1,6}\s|>\s?|\s*[-*+]\s+|\s*\d+\.\s+|```|(-{3,}|\*{3,}|_{3,})$)/;function Zo(e){const t=e.replace(/\r\n?/g,`
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _0(e,t){if(e){if(typeof e=="string")return Ni(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ni(e,t)}}function Ni(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k0(e,t){for(var n=F0(e),r;!(r=n()).done;){var a=r.value;a&&L0(a,t)}}function L0(e,t){typeof e=="function"?e(t):e.current=t}var To=j.shape({country_calling_codes:j.object.isRequired,countries:j.object.isRequired}),Io=j.objectOf(j.string);function Oe(e,t){var n="+"+Ge(e,t);return n}function M0(e){var t=e.value,n=e.phoneNumber,r=e.defaultCountry,a=e.getAnyCountry,i=e.countries,s=e.required,d=e.metadata,l;return n&&n.country?l=n.country:r&&(!t||it(t,r,d))&&(l=r),i&&i.indexOf(l)<0&&(l=void 0),!l&&s&&i&&i.length>0&&(l=a()),l}function D0(e){var t=e.countries,n=e.countryNames,r=e.addInternationalOption,a=e.compareStringsLocales,i=e.compareStrings;i||(i=H0);var s=t.map(function(d){return{value:d,label:n[d]||d}});return s.sort(function(d,l){return i(d.label,l.label,a)}),r&&s.unshift({label:n.ZZ}),s}function Ro(e,t){return yo(e||"",t)}function B0(e){return e.formatNational().replace(/\D/g,"")}function U0(e,t){var n=t.prevCountry,r=t.newCountry,a=t.metadata,i=t.useNationalFormat;if(n===r)return e;if(!e)return i?"":r?Oe(r,a):"";if(r){if(e[0]==="+"){if(i)return e.indexOf("+"+Ge(r,a))===0?z0(e,r,a):"";if(n){var s=Oe(r,a);return e.indexOf(s)===0?e:s}else{var d=Oe(r,a);return e.indexOf(d)===0?e:d}}}else if(e[0]!=="+")return rt(e,n,a)||"";return e}function rt(e,t,n){if(e){if(e[0]==="+"){if(e==="+")return;var r=new ct(t,n);return r.input(e),r.getNumberValue()}if(t){var a=_o(e,t,n);return"+".concat(Ge(t,n)).concat(a||"")}}}function G0(e,t,n){var r=_o(e,t,n);if(r){var a=r.length-W0(t,n);if(a>0)return e.slice(0,e.length-a)}return e}function W0(e,t){return t=new re(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}function Fo(e,t){var n=t.country,r=t.countries,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.required,d=t.metadata;if(e==="+")return n;var l=K0(e,d);if(l)return!r||r.indexOf(l)>=0?l:void 0;if(n){if(it(e,n,d)){if(i&&it(e,i,d))return i;if(a&&it(e,a,d))return a;if(!s)return}else if(!s)return}return n}function V0(e,t){var n=t.prevPhoneDigits,r=t.country,a=t.defaultCountry,i=t.latestCountrySelectedByUser,s=t.countryRequired,d=t.getAnyCountry,l=t.countries,u=t.international,f=t.limitMaxLength,h=t.countryCallingCodeEditable,$=t.metadata;if(u&&h===!1&&r){var v=Oe(r,$);if(e.indexOf(v)!==0){var b,g=e&&e[0]!=="+";return g?(e=v+e,b=rt(e,r,$)):e=v,{phoneDigits:e,value:b,country:r}}}u===!1&&r&&e&&e[0]==="+"&&(e=ji(e,r,$)),e&&r&&f&&(e=G0(e,r,$)),e&&e[0]!=="+"&&(!r||u)&&(e="+"+e),!e&&n&&n[0]==="+"&&(u?r=void 0:r=a),e==="+"&&n&&n[0]==="+"&&n.length>1&&(r=void 0);var m;return e&&(e[0]==="+"&&(e==="+"||r&&Oe(r,$).indexOf(e)===0)?m=void 0:m=rt(e,r,$)),m&&(r=Fo(m,{country:r,countries:l,defaultCountry:a,latestCountrySelectedByUser:i,required:!1,metadata:$}),u===!1&&r&&e&&e[0]==="+"&&(e=ji(e,r,$),m=rt(e,r,$))),!r&&s&&(r=a||d()),{phoneDigits:e,country:r,value:m}}function ji(e,t,n){if(e.indexOf(Oe(t,n))===0){var r=new ct(t,n);r.input(e);var a=r.getNumber();return a?a.formatNational().replace(/\D/g,""):""}else return e.replace(/\D/g,"")}function K0(e,t){var n=new ct(null,t);return n.input(e),n.getCountry()}function H0(e,t,n){return String.prototype.localeCompare?e.localeCompare(t,n):e<t?-1:e>t?1:0}function z0(e,t,n){if(t){var r="+"+Ge(t,n);if(e.length<r.length){if(r.indexOf(e)===0)return""}else if(e.indexOf(r)===0)return e.slice(r.length)}for(var a=0,i=Object.keys(n.country_calling_codes);a<i.length;a++){var s=i[a];if(e.indexOf(s)===1)return e.slice(1+s.length)}return""}function _o(e,t,n){var r=new ct(t,n);r.input(e);var a=r.getNumber();return a&&a.nationalNumber}function it(e,t,n){for(var r=Oe(t,n),a=0;a<e.length&&a<r.length;){if(e[a]!==r[a])return!1;a++}return!0}function ko(e){var t=e.value,n=e.phoneNumber,r=e.defaultCountry,a=e.international,i=e.useNationalFormat,s=e.metadata;return(a===!1||i)&&n&&n.country?B0(n):!t&&a&&r?Oe(r,s):t}function Ft(e){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(e)}function Ai(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ai(Object(n),!0).forEach(function(r){q0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ai(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q0(e,t,n){return t=Y0(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y0(e){var t=Z0(e,"string");return Ft(t)=="symbol"?t:t+""}function Z0(e,t){if(Ft(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ft(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function J0(e,t,n){var r=e.metadata,a=e.countries,i=e.defaultCountry,s=e.value,d=e.reset,l=e.international,u=e.displayInitialValueAsLocalNumber,f=e.initialValueFormat,h=t.defaultCountry,$=t.value,v=t.reset;n.country;var b=n.value,g=n.hasUserSelectedACountry,m=n.latestCountrySelectedByUser,y=function(I){return ko(dn(dn({},I),{},{international:l,useNationalFormat:u||f==="national",metadata:r}))};if(d!==v)return{phoneDigits:y({value:void 0,defaultCountry:i}),value:void 0,country:i,latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};if(i!==h){var S=!i||Nn(i,r),T=!b||l&&b===y({value:void 0,defaultCountry:h}),P=!s&&T;if(!g&&S&&P)return{country:i,phoneDigits:y({value:void 0,defaultCountry:i}),value:void 0}}if(!Ei(s,$)&&!Ei(s,b)){var w,A;if(s){s&&Ao(s),w=Ro(s,r);var H=Eo(a,r);w&&w.country?(!H||H.indexOf(w.country)>=0)&&(A=w.country):(A=Fo(s,{country:void 0,countries:H,metadata:r}),A||i&&s.indexOf(Oe(i,r))===0&&(A=i))}var G;if(s){if(m){var x=A?m===A:it(s,m,r);x?A||(A=m):G={latestCountrySelectedByUser:void 0}}}else G={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};return dn(dn({},G),{},{phoneDigits:y({phoneNumber:w,value:s,defaultCountry:i}),value:s,country:s?A:i})}}function Ei(e,t){return e===null&&(e=void 0),t===null&&(t=void 0),e===t}var X0=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function dt(e){"@babel/helpers - typeof";return dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(e)}function Oi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oi(Object(n),!0).forEach(function(r){xe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ot.apply(this,arguments)}function Q0(e,t){if(e==null)return{};var n=e1(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function e1(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function t1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ti(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Do(r.key),r)}}function n1(e,t,n){return t&&Ti(e.prototype,t),n&&Ti(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function r1(e,t,n){return t=gn(t),a1(e,Mo()?Reflect.construct(t,n||[],gn(e).constructor):t.apply(e,n))}function a1(e,t){if(t&&(dt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i1(e)}function i1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mo=function(){return!!e})()}function gn(e){return gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gn(e)}function o1(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nr(e,t)}function Nr(e,t){return Nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Nr(e,t)}function xe(e,t,n){return t=Do(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e){var t=s1(e,"string");return dt(t)=="symbol"?t:t+""}function s1(e,t){if(dt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var d1=function(e){function t(n){var r;t1(this,t),r=r1(this,t,[n]),xe(r,"setInputRef",function(m){k0([r.props.inputRef,r.inputRef],m)}),xe(r,"isCountrySupportedWithError",function(m){var y=r.props.metadata;return Nn(m,y)}),xe(r,"onCountryChange",function(m){var y=r.props,S=y.international,T=y.metadata,P=y.onChange,w=y.focusInputOnCountrySelection,A=r.state,H=A.phoneDigits,G=A.country,x=U0(H,{prevCountry:G,newCountry:m,metadata:T,useNationalFormat:!S}),B=rt(x,m,T);w&&r.inputRef.current.focus(),r.setState({country:m,latestCountrySelectedByUser:m,hasUserSelectedACountry:!0,phoneDigits:x,value:B},function(){P(B)})}),xe(r,"onChange",function(m){var y=r.props,S=y.defaultCountry,T=y.onChange,P=y.addInternationalOption,w=y.international,A=y.limitMaxLength,H=y.countryCallingCodeEditable,G=y.metadata,x=r.state,B=x.countries,I=x.phoneDigits,D=x.country,ie=x.latestCountrySelectedByUser,ne=V0(m,{prevPhoneDigits:I,country:D,countryRequired:!P,defaultCountry:S,latestCountrySelectedByUser:ie,getAnyCountry:function(){return r.getFirstSupportedCountry({countries:B})},countries:B,international:w,limitMaxLength:A,countryCallingCodeEditable:H,metadata:G}),ce=ne.phoneDigits,Q=ne.country,te=ne.value,de={phoneDigits:ce,value:te,country:Q};ie&&te&&!it(te,ie,G)&&(de.latestCountrySelectedByUser=void 0),H===!1&&!te&&ce===r.state.phoneDigits&&(de.forceRerender={}),r.setState(de,function(){return T(te)})}),xe(r,"_onFocus",function(){return r.setState({isFocused:!0})}),xe(r,"_onBlur",function(){return r.setState({isFocused:!1})}),xe(r,"onFocus",function(m){r._onFocus();var y=r.props.onFocus;y&&y(m)}),xe(r,"onBlur",function(m){var y=r.props.onBlur;r._onBlur(),y&&y(m)}),xe(r,"onCountryFocus",function(m){r._onFocus();var y=r.props.countrySelectProps;if(y){var S=y.onFocus;S&&S(m)}}),xe(r,"onCountryBlur",function(m){r._onBlur();var y=r.props.countrySelectProps;if(y){var S=y.onBlur;S&&S(m)}}),r.inputRef=c.createRef();var a=r.props,i=a.value;a.labels;var s=a.international,d=a.addInternationalOption,l=a.displayInitialValueAsLocalNumber,u=a.initialValueFormat,f=a.metadata,h=r.props,$=h.defaultCountry,v=h.countries;$&&(r.isCountrySupportedWithError($)||($=void 0)),i&&Ao(i),v=Eo(v,f);var b=Ro(i,f);r.CountryIcon=Oo(r.props);var g=M0({value:i,phoneNumber:b,defaultCountry:$,required:!d,countries:v||xi(f),getAnyCountry:function(){return r.getFirstSupportedCountry({countries:v})},metadata:f});return r.state={props:r.props,country:g,countries:v,phoneDigits:ko({value:i,phoneNumber:b,defaultCountry:$,international:s,useNationalFormat:l||u==="national",metadata:f}),value:i},r}return o1(t,e),n1(t,[{key:"componentDidMount",value:function(){var r=this.props.onCountryChange,a=this.props.defaultCountry,i=this.state.country;r&&(a&&(this.isCountrySupportedWithError(a)||(a=void 0)),i!==a&&r(i))}},{key:"componentDidUpdate",value:function(r,a){var i=this.props.onCountryChange,s=this.state.country;i&&s!==a.country&&i(s)}},{key:"getCountrySelectOptions",value:function(r){var a=r.countries,i=this.props,s=i.international,d=i.countryCallingCodeEditable,l=i.countryOptionsOrder,u=i.addInternationalOption,f=i.labels,h=i.locales,$=i.metadata;return this.useMemoCountrySelectOptions(function(){return E0(D0({countries:a||xi($),countryNames:f,addInternationalOption:s&&d===!1?!1:u,compareStringsLocales:h}),O0(l,$))},[a,l,u,f,$])}},{key:"useMemoCountrySelectOptions",value:function(r,a){return(!this.countrySelectOptionsMemoDependencies||!u1(a,this.countrySelectOptionsMemoDependencies))&&(this.countrySelectOptionsMemo=r(),this.countrySelectOptionsMemoDependencies=a),this.countrySelectOptionsMemo}},{key:"getFirstSupportedCountry",value:function(r){var a=r.countries,i=this.getCountrySelectOptions({countries:a});return i[0].value}},{key:"render",value:function(){var r=this.props,a=r.name,i=r.disabled,s=r.readOnly,d=r.autoComplete,l=r.style,u=r.className;r.inputRef;var f=r.inputComponent,h=r.numberInputProps,$=r.smartCaret,v=r.countrySelectComponent,b=r.countrySelectProps,g=r.containerComponent,m=r.containerComponentProps;r.defaultCountry,r.countries,r.countryOptionsOrder;var y=r.labels;r.flags,r.flagComponent,r.flagUrl,r.addInternationalOption,r.internationalIcon,r.displayInitialValueAsLocalNumber,r.initialValueFormat,r.onCountryChange,r.limitMaxLength,r.countryCallingCodeEditable,r.focusInputOnCountrySelection,r.reset;var S=r.metadata,T=r.international;r.locales;var P=Q0(r,X0),w=this.state,A=w.country,H=w.countries,G=w.phoneDigits,x=w.isFocused,B=$?a0:l0,I=this.getCountrySelectOptions({countries:H});return c.createElement(g,ot({style:l,className:cn(u,"PhoneInput",{"PhoneInput--focus":x,"PhoneInput--disabled":i,"PhoneInput--readOnly":s})},m),c.createElement(v,ot({name:a?"".concat(a,"Country"):void 0,"aria-label":y.country},b,{value:A,options:I,onChange:this.onCountryChange,onFocus:this.onCountryFocus,onBlur:this.onCountryBlur,disabled:i||b&&b.disabled,readOnly:s||b&&b.readOnly,iconComponent:this.CountryIcon})),c.createElement(B,ot({ref:this.setInputRef,type:"tel",autoComplete:d},h,P,{inputFormat:T===!0?"INTERNATIONAL":T===!1?"NATIONAL":"INTERNATIONAL_OR_NATIONAL",international:T?!0:void 0,withCountryCallingCode:T?!0:void 0,name:a,metadata:S,country:A,value:G||"",onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,disabled:i,readOnly:s,inputComponent:f,className:cn("PhoneInputInput",h&&h.className,P.className)})))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return Lo({props:r},J0(r,a.props,a))}}])}(c.PureComponent),Bo=c.forwardRef(function(e,t){return c.createElement(d1,ot({},l1(e),{inputRef:t}))});Bo.propTypes={value:j.string,onChange:j.func.isRequired,onFocus:j.func,onBlur:j.func,disabled:j.bool,readOnly:j.bool,autoComplete:j.string,initialValueFormat:j.oneOf(["national"]),displayInitialValueAsLocalNumber:j.bool,defaultCountry:j.string,countries:j.arrayOf(j.string),labels:Io,locales:j.oneOfType([j.string,j.arrayOf(j.string)]),flagUrl:j.string,flags:j.objectOf(j.elementType),flagComponent:j.elementType,addInternationalOption:j.bool,internationalIcon:j.elementType,countryOptionsOrder:j.arrayOf(j.string),style:j.object,className:j.string,countrySelectComponent:j.elementType,countrySelectProps:j.object,inputComponent:j.elementType,numberInputProps:j.object,containerComponent:j.elementType,containerComponentProps:j.object,smartCaret:j.bool,international:j.bool,limitMaxLength:j.bool,countryCallingCodeEditable:j.bool,metadata:To,onCountryChange:j.func,focusInputOnCountrySelection:j.bool};var Ii={autoComplete:"tel",countrySelectComponent:So,flagComponent:Gr,flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",internationalIcon:Pn,inputComponent:"input",containerComponent:"div",reset:j.any,smartCaret:!0,addInternationalOption:!0,countryCallingCodeEditable:!0,focusInputOnCountrySelection:!0};function l1(e){e=Lo({},e);for(var t in Ii)e[t]===void 0&&(e[t]=Ii[t]);return e}function u1(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;){if(e[n]!==t[n])return!1;n++}return!0}const c1={ext:"ext.",country:"Phone number country",phone:"Phone",AC:"Ascension Island",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic of the",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin (French Part)",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Swaziland",TA:"Tristan da Cunha",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XA:"Abkhazia",XK:"Kosovo",XO:"South Ossetia",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"International"};var f1=["metadata","labels"];function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}function p1(e,t){if(e==null)return{};var n=h1(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function h1(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Uo(e){var t=c.forwardRef(function(n,r){var a=n.metadata,i=a===void 0?e:a,s=n.labels,d=s===void 0?c1:s,l=p1(n,f1);return c.createElement(Bo,jr({},l,{ref:r,metadata:i,labels:d}))});return t.propTypes={metadata:To,labels:Io},t}Uo();function m1(e,t){var n=Array.prototype.slice.call(t);return n.push(Yi),e.apply(this,n)}const Ar=Uo(Yi);function $1(){return m1(yo,arguments)}const ar={US:"USD",GB:"GBP",CA:"CAD",AU:"AUD",DE:"EUR",FR:"EUR",IN:"INR",JP:"JPY",BR:"BRL",MX:"MXN",SG:"SGD",AE:"AED",ZA:"ZAR",NG:"NGN",KE:"KES",ES:"EUR",IT:"EUR",NL:"EUR",PT:"EUR",BE:"EUR",AT:"EUR",IE:"EUR",FI:"EUR",GR:"EUR",NZ:"NZD",CH:"CHF",SE:"SEK",NO:"NOK",DK:"DKK",PL:"PLN",CZ:"CZK",HU:"HUF",RO:"RON",BG:"BGN",HR:"EUR",SK:"EUR",SI:"EUR",LT:"EUR",LV:"EUR",EE:"EUR",CY:"EUR",MT:"EUR",LU:"EUR",CN:"CNY",KR:"KRW",TW:"TWD",HK:"HKD",TH:"THB",MY:"MYR",ID:"IDR",PH:"PHP",VN:"VND",PK:"PKR",BD:"BDT",LK:"LKR",EG:"EGP",SA:"SAR",QA:"QAR",KW:"KWD",BH:"BHD",OM:"OMR",JO:"JOD",IL:"ILS",TR:"TRY",RU:"RUB",UA:"UAH",CL:"CLP",CO:"COP",PE:"PEN",AR:"ARS",UY:"UYU",GH:"GHS",TZ:"TZS",UG:"UGX",RW:"RWF",ET:"ETB",MA:"MAD",TN:"TND"},Go=[{code:"US",name:"United States"},{code:"GB",name:"United Kingdom"},{code:"CA",name:"Canada"},{code:"AU",name:"Australia"},{code:"NZ",name:"New Zealand"},{code:"DE",name:"Germany"},{code:"FR",name:"France"},{code:"ES",name:"Spain"},{code:"IT",name:"Italy"},{code:"NL",name:"Netherlands"},{code:"BE",name:"Belgium"},{code:"AT",name:"Austria"},{code:"CH",name:"Switzerland"},{code:"IE",name:"Ireland"},{code:"PT",name:"Portugal"},{code:"SE",name:"Sweden"},{code:"NO",name:"Norway"},{code:"DK",name:"Denmark"},{code:"FI",name:"Finland"},{code:"PL",name:"Poland"},{code:"CZ",name:"Czech Republic"},{code:"IN",name:"India"},{code:"JP",name:"Japan"},{code:"CN",name:"China"},{code:"KR",name:"South Korea"},{code:"TW",name:"Taiwan"},{code:"HK",name:"Hong Kong"},{code:"SG",name:"Singapore"},{code:"MY",name:"Malaysia"},{code:"TH",name:"Thailand"},{code:"ID",name:"Indonesia"},{code:"PH",name:"Philippines"},{code:"VN",name:"Vietnam"},{code:"PK",name:"Pakistan"},{code:"BD",name:"Bangladesh"},{code:"LK",name:"Sri Lanka"},{code:"BR",name:"Brazil"},{code:"MX",name:"Mexico"},{code:"AR",name:"Argentina"},{code:"CL",name:"Chile"},{code:"CO",name:"Colombia"},{code:"PE",name:"Peru"},{code:"AE",name:"United Arab Emirates"},{code:"SA",name:"Saudi Arabia"},{code:"QA",name:"Qatar"},{code:"KW",name:"Kuwait"},{code:"IL",name:"Israel"},{code:"TR",name:"Turkey"},{code:"EG",name:"Egypt"},{code:"ZA",name:"South Africa"},{code:"NG",name:"Nigeria"},{code:"KE",name:"Kenya"},{code:"GH",name:"Ghana"},{code:"TZ",name:"Tanzania"},{code:"UG",name:"Uganda"},{code:"GA",name:"Gabon"},{code:"MA",name:"Morocco"},{code:"RU",name:"Russia"},{code:"UA",name:"Ukraine"}];function g1(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return e?{"America/New_York":"US","America/Chicago":"US","America/Denver":"US","America/Los_Angeles":"US","America/Phoenix":"US","America/Anchorage":"US","Pacific/Honolulu":"US","America/Toronto":"CA","America/Vancouver":"CA","America/Edmonton":"CA","America/Winnipeg":"CA","America/Halifax":"CA","Europe/London":"GB","Europe/Dublin":"IE","Europe/Berlin":"DE","Europe/Paris":"FR","Europe/Madrid":"ES","Europe/Rome":"IT","Europe/Amsterdam":"NL","Europe/Brussels":"BE","Europe/Vienna":"AT","Europe/Zurich":"CH","Europe/Lisbon":"PT","Europe/Stockholm":"SE","Europe/Oslo":"NO","Europe/Copenhagen":"DK","Europe/Helsinki":"FI","Europe/Warsaw":"PL","Europe/Prague":"CZ","Europe/Budapest":"HU","Europe/Bucharest":"RO","Europe/Sofia":"BG","Europe/Athens":"GR","Europe/Istanbul":"TR","Europe/Moscow":"RU","Europe/Kiev":"UA","Asia/Kolkata":"IN","Asia/Calcutta":"IN","Asia/Mumbai":"IN","Asia/Tokyo":"JP","Asia/Shanghai":"CN","Asia/Hong_Kong":"HK","Asia/Seoul":"KR","Asia/Taipei":"TW","Asia/Singapore":"SG","Asia/Kuala_Lumpur":"MY","Asia/Bangkok":"TH","Asia/Jakarta":"ID","Asia/Manila":"PH","Asia/Ho_Chi_Minh":"VN","Asia/Karachi":"PK","Asia/Dhaka":"BD","Asia/Colombo":"LK","Asia/Dubai":"AE","Asia/Riyadh":"SA","Asia/Qatar":"QA","Asia/Kuwait":"KW","Asia/Jerusalem":"IL","Australia/Sydney":"AU","Australia/Melbourne":"AU","Australia/Brisbane":"AU","Australia/Perth":"AU","Australia/Adelaide":"AU","Pacific/Auckland":"NZ","America/Sao_Paulo":"BR","America/Mexico_City":"MX","America/Argentina/Buenos_Aires":"AR","America/Santiago":"CL","America/Bogota":"CO","America/Lima":"PE","Africa/Johannesburg":"ZA","Africa/Lagos":"NG","Africa/Nairobi":"KE","Africa/Accra":"GH","Africa/Cairo":"EG","Africa/Casablanca":"MA","Africa/Dar_es_Salaam":"TZ","Africa/Kampala":"UG"}[e]:void 0}catch{return}}function y1({projectId:e,classNames:t,onSuccess:n,onError:r,onLoginClick:a,apiBaseUrl:i}){const{config:s,isLoading:d,error:l}=lt(),[u,f]=c.useState(""),[h,$]=c.useState(""),v=c.useRef(null),[b,g]=c.useState(),[m,y]=c.useState(),[S,T]=c.useState(null),P=vn({firstName:"",lastName:"",email:"",password:"",phoneNumber:"",country:"",currency:""});c.useEffect(()=>{const x=g1();if(x){y(x),P.setValue("country",x);const B=ar[x];B&&P.setValue("currency",B)}},[]),c.useEffect(()=>{let x=!1;return ki(e,i).then(B=>{x||T(B)}).catch(()=>{x||T([])}),()=>{x=!0}},[e,i]),c.useEffect(()=>{if(!S)return;const x=P.values.currency;x&&!S.some(B=>B.code===x)&&P.setValue("currency","")},[S]);const w=x=>{if(y(x),x){P.setValue("country",x);const B=ar[x];B&&P.setValue("currency",B)}},A=x=>{if(P.setValue("country",x),x){y(x);const B=ar[x];B&&P.setValue("currency",B)}},H={firstName:x=>{if(!x)return"First name is required"},lastName:x=>{if(!x)return"Last name is required"},email:x=>{if(!x)return"Email is required";if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x))return"Invalid email"},password:x=>{if(!x)return"Password is required";if(x.length<8)return"Password must be at least 8 characters"}},G=async x=>{var B;if(s!=null&&s.captcha.enabled&&!u){$("Please complete the captcha verification");return}$("");try{const I=await qs(e,{firstName:x.firstName,lastName:x.lastName,email:x.email,password:x.password,phoneNumber:b||void 0,country:x.country||void 0,currency:x.currency||void 0,captchaToken:u||void 0},i);n==null||n(I)}catch(I){(B=v.current)==null||B.reset(),f("");const D=I instanceof ae||I instanceof Error?I:new Error("Signup failed");throw r==null||r(D),D}};return d||l||!s?o.jsx(xt,{type:"signup",classNames:t,isLoading:d,error:l}):o.jsx(Ue,{config:s,title:"Create Account",description:"Fill in your details to get started",classNames:t,children:o.jsxs("form",{onSubmit:P.handleSubmit(G,H),children:[o.jsxs("div",{className:"aas-row",children:[o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-firstName",className:t==null?void 0:t.label,children:"First Name"}),o.jsx(Be,{id:"signup-firstName",type:"text",placeholder:"John",value:P.values.firstName,onChange:x=>P.setValue("firstName",x.target.value),className:t==null?void 0:t.input,autoComplete:"given-name"}),P.errors.firstName&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.firstName})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-lastName",className:t==null?void 0:t.label,children:"Last Name"}),o.jsx(Be,{id:"signup-lastName",type:"text",placeholder:"Doe",value:P.values.lastName,onChange:x=>P.setValue("lastName",x.target.value),className:t==null?void 0:t.input,autoComplete:"family-name"}),P.errors.lastName&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.lastName})]})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-email",className:t==null?void 0:t.label,children:"Email"}),o.jsx(Be,{id:"signup-email",type:"email",placeholder:"you@example.com",value:P.values.email,onChange:x=>P.setValue("email",x.target.value),className:t==null?void 0:t.input,autoComplete:"email"}),P.errors.email&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.email})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-password",className:t==null?void 0:t.label,children:"Password"}),o.jsx(Be,{id:"signup-password",type:"password",placeholder:"••••••••",value:P.values.password,onChange:x=>P.setValue("password",x.target.value),className:t==null?void 0:t.input,autoComplete:"new-password"}),P.errors.password&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.password})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{className:t==null?void 0:t.label,children:"Phone Number"}),o.jsx(Ar,{international:!0,defaultCountry:m,countryCallingCodeEditable:!1,value:b,onChange:x=>g(x),onCountryChange:w,className:"aas-phone-input"}),P.errors.phoneNumber&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.phoneNumber})]}),o.jsxs("div",{className:"aas-row",children:[o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-country",className:t==null?void 0:t.label,children:"Country"}),o.jsxs("select",{id:"signup-country",value:P.values.country,onChange:x=>A(x.target.value),className:"aas-select",children:[o.jsx("option",{value:"",children:"Select country"}),Go.map(x=>o.jsx("option",{value:x.code,children:x.name},x.code))]}),P.errors.country&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.country})]}),o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"signup-currency",className:t==null?void 0:t.label,children:"Currency"}),o.jsxs("select",{id:"signup-currency",value:P.values.currency,onChange:x=>P.setValue("currency",x.target.value),className:"aas-select",disabled:!S,children:[o.jsx("option",{value:"",children:S?"Select currency":"Loading currencies…"}),(S??[]).map(x=>o.jsxs("option",{value:x.code,children:[x.name," (",x.code,")"]},x.code))]}),P.errors.currency&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:P.errors.currency})]})]}),s.captcha.enabled&&o.jsxs("div",{className:"aas-field",children:[o.jsx(He,{ref:v,captcha:s.captcha,onVerify:x=>{f(x),$("")},onExpire:()=>f(""),className:t==null?void 0:t.captcha}),h&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:h})]}),P.submitError&&o.jsx("p",{className:E("aas-error-submit",t==null?void 0:t.error),children:P.submitError}),o.jsx(Ee,{type:"submit",className:E("sso:w-full",t==null?void 0:t.button),disabled:P.isSubmitting,children:P.isSubmitting?"Creating account...":"Create Account"}),o.jsxs("div",{style:{textAlign:"center",fontSize:"0.875rem"},children:[o.jsx("span",{className:"aas-info",children:"Already have an account? "}),o.jsx("button",{type:"button",onClick:a,className:t==null?void 0:t.link,style:{fontWeight:500},children:"Sign in"})]})]})})}function b1(e){return o.jsx(kt,{projectId:e.projectId,config:e.config,apiBaseUrl:e.apiBaseUrl,children:o.jsx(y1,{...e})})}function v1({projectId:e,classNames:t,onError:n,onBackToLogin:r,apiBaseUrl:a}){const{config:i,isLoading:s,error:d}=lt(),[l,u]=c.useState(""),[f,h]=c.useState(""),$=c.useRef(null),[v,b]=c.useState(!1),g=vn({email:""}),m={email:S=>{if(!S)return"Email is required";if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S))return"Invalid email"}},y=async S=>{var T;if(i!=null&&i.captcha.enabled&&!l){h("Please complete the captcha verification");return}h("");try{await Ys(e,{email:S.email,captchaToken:l||void 0},a),b(!0)}catch(P){(T=$.current)==null||T.reset(),u("");const w=P instanceof ae||P instanceof Error?P:new Error("Request failed");throw n==null||n(w),w}};return s||d||!i?o.jsx(xt,{type:"forgot-password",classNames:t,isLoading:s,error:d}):v?o.jsx(Ue,{config:i,title:"Check Your Email",description:"We've sent password reset instructions to your email address",classNames:t,footer:o.jsx("button",{type:"button",onClick:r,className:t==null?void 0:t.link,children:"Back to sign in"}),children:o.jsx("div",{className:"aas-info",children:"If you don't see the email, check your spam folder."})}):o.jsx(Ue,{config:i,title:"Reset Password",description:"Enter your email and we'll send you reset instructions",classNames:t,children:o.jsxs("form",{onSubmit:g.handleSubmit(y,m),children:[o.jsxs("div",{className:"aas-field",children:[o.jsx(ve,{htmlFor:"forgot-email",className:t==null?void 0:t.label,children:"Email"}),o.jsx(Be,{id:"forgot-email",type:"email",placeholder:"you@example.com",value:g.values.email,onChange:S=>g.setValue("email",S.target.value),className:t==null?void 0:t.input,autoComplete:"email"}),g.errors.email&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:g.errors.email})]}),i.captcha.enabled&&o.jsxs("div",{className:"aas-field",children:[o.jsx(He,{ref:$,captcha:i.captcha,onVerify:S=>{u(S),h("")},onExpire:()=>u(""),className:t==null?void 0:t.captcha}),f&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:f})]}),g.submitError&&o.jsx("p",{className:E("aas-error-submit",t==null?void 0:t.error),children:g.submitError}),o.jsx(Ee,{type:"submit",className:E("sso:w-full",t==null?void 0:t.button),disabled:g.isSubmitting,children:g.isSubmitting?"Sending...":"Send Reset Instructions"}),o.jsx("div",{style:{textAlign:"center"},children:o.jsx("button",{type:"button",onClick:r,className:t==null?void 0:t.link,children:"Back to sign in"})})]})})}function x1(e){return o.jsx(kt,{projectId:e.projectId,config:e.config,apiBaseUrl:e.apiBaseUrl,children:o.jsx(v1,{...e})})}function C1(){if(typeof window>"u")return"";const e=window.location.pathname.split("/").filter(Boolean),t=e[e.length-1]??"";return t.toLowerCase()==="verify"?"":decodeURIComponent(t)}function w1({projectId:e,classNames:t,token:n,onVerified:r,onLoginClick:a,onSignupClick:i,onError:s,apiBaseUrl:d}){const{config:l,isLoading:u,error:f}=lt(),[h,$]=c.useState(""),[v,b]=c.useState(""),g=c.useRef(null),[m,y]=c.useState("idle"),[S,T]=c.useState(""),P=n??C1(),w=async()=>{var A;if(!P){y("failed"),T("This verification link is invalid or incomplete.");return}if(l!=null&&l.captcha.enabled&&!h){b("Please complete the captcha verification");return}b(""),y("verifying");try{await Li(e,{token:P,captchaToken:h||void 0},d),y("verified"),r==null||r()}catch(H){(A=g.current)==null||A.reset(),$("");const G=H instanceof ae||H instanceof Error?H:new Error("Email verification failed");T(G.message),y("failed"),s==null||s(G)}};return u||f||!l?o.jsx(xt,{type:"verify-email",classNames:t,isLoading:u,error:f}):m==="verified"?o.jsxs(Ue,{config:l,title:"Email Verified",description:"Your email address has been confirmed. You can now sign in.",classNames:t,children:[o.jsx("div",{className:"aas-info",children:"Thanks for confirming your email address."}),o.jsx(Ee,{type:"button",className:E("sso:w-full",t==null?void 0:t.button),onClick:a??r,children:"Continue to sign in"})]}):m==="failed"?o.jsxs(Ue,{config:l,title:"Verification Failed",description:"We couldn't verify your email address.",classNames:t,children:[o.jsx("p",{className:E("aas-error-submit",t==null?void 0:t.error),children:S||"Email verification failed"}),o.jsx("div",{className:"aas-info",children:"The link may have expired or already been used. Try signing in — your email may already be verified — or sign up again to get a new link."}),o.jsxs("div",{className:"sso:flex sso:flex-col sso:gap-2",children:[o.jsx(Ee,{type:"button",className:E("sso:w-full",t==null?void 0:t.button),onClick:a,children:"Go to sign in"}),o.jsx(Ee,{type:"button",variant:"outline",className:E("sso:w-full",t==null?void 0:t.button),onClick:i,children:"Go to sign up"})]})]}):o.jsx(Ue,{config:l,title:"Verify Your Email",description:"Complete the check below to confirm your email address",classNames:t,children:o.jsxs("form",{onSubmit:A=>{A.preventDefault(),w()},children:[l.captcha.enabled&&o.jsxs("div",{className:"aas-field",children:[o.jsx(He,{ref:g,captcha:l.captcha,action:"verify_email",onVerify:A=>{$(A),b("")},onExpire:()=>$(""),className:t==null?void 0:t.captcha}),v&&o.jsx("p",{className:E("aas-error",t==null?void 0:t.error),children:v})]}),o.jsx(Ee,{type:"submit",className:E("sso:w-full",t==null?void 0:t.button),disabled:m==="verifying",children:m==="verifying"?"Verifying...":"Verify email"}),o.jsx("div",{style:{textAlign:"center"},children:o.jsx("button",{type:"button",onClick:a,className:t==null?void 0:t.link,children:"Back to sign in"})})]})})}function S1(e){return o.jsx(kt,{projectId:e.projectId,config:e.config,apiBaseUrl:e.apiBaseUrl,children:o.jsx(w1,{...e})})}class Wo extends Error{constructor(n,r){super(n);Hn(this,"status");this.name="AccountApiError",this.status=r}}function se(e){return e??"http://localhost:3000"??""}function Vo(e){return{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}async function ue(e,t,n){var i;const r=await fetch(e,{...n,headers:{...Vo(t),...(n==null?void 0:n.headers)??{}}});let a=null;try{a=await r.json()}catch{}if(!r.ok||(a==null?void 0:a.success)===!1)throw new Wo(((i=a==null?void 0:a.data)==null?void 0:i.toString())||`Request failed (${r.status})`,r.status);return(a==null?void 0:a.data)??a}async function P1(e,t){const n=await fetch(e,{headers:Vo(t)});let r=null;try{r=await n.json()}catch{}if(!n.ok)throw new Wo((r==null?void 0:r.message)||`Request failed (${n.status})`,n.status);return{enabled:(r==null?void 0:r.success)===!0,data:(r==null?void 0:r.data)??{}}}function Ko(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/me`,t)}function N1(e){return{first_name:e.firstName??"",last_name:e.lastName??"",email:e.email??"",address:{city:e.city??"",state:e.state??"",country:e.country??"",code:e.zip??""},timezone:e.timezone??"",language:e.language??"en",phone_number:{number:e.phone}}}function j1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/profile`,n,{method:"PUT",body:JSON.stringify(N1(t))})}function A1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/account`,n,{method:"PUT",body:JSON.stringify({password:t.password,oldPassword:t.oldPassword,captchaToken:t.captchaToken})})}async function E1(e,t,n){const{enabled:r}=await P1(`${se(n)}/api/v1/projects/${e}/2fa/status`,t);return{enabled:r}}async function O1(e,t,n){const r=await ue(`${se(n)}/api/v1/projects/${e}/2fa/enable`,t,{method:"POST",body:JSON.stringify({})});return{secret:typeof r.secret=="string"?r.secret:void 0,qrCodeUrl:(typeof r.qrCode=="string"?r.qrCode:void 0)??(typeof r.qrCodeUrl=="string"?r.qrCodeUrl:void 0),otpauthUrl:typeof r.otpauthUrl=="string"?r.otpauthUrl:void 0}}function T1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/2fa/verify`,n,{method:"POST",body:JSON.stringify({otp:t})})}function I1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/2fa/disable`,n,{method:"POST",body:JSON.stringify({otp:t})})}function R1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/whatsapp/enable`,n,{method:"POST",body:JSON.stringify({number:t})})}function F1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/whatsapp/verify`,n,{method:"POST",body:JSON.stringify(t)})}function _1(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/plans`,t)}function k1(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/recharge-links`,t)}function L1(e,t,n,r){const a=t==="coin"?"?wallet=coin":"";return ue(`${se(r)}/api/v1/projects/${e}/wallet/logs${a}`,n)}function Ho(e){const t=e.transaction??{},n=(e.type??"").toLowerCase(),r=n==="credit"?!0:n==="debit"?!1:e.in===!0,a=typeof e.amount=="number"?e.amount:0,i=e.currency||t.sender_currency||t.receiver_currency||"",s=i?` ${i}`:"",d=e.createdAt?new Date(e.createdAt).getTime():e.created_on;return{id:e.id||e._id||"",description:e.note||e.category||t.category||"Transaction",date:d?new Date(d).toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"",amount:`${r?"+":"-"}${a.toLocaleString()}${s}`,type:r?"credit":"debit"}}function M1(e){const t=e??{},n=t.inclusion??{},r=typeof t.credit=="number"?t.credit:typeof t.balance=="number"?t.balance:Number(t.credit??t.balance)||0,a=k(t.unit)||k(t.creditUnit)||k(t.credit_unit)||k(n.slug),i=(k(t.fundSource)||k(t.fund_source)||k(t.source)).toLowerCase(),s=/coin/.test(i)?"coin":/main/.test(i)?"main":"";return{id:k(t.id)||k(t._id),label:k(n.name)||k(t.label)||k(t.name)||k(t.title)||k(t.walletSlug)||"Credit wallet",balance:r,balanceFormatted:k(t.balanceFormatted)||`${r.toLocaleString()}${a?` ${a}`:""}`.trim(),creditUnit:a,currency:k(t.currency),fundSource:s,rechargeable:t.rechargeable!==!1}}async function zo(e,t,n){const r=await ue(`${se(n)}/api/v1/projects/${e}/credit-wallets`,t);return(Array.isArray(r)?r:Array.isArray(r==null?void 0:r.data)?r.data:[]).map(M1)}async function D1(e,t,n,r){const a=await ue(`${se(r)}/api/v1/projects/${e}/credit-wallets/${t}/logs`,n);return Array.isArray(a)?a.map(Ho):[]}function B1(e,t,n,r,a){return ue(`${se(a)}/api/v1/projects/${e}/credit-wallets/${t}/recharge`,r,{method:"POST",body:JSON.stringify({credits:n.credits,captchaToken:n.captchaToken})})}function U1(e,t,n,r){return ue(`${se(r)}/api/v1/projects/${e}/subscribe`,n,{method:"POST",body:JSON.stringify(t)})}function _t(e,t,n){return ue(`${se(n)}/api/v1/projects/${e}/subscription`,t)}function ir(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;const n=t??{};return k(n.id)||k(n._id)||k(n.plan_id)||k(n.planId)}).filter(Boolean):[]}function yn(e){const t=(e==null?void 0:e.data)??e??{},n=t.plan,r=n&&typeof n=="object"?n:{},a=k(t.plan_id)||k(t.planId)||(typeof n=="string"?n:"")||k(r.id)||k(r._id),i=ir(t.package),s={};for(const f of i)s[f]=(s[f]??0)+1;const d=Array.from(new Set([a,...i,...ir(t.add_on),...ir(t.addons)].filter(Boolean))),l=t.expiry??t.expiresAt??t.endDate;let u="";return typeof l=="number"&&l>0?u=new Date(l).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"2-digit"}):typeof l=="string"&&l?u=l:u=k(t.renewsAt)||k(t.nextBillingDate),{planId:a,duration:k(t.validity)||k(t.duration)||k(t.billingCycle),status:k(t.status)||k(t.type),renewsAt:u,subscribedIds:d,packageCounts:s}}function k(e){return typeof e=="string"?e:""}function qo(e){const t=(e==null?void 0:e.data)??e??{},n=t.profile??{},r=n.name??{},a=n.address??{},i=n.phone_number??{},s=n.whatsapp??{};return{id:k(t.id),username:k(t.username),firstName:k(r.first),lastName:k(r.last),email:k(n.email)||k(t.username),phone:k(i.number),whatsapp:k(s.number),whatsappVerified:!!s.verified,city:k(a.city),state:k(a.state),country:k(a.country),zip:k(a.code),timezone:k(n.timezone),language:k(n.language)||"en",emailVerified:!!(n.emailVerified??n.email_verified??(k(n.email)||k(t.username))),avatarUrl:k(n.profile_picture)||void 0,mainWallet:t.mainWallet,coinWallet:t.coinWallet}}async function Yo(e,t,n){const r=await Ko(e,t,n);return qo(r)}async function G1(e,t,n){const r=await Yo(e,t,n);return{mainWallet:r.mainWallet,coinWallet:r.coinWallet}}function W1(e,t,n){return zo(e,t,n)}function V1(e,t,n){return _t(e,t,n)}function K1(e){const t=e.trim();return/^(https?:|mailto:|\/|#)/i.test(t)?t:null}function De(e,t){const n=[],r=/(`[^`]+`)|(\*\*[^*]+\*\*|__[^_]+__)|(~~[^~]+~~)|(\*[^*]+\*|_[^_]+_)|(\[[^\]]+\]\([^)]+\))/g;let a=0,i,s=0;for(;(i=r.exec(e))!==null;){i.index>a&&n.push(e.slice(a,i.index));const d=i[0],l=`${t}-${s}`;if(i[1])n.push(o.jsx("code",{className:"aas-md-code",children:d.slice(1,-1)},l));else if(i[2])n.push(o.jsx("strong",{children:De(d.slice(2,-2),l)},l));else if(i[3])n.push(o.jsx("del",{children:De(d.slice(2,-2),l)},l));else if(i[4])n.push(o.jsx("em",{children:De(d.slice(1,-1),l)},l));else if(i[5]){const u=/\[([^\]]+)\]\(([^)]+)\)/.exec(d),f=u?K1(u[2]):null;u&&f?n.push(o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:u[1]},l)):n.push(d)}a=r.lastIndex,s++}return a<e.length&&n.push(e.slice(a)),n}const H1=/^(#{1,6}\s|>\s?|\s*[-*+]\s+|\s*\d+\.\s+|```|(-{3,}|\*{3,}|_{3,})$)/;function Zo(e){const t=e.replace(/\r\n?/g,`
42
42
  `).split(`
43
43
  `),n=[];let r=0,a=0;for(;r<t.length;){const i=t[r];if(!i.trim()){r++;continue}if(/^\s*```/.test(i)){const l=[];for(r++;r<t.length&&!/^\s*```/.test(t[r]);)l.push(t[r]),r++;r++,n.push(o.jsx("pre",{className:"aas-md-pre",children:o.jsx("code",{children:l.join(`
44
44
  `)})},a++));continue}const s=/^(#{1,6})\s+(.*)$/.exec(i);if(s){const l=s[1].length;n.push(c.createElement(`h${l}`,{key:a++,className:`aas-md-h aas-md-h${l}`},De(s[2],`h-${a}`))),r++;continue}if(/^(-{3,}|\*{3,}|_{3,})$/.test(i.trim())){n.push(o.jsx("hr",{className:"aas-md-hr"},a++)),r++;continue}if(/^>\s?/.test(i)){const l=[];for(;r<t.length&&/^>\s?/.test(t[r]);)l.push(t[r].replace(/^>\s?/,"")),r++;n.push(o.jsx("blockquote",{className:"aas-md-quote",children:Zo(l.join(`
@@ -9740,6 +9740,7 @@ const sr = {
9740
9740
  { code: "GH", name: "Ghana" },
9741
9741
  { code: "TZ", name: "Tanzania" },
9742
9742
  { code: "UG", name: "Uganda" },
9743
+ { code: "GA", name: "Gabon" },
9743
9744
  { code: "MA", name: "Morocco" },
9744
9745
  { code: "RU", name: "Russia" },
9745
9746
  { code: "UA", name: "Ukraine" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ab-ecosystem-sso",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "main": "dist/ab-ecosystem-sso.cjs",
6
6
  "module": "dist/ab-ecosystem-sso.js",