@ozdao/prometheus-framework 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,4 +5,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
5
5
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ln(e,n){if(e){if(typeof e=="string")return we(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return we(e,n)}}function we(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,d=new Array(n);t<n;t++)d[t]=e[t];return d}function Pe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);n&&(d=d.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,d)}return t}function Ne(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Pe(Object(t),!0).forEach(function(d){un(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pe(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function un(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var Ee={formatExtension:function(n,t,d){return"".concat(n).concat(d.ext()).concat(t)}};function $n(e,n,t,d){if(t?t=Ne(Ne({},Ee),t):t=Ee,d=new C(d),e.country&&e.country!=="001"){if(!d.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));d.country(e.country)}else if(e.countryCallingCode)d.selectNumberingPlan(e.countryCallingCode);else return e.phone||"";var o=d.countryCallingCode(),i=t.v2?e.nationalNumber:e.phone,a;switch(n){case"NATIONAL":return i?(a=B(i,e.carrierCode,"NATIONAL",d,t),H(a,e.ext,d,t.formatExtension)):"";case"INTERNATIONAL":return i?(a=B(i,null,"INTERNATIONAL",d,t),a="+".concat(o," ").concat(a),H(a,e.ext,d,t.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(i);case"RFC3966":return an({number:"+".concat(o).concat(i),ext:e.ext});case"IDD":if(!t.fromCountry)return;var s=fn(i,e.carrierCode,o,t.fromCountry,d);return H(s,e.ext,d,t.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(n,'"'))}}function B(e,n,t,d,o){var i=cn(d.formats(),e);return i?dn(e,i,{useInternationalFormat:t==="INTERNATIONAL",withNationalPrefix:!(i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&o&&o.nationalPrefix===!1),carrierCode:n,metadata:d}):e}function cn(e,n){for(var t=sn(e),d;!(d=t()).done;){var o=d.value;if(o.leadingDigitsPatterns().length>0){var i=o.leadingDigitsPatterns()[o.leadingDigitsPatterns().length-1];if(n.search(i)!==0)continue}if(I(n,o.pattern()))return o}}function H(e,n,t,d){return n?d(e,n,t):e}function fn(e,n,t,d,o){var i=ne(d,o.metadata);if(i===t){var a=B(e,n,"NATIONAL",o);return t==="1"?t+" "+a:a}var s=on(d,void 0,o.metadata);if(s)return"".concat(s," ").concat(t," ").concat(B(e,null,"INTERNATIONAL",o))}function Oe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);n&&(d=d.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,d)}return t}function Se(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Oe(Object(t),!0).forEach(function(d){pn(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Oe(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function pn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function mn(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Ie(e,n){for(var t=0;t<n.length;t++){var d=n[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function hn(e,n,t){return n&&Ie(e.prototype,n),t&&Ie(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var yn=function(){function e(n,t,d){if(mn(this,e),!n)throw new TypeError("`country` or `countryCallingCode` not passed");if(!t)throw new TypeError("`nationalNumber` not passed");if(!d)throw new TypeError("`metadata` not passed");var o=vn(n,d),i=o.country,a=o.countryCallingCode;this.country=i,this.countryCallingCode=a,this.nationalNumber=t,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return d}}return hn(e,[{key:"setExt",value:function(t){this.ext=t}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Qt(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return qt(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Jt(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var t=new C(this.getMetadata());return t.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return re(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,d){return $n(this,t,d?Se(Se({},d),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}]),e}(),gn=function(n){return/^[A-Z]{2}$/.test(n)};function vn(e,n){var t,d,o=new C(n);return gn(e)?(t=e,o.selectNumberingPlan(t),d=o.countryCallingCode()):d=e,{country:t,countryCallingCode:d}}var bn=new RegExp("(["+N+"])");function _n(e,n,t,d){if(n){var o=new C(d);o.selectNumberingPlan(n,t);var i=new RegExp(o.IDDPrefix());if(e.search(i)===0){e=e.slice(e.match(i)[0].length);var a=e.match(bn);if(!(a&&a[1]!=null&&a[1].length>0&&a[1]==="0"))return e}}}function Cn(e,n){if(e&&n.numberingPlan.nationalPrefixForParsing()){var t=new RegExp("^(?:"+n.numberingPlan.nationalPrefixForParsing()+")"),d=t.exec(e);if(d){var o,i,a=d.length-1,s=a>0&&d[a];if(n.nationalPrefixTransformRule()&&s)o=e.replace(t,n.nationalPrefixTransformRule()),a>1&&(i=d[1]);else{var $=d[0];o=e.slice($.length),s&&(i=d[1])}var l;if(s){var m=e.indexOf(d[1]),y=e.slice(0,m);y===n.numberingPlan.nationalPrefix()&&(l=n.numberingPlan.nationalPrefix())}else l=d[0];return{nationalNumber:o,nationalPrefix:l,carrierCode:i}}}return{nationalNumber:e}}function X(e,n){var t=Cn(e,n),d=t.carrierCode,o=t.nationalNumber;if(o!==e){if(!wn(e,o,n))return{nationalNumber:e};if(n.possibleLengths()&&!Pn(o,n))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:d}}function wn(e,n,t){return!(I(e,t.nationalNumberPattern())&&!I(n,t.nationalNumberPattern()))}function Pn(e,n){switch(de(e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Nn(e,n,t,d){var o=n?ne(n,d):t;if(e.indexOf(o)===0){d=new C(d),d.selectNumberingPlan(n,t);var i=e.slice(o.length),a=X(i,d),s=a.nationalNumber,$=X(e,d),l=$.nationalNumber;if(!I(l,d.nationalNumberPattern())&&I(s,d.nationalNumberPattern())||de(l,d)==="TOO_LONG")return{countryCallingCode:o,number:i}}return{number:e}}function En(e,n,t,d){if(!e)return{};var o;if(e[0]!=="+"){var i=_n(e,n,t,d);if(i&&i!==e)o=!0,e="+"+i;else{if(n||t){var a=Nn(e,n,t,d),s=a.countryCallingCode,$=a.number;if(s)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:s,number:$}}return{number:e}}}if(e[1]==="0")return{};d=new C(d);for(var l=2;l-1<=mt&&l<=e.length;){var m=e.slice(1,l);if(d.hasCallingCode(m))return d.selectNumberingPlan(m),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:m,number:e.slice(l)};l++}return{}}function On(e,n){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=Sn(e))||n&&e&&typeof e.length=="number"){t&&(e=t);var d=0;return function(){return d>=e.length?{done:!0}:{done:!1,value:e[d++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
6
6
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sn(e,n){if(e){if(typeof e=="string")return Te(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Te(e,n)}}function Te(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,d=new Array(n);t<n;t++)d[t]=e[t];return d}function In(e,n){var t=n.countries,d=n.defaultCountry,o=n.metadata;o=new C(o);for(var i=[],a=On(t),s;!(s=a()).done;){var $=s.value;if(o.country($),o.leadingDigits()){if(e&&e.search(o.leadingDigits())===0)return $}else if(re({phone:e,country:$},void 0,o.metadata))if(d){if($===d)return $;i.push($)}else return $}if(i.length>0)return i[0]}var Tn=!1;function An(e,n){var t=n.nationalNumber,d=n.defaultCountry,o=n.metadata;if(Tn&&o.isNonGeographicCallingCode(e))return"001";var i=o.getCountryCodesForCallingCode(e);if(i)return i.length===1?i[0]:In(t,{countries:i,defaultCountry:d,metadata:o.metadata})}var Ze="+",Fn="[\\-\\.\\(\\)]?",Ae="(["+N+"]|"+Fn+")",Dn="^\\"+Ze+Ae+"*["+N+"]"+Ae+"*$",kn=new RegExp(Dn,"g"),Y=N,Rn="["+Y+"]+((\\-)*["+Y+"])*",xn="a-zA-Z",Mn="["+xn+"]+((\\-)*["+Y+"])*",zn="^("+Rn+"\\.)*"+Mn+"\\.?$",Ln=new RegExp(zn,"g"),Fe="tel:",Z=";phone-context=",Bn=";isub=";function Vn(e){var n=e.indexOf(Z);if(n<0)return null;var t=n+Z.length;if(t>=e.length)return"";var d=e.indexOf(";",t);return d>=0?e.substring(t,d):e.substring(t)}function jn(e){return e===null?!0:e.length===0?!1:kn.test(e)||Ln.test(e)}function Un(e,n){var t=n.extractFormattedPhoneNumber,d=Vn(e);if(!jn(d))throw new O("NOT_A_NUMBER");var o;if(d===null)o=t(e)||"";else{o="",d.charAt(0)===Ze&&(o+=d);var i=e.indexOf(Fe),a;i>=0?a=i+Fe.length:a=0;var s=e.indexOf(Z);o+=e.substring(a,s)}var $=o.indexOf(Bn);if($>0&&(o=o.substring(0,$)),o!=="")return o}var Gn=250,Hn=new RegExp("["+te+N+"]"),Kn=new RegExp("[^"+N+"#]+$");function Wn(e,n,t){if(n=n||{},t=new C(t),n.defaultCountry&&!t.hasCountry(n.defaultCountry))throw n.v2?new O("INVALID_COUNTRY"):new Error("Unknown country: ".concat(n.defaultCountry));var d=Xn(e,n.v2,n.extract),o=d.number,i=d.ext,a=d.error;if(!o){if(n.v2)throw a==="TOO_SHORT"?new O("TOO_SHORT"):new O("NOT_A_NUMBER");return{}}var s=Zn(o,n.defaultCountry,n.defaultCallingCode,t),$=s.country,l=s.nationalNumber,m=s.countryCallingCode,y=s.countryCallingCodeSource,p=s.carrierCode;if(!t.hasSelectedNumberingPlan()){if(n.v2)throw new O("INVALID_COUNTRY");return{}}if(!l||l.length<ee){if(n.v2)throw new O("TOO_SHORT");return{}}if(l.length>pt){if(n.v2)throw new O("TOO_LONG");return{}}if(n.v2){var c=new yn(m,l,t.metadata);return $&&(c.country=$),p&&(c.carrierCode=p),i&&(c.ext=i),c.__countryCallingCodeSource=y,c}var f=(n.extended?t.hasSelectedNumberingPlan():$)?I(l,t.nationalNumberPattern()):!1;return n.extended?{country:$,countryCallingCode:m,carrierCode:p,valid:f,possible:f?!0:!!(n.extended===!0&&t.possibleLengths()&&Ye(l,t)),phone:l,ext:i}:f?Yn($,l,i):{}}function qn(e,n,t){if(e){if(e.length>Gn){if(t)throw new O("TOO_LONG");return}if(n===!1)return e;var d=e.search(Hn);if(!(d<0))return e.slice(d).replace(Kn,"")}}function Xn(e,n,t){var d=Un(e,{extractFormattedPhoneNumber:function(a){return qn(a,t,n)}});if(!d)return{};if(!Mt(d))return zt(d)?{error:"TOO_SHORT"}:{};var o=Lt(d);return o.ext?o:{number:d}}function Yn(e,n,t){var d={country:e,phone:n};return t&&(d.ext=t),d}function Zn(e,n,t,d){var o=En(be(e),n,t,d.metadata),i=o.countryCallingCodeSource,a=o.countryCallingCode,s=o.number,$;if(a)d.selectNumberingPlan(a);else if(s&&(n||t))d.selectNumberingPlan(n,t),n&&($=n),a=t||ne(n,d.metadata);else return{};if(!s)return{countryCallingCodeSource:i,countryCallingCode:a};var l=X(be(s),d),m=l.nationalNumber,y=l.carrierCode,p=An(a,{nationalNumber:m,defaultCountry:n,metadata:d});return p&&($=p,p==="001"||d.country($)),{country:$,countryCallingCode:a,countryCallingCodeSource:i,nationalNumber:m,carrierCode:y}}function De(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);n&&(d=d.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,d)}return t}function ke(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?De(Object(t),!0).forEach(function(d){Jn(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):De(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function Jn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Qn(e,n,t){return Wn(e,ke(ke({},n),{},{v2:!0}),t)}function J(e){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},J(e)}function Re(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);n&&(d=d.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,d)}return t}function ed(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Re(Object(t),!0).forEach(function(d){td(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Re(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function td(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function nd(e,n){return id(e)||od(e,n)||rd(e,n)||dd()}function dd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
7
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rd(e,n){if(e){if(typeof e=="string")return xe(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xe(e,n)}}function xe(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,d=new Array(n);t<n;t++)d[t]=e[t];return d}function od(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var d=[],o=!0,i=!1,a,s;try{for(t=t.call(e);!(o=(a=t.next()).done)&&(d.push(a.value),!(n&&d.length===n));o=!0);}catch($){i=!0,s=$}finally{try{!o&&t.return!=null&&t.return()}finally{if(i)throw s}}return d}}function id(e){if(Array.isArray(e))return e}function ad(e){var n=Array.prototype.slice.call(e),t=nd(n,4),d=t[0],o=t[1],i=t[2],a=t[3],s,$,l;if(typeof d=="string")s=d;else throw new TypeError("A text for parsing must be a string.");if(!o||typeof o=="string")a?($=i,l=a):($=void 0,l=i),o&&($=ed({defaultCountry:o},$));else if(sd(o))i?($=o,l=i):l=o;else throw new Error("Invalid second argument: ".concat(o));return{text:s,options:$,metadata:l}}var sd=function(n){return J(n)==="object"};function Me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);n&&(d=d.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,d)}return t}function ze(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Me(Object(t),!0).forEach(function(d){ld(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function ld(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ud(e,n,t){n&&n.defaultCountry&&!Tt(n.defaultCountry,t)&&(n=ze(ze({},n),{},{defaultCountry:void 0}));try{return Qn(e,n,t)}catch(d){if(!(d instanceof O))throw d}}function $d(){var e=ad(arguments),n=e.text,t=e.options,d=e.metadata;return ud(n,t,d)}function K(){return at($d,arguments)}const cd={class:"cols-2-1_2 gap-small pd-small bg-white"},fd=r.createElementVNode("section",{class:"w-100 desktop-only o-hidden radius-big bg-grad-main"},null,-1),Je={__name:"Auth",setup(e){return r.ref(null),r.ref(null),r.ref(null),w.useRoute(),w.useRouter(),r.ref("email"),(n,t)=>{const d=r.resolveComponent("router-view");return r.openBlock(),r.createElementBlock("div",cd,[r.createVNode(d,{class:"pd-medium br-solid br-1px br-grey radius-big w-m-66r t-center"},{default:r.withCtx(({Component:o,route:i})=>[r.createVNode(r.Transition,{name:"scaleIn",mode:"out-in"},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(o),{ref:"page",key:i.path,localPosition:n.localPosition},null,8,["localPosition"]))]),_:2},1024)]),_:1}),fd])}}};function Le(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{verifyNumberTitle:t=>{const{normalize:d}=t;return d(["Verify Number"])},instructions:t=>{const{normalize:d}=t;return d(["We have sent a registration code to your phone number. Please enter it in the field below:"])},resendCode:t=>{const{normalize:d}=t;return d(["Send the code again"])},secondsResend:t=>{const{normalize:d}=t;return d(["seconds to the possibility of sending the code again."])}},ru:{verifyNumberTitle:t=>{const{normalize:d}=t;return d(["Подтвердите номер"])},instructions:t=>{const{normalize:d}=t;return d(["Мы отправили код регистрации на ваш номер телефона. Введите его в поле ниже:"])},resendCode:t=>{const{normalize:d}=t;return d(["Отправить код еще раз"])},secondsResend:t=>{const{normalize:d}=t;return d(["секунд до возможности отправить код еще раз."])}}}})}const pd={class:"t-center pd-medium"},md={class:"mn-medium"},hd={class:"mn-big t-transp"},yd={class:"w-100 mn-big flex-nowrap flex"},gd={key:1},oe={__name:"EnterCode",setup(e){const n=w.useRoute(),t=w.useRouter(),{t:d}=k.useI18n({inheritLocale:!0,useScope:"local"}),o=r.reactive({digits:["","","",""],error:null}),i=r.ref(null),a=r.ref(0);async function s(){try{await u.sendCode(u.state.user,n.query.type,u.state.user.phone?"phone":"email"),a.value=30;const p=setInterval(()=>{a.value>0?a.value-=1:clearInterval(p)},1e3)}catch{A.setError({response:{data:{errorCode:"CODE_NOT_SENT"}}})}}const $=(p,c)=>{navigator.clipboard.readText().then(g=>{if(g&&/^\d{4}$/.test(g)){for(let h=0;h<4;h++)o.digits[c+h]=g[h];y(c+3)}})},l=(p,c)=>{p.preventDefault();const f=p.clipboardData.getData("text/plain");if(/^\d{4}$/.test(f)){for(let g=0;g<4;g++)o.digits[c+g]=f[g];y(c+3)}else A.setError({response:{data:{errorCode:"INPUT_ERROR"}}})},m=(p,c)=>{if(p.key==="Backspace"&&(o.digits[c]===null||o.digits[c]===void 0||o.digits[c]==="")){p.preventDefault();const f=document.querySelectorAll("input"),g=c>0?f[c-1]:null;g&&(g.focus(),g.setSelectionRange(g.value.length,g.value.length))}},y=p=>{const c=document.querySelectorAll("input"),f=c[p+1],g=p>0?c[p-1]:null;if(o.digits[p]!==""&&o.digits[p]!==null&&o.digits[p]!==void 0&&p<4&&(p<3?f.focus():i.value.focus()),(o.digits[p]===null||o.digits[p]===void 0||o.digits[p]==="")&&p>0&&g.focus(),o.digits.every(h=>h!=="")){const h=o.digits.join(""),v=u.state$1.code.code.toString();h===v?(u.state$1.code.isValid=!0,t.push({path:"/auth/enter-password",query:{type:u.state$1.code.type,method:n.query.method}})):(A.setError({response:{data:{errorCode:"WRONG_CODE"}}}),i.value.focus(),o.digits=["","","",""])}};return(p,c)=>(r.openBlock(),r.createElementBlock("section",pd,[r.createElementVNode("h3",md,r.toDisplayString(r.unref(d)("verifyNumberTitle")),1),r.createElementVNode("p",hd,r.toDisplayString(r.unref(d)("instructions")),1),r.createElementVNode("div",yd,[r.withDirectives(r.createElementVNode("input",{type:"number","onUpdate:modelValue":c[0]||(c[0]=f=>o.digits[0]=f),ref_key:"firstInput",ref:i,maxlength:"1",onInput:c[1]||(c[1]=f=>y(0)),onPaste:c[2]||(c[2]=f=>l(f,0)),onKeydown:c[3]||(c[3]=f=>m(f,0)),onFocus:c[4]||(c[4]=f=>$(f,0)),class:"w-100 h1 pd-small t-center bg-grey radius-small mn-r-small"},null,544),[[r.vModelText,o.digits[0]]]),r.withDirectives(r.createElementVNode("input",{type:"number","onUpdate:modelValue":c[5]||(c[5]=f=>o.digits[1]=f),maxlength:"1",onInput:c[6]||(c[6]=f=>y(1)),onPaste:c[7]||(c[7]=f=>l(f,1)),onKeydown:c[8]||(c[8]=f=>m(f,1)),class:"w-100 h1 pd-small t-center bg-grey radius-small mn-r-small"},null,544),[[r.vModelText,o.digits[1]]]),r.withDirectives(r.createElementVNode("input",{type:"number","onUpdate:modelValue":c[9]||(c[9]=f=>o.digits[2]=f),maxlength:"1",onInput:c[10]||(c[10]=f=>y(2)),onPaste:c[11]||(c[11]=f=>l(f,2)),onKeydown:c[12]||(c[12]=f=>m(f,2)),class:"w-100 h1 pd-small t-center bg-grey radius-small mn-r-small"},null,544),[[r.vModelText,o.digits[2]]]),r.withDirectives(r.createElementVNode("input",{type:"number","onUpdate:modelValue":c[13]||(c[13]=f=>o.digits[3]=f),maxlength:"1",onInput:c[14]||(c[14]=f=>y(3)),onPaste:c[15]||(c[15]=f=>l(f,3)),onKeydown:c[16]||(c[16]=f=>m(f,3)),class:"w-100 h1 pd-small t-center bg-grey radius-small"},null,544),[[r.vModelText,o.digits[3]]])]),a.value<1?(r.openBlock(),r.createElementBlock("a",{key:0,onClick:s,class:"t-blue"},r.toDisplayString(r.unref(d)("resendCode")),1)):(r.openBlock(),r.createElementBlock("span",gd,r.toDisplayString(a.value)+" "+r.toDisplayString(r.unref(d)("secondsResend")),1))]))}};typeof Le=="function"&&Le(oe);const vd=Object.freeze(Object.defineProperty({__proto__:null,default:oe},Symbol.toStringTag,{value:"Module"})),D=u.axios.create({baseURL:process.env.API_URL,withCredentials:!0});D.defaults.withCredentials=!0;const S=r.reactive({invites:[],invite:null,error:null}),Qe={async read(e){await D.get(`/api/invites/${e}`).then(n=>{S.invites=n.data,S.error=null}).catch(n=>{A.setError(n)})},async readOne(e){await D.get(`/api/invites/get/${e}`).then(n=>{S.invite=n.data,u.state.user.phone=n.data.invitedPhone,u.state.user.email=n.data.invitedEmail}).catch(n=>{A.setError(n)})},async create(e,n){await D.post(`/api/invites/${e}/create`,n).then(()=>{S.error=null}).catch(t=>{A.setError(t)})},async update(e,n){await D.put(`/api/invites/${e}/update`,n).then(()=>{S.error=null}).catch(t=>{A.setError(t)})},async delete(e){await D.delete(`/api/invites/${e}/delete`).then(()=>{S.error=null}).catch(n=>{A.setError(n)})}};r.watch(S,(e,n)=>{});const bd=Object.freeze(Object.defineProperty({__proto__:null,actions:Qe,state:S},Symbol.toStringTag,{value:"Module"}));const _d={class:"t-left pd-medium"},Cd=r.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),wd=r.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),Pd={class:"mn-semi radius-small o-hidden"},Nd={key:0},Ed={key:1},et={__name:"Invite",async setup(e){let n,t;const d=r.ref(null),o=w.useRoute(),i=w.useRouter();[n,t]=r.withAsyncContext(()=>Qe.readOne(o.query.inviteCode)),await n,t();async function a(){try{await b.validateInputs(d,b.validatePassword,u.state.user.password,"Некорректный пароль")}catch{throw new Error}await u.actions.signup(u.state.user,o.query.type,o.query.inviteCode)}function s(){i.push({name:"Dashboard"})}return($,l)=>(r.openBlock(),r.createElementBlock("section",_d,[Cd,wd,r.createElementVNode("div",Pd,[r.createVNode(u.Field,{field:u.state.user.password,"onUpdate:field":l[0]||(l[0]=m=>u.state.user.password=m),type:"password",validation:d.value,label:"Пароль",placeholder:"******",class:"bg-white radius-small mn-small"},null,8,["field","validation"]),r.createVNode(u.Field,{field:u.state.user.passwordRepeat,"onUpdate:field":l[1]||(l[1]=m=>u.state.user.passwordRepeat=m),type:"password",label:"Повторите пароль",placeholder:"******",class:"bg-white radius-small mn-semi"},null,8,["field"])]),r.createVNode(u._sfc_main,{disabled:S.invite===null,submit:a,callback:s,class:"mn-big"},{default:r.withCtx(()=>[r.unref(o).query.method==="reset-password"?(r.openBlock(),r.createElementBlock("span",Nd,"Поменять пароль")):(r.openBlock(),r.createElementBlock("span",Ed,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}},Od=Object.freeze(Object.defineProperty({__proto__:null,default:et},Symbol.toStringTag,{value:"Module"}));function Be(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{almostDone:t=>{const{normalize:d}=t;return d(["Almost there!"])},newPasswordPrompt:t=>{const{normalize:d}=t;return d(["Please, set a new password."])},registrationPasswordPrompt:t=>{const{normalize:d}=t;return d(["Please, set your password to complete the registration."])},passwordPlaceholder:t=>{const{normalize:d}=t;return d(["Password"])},repeatPasswordPlaceholder:t=>{const{normalize:d}=t;return d(["Repeat Password"])},changePasswordBtn:t=>{const{normalize:d}=t;return d(["Change Password"])},registerBtn:t=>{const{normalize:d}=t;return d(["Register"])}},ru:{almostDone:t=>{const{normalize:d}=t;return d(["Почти все!"])},newPasswordPrompt:t=>{const{normalize:d}=t;return d(["Пожалуйста, укажите новый пароль."])},registrationPasswordPrompt:t=>{const{normalize:d}=t;return d(["Пожалуйста, укажите пароль, на этом регистрация будет закончена."])},passwordPlaceholder:t=>{const{normalize:d}=t;return d(["Пароль"])},repeatPasswordPlaceholder:t=>{const{normalize:d}=t;return d(["Повторите пароль"])},changePasswordBtn:t=>{const{normalize:d}=t;return d(["Поменять пароль"])},registerBtn:t=>{const{normalize:d}=t;return d(["Зарегистрироваться"])}}}})}const Sd={class:"t-left pd-medium"},Id={class:"mn-small"},Td={key:0,class:"mn-semi t-transp"},Ad={key:1,class:"mn-semi t-transp"},Fd={class:"mn-semi radius-small o-hidden"},Dd={key:0},kd={key:1},ie={__name:"EnterPassword",setup(e){const n=r.ref(null),{t}=k.useI18n({inheritLocale:!0,useScope:"local"}),d=w.useRoute(),o=w.useRouter();r.ref("phone");async function i(){try{await b.validateInputs(n,b.validatePassword,u.state.user.password,"Некорректный пароль")}catch{throw new Error}d.query.method==="reset-password"&&await u.actions.updatePassword(u.state.user,d.query.type),d.query.method!=="reset-password"&&await u.actions.signup(u.state.user,d.query.type)}function a(){o.push({name:"User Profile",params:{_id:u.state.user._id}})}return(s,$)=>(r.openBlock(),r.createElementBlock("section",Sd,[r.createElementVNode("h3",Id,r.toDisplayString(r.unref(t)("almostDone")),1),r.unref(d).query.method==="reset-password"?(r.openBlock(),r.createElementBlock("p",Td,r.toDisplayString(r.unref(t)("newPasswordPrompt")),1)):(r.openBlock(),r.createElementBlock("p",Ad,r.toDisplayString(r.unref(t)("registrationPasswordPrompt")),1)),r.createElementVNode("div",Fd,[r.createVNode(u.Field,{field:u.state.user.password,"onUpdate:field":$[0]||($[0]=l=>u.state.user.password=l),type:"password",validation:n.value,placeholder:r.unref(t)("passwordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","validation","placeholder"]),r.createVNode(u.Field,{field:u.state.user.passwordRepeat,"onUpdate:field":$[1]||($[1]=l=>u.state.user.passwordRepeat=l),type:"password",placeholder:r.unref(t)("repeatPasswordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","placeholder"])]),r.createVNode(u._sfc_main,{submit:i,callback:a,class:"mn-big"},{default:r.withCtx(()=>[r.unref(d).query.method==="reset-password"?(r.openBlock(),r.createElementBlock("span",Dd,r.toDisplayString(r.unref(t)("changePasswordBtn")),1)):(r.openBlock(),r.createElementBlock("span",kd,r.toDisplayString(r.unref(t)("registerBtn")),1))]),_:1})]))}};typeof Be=="function"&&Be(ie);const Rd=Object.freeze(Object.defineProperty({__proto__:null,default:ie},Symbol.toStringTag,{value:"Module"})),xd=[["‫افغانستان‬‎","af","93",,"🇦🇫"],["Shqipëri","al","355",,"🇦🇱"],["‫الجزائر‬‎","dz","213",,"🇩🇿"],["American Samoa","as","1684",,"🇦🇸"],["Andorra","ad","376",,"🇦🇩"],["Angola","ao","244",,"🇦🇴"],["Anguilla","ai","1264",,"🇦🇮"],["Antigua and Barbuda","ag","1268",,"🇦🇬"],["Argentina","ar","54",,"🇦🇷"],["Հայաստան","am","374",,"🇦🇲"],["Aruba","aw","297",,"🇦🇼"],["Australia","au","61",0,,"🇦🇺"],["Österreich","at","43",,"🇦🇹"],["Azərbaycan","az","994",,"🇦🇿"],["Bahamas","bs","1242",,"🇧🇸"],["‫البحرين‬‎","bh","973",,"🇧🇭"],["বাংলাদেশ","bd","880",,"🇧🇩"],["Barbados","bb","1246",,"🇧🇧"],["Беларусь","by","375",,"🇧🇾"],["België","be","32",,"🇧🇪"],["Belize","bz","501",,"🇧🇿"],["Bénin","bj","229",,"🇧🇯"],["Bermuda","bm","1441",,"🇧🇲"],["འབྲུག","bt","975",,"🇧🇹"],["Bolivia","bo","591",,"🇧🇴"],["Босна и Херцеговина","ba","387",,"🇧🇦"],["Botswana","bw","267",,"🇧🇼"],["Brasil","br","55",,"🇧🇷"],["British Indian Ocean Territory","io","246",,"🇮🇴"],["British Virgin Islands","vg","1284",,"🇻🇬"],["Brunei","bn","673",,"🇧🇳"],["България","bg","359",,"🇧🇬"],["Burkina Faso","bf","226",,"🇧🇫"],["Uburundi","bi","257",,"🇧🇮"],["កម្ពុជា","kh","855",,"🇰🇭"],["Cameroun","cm","237",,"🇨🇲"],["Canada","ca","1",1,"🇨🇦"],["Kabu Verdi","cv","238",,"🇨🇻"],["Caribbean Netherlands","bq","599",1,,"🇧🇶"],["Cayman Islands","ky","1345",,"🇰🇾"],["République centrafricaine","cf","236",,"🇨🇫"],["Tchad","td","235",,"🇹🇩"],["Chile","cl","56",,"🇨🇱"],["中国","cn","86",,"🇨🇳"],["Christmas Island","cx","61",2,,"🇨🇽"],["Keeling","cc","61",1,,"🇨🇨"],["Colombia","co","57",,"🇨🇴"],["‫جزر القمر‬‎","km","269",,"🇰🇲"],["DRC","cd","243",,"🇨🇩"],["Republic","cg","242",,"🇨🇬"],["Cook Islands","ck","682",,"🇨🇰"],["Costa Rica","cr","506",,"🇨🇷"],["Côte d’Ivoire","ci","225",,"🇨🇮"],["Hrvatska","hr","385",,"🇭🇷"],["Cuba","cu","53",,"🇨🇺"],["Curaçao","cw","599",0,,"🇨🇼"],["Κύπρος","cy","357",,"🇨🇾"],["Česká republika","cz","420",,"🇨🇿"],["Danmark","dk","45",,"🇩🇰"],["Djibouti","dj","253",,"🇩🇯"],["Dominica","dm","1767",,"🇩🇲"],["República Dominicana","do","1",2,["809","829","849","🇩🇴"]],["Ecuador","ec","593",,"🇪🇨"],["‫مصر‬‎","eg","20",,"🇪🇬"],["El Salvador","sv","503",,"🇸🇻"],["Guinea Ecuatorial","gq","240",,"🇬🇶"],["Eritrea","er","291",,"🇪🇷"],["Eesti","ee","372",,"🇪🇪"],["Ethiopia","et","251",,"🇪🇹"],["Islas Malvinas","fk","500",,"🇫🇰"],["Føroyar","fo","298",,"🇫🇴"],["Fiji","fj","679",,"🇫🇯"],["Suomi","fi","358",0,,"🇫🇮"],["France","fr","33",,"🇫🇷"],["Guyane française","gf","594",,"🇬🇫"],["Polynésie française","pf","689",,"🇵🇫"],["Gabon","ga","241",,"🇬🇦"],["Gambia","gm","220",,"🇬🇲"],["საქართველო","ge","995",,"🇬🇪"],["Deutschland","de","49",,"🇩🇪"],["Gaana","gh","233",,"🇬🇭"],["Gibraltar","gi","350",,"🇬🇮"],["Ελλάδα","gr","30",,"🇬🇷"],["Kalaallit Nunaat","gl","299",,"🇬🇱"],["Grenada","gd","1473",,"🇬🇩"],["Guadeloupe","gp","590",0,,"🇬🇵"],["Guam","gu","1671",,"🇬🇺"],["Guatemala","gt","502",,"🇬🇹"],["Guernsey","gg","44",1,,"🇬🇬"],["Guinée","gn","224",,"🇬🇳"],["Guiné Bissau","gw","245",,"🇬🇼"],["Guyana","gy","592",,"🇬🇾"],["Haiti","ht","509",,"🇭🇹"],["Honduras","hn","504",,"🇭🇳"],["香港","hk","852",,"🇭🇰"],["Magyarország","hu","36",,"🇭🇺"],["Ísland","is","354",,"🇮🇸"],["भारत","in","91",,"🇮🇳"],["Indonesia","id","62",,"🇮🇩"],["‫ایران‬‎","ir","98",,"🇮🇷"],["‫العراق‬‎","iq","964",,"🇮🇶"],["Ireland","ie","353",,"🇮🇪"],["Isle of Man","im","44",2,,"🇮🇲"],["‫ישראל‬‎","il","972",,"🇮🇱"],["Italia","it","39",0,,"🇮🇹"],["Jamaica","jm","1876",,"🇯🇲"],["日本","jp","81",,"🇯🇵"],["Jersey","je","44",3,,"🇯🇪"],["‫الأردن‬‎","jo","962",,"🇯🇴"],["Казахстан","kz","7",1,,"🇰🇿"],["Kenya","ke","254",,"🇰🇪"],["Kiribati","ki","686",,"🇰🇮"],["Kosovo","xk","383",,"🇽🇰"],["‫الكويت‬‎","kw","965",,"🇰🇼"],["Кыргызстан","kg","996",,"🇰🇬"],["ລາວ","la","856",,"🇱🇦"],["Latvija","lv","371",,"🇱🇻"],["‫لبنان‬‎","lb","961",,"🇱🇧"],["Lesotho","ls","266",,"🇱🇸"],["Liberia","lr","231",,"🇱🇷"],["‫ليبيا‬‎","ly","218",,"🇱🇾"],["Liechtenstein","li","423",,"🇱🇮"],["Lietuva","lt","370",,"🇱🇹"],["Luxembourg","lu","352",,"🇱🇺"],["澳門","mo","853",,"🇲🇴"],["FYROM","mk","389",,"🇲🇰"],["Madagasikara","mg","261",,"🇲🇬"],["Malawi","mw","265",,"🇲🇼"],["Malaysia","my","60",,"🇲🇾"],["Maldives","mv","960",,"🇲🇻"],["Mali","ml","223",,"🇲🇱"],["Malta","mt","356",,"🇲🇹"],["Marshall Islands","mh","692",,"🇲🇭"],["Martinique","mq","596",,"🇲🇶"],["‫موريتانيا‬‎","mr","222",,"🇲🇷"],["Moris","mu","230",,"🇲🇺"],["Mayotte","yt","262",1,,"🇾🇹"],["México","mx","52",,"🇲🇽"],["Micronesia","fm","691",,"🇫🇲"],["Republica Moldova","md","373",,"🇲🇩"],["Monaco","mc","377",,"🇲🇨"],["Монгол","mn","976",,"🇲🇳"],["Crna Gora","me","382",,"🇲🇪"],["Montserrat","ms","1664",,"🇲🇸"],["‫المغرب‬‎","ma","212",0,,"🇲🇦"],["Moçambique","mz","258",,"🇲🇿"],["Burma","mm","95",,"🇲🇲"],["Namibië","na","264",,"🇳🇦"],["Nauru","nr","674",,"🇳🇷"],["नेपाल","np","977",,"🇳🇵"],["Nederland","nl","31",,"🇳🇱"],["Nouvelle-Calédonie","nc","687",,"🇳🇨"],["New Zealand","nz","64",,"🇳🇿"],["Nicaragua","ni","505",,"🇳🇮"],["Nijar","ne","227",,"🇳🇪"],["Nigeria","ng","234",,"🇳🇬"],["Niue","nu","683",,"🇳🇺"],["Norfolk Island","nf","672",,"🇳🇫"],["조선 민주주의 인민 공화국","kp","850",,"🇰🇵"],["Northern Mariana Islands","mp","1670",,"🇲🇵"],["Norge","no","47",0,,"🇳🇴"],["‫عُمان‬‎","om","968",,"🇴🇲"],["‫پاکستان‬‎","pk","92",,"🇵🇰"],["Palau","pw","680",,"🇵🇼"],["‫فلسطين‬‎","ps","970",,"🇵🇸"],["Panamá","pa","507",,"🇵🇦"],["Papua New Guinea","pg","675",,"🇵🇬"],["Paraguay","py","595",,"🇵🇾"],["Perú","pe","51",,"🇵🇪"],["Philippines","ph","63",,"🇵🇭"],["Polska","pl","48",,"🇵🇱"],["Portugal","pt","351",,"🇵🇹"],["Puerto Rico","pr","1",3,["787","939","🇵🇷"]],["‫قطر‬‎","qa","974",,"🇶🇦"],["La Réunion","re","262",0,,"🇷🇪"],["România","ro","40",,"🇷🇴"],["Россия","ru","7",0,,"🇷🇺"],["Rwanda","rw","250",,"🇷🇼"],["Saint Barthélemy","bl","590",1,,"🇧🇱"],["Saint Helena","sh","290",,"🇸🇭"],["Saint Kitts and Nevis","kn","1869",,"🇰🇳"],["Saint Lucia","lc","1758",,"🇱🇨"],["Saint-Martin (partie française","mf","590",2,,"🇲🇫"],["Saint-Pierre-et-Miquelon","pm","508",,"🇵🇲"],["Saint Vincent and the Grenadines","vc","1784",,"🇻🇨"],["Samoa","ws","685",,"🇼🇸"],["San Marino","sm","378",,"🇸🇲"],["São Tomé e Príncipe","st","239",,"🇸🇹"],["‫المملكة العربية السعودية‬‎","sa","966",,"🇸🇦"],["Sénégal","sn","221",,"🇸🇳"],["Србија","rs","381",,"🇷🇸"],["Seychelles","sc","248",,"🇸🇨"],["Sierra Leone","sl","232",,"🇸🇱"],["Singapore","sg","65",,"🇸🇬"],["Sint Maarten","sx","1721",,"🇸🇽"],["Slovensko","sk","421",,"🇸🇰"],["Slovenija","si","386",,"🇸🇮"],["Solomon Islands","sb","677",,"🇸🇧"],["Soomaaliya","so","252",,"🇸🇴"],["South Africa","za","27",,"🇿🇦"],["대한민국","kr","82",,"🇰🇷"],["‫جنوب السودان‬‎","ss","211",,"🇸🇸"],["España","es","34",,"🇪🇸"],["ශ්‍රී ලංකාව","lk","94",,"🇱🇰"],["‫السودان‬‎","sd","249",,"🇸🇩"],["Suriname","sr","597",,"🇸🇷"],["Svalbard and Jan Mayen","sj","47",1,,"🇸🇯"],["Swaziland","sz","268",,"🇸🇿"],["Sverige","se","46",,"🇸🇪"],["Schweiz","ch","41",,"🇨🇭"],["‫سوريا‬‎","sy","963",,"🇸🇾"],["台灣","tw","886",,"🇹🇼"],["Tajikistan","tj","992",,"🇹🇯"],["Tanzania","tz","255",,"🇹🇿"],["ไทย","th","66",,"🇹🇭"],["Timor-Leste","tl","670",,"🇹🇱"],["Togo","tg","228",,"🇹🇬"],["Tokelau","tk","690",,"🇹🇰"],["Tonga","to","676",,"🇹🇴"],["Trinidad and Tobago","tt","1868",,"🇹🇹"],["‫تونس‬‎","tn","216",,"🇹🇳"],["Türkiye","tr","90",,"🇹🇷"],["Turkmenistan","tm","993",,"🇹🇲"],["Turks and Caicos Islands","tc","1649",,"🇹🇨"],["Tuvalu","tv","688",,"🇹🇻"],["U.S. Virgin Islands","vi","1340",,"🇻🇮"],["Uganda","ug","256",,"🇺🇬"],["Україна","ua","380",,"🇺🇦"],["‫الإمارات العربية المتحدة‬‎","ae","971",,"🇦🇪"],["United Kingdom","gb","44",0,,"🇬🇧"],["United States","us","1",0,,"🇺🇸"],["Uruguay","uy","598",,"🇺🇾"],["Oʻzbekiston","uz","998",,"🇺🇿"],["Vanuatu","vu","678",,"🇻🇺"],["Città del Vaticano","va","39",1,,"🇻🇦"],["Venezuela","ve","58",,"🇻🇪"],["Việt Nam","vn","84",,"🇻🇳"],["Wallis-et-Futuna","wf","681",,"🇼🇫"],["‫الصحراء الغربية‬‎","eh","212",1,,"🇪🇭"],["‫اليمن‬‎","ye","967",,"🇾🇪"],["Zambia","zm","260",,"🇿🇲"],["Zimbabwe","zw","263",,"🇿🇼"],["Åland Islands","ax","358",1,,"🇦🇽"]],Md=xd.map(e=>({name:e[0],iso2:e[1].toUpperCase(),dialCode:e[2],priority:e[3]||0,areaCodes:e[4]||null,flag:e[e.length-1]||null}));function zd(){return fetch("https://ip2c.org/s").then(e=>e.text()).then(e=>{const n=(e||"").toString();if(!n||n[0]!=="1")throw new Error("unable to fetch the country");return n.substr(2,2)})}function Ld(e,n){if(e.setSelectionRange)e.focus(),e.setSelectionRange(n,n);else if(e.createTextRange){const t=e.createTextRange();t.collapse(!0),t.moveEnd("character",n),t.moveStart("character",n),t.select()}}const Bd=[{name:"allCountries",type:Array,default:Md,description:"All countries that are used in <code>libphonenumber-js</code>, can be overridden by this prop",inDemo:!1},{name:"autoFormat",type:Boolean,default:!0,description:"Auto update the input to the formatted phone number when it's valid",inDemo:!0},{name:"customValidate",type:[Boolean,RegExp],default:!1,description:"Custom validation RegExp for input",inDemo:!1},{name:"defaultCountry",default:"",type:String,description:"Default country, will override the country fetched from IP address of user",inDemo:!1},{name:"disabled",default:!1,type:Boolean,description:"Disable <code>vue-tel-input</code>, including the input & flag dropdown",inDemo:!1},{name:"autoDefaultCountry",default:!0,type:Boolean,description:"To fetch default country based on IP address of user",inDemo:!1},{name:"dropdownOptions",type:Object,description:"Options for dropdown, see below",inDemo:!1},{name:"dropdownOptions.showDialCodeInList",default:!0,type:Boolean,description:"Show dial code in the dropdown list",inDemo:!0},{name:"dropdownOptions.showDialCodeInSelection",default:!1,type:Boolean,description:"Show dial code in the dropdown selection",inDemo:!0},{name:"dropdownOptions.showFlags",default:!0,type:Boolean,description:"Show flags in the dropdown selection and list",inDemo:!0},{name:"dropdownOptions.tabindex",default:0,type:Number,description:"Native dropdown <code>tabindex</code> attribute",inDemo:!1},{name:"ignoredCountries",default:[],type:Array,description:"List of countries will NOT be shown on the dropdown",inDemo:!1},{name:"inputOptions",type:Object,description:"Options for input, see below",inDemo:!1},{name:"inputOptions.autocomplete",type:String,default:"on",description:"Native input <code>autocomplete</code> attribute",inDemo:!1},{name:"inputOptions.autofocus",type:Boolean,default:!1,description:"Native input <code>autofocus</code> attribute",inDemo:!1},{name:"inputOptions.id",default:"",type:String,description:"Native input <code>id</code> attribute",inDemo:!1},{name:"inputOptions.maxlength",default:25,type:Number,description:"Native input <code>maxlength</code> attribute",inDemo:!1},{name:"inputOptions.name",default:"telephone",type:String,description:"Native input <code>name</code> attribute",inDemo:!1},{name:"inputOptions.placeholder",default:"Enter a phone number",type:String,description:"Placeholder for the input",inDemo:!1},{name:"inputOptions.readonly",default:!1,type:Boolean,description:"Native input <code>readonly</code> attribute",inDemo:!1},{name:"inputOptions.required",default:!1,type:Boolean,description:"Native input <code>required</code> attribute",inDemo:!1},{name:"inputOptions.tabindex",default:0,type:Number,description:"Native input <code>tabindex</code> attribute",inDemo:!1},{name:"inputOptions.type",default:"tel",type:String,description:"Native input <code>type</code> attribute",inDemo:!1},{name:"inputOptions.styleClasses",default:"",type:[String,Array,Object],description:"Custom classes for the <code>input</code>",inDemo:!1},{name:"invalidMsg",default:"",type:String,description:"",inDemo:!1},{name:"mode",default:"auto",type:String,description:"Allowed values: <code>'auto'</code> (Default set by phone), <code>'international'</code> (Format number with the dial code i.e. + 61), <code>'national'</code> (Format number without dial code i.e. 0321232)",inDemo:!0,options:["auto","national","international"]},{name:"onlyCountries",default:[],type:Array,description:"List of countries will be shown on the dropdown",inDemo:!1},{name:"preferredCountries",default:[],type:Array,description:"Preferred countries list, will be on top of the dropdown",inDemo:!1},{name:"styleClasses",default:"",type:[String,Array,Object],description:"Custom classes for the wrapper",inDemo:!1},{name:"validCharactersOnly",default:!1,type:Boolean,description:"Only allow valid characters in a phone number (will also verify in <code>mounted</code>, so phone number with invalid characters will be shown as an empty string)",inDemo:!1}],Vd=[...Bd].reduce((e,n)=>{if(n.name.includes(".")){const[t,d]=n.name.split(".");e[t]?Object.assign(e[t],{[d]:n.default}):Object.assign(e,{[t]:{[d]:n.default}})}else Object.assign(e,{[n.name]:n.default});return e},{}),Ve={options:{...Vd}},jd={beforeMount(e,n,t){if(typeof n.value!="function"){const d=t.context.name;let o=`[Vue-click-outside:] provided expression ${n.expression}
8
- is not a function, but has to be`;d&&(o+=`Found in component ${d}`),console.warn(o)}e.clickOutsideEvent=function(d){e===d.target||e.contains(d.target)||n.value(d,e)},document.body.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.body.removeEventListener("click",e.clickOutsideEvent)}};function _(e){const n=Ve.options[e];return typeof n>"u"?Ve.options[e]:n}const Ud=r.defineComponent({name:"Vue3ReactiveTelInput",directives:{clickOutside:jd},props:{modelValue:{type:String,default:""},badClass:{type:[String,Array,Object],default:""},goodClass:{type:[String,Array,Object],default:""},badStyle:{type:[String,Array,Object],default:""},goodStyle:{type:[String,Array,Object],default:""},badInputClass:{type:[String,Array,Object],default:""},goodInputClass:{type:[String,Array,Object],default:""},badInputStyle:{type:[String,Array,Object],default:""},goodInputStyle:{type:[String,Array,Object],default:""},allCountries:{type:Array,default:()=>_("allCountries")},autoFormat:{type:Boolean,default:()=>_("autoFormat")},validation:{type:[Boolean,Object],default:!1},customValidate:{type:[Boolean,RegExp],default:()=>_("customValidate")},defaultCountry:{type:String,default:()=>_("defaultCountry")},disabled:{type:Boolean,default:()=>_("disabled")},autoDefaultCountry:{type:Boolean,default:()=>_("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>_("dropdownOptions")},ignoredCountries:{type:Array,default:()=>_("ignoredCountries")},inputOptions:{type:Object,default:()=>_("inputOptions")},invalidMsg:{type:String,default:()=>_("invalidMsg")},mode:{type:String,default:()=>_("mode")},onlyCountries:{type:Array,default:()=>_("onlyCountries")},preferredCountries:{type:Array,default:()=>_("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>_("validCharactersOnly")},rootClass:{type:[String,Array,Object],default:()=>_("styleClasses")},inputClass:{type:[String,Array,Object],default:()=>""},divInputClass:{type:[String,Array,Object],default:()=>""},rootStyle:{type:[String,Array,Object],default:()=>""},dropdownStyle:{type:[String,Array,Object],default:()=>""},listStyle:{type:[String,Array,Object],default:()=>""},inputStyle:{type:[String,Array,Object],default:()=>""},inputId:{type:[String,Array,Object],default:()=>""},Placeholder:{type:[String,Object,Function],default:()=>""}},data(){return{counter:5,initCounter:5,message:{action:null,amount:null},phone:this.modelValue?this.modelValue:"",activeCountryCode:"",open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:null,dropdownOpenDirection:"below",parsedPlaceholder:this.Placeholder!==""?this.Placeholder:this.inputOptions.placeholder}},watch:{activeCountry(e,n){if(!e&&(n!=null&&n.iso2)){this.activeCountryCode=n.iso2;return}e!=null&&e.iso2&&this.$emit("country-changed",e)},"phoneObject.countryCode":function(e){this.activeCountryCode=e},"phoneObject.valid":function(){this.$emit("validate",this.phoneObject)},"phoneObject.formatted":function(e){!this.autoFormat||this.customValidate||(this.emitInput(e),this.$nextTick(()=>{e&&!this.value&&(this.phone=e)}))},"inputOptions.placeholder":function(){this.resetPlaceholder()},value(e,n){this.testCharacters()?this.phone=e:this.$nextTick(()=>{this.phone=n,this.onInput()})},open(e){e?(this.setDropdownPosition(),this.$emit("open")):this.$emit("close")}},mounted(){this.cleanInvalidCharacters(),this.initializeCountry().then(()=>{var e;!this.phone&&((e=this.inputOptions)!=null&&e.showDialCode)&&this.activeCountryCode&&(this.phone=`+${this.activeCountryCode}`),this.$emit("validate",this.phoneObject)}).catch(console.error).then(()=>{this.finishMounted=!0})},computed:{activeCountry(){return this.findCountry(this.activeCountryCode)},activeCountryFlag(){return this.activeCountry?this.activeCountry.flag:null},parsedMode(){return this.mode==="auto"?!this.phone||this.phone[0]!=="+"?"national":"international":["international","national"].includes(this.mode)?this.mode:(console.error('Invalid value of prop "mode"'),"international")},filteredCountries(){return this.onlyCountries.length?this.allCountries.filter(({iso2:e})=>this.onlyCountries.some(n=>n.toUpperCase()===e)):this.ignoredCountries.length?this.allCountries.filter(({iso2:e})=>!this.ignoredCountries.includes(e.toUpperCase())&&!this.ignoredCountries.includes(e.toLowerCase())):this.allCountries},sortedCountries(){return[...this.getCountries(this.preferredCountries).map(n=>({...n,preferred:!0})),...this.filteredCountries]},phoneObject(){var i,a,s;let e;((i=this.phone)==null?void 0:i[0])==="+"?e=K(this.phone)||{}:e=K(this.phone,this.activeCountryCode)||{};const{metadata:n,...t}=e;console.log(e);let d=(a=e.isValid)==null?void 0:a.call(e),o=this.phone;return d&&(o=(s=e.format)==null?void 0:s.call(e,this.parsedMode.toUpperCase(),{nationalPrefix:!1})),e.country&&(this.ignoredCountries.length||this.onlyCountries.length)&&(this.findCountry(e.country)||(d=!1,Object.assign(e,{country:null}))),Object.assign(t,{countryCode:e.country,valid:d,country:this.activeCountry,formatted:o}),t},classes(){return this.phoneObject.valid===!0?this.goodClass:this.phoneObject.valid===!1?this.badClass:void 0},styles(){return this.phoneObject.valid===!0?this.goodStyle:this.phoneObject.valid===!1?this.badStyle:void 0},Iclasses(){return this.phoneObject.valid===!0?this.goodInputClass:this.phoneObject.valid===!1?this.badInputClass:void 0},Istyles(){return this.phoneObject.valid===!0?this.goodInputStyle:this.phoneObject.valid===!1?this.badInputStyle:void 0}},methods:{resetPlaceholder(){this.parsedPlaceholder=this.inputOptions.placeholder},initializeCountry(){return new Promise(e=>{var t;if(((t=this.phone)==null?void 0:t[0])==="+"){e();return}if(this.defaultCountry){this.choose(this.defaultCountry),e();return}const n=this.preferredCountries[0]||this.filteredCountries[0];this.autoDefaultCountry?zd().then(d=>{this.choose(d||this.activeCountryCode)}).catch(d=>{console.warn(d),this.choose(n)}).then(()=>{e()}):(this.choose(n),e())})},getCountries(e=[]){return e.map(n=>this.findCountry(n)).filter(Boolean)},findCountry(e=""){return this.filteredCountries.find(n=>n.iso2===e.toUpperCase())},getItemClass(e,n){const t=this.selectedIndex===e,d=e===this.preferredCountries.length-1,o=this.preferredCountries.some(i=>i.toUpperCase()===n);return{highlighted:t,"last-preferred":d,preferred:o}},choose(e){var t,d;let n=e;if(typeof n=="string"&&(n=this.findCountry(n)),!!n){if(((t=this.phone)==null?void 0:t[0])==="+"&&n.iso2&&this.phoneObject.nationalNumber){this.activeCountryCode=n.iso2,this.phone=K(this.phoneObject.nationalNumber,n.iso2).formatInternational();return}if((d=this.inputOptions)!=null&&d.showDialCode&&n){this.phone=`+${n.dialCode}`;return}this.activeCountryCode=n.iso2,this.emitInput(this.phone)}},cleanInvalidCharacters(){const e=this.phone;if(this.validCharactersOnly){const n=this.phone.match(/[()\-+0-9\s]*/g);this.phone=n.join("")}if(this.customValidate&&this.customValidate instanceof RegExp){const n=this.phone.match(this.customValidate);this.phone=n.join("")}e!==this.phone&&this.emitInput(this.phone)},testCharacters(){return this.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(this.phone)?!1:this.customValidate?this.testCustomValidate():!0},testCustomValidate(){return this.customValidate instanceof RegExp?this.customValidate.test(this.phone):!1},onInput(){this.$refs.input.setCustomValidity(this.phoneObject.valid?"":this.invalidMsg),this.emitInput(this.phoneObject)},emitInput(e){this.$emit("update:modelValue",e)},onBlur(){this.$emit("blur")},onFocus(){Ld(this.$refs.input,this.phone.length),this.$emit("focus")},onEnter(){this.$emit("enter")},onSpace(){this.$emit("space")},focus(){this.$refs.input.focus()},toggleDropdown(){this.disabled||(this.open=!this.open)},clickedOutside(){this.open=!1},keyboardNav(e){if(e.keyCode===40){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=0:this.selectedIndex=Math.min(this.sortedCountries.length-1,this.selectedIndex+1);const n=this.$refs.list.children[this.selectedIndex];n.offsetTop+n.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight&&(this.$refs.list.scrollTop=n.offsetTop-this.$refs.list.clientHeight+n.clientHeight)}else if(e.keyCode===38){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=this.sortedCountries.length-1:this.selectedIndex=Math.max(0,this.selectedIndex-1);const n=this.$refs.list.children[this.selectedIndex];n.offsetTop<this.$refs.list.scrollTop&&(this.$refs.list.scrollTop=n.offsetTop)}else if(e.keyCode===13)this.selectedIndex!==null&&this.choose(this.sortedCountries[this.selectedIndex]),this.open=!this.open;else{this.typeToFindInput+=e.key,clearTimeout(this.typeToFindTimer),this.typeToFindTimer=setTimeout(()=>{this.typeToFindInput=""},700);const n=this.sortedCountries.slice(this.preferredCountries.length).findIndex(t=>t.name.toLowerCase().startsWith(this.typeToFindInput));if(n>=0){this.selectedIndex=this.preferredCountries.length+n;const t=this.$refs.list.children[this.selectedIndex],d=t.offsetTop<this.$refs.list.scrollTop,o=t.offsetTop+t.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight;(d||o)&&(this.$refs.list.scrollTop=t.offsetTop-this.$refs.list.clientHeight/2)}}},reset(){this.selectedIndex=this.sortedCountries.map(e=>e.iso2).indexOf(this.activeCountryCode),this.open=!1},setDropdownPosition(){window.innerHeight-this.$refs.rootElement.getBoundingClientRect().bottom>200?this.dropdownOpenDirection="below":this.dropdownOpenDirection="above"}}}),Gd=["tabindex"],Hd={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},Kd=["innerHTML"],Wd={key:1,class:"vti__country-code"},qd=["onClick","onMousemove"],Xd=["innerHTML"],Yd={key:1},Zd=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],Jd={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"};function Qd(e,n,t,d,o,i){const a=r.resolveDirective("click-outside");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass(["vue3-reactive-tel-input",{"bg-fourth-nano":e.validation},e.$attrs.class,e.rootClass,{disabled:e.disabled},e.classes]),style:r.normalizeStyle([e.rootStyle,e.styles]),ref:"rootElement"},[r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([["vti__dropdown",{open:e.open}],"br-solid br-black-transp br-1px radius-medium"]),tabindex:e.dropdownOptions.tabindex,onKeydown:[n[0]||(n[0]=(...s)=>e.keyboardNav&&e.keyboardNav(...s)),n[2]||(n[2]=r.withKeys((...s)=>e.reset&&e.reset(...s),["esc"]))],onClick:n[1]||(n[1]=(...s)=>e.toggleDropdown&&e.toggleDropdown(...s)),style:r.normalizeStyle([e.dropdownStyle])},[r.createElementVNode("span",Hd,[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:e.activeCountryFlag,class:"mn-r-thin"},null,8,Kd)):r.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(r.openBlock(),r.createElementBlock("span",Wd," +"+r.toDisplayString(e.activeCountry&&e.activeCountry.dialCode),1)):r.createCommentVNode("",!0)]),r.withDirectives(r.createElementVNode("ul",{ref:"list",class:r.normalizeClass(["bs-black radius-small vti__dropdown-list",e.dropdownOpenDirection]),style:r.normalizeStyle([e.listStyle])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.sortedCountries,(s,$)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["flex-nowrap flex w-max",["vti__dropdown-item",e.getItemClass($,s.iso2)]]),key:s.iso2+(s.preferred?"-preferred":""),onClick:l=>e.choose(s),onMousemove:l=>e.selectedIndex=$},[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:s.flag,class:"mn-r-thin"},null,8,Xd)):r.createCommentVNode("",!0),r.createElementVNode("strong",null,r.toDisplayString(s.name),1),e.dropdownOptions.showDialCodeInList?(r.openBlock(),r.createElementBlock("span",Yd," +"+r.toDisplayString(s.dialCode),1)):r.createCommentVNode("",!0)],42,qd))),128))],6),[[r.vShow,e.open]])],46,Gd)),[[a,e.clickedOutside]]),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":n[3]||(n[3]=s=>e.phone=s),pattern:"[0-9]*",ref:"input",type:e.inputOptions.type,autocomplete:e.inputOptions.autocomplete,autofocus:e.inputOptions.autofocus,class:r.normalizeClass(["vti__input",e.inputOptions.styleClasses,e.inputClass,e.Iclasses]),style:r.normalizeStyle([e.inputStyle,e.Istyles]),disabled:e.disabled,id:e.inputId!==""?e.inputId:e.inputOptions.id,maxlength:e.inputOptions.maxlength,name:e.inputId!==""?e.inputId:e.inputOptions.name,placeholder:e.parsedPlaceholder,readonly:e.inputOptions.readonly,required:e.inputOptions.required,tabindex:e.inputOptions.tabindex,onBlur:n[4]||(n[4]=(...s)=>e.onBlur&&e.onBlur(...s)),onFocus:n[5]||(n[5]=(...s)=>e.onFocus&&e.onFocus(...s)),onInput:n[6]||(n[6]=(...s)=>e.onInput&&e.onInput(...s)),onKeyup:[n[7]||(n[7]=r.withKeys((...s)=>e.onEnter&&e.onEnter(...s),["enter"])),n[8]||(n[8]=r.withKeys((...s)=>e.onSpace&&e.onSpace(...s),["space"]))]},null,46,Zd),[[r.vModelDynamic,e.phone]]),r.renderSlot(e.$slots,"default",{},void 0,!0)],6),r.createVNode(r.Transition,{name:"fade"},{default:r.withCtx(()=>[e.validation?(r.openBlock(),r.createElementBlock("div",Jd," * "+r.toDisplayString(e.validation.message),1)):r.createCommentVNode("",!0)]),_:1})],64)}const ae=tt._export_sfc(Ud,[["render",Qd],["__scopeId","data-v-50353ca7"]]);function je(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{forgotPasswordTitle:t=>{const{normalize:d}=t;return d(["Forgot Password?"])},instructions:t=>{const{normalize:d}=t;return d(["To reset your password, specify the phone or email used during registration."])},smsInfo:t=>{const{normalize:d}=t;return d(["We will send you an SMS with a confirmation code to reset your password, which you will need to enter in the next step."])},emailInfo:t=>{const{normalize:d}=t;return d(["We will send you an email with a confirmation code to reset your password, which you will need to enter in the next step."])},phone:t=>{const{normalize:d}=t;return d(["Phone"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Enter your phone"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your email"])},sendCode:t=>{const{normalize:d}=t;return d(["Send code"])}},ru:{forgotPasswordTitle:t=>{const{normalize:d}=t;return d(["Забыли пароль?"])},instructions:t=>{const{normalize:d}=t;return d(["Чтобы сбросить пароль, укажите телефон или email, использованные при регистрации."])},smsInfo:t=>{const{normalize:d}=t;return d(["Мы вышлем вам SMS с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге."])},emailInfo:t=>{const{normalize:d}=t;return d(["Мы отправим вам электронное письмо с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге."])},phone:t=>{const{normalize:d}=t;return d(["Телефон"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш телефон"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш email"])},sendCode:t=>{const{normalize:d}=t;return d(["Отправить код"])}}}})}const er={class:"t-left pd-medium"},tr={class:"mn-small"},nr={class:"mn-small t-transp"},dr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},rr={key:0,class:"mn-semi radius-small o-hidden"},or={class:"mn-small t-transp"},ir={key:0,class:"mn-semi radius-small o-hidden"},ar={class:"mn-small t-transp"},se={__name:"ResetPassword",setup(e){const{t:n}=k.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);w.useRoute();const o=w.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await b.validateInputs(t,b.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await b.validateInputs(d,b.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}try{await u.actions.resetPassword(u.state.user,i.value,"reset-password")}catch($){throw console.log($),new Error}}function s(){o.push({name:"Enter Code",query:{type:i.value,method:"reset-password"}})}return($,l)=>(r.openBlock(),r.createElementBlock("section",er,[r.createElementVNode("h3",tr,r.toDisplayString(r.unref(n)("forgotPasswordTitle")),1),r.createElementVNode("p",nr,r.toDisplayString(r.unref(n)("instructions")),1),r.createElementVNode("div",dr,[r.createVNode(Q._sfc_main,{selected:i.value,"onUpdate:selected":l[0]||(l[0]=m=>i.value=m),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",null,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[i.value==="phone"?(r.openBlock(),r.createElementBlock("div",rr,[r.createElementVNode("p",or,r.toDisplayString(r.unref(n)("smsInfo")),1),r.createVNode(ae,{modelValue:u.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=m=>u.state.user.phone=m),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:t.value,mode:"national",inputOptions:{placeholder:r.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):r.createCommentVNode("",!0)]),_:1}),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[i.value==="email"?(r.openBlock(),r.createElementBlock("div",ir,[r.createElementVNode("p",ar,r.toDisplayString(r.unref(n)("emailInfo")),1),r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":l[2]||(l[2]=m=>u.state.user.email=m),placeholder:r.unref(n)("emailPlaceholder"),validation:d.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):r.createCommentVNode("",!0)]),_:1})]),r.createVNode(u._sfc_main,{submit:a,callback:s,class:"mn-big"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("sendCode")),1)]),_:1})]))}};typeof je=="function"&&je(se);const sr=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));function Ue(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{title:t=>{const{normalize:d}=t;return d(["Sign Up to The Commune"])},description:t=>{const{normalize:d}=t;return d(["Choose a convenient way to register via phone or email:"])},phone:t=>{const{normalize:d}=t;return d(["Phone"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Enter your phone"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your email"])},emailNotice:t=>{const{normalize:d}=t;return d(["We will send you an email with a confirmation code that you will need to enter in the next step."])},smsNotice:t=>{const{normalize:d}=t;return d(["We will send you an SMS with a confirmation code that you will need to enter in the next step."])},sendCode:t=>{const{normalize:d}=t;return d(["Send Code"])},haveAccount:t=>{const{normalize:d}=t;return d(["Already have an account?"])}},ru:{title:t=>{const{normalize:d}=t;return d(["Новая учетная запись"])},description:t=>{const{normalize:d}=t;return d(["Выберите удобный способ регистрации через телефон или email:"])},phone:t=>{const{normalize:d}=t;return d(["Телефон"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш телефон"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш email"])},emailNotice:t=>{const{normalize:d}=t;return d(["Мы отправим вам электронное письмо с кодом подтверждения, который вы должны будете ввести в следующем шаге."])},smsNotice:t=>{const{normalize:d}=t;return d(["Мы вышлем вам SMS с кодом подтверждения, который вы должны будете ввести в следующем шаге."])},sendCode:t=>{const{normalize:d}=t;return d(["Отправить код"])},haveAccount:t=>{const{normalize:d}=t;return d(["У вас уже есть аккаунт?"])}}}})}const lr={class:"t-left pd-medium"},ur={class:"mn-small"},$r={class:"mn-small t-transp"},cr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},fr={class:""},pr={class:"mn-semi radius-small"},mr={class:"mn-small t-transp"},hr={class:"mn-semi radius-small o-hidden"},yr={class:"mn-small t-transp"},gr={class:"w-100"},le={__name:"SignUp",setup(e){const{t:n}=k.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);w.useRoute();const o=w.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await b.validateInputs(t,b.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await b.validateInputs(d,b.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}try{await u.sendCode(u.state.user,"signup",i.value)}catch{throw new Error}}function s(){o.push({name:"Enter Code"})}return($,l)=>{const m=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",lr,[r.createElementVNode("h3",ur,r.toDisplayString(r.unref(n)("title")),1),r.createElementVNode("p",$r,r.toDisplayString(r.unref(n)("description")),1),r.createElementVNode("div",cr,[r.createVNode(Q._sfc_main,{selected:i.value,"onUpdate:selected":l[0]||(l[0]=y=>i.value=y),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",fr,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",pr,[r.createElementVNode("p",mr,r.toDisplayString(r.unref(n)("smsNotice")),1),r.createVNode(ae,{modelValue:u.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=y=>u.state.user.phone=y),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:t.value,mode:"national",inputOptions:{placeholder:r.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[r.vShow,i.value==="phone"]])]),_:1}),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",hr,[r.createElementVNode("p",yr,r.toDisplayString(r.unref(n)("emailNotice")),1),r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":l[2]||(l[2]=y=>u.state.user.email=y),placeholder:r.unref(n)("emailPlaceholder"),validation:d.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[r.vShow,i.value==="email"]])]),_:1})]),r.createVNode(u._sfc_main,{submit:a,callback:s,class:"mn-big"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("sendCode")),1)]),_:1}),r.createElementVNode("div",gr,[r.createVNode(m,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("haveAccount")),1)]),_:1})])])}}};typeof Ue=="function"&&Ue(le);const vr=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"}));function Ge(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{title:t=>{const{normalize:d}=t;return d(["Welcome to The Commune"])},subtitle:t=>{const{normalize:d}=t;return d(["Sign In to Continue"])},signup:t=>{const{normalize:d}=t;return d(["Don't have an account?"])},phone:t=>{const{normalize:d}=t;return d(["Phone"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Enter your phone"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your email"])},haveAccount:t=>{const{normalize:d}=t;return d(["Don't have an account? Sign Up"])},passwordPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your password"])},forgotPassword:t=>{const{normalize:d}=t;return d(["Forgot Password?"])},signin:t=>{const{normalize:d}=t;return d(["Sign In"])},soon:t=>{const{normalize:d}=t;return d(["SOON"])},signinMetamask:t=>{const{normalize:d}=t;return d(["Sign In with Apple"])}},ru:{title:t=>{const{normalize:d}=t;return d(["Приветствуем вас,"])},subtitle:t=>{const{normalize:d}=t;return d(["Войдите для продолжения"])},signup:t=>{const{normalize:d}=t;return d(["Нет аккаунта?"])},phone:t=>{const{normalize:d}=t;return d(["Телефон"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш телефон"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш email"])},haveAccount:t=>{const{normalize:d}=t;return d(["Нет аккаунта? Зарегистрироваться"])},passwordPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш пароль"])},forgotPassword:t=>{const{normalize:d}=t;return d(["Забыли пароль?"])},signin:t=>{const{normalize:d}=t;return d(["Войти"])},soon:t=>{const{normalize:d}=t;return d(["СКОРО"])},signinMetamask:t=>{const{normalize:d}=t;return d(["Войти через Apple"])}}}})}const br={class:""},_r={class:"mn-medium"},Cr=r.createElementVNode("br",null,null,-1),wr={class:"t-semi"},Pr={class:"mn-big"},Nr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},Er={class:""},Or={class:"mn-thin radius-small"},Sr={class:"mn-thin radius-small o-hidden"},Ir={class:"w-100 mn-big"},Tr={class:"flex-v-center flex"},Ar={class:"mn-r-small"},ue={__name:"SignIn",setup(e){const{t:n}=k.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null),o=r.ref(null);w.useRoute();const i=w.useRouter(),a=r.ref("phone"),s=h=>{console.log("Apple login success:",h)},$=h=>{console.log("Apple login failure:",h)},l=r.inject("APPLE_CLIENTID"),m=r.inject("API_URL"),y=()=>{if(!window.AppleID){console.error('"https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js" needs to be included as a <script>');return}let h="email",v="123",T=!0;window.AppleID.auth.init({clientId:l,scope:h,redirectURI:m,state:v,usePopup:T}),document.addEventListener("AppleIDSignInOnSuccess",s),document.addEventListener("AppleIDSignInOnFailure",$)},p=()=>{try{window.AppleID.auth.signIn()}catch(h){console.error("Error signing in with Apple:",h)}},c=h=>new Promise((v,T)=>{const P=document.createElement("script");P.type="text/javascript",P.src=h,P.onload=v,P.onerror=T,document.head.appendChild(P)});r.onMounted(async()=>{try{await c("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"),y()}catch(h){console.error("Error loading AppleID script:",h)}});async function f(){try{a.value==="phone"&&await b.validateInputs(t,b.validatePhone,u.state.user.phone,"Некорректный телефон"),a.value==="email"&&await b.validateInputs(o,b.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}await u.actions.login(u.state.user,a.value)}function g(){i.push({name:"User Profile",params:{_id:u.state.user._id}})}return(h,v)=>{const T=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",br,[r.createElementVNode("h3",_r,[r.createTextVNode(r.toDisplayString(r.unref(n)("title"))+" ",1),Cr,r.createElementVNode("span",wr,r.toDisplayString(r.unref(n)("subtitle")),1)]),r.createElementVNode("p",Pr,[r.createVNode(T,{to:{name:"Sign Up"},class:"underline t-second"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signup")),1)]),_:1})]),r.createElementVNode("div",Nr,[r.createVNode(Q._sfc_main,{selected:a.value,"onUpdate:selected":v[0]||(v[0]=P=>a.value=P),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",Er,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",Or,[r.createVNode(ae,{modelValue:u.state.user.phone,"onUpdate:modelValue":v[1]||(v[1]=P=>u.state.user.phone=P),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:t.value,mode:"national",inputOptions:{placeholder:r.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[r.vShow,a.value==="phone"]])]),_:1}),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",Sr,[r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":v[2]||(v[2]=P=>u.state.user.email=P),placeholder:r.unref(n)("emailPlaceholder"),validation:o.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[r.vShow,a.value==="email"]])]),_:1})]),r.createVNode(u.Field,{field:u.state.user.password,"onUpdate:field":v[3]||(v[3]=P=>u.state.user.password=P),type:"password",validation:d.value,placeholder:r.unref(n)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),r.createElementVNode("div",Ir,[r.createVNode(T,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("forgotPassword")),1)]),_:1})]),r.createVNode(u._sfc_main,{submit:f,callback:g,class:"mn-thin"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signin")),1)]),_:1}),r.createElementVNode("button",{onClick:p,class:"bg-black t-white w-100 button"},[r.createElementVNode("div",Tr,[r.createElementVNode("span",Ar,r.toDisplayString(r.unref(n)("signinMetamask")),1)])])])}}};typeof Ge=="function"&&Ge(ue);const Fr=Object.freeze(Object.defineProperty({__proto__:null,default:ue},Symbol.toStringTag,{value:"Module"})),Dr=[{path:"auth",name:"Authentication",meta:{title:{en:"Sign In",ru:"Вход"}},component:Je,children:[{path:"signin",name:"Sign In",beforeEnter:[E.requiresNoAuth,E.resetUser],meta:{title:{en:"Sign In",ru:"Вход"}},component:()=>Promise.resolve().then(()=>Fr)},{path:"reset-password",name:"Reset Password",beforeEnter:[E.requiresNoAuth,E.resetUser],meta:{title:{en:"Reset Password",ru:"Сбросить Пароль"}},component:()=>Promise.resolve().then(()=>sr)},{path:"signup",name:"Sign Up",beforeEnter:[E.requiresNoAuth,E.resetUser],meta:{title:{en:"Sign Up",ru:"Регистрация"}},component:()=>Promise.resolve().then(()=>vr)},{path:"enter-code",name:"Enter Code",beforeEnter:[E.requiresNoAuth,E.checkUser],meta:{title:{en:"Enter Code",ru:"Введите Код"}},component:()=>Promise.resolve().then(()=>vd)},{path:"enter-password",name:"Enter Password",beforeEnter:[E.requiresNoAuth,E.checkUser],meta:{title:{en:"Enter Password",ru:"Введите Пароль"}},component:()=>Promise.resolve().then(()=>Rd)},{path:"invite",name:"Invite",meta:{title:{en:"Invite",ru:"Приглашение"}},component:()=>Promise.resolve().then(()=>Od)}]}];exports.authStore=u.auth;exports.twofaStore=u.twofa;exports.Auth=Je;exports.EnterCode=oe;exports.EnterPassword=ie;exports.Invite=et;exports.ResetPassword=se;exports.SignIn=ue;exports.SignUp=le;exports.SliderFeatures=ot;exports.authRoutes=Dr;exports.invitesStore=bd;
8
+ is not a function, but has to be`;d&&(o+=`Found in component ${d}`),console.warn(o)}e.clickOutsideEvent=function(d){e===d.target||e.contains(d.target)||n.value(d,e)},document.body.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.body.removeEventListener("click",e.clickOutsideEvent)}};function _(e){const n=Ve.options[e];return typeof n>"u"?Ve.options[e]:n}const Ud=r.defineComponent({name:"Vue3ReactiveTelInput",directives:{clickOutside:jd},props:{modelValue:{type:String,default:""},badClass:{type:[String,Array,Object],default:""},goodClass:{type:[String,Array,Object],default:""},badStyle:{type:[String,Array,Object],default:""},goodStyle:{type:[String,Array,Object],default:""},badInputClass:{type:[String,Array,Object],default:""},goodInputClass:{type:[String,Array,Object],default:""},badInputStyle:{type:[String,Array,Object],default:""},goodInputStyle:{type:[String,Array,Object],default:""},allCountries:{type:Array,default:()=>_("allCountries")},autoFormat:{type:Boolean,default:()=>_("autoFormat")},validation:{type:[Boolean,Object],default:!1},customValidate:{type:[Boolean,RegExp],default:()=>_("customValidate")},defaultCountry:{type:String,default:()=>_("defaultCountry")},disabled:{type:Boolean,default:()=>_("disabled")},autoDefaultCountry:{type:Boolean,default:()=>_("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>_("dropdownOptions")},ignoredCountries:{type:Array,default:()=>_("ignoredCountries")},inputOptions:{type:Object,default:()=>_("inputOptions")},invalidMsg:{type:String,default:()=>_("invalidMsg")},mode:{type:String,default:()=>_("mode")},onlyCountries:{type:Array,default:()=>_("onlyCountries")},preferredCountries:{type:Array,default:()=>_("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>_("validCharactersOnly")},rootClass:{type:[String,Array,Object],default:()=>_("styleClasses")},inputClass:{type:[String,Array,Object],default:()=>""},divInputClass:{type:[String,Array,Object],default:()=>""},rootStyle:{type:[String,Array,Object],default:()=>""},dropdownStyle:{type:[String,Array,Object],default:()=>""},listStyle:{type:[String,Array,Object],default:()=>""},inputStyle:{type:[String,Array,Object],default:()=>""},inputId:{type:[String,Array,Object],default:()=>""},Placeholder:{type:[String,Object,Function],default:()=>""}},data(){return{counter:5,initCounter:5,message:{action:null,amount:null},phone:this.modelValue?this.modelValue:"",activeCountryCode:"",open:!1,finishMounted:!1,selectedIndex:null,typeToFindInput:"",typeToFindTimer:null,dropdownOpenDirection:"below",parsedPlaceholder:this.Placeholder!==""?this.Placeholder:this.inputOptions.placeholder}},watch:{activeCountry(e,n){if(!e&&(n!=null&&n.iso2)){this.activeCountryCode=n.iso2;return}e!=null&&e.iso2&&this.$emit("country-changed",e)},"phoneObject.countryCode":function(e){this.activeCountryCode=e},"phoneObject.valid":function(){this.$emit("validate",this.phoneObject)},"phoneObject.formatted":function(e){!this.autoFormat||this.customValidate||(this.emitInput(e),this.$nextTick(()=>{e&&!this.value&&(this.phone=e)}))},"inputOptions.placeholder":function(){this.resetPlaceholder()},value(e,n){this.testCharacters()?this.phone=e:this.$nextTick(()=>{this.phone=n,this.onInput()})},open(e){e?(this.setDropdownPosition(),this.$emit("open")):this.$emit("close")}},mounted(){this.cleanInvalidCharacters(),this.initializeCountry().then(()=>{var e;!this.phone&&((e=this.inputOptions)!=null&&e.showDialCode)&&this.activeCountryCode&&(this.phone=`+${this.activeCountryCode}`),this.$emit("validate",this.phoneObject)}).catch(console.error).then(()=>{this.finishMounted=!0})},computed:{activeCountry(){return this.findCountry(this.activeCountryCode)},activeCountryFlag(){return this.activeCountry?this.activeCountry.flag:null},parsedMode(){return this.mode==="auto"?!this.phone||this.phone[0]!=="+"?"national":"international":["international","national"].includes(this.mode)?this.mode:(console.error('Invalid value of prop "mode"'),"international")},filteredCountries(){return this.onlyCountries.length?this.allCountries.filter(({iso2:e})=>this.onlyCountries.some(n=>n.toUpperCase()===e)):this.ignoredCountries.length?this.allCountries.filter(({iso2:e})=>!this.ignoredCountries.includes(e.toUpperCase())&&!this.ignoredCountries.includes(e.toLowerCase())):this.allCountries},sortedCountries(){return[...this.getCountries(this.preferredCountries).map(n=>({...n,preferred:!0})),...this.filteredCountries]},phoneObject(){var i,a,s;let e;((i=this.phone)==null?void 0:i[0])==="+"?e=K(this.phone)||{}:e=K(this.phone,this.activeCountryCode)||{};const{metadata:n,...t}=e;console.log(e);let d=(a=e.isValid)==null?void 0:a.call(e),o=this.phone;return d&&(o=(s=e.format)==null?void 0:s.call(e,this.parsedMode.toUpperCase(),{nationalPrefix:!1})),e.country&&(this.ignoredCountries.length||this.onlyCountries.length)&&(this.findCountry(e.country)||(d=!1,Object.assign(e,{country:null}))),Object.assign(t,{countryCode:e.country,valid:d,country:this.activeCountry,formatted:o}),t},classes(){return this.phoneObject.valid===!0?this.goodClass:this.phoneObject.valid===!1?this.badClass:void 0},styles(){return this.phoneObject.valid===!0?this.goodStyle:this.phoneObject.valid===!1?this.badStyle:void 0},Iclasses(){return this.phoneObject.valid===!0?this.goodInputClass:this.phoneObject.valid===!1?this.badInputClass:void 0},Istyles(){return this.phoneObject.valid===!0?this.goodInputStyle:this.phoneObject.valid===!1?this.badInputStyle:void 0}},methods:{resetPlaceholder(){this.parsedPlaceholder=this.inputOptions.placeholder},initializeCountry(){return new Promise(e=>{var t;if(((t=this.phone)==null?void 0:t[0])==="+"){e();return}if(this.defaultCountry){this.choose(this.defaultCountry),e();return}const n=this.preferredCountries[0]||this.filteredCountries[0];this.autoDefaultCountry?zd().then(d=>{this.choose(d||this.activeCountryCode)}).catch(d=>{console.warn(d),this.choose(n)}).then(()=>{e()}):(this.choose(n),e())})},getCountries(e=[]){return e.map(n=>this.findCountry(n)).filter(Boolean)},findCountry(e=""){return this.filteredCountries.find(n=>n.iso2===e.toUpperCase())},getItemClass(e,n){const t=this.selectedIndex===e,d=e===this.preferredCountries.length-1,o=this.preferredCountries.some(i=>i.toUpperCase()===n);return{highlighted:t,"last-preferred":d,preferred:o}},choose(e){var t,d;let n=e;if(typeof n=="string"&&(n=this.findCountry(n)),!!n){if(((t=this.phone)==null?void 0:t[0])==="+"&&n.iso2&&this.phoneObject.nationalNumber){this.activeCountryCode=n.iso2,this.phone=K(this.phoneObject.nationalNumber,n.iso2).formatInternational();return}if((d=this.inputOptions)!=null&&d.showDialCode&&n){this.phone=`+${n.dialCode}`;return}this.activeCountryCode=n.iso2,this.emitInput(this.phone)}},cleanInvalidCharacters(){const e=this.phone;if(this.validCharactersOnly){const n=this.phone.match(/[()\-+0-9\s]*/g);this.phone=n.join("")}if(this.customValidate&&this.customValidate instanceof RegExp){const n=this.phone.match(this.customValidate);this.phone=n.join("")}e!==this.phone&&this.emitInput(this.phone)},testCharacters(){return this.validCharactersOnly&&!/^[()\-+0-9\s]*$/.test(this.phone)?!1:this.customValidate?this.testCustomValidate():!0},testCustomValidate(){return this.customValidate instanceof RegExp?this.customValidate.test(this.phone):!1},onInput(){this.$refs.input.setCustomValidity(this.phoneObject.valid?"":this.invalidMsg),this.emitInput(this.phoneObject)},emitInput(e){this.$emit("update:modelValue",e)},onBlur(){this.$emit("blur")},onFocus(){Ld(this.$refs.input,this.phone.length),this.$emit("focus")},onEnter(){this.$emit("enter")},onSpace(){this.$emit("space")},focus(){this.$refs.input.focus()},toggleDropdown(){this.disabled||(this.open=!this.open)},clickedOutside(){this.open=!1},keyboardNav(e){if(e.keyCode===40){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=0:this.selectedIndex=Math.min(this.sortedCountries.length-1,this.selectedIndex+1);const n=this.$refs.list.children[this.selectedIndex];n.offsetTop+n.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight&&(this.$refs.list.scrollTop=n.offsetTop-this.$refs.list.clientHeight+n.clientHeight)}else if(e.keyCode===38){e.preventDefault(),this.open=!0,this.selectedIndex===null?this.selectedIndex=this.sortedCountries.length-1:this.selectedIndex=Math.max(0,this.selectedIndex-1);const n=this.$refs.list.children[this.selectedIndex];n.offsetTop<this.$refs.list.scrollTop&&(this.$refs.list.scrollTop=n.offsetTop)}else if(e.keyCode===13)this.selectedIndex!==null&&this.choose(this.sortedCountries[this.selectedIndex]),this.open=!this.open;else{this.typeToFindInput+=e.key,clearTimeout(this.typeToFindTimer),this.typeToFindTimer=setTimeout(()=>{this.typeToFindInput=""},700);const n=this.sortedCountries.slice(this.preferredCountries.length).findIndex(t=>t.name.toLowerCase().startsWith(this.typeToFindInput));if(n>=0){this.selectedIndex=this.preferredCountries.length+n;const t=this.$refs.list.children[this.selectedIndex],d=t.offsetTop<this.$refs.list.scrollTop,o=t.offsetTop+t.clientHeight>this.$refs.list.scrollTop+this.$refs.list.clientHeight;(d||o)&&(this.$refs.list.scrollTop=t.offsetTop-this.$refs.list.clientHeight/2)}}},reset(){this.selectedIndex=this.sortedCountries.map(e=>e.iso2).indexOf(this.activeCountryCode),this.open=!1},setDropdownPosition(){window.innerHeight-this.$refs.rootElement.getBoundingClientRect().bottom>200?this.dropdownOpenDirection="below":this.dropdownOpenDirection="above"}}}),Gd=["tabindex"],Hd={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},Kd=["innerHTML"],Wd={key:1,class:"vti__country-code"},qd=["onClick","onMousemove"],Xd=["innerHTML"],Yd={key:1},Zd=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],Jd={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"};function Qd(e,n,t,d,o,i){const a=r.resolveDirective("click-outside");return r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass(["vue3-reactive-tel-input",{"bg-fourth-nano":e.validation},e.$attrs.class,e.rootClass,{disabled:e.disabled},e.classes]),style:r.normalizeStyle([e.rootStyle,e.styles]),ref:"rootElement"},[r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([["vti__dropdown",{open:e.open}],"br-solid br-black-transp br-1px radius-medium"]),tabindex:e.dropdownOptions.tabindex,onKeydown:[n[0]||(n[0]=(...s)=>e.keyboardNav&&e.keyboardNav(...s)),n[2]||(n[2]=r.withKeys((...s)=>e.reset&&e.reset(...s),["esc"]))],onClick:n[1]||(n[1]=(...s)=>e.toggleDropdown&&e.toggleDropdown(...s)),style:r.normalizeStyle([e.dropdownStyle])},[r.createElementVNode("span",Hd,[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:e.activeCountryFlag,class:"mn-r-thin"},null,8,Kd)):r.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(r.openBlock(),r.createElementBlock("span",Wd," +"+r.toDisplayString(e.activeCountry&&e.activeCountry.dialCode),1)):r.createCommentVNode("",!0)]),r.withDirectives(r.createElementVNode("ul",{ref:"list",class:r.normalizeClass(["bs-black radius-small vti__dropdown-list",e.dropdownOpenDirection]),style:r.normalizeStyle([e.listStyle])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.sortedCountries,(s,$)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["flex-nowrap flex w-max",["vti__dropdown-item",e.getItemClass($,s.iso2)]]),key:s.iso2+(s.preferred?"-preferred":""),onClick:l=>e.choose(s),onMousemove:l=>e.selectedIndex=$},[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:s.flag,class:"mn-r-thin"},null,8,Xd)):r.createCommentVNode("",!0),r.createElementVNode("strong",null,r.toDisplayString(s.name),1),e.dropdownOptions.showDialCodeInList?(r.openBlock(),r.createElementBlock("span",Yd," +"+r.toDisplayString(s.dialCode),1)):r.createCommentVNode("",!0)],42,qd))),128))],6),[[r.vShow,e.open]])],46,Gd)),[[a,e.clickedOutside]]),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":n[3]||(n[3]=s=>e.phone=s),pattern:"[0-9]*",ref:"input",type:e.inputOptions.type,autocomplete:e.inputOptions.autocomplete,autofocus:e.inputOptions.autofocus,class:r.normalizeClass(["vti__input",e.inputOptions.styleClasses,e.inputClass,e.Iclasses]),style:r.normalizeStyle([e.inputStyle,e.Istyles]),disabled:e.disabled,id:e.inputId!==""?e.inputId:e.inputOptions.id,maxlength:e.inputOptions.maxlength,name:e.inputId!==""?e.inputId:e.inputOptions.name,placeholder:e.parsedPlaceholder,readonly:e.inputOptions.readonly,required:e.inputOptions.required,tabindex:e.inputOptions.tabindex,onBlur:n[4]||(n[4]=(...s)=>e.onBlur&&e.onBlur(...s)),onFocus:n[5]||(n[5]=(...s)=>e.onFocus&&e.onFocus(...s)),onInput:n[6]||(n[6]=(...s)=>e.onInput&&e.onInput(...s)),onKeyup:[n[7]||(n[7]=r.withKeys((...s)=>e.onEnter&&e.onEnter(...s),["enter"])),n[8]||(n[8]=r.withKeys((...s)=>e.onSpace&&e.onSpace(...s),["space"]))]},null,46,Zd),[[r.vModelDynamic,e.phone]]),r.renderSlot(e.$slots,"default",{},void 0,!0)],6),r.createVNode(r.Transition,{name:"fade"},{default:r.withCtx(()=>[e.validation?(r.openBlock(),r.createElementBlock("div",Jd," * "+r.toDisplayString(e.validation.message),1)):r.createCommentVNode("",!0)]),_:1})],64)}const ae=tt._export_sfc(Ud,[["render",Qd],["__scopeId","data-v-50353ca7"]]);function je(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{forgotPasswordTitle:t=>{const{normalize:d}=t;return d(["Forgot Password?"])},instructions:t=>{const{normalize:d}=t;return d(["To reset your password, specify the phone or email used during registration."])},smsInfo:t=>{const{normalize:d}=t;return d(["We will send you an SMS with a confirmation code to reset your password, which you will need to enter in the next step."])},emailInfo:t=>{const{normalize:d}=t;return d(["We will send you an email with a confirmation code to reset your password, which you will need to enter in the next step."])},phone:t=>{const{normalize:d}=t;return d(["Phone"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Enter your phone"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your email"])},sendCode:t=>{const{normalize:d}=t;return d(["Send code"])}},ru:{forgotPasswordTitle:t=>{const{normalize:d}=t;return d(["Забыли пароль?"])},instructions:t=>{const{normalize:d}=t;return d(["Чтобы сбросить пароль, укажите телефон или email, использованные при регистрации."])},smsInfo:t=>{const{normalize:d}=t;return d(["Мы вышлем вам SMS с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге."])},emailInfo:t=>{const{normalize:d}=t;return d(["Мы отправим вам электронное письмо с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге."])},phone:t=>{const{normalize:d}=t;return d(["Телефон"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш телефон"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш email"])},sendCode:t=>{const{normalize:d}=t;return d(["Отправить код"])}}}})}const er={class:"t-left pd-medium"},tr={class:"mn-small"},nr={class:"mn-small t-transp"},dr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},rr={key:0,class:"mn-semi radius-small o-hidden"},or={class:"mn-small t-transp"},ir={key:0,class:"mn-semi radius-small o-hidden"},ar={class:"mn-small t-transp"},se={__name:"ResetPassword",setup(e){const{t:n}=k.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);w.useRoute();const o=w.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await b.validateInputs(t,b.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await b.validateInputs(d,b.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}try{await u.actions.resetPassword(u.state.user,i.value,"reset-password")}catch($){throw console.log($),new Error}}function s(){o.push({name:"Enter Code",query:{type:i.value,method:"reset-password"}})}return($,l)=>(r.openBlock(),r.createElementBlock("section",er,[r.createElementVNode("h3",tr,r.toDisplayString(r.unref(n)("forgotPasswordTitle")),1),r.createElementVNode("p",nr,r.toDisplayString(r.unref(n)("instructions")),1),r.createElementVNode("div",dr,[r.createVNode(Q._sfc_main,{selected:i.value,"onUpdate:selected":l[0]||(l[0]=m=>i.value=m),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",null,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[i.value==="phone"?(r.openBlock(),r.createElementBlock("div",rr,[r.createElementVNode("p",or,r.toDisplayString(r.unref(n)("smsInfo")),1),r.createVNode(ae,{modelValue:u.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=m=>u.state.user.phone=m),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:t.value,mode:"national",inputOptions:{placeholder:r.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):r.createCommentVNode("",!0)]),_:1}),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[i.value==="email"?(r.openBlock(),r.createElementBlock("div",ir,[r.createElementVNode("p",ar,r.toDisplayString(r.unref(n)("emailInfo")),1),r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":l[2]||(l[2]=m=>u.state.user.email=m),placeholder:r.unref(n)("emailPlaceholder"),validation:d.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):r.createCommentVNode("",!0)]),_:1})]),r.createVNode(u._sfc_main,{submit:a,callback:s,class:"mn-big"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("sendCode")),1)]),_:1})]))}};typeof je=="function"&&je(se);const sr=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));function Ue(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{title:t=>{const{normalize:d}=t;return d(["Sign Up to The Commune"])},description:t=>{const{normalize:d}=t;return d(["Choose a convenient way to register via phone or email:"])},phone:t=>{const{normalize:d}=t;return d(["Phone"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Enter your phone"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your email"])},emailNotice:t=>{const{normalize:d}=t;return d(["We will send you an email with a confirmation code that you will need to enter in the next step."])},smsNotice:t=>{const{normalize:d}=t;return d(["We will send you an SMS with a confirmation code that you will need to enter in the next step."])},sendCode:t=>{const{normalize:d}=t;return d(["Send Code"])},haveAccount:t=>{const{normalize:d}=t;return d(["Already have an account?"])}},ru:{title:t=>{const{normalize:d}=t;return d(["Новая учетная запись"])},description:t=>{const{normalize:d}=t;return d(["Выберите удобный способ регистрации через телефон или email:"])},phone:t=>{const{normalize:d}=t;return d(["Телефон"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш телефон"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш email"])},emailNotice:t=>{const{normalize:d}=t;return d(["Мы отправим вам электронное письмо с кодом подтверждения, который вы должны будете ввести в следующем шаге."])},smsNotice:t=>{const{normalize:d}=t;return d(["Мы вышлем вам SMS с кодом подтверждения, который вы должны будете ввести в следующем шаге."])},sendCode:t=>{const{normalize:d}=t;return d(["Отправить код"])},haveAccount:t=>{const{normalize:d}=t;return d(["У вас уже есть аккаунт?"])}}}})}const lr={class:"t-left pd-medium"},ur={class:"mn-small"},$r={class:"mn-small t-transp"},cr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},fr={class:""},pr={class:"mn-semi radius-small"},mr={class:"mn-small t-transp"},hr={class:"mn-semi radius-small o-hidden"},yr={class:"mn-small t-transp"},gr={class:"w-100"},le={__name:"SignUp",setup(e){const{t:n}=k.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);w.useRoute();const o=w.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await b.validateInputs(t,b.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await b.validateInputs(d,b.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}try{await u.sendCode(u.state.user,"signup",i.value)}catch{throw new Error}}function s(){o.push({name:"Enter Code"})}return($,l)=>{const m=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",lr,[r.createElementVNode("h3",ur,r.toDisplayString(r.unref(n)("title")),1),r.createElementVNode("p",$r,r.toDisplayString(r.unref(n)("description")),1),r.createElementVNode("div",cr,[r.createVNode(Q._sfc_main,{selected:i.value,"onUpdate:selected":l[0]||(l[0]=y=>i.value=y),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",fr,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",pr,[r.createElementVNode("p",mr,r.toDisplayString(r.unref(n)("smsNotice")),1),r.createVNode(ae,{modelValue:u.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=y=>u.state.user.phone=y),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:t.value,mode:"national",inputOptions:{placeholder:r.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[r.vShow,i.value==="phone"]])]),_:1}),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",hr,[r.createElementVNode("p",yr,r.toDisplayString(r.unref(n)("emailNotice")),1),r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":l[2]||(l[2]=y=>u.state.user.email=y),placeholder:r.unref(n)("emailPlaceholder"),validation:d.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[r.vShow,i.value==="email"]])]),_:1})]),r.createVNode(u._sfc_main,{submit:a,callback:s,class:"mn-big"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("sendCode")),1)]),_:1}),r.createElementVNode("div",gr,[r.createVNode(m,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("haveAccount")),1)]),_:1})])])}}};typeof Ue=="function"&&Ue(le);const vr=Object.freeze(Object.defineProperty({__proto__:null,default:le},Symbol.toStringTag,{value:"Module"}));function Ge(e){const n=e;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{en:{title:t=>{const{normalize:d}=t;return d(["Welcome to The Commune"])},subtitle:t=>{const{normalize:d}=t;return d(["Sign In to Continue"])},signup:t=>{const{normalize:d}=t;return d(["Don't have an account?"])},phone:t=>{const{normalize:d}=t;return d(["Phone"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Enter your phone"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your email"])},haveAccount:t=>{const{normalize:d}=t;return d(["Don't have an account? Sign Up"])},passwordPlaceholder:t=>{const{normalize:d}=t;return d(["Enter your password"])},forgotPassword:t=>{const{normalize:d}=t;return d(["Forgot Password?"])},signin:t=>{const{normalize:d}=t;return d(["Sign In"])},soon:t=>{const{normalize:d}=t;return d(["SOON"])},signinMetamask:t=>{const{normalize:d}=t;return d(["Sign In with Apple"])}},ru:{title:t=>{const{normalize:d}=t;return d(["Приветствуем вас,"])},subtitle:t=>{const{normalize:d}=t;return d(["Войдите для продолжения"])},signup:t=>{const{normalize:d}=t;return d(["Нет аккаунта?"])},phone:t=>{const{normalize:d}=t;return d(["Телефон"])},email:t=>{const{normalize:d}=t;return d(["Email"])},phonePlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш телефон"])},emailPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш email"])},haveAccount:t=>{const{normalize:d}=t;return d(["Нет аккаунта? Зарегистрироваться"])},passwordPlaceholder:t=>{const{normalize:d}=t;return d(["Введите ваш пароль"])},forgotPassword:t=>{const{normalize:d}=t;return d(["Забыли пароль?"])},signin:t=>{const{normalize:d}=t;return d(["Войти"])},soon:t=>{const{normalize:d}=t;return d(["СКОРО"])},signinMetamask:t=>{const{normalize:d}=t;return d(["Войти через Apple"])}}}})}const br={class:""},_r={class:"mn-medium"},Cr=r.createElementVNode("br",null,null,-1),wr={class:"t-semi"},Pr={class:"mn-big"},Nr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},Er={class:""},Or={class:"mn-thin radius-small"},Sr={class:"mn-thin radius-small o-hidden"},Ir={class:"w-100 mn-big"},Tr={class:"flex-v-center flex"},Ar={class:"mn-r-small"},ue={__name:"SignIn",setup(e){const{t:n}=k.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null),o=r.ref(null);w.useRoute();const i=w.useRouter(),a=r.ref("phone"),s=h=>{console.log("Apple login success:",h)},$=h=>{console.log("Apple login failure:",h)},l=r.inject("APPLE_CLIENTID"),m=r.inject("APPLE_REDIRECT_URL"),y=()=>{if(!window.AppleID){console.error('"https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js" needs to be included as a <script>');return}let h="email",v="123",T=!0;window.AppleID.auth.init({clientId:l,scope:h,redirectURI:m,state:v,usePopup:T}),document.addEventListener("AppleIDSignInOnSuccess",s),document.addEventListener("AppleIDSignInOnFailure",$)},p=()=>{try{window.AppleID.auth.signIn()}catch(h){console.error("Error signing in with Apple:",h)}},c=h=>new Promise((v,T)=>{const P=document.createElement("script");P.type="text/javascript",P.src=h,P.onload=v,P.onerror=T,document.head.appendChild(P)});r.onMounted(async()=>{try{await c("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"),y()}catch(h){console.error("Error loading AppleID script:",h)}});async function f(){try{a.value==="phone"&&await b.validateInputs(t,b.validatePhone,u.state.user.phone,"Некорректный телефон"),a.value==="email"&&await b.validateInputs(o,b.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}await u.actions.login(u.state.user,a.value)}function g(){i.push({name:"User Profile",params:{_id:u.state.user._id}})}return(h,v)=>{const T=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",br,[r.createElementVNode("h3",_r,[r.createTextVNode(r.toDisplayString(r.unref(n)("title"))+" ",1),Cr,r.createElementVNode("span",wr,r.toDisplayString(r.unref(n)("subtitle")),1)]),r.createElementVNode("p",Pr,[r.createVNode(T,{to:{name:"Sign Up"},class:"underline t-second"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signup")),1)]),_:1})]),r.createElementVNode("div",Nr,[r.createVNode(Q._sfc_main,{selected:a.value,"onUpdate:selected":v[0]||(v[0]=P=>a.value=P),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",Er,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",Or,[r.createVNode(ae,{modelValue:u.state.user.phone,"onUpdate:modelValue":v[1]||(v[1]=P=>u.state.user.phone=P),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:t.value,mode:"national",inputOptions:{placeholder:r.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[r.vShow,a.value==="phone"]])]),_:1}),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",Sr,[r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":v[2]||(v[2]=P=>u.state.user.email=P),placeholder:r.unref(n)("emailPlaceholder"),validation:o.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[r.vShow,a.value==="email"]])]),_:1})]),r.createVNode(u.Field,{field:u.state.user.password,"onUpdate:field":v[3]||(v[3]=P=>u.state.user.password=P),type:"password",validation:d.value,placeholder:r.unref(n)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),r.createElementVNode("div",Ir,[r.createVNode(T,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("forgotPassword")),1)]),_:1})]),r.createVNode(u._sfc_main,{submit:f,callback:g,class:"mn-thin"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signin")),1)]),_:1}),r.createElementVNode("button",{onClick:p,class:"bg-black t-white w-100 button"},[r.createElementVNode("div",Tr,[r.createElementVNode("span",Ar,r.toDisplayString(r.unref(n)("signinMetamask")),1)])])])}}};typeof Ge=="function"&&Ge(ue);const Fr=Object.freeze(Object.defineProperty({__proto__:null,default:ue},Symbol.toStringTag,{value:"Module"})),Dr=[{path:"auth",name:"Authentication",meta:{title:{en:"Sign In",ru:"Вход"}},component:Je,children:[{path:"signin",name:"Sign In",beforeEnter:[E.requiresNoAuth,E.resetUser],meta:{title:{en:"Sign In",ru:"Вход"}},component:()=>Promise.resolve().then(()=>Fr)},{path:"reset-password",name:"Reset Password",beforeEnter:[E.requiresNoAuth,E.resetUser],meta:{title:{en:"Reset Password",ru:"Сбросить Пароль"}},component:()=>Promise.resolve().then(()=>sr)},{path:"signup",name:"Sign Up",beforeEnter:[E.requiresNoAuth,E.resetUser],meta:{title:{en:"Sign Up",ru:"Регистрация"}},component:()=>Promise.resolve().then(()=>vr)},{path:"enter-code",name:"Enter Code",beforeEnter:[E.requiresNoAuth,E.checkUser],meta:{title:{en:"Enter Code",ru:"Введите Код"}},component:()=>Promise.resolve().then(()=>vd)},{path:"enter-password",name:"Enter Password",beforeEnter:[E.requiresNoAuth,E.checkUser],meta:{title:{en:"Enter Password",ru:"Введите Пароль"}},component:()=>Promise.resolve().then(()=>Rd)},{path:"invite",name:"Invite",meta:{title:{en:"Invite",ru:"Приглашение"}},component:()=>Promise.resolve().then(()=>Od)}]}];exports.authStore=u.auth;exports.twofaStore=u.twofa;exports.Auth=Je;exports.EnterCode=oe;exports.EnterPassword=ie;exports.Invite=et;exports.ResetPassword=se;exports.SignIn=ue;exports.SignUp=le;exports.SliderFeatures=ot;exports.authRoutes=Dr;exports.invitesStore=bd;
@@ -3619,7 +3619,7 @@ const ai = { class: "" }, si = { class: "mn-medium" }, li = /* @__PURE__ */ u("b
3619
3619
  console.log("Apple login success:", _);
3620
3620
  }, l = (_) => {
3621
3621
  console.log("Apple login failure:", _);
3622
- }, s = De("APPLE_CLIENTID"), y = De("API_URL"), C = () => {
3622
+ }, s = De("APPLE_CLIENTID"), y = De("APPLE_REDIRECT_URL"), C = () => {
3623
3623
  if (!window.AppleID) {
3624
3624
  console.error('"https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js" needs to be included as a <script>');
3625
3625
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -159,7 +159,7 @@ const callOnFailure = (error) => {
159
159
  };
160
160
 
161
161
  const clientId = inject('APPLE_CLIENTID')
162
- const redirectURI = inject('API_URL')
162
+ const redirectURI = inject('APPLE_REDIRECT_URL')
163
163
 
164
164
  const initAppleSignIn = () => {
165
165
  if (!window.AppleID) {