@ozdao/prometheus-framework 0.1.6 → 0.1.7

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 sn(e,n){if(e){if(typeof e=="string")return _e(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 _e(e,n)}}function _e(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 Ce(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 we(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Ce(Object(t),!0).forEach(function(d){ln(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function ln(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var Pe={formatExtension:function(n,t,d){return"".concat(n).concat(d.ext()).concat(t)}};function un(e,n,t,d){if(t?t=we(we({},Pe),t):t=Pe,d=new _(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=M(i,e.carrierCode,"NATIONAL",d,t),U(a,e.ext,d,t.formatExtension)):"";case"INTERNATIONAL":return i?(a=M(i,null,"INTERNATIONAL",d,t),a="+".concat(o," ").concat(a),U(a,e.ext,d,t.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(i);case"RFC3966":return on({number:"+".concat(o).concat(i),ext:e.ext});case"IDD":if(!t.fromCountry)return;var s=cn(i,e.carrierCode,o,t.fromCountry,d);return U(s,e.ext,d,t.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(n,'"'))}}function M(e,n,t,d,o){var i=$n(d.formats(),e);return i?nn(e,i,{useInternationalFormat:t==="INTERNATIONAL",withNationalPrefix:!(i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&o&&o.nationalPrefix===!1),carrierCode:n,metadata:d}):e}function $n(e,n){for(var t=an(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(O(n,o.pattern()))return o}}function U(e,n,t,d){return n?d(e,n,t):e}function cn(e,n,t,d,o){var i=ee(d,o.metadata);if(i===t){var a=M(e,n,"NATIONAL",o);return t==="1"?t+" "+a:a}var s=rn(d,void 0,o.metadata);if(s)return"".concat(s," ").concat(t," ").concat(M(e,null,"INTERNATIONAL",o))}function Ne(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 Ee(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Ne(Object(t),!0).forEach(function(d){fn(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ne(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function fn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function pn(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Oe(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 mn(e,n,t){return n&&Oe(e.prototype,n),t&&Oe(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var hn=function(){function e(n,t,d){if(pn(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=gn(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 mn(e,[{key:"setExt",value:function(t){this.ext=t}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Jt(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return Wt(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return Zt(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var t=new _(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 ne(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,d){return un(this,t,d?Ee(Ee({},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}(),yn=function(n){return/^[A-Z]{2}$/.test(n)};function gn(e,n){var t,d,o=new _(n);return yn(e)?(t=e,o.selectNumberingPlan(t),d=o.countryCallingCode()):d=e,{country:t,countryCallingCode:d}}var vn=new RegExp("(["+w+"])");function bn(e,n,t,d){if(n){var o=new _(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(vn);if(!(a&&a[1]!=null&&a[1].length>0&&a[1]==="0"))return e}}}function _n(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 c=d[0];o=e.slice(c.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 W(e,n){var t=_n(e,n),d=t.carrierCode,o=t.nationalNumber;if(o!==e){if(!Cn(e,o,n))return{nationalNumber:e};if(n.possibleLengths()&&!wn(o,n))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:d}}function Cn(e,n,t){return!(O(e,t.nationalNumberPattern())&&!O(n,t.nationalNumberPattern()))}function wn(e,n){switch(te(e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function Pn(e,n,t,d){var o=n?ee(n,d):t;if(e.indexOf(o)===0){d=new _(d),d.selectNumberingPlan(n,t);var i=e.slice(o.length),a=W(i,d),s=a.nationalNumber,c=W(e,d),l=c.nationalNumber;if(!O(l,d.nationalNumberPattern())&&O(s,d.nationalNumberPattern())||te(l,d)==="TOO_LONG")return{countryCallingCode:o,number:i}}return{number:e}}function Nn(e,n,t,d){if(!e)return{};var o;if(e[0]!=="+"){var i=bn(e,n,t,d);if(i&&i!==e)o=!0,e="+"+i;else{if(n||t){var a=Pn(e,n,t,d),s=a.countryCallingCode,c=a.number;if(s)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:s,number:c}}return{number:e}}}if(e[1]==="0")return{};d=new _(d);for(var l=2;l-1<=pt&&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 En(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=On(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 On(e,n){if(e){if(typeof e=="string")return Se(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 Se(e,n)}}function Se(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 Sn(e,n){var t=n.countries,d=n.defaultCountry,o=n.metadata;o=new _(o);for(var i=[],a=En(t),s;!(s=a()).done;){var c=s.value;if(o.country(c),o.leadingDigits()){if(e&&e.search(o.leadingDigits())===0)return c}else if(ne({phone:e,country:c},void 0,o.metadata))if(d){if(c===d)return c;i.push(c)}else return c}if(i.length>0)return i[0]}var In=!1;function Tn(e,n){var t=n.nationalNumber,d=n.defaultCountry,o=n.metadata;if(In&&o.isNonGeographicCallingCode(e))return"001";var i=o.getCountryCodesForCallingCode(e);if(i)return i.length===1?i[0]:Sn(t,{countries:i,defaultCountry:d,metadata:o.metadata})}var Xe="+",Fn="[\\-\\.\\(\\)]?",Ie="(["+w+"]|"+Fn+")",An="^\\"+Xe+Ie+"*["+w+"]"+Ie+"*$",Dn=new RegExp(An,"g"),q=w,kn="["+q+"]+((\\-)*["+q+"])*",Rn="a-zA-Z",xn="["+Rn+"]+((\\-)*["+q+"])*",Mn="^("+kn+"\\.)*"+xn+"\\.?$",zn=new RegExp(Mn,"g"),Te="tel:",X=";phone-context=",Ln=";isub=";function Bn(e){var n=e.indexOf(X);if(n<0)return null;var t=n+X.length;if(t>=e.length)return"";var d=e.indexOf(";",t);return d>=0?e.substring(t,d):e.substring(t)}function Vn(e){return e===null?!0:e.length===0?!1:Dn.test(e)||zn.test(e)}function jn(e,n){var t=n.extractFormattedPhoneNumber,d=Bn(e);if(!Vn(d))throw new N("NOT_A_NUMBER");var o;if(d===null)o=t(e)||"";else{o="",d.charAt(0)===Xe&&(o+=d);var i=e.indexOf(Te),a;i>=0?a=i+Te.length:a=0;var s=e.indexOf(X);o+=e.substring(a,s)}var c=o.indexOf(Ln);if(c>0&&(o=o.substring(0,c)),o!=="")return o}var Un=250,Gn=new RegExp("["+Q+w+"]"),Hn=new RegExp("[^"+w+"#]+$");function Kn(e,n,t){if(n=n||{},t=new _(t),n.defaultCountry&&!t.hasCountry(n.defaultCountry))throw n.v2?new N("INVALID_COUNTRY"):new Error("Unknown country: ".concat(n.defaultCountry));var d=qn(e,n.v2,n.extract),o=d.number,i=d.ext,a=d.error;if(!o){if(n.v2)throw a==="TOO_SHORT"?new N("TOO_SHORT"):new N("NOT_A_NUMBER");return{}}var s=Yn(o,n.defaultCountry,n.defaultCallingCode,t),c=s.country,l=s.nationalNumber,m=s.countryCallingCode,y=s.countryCallingCodeSource,p=s.carrierCode;if(!t.hasSelectedNumberingPlan()){if(n.v2)throw new N("INVALID_COUNTRY");return{}}if(!l||l.length<J){if(n.v2)throw new N("TOO_SHORT");return{}}if(l.length>ft){if(n.v2)throw new N("TOO_LONG");return{}}if(n.v2){var $=new hn(m,l,t.metadata);return c&&($.country=c),p&&($.carrierCode=p),i&&($.ext=i),$.__countryCallingCodeSource=y,$}var f=(n.extended?t.hasSelectedNumberingPlan():c)?O(l,t.nationalNumberPattern()):!1;return n.extended?{country:c,countryCallingCode:m,carrierCode:p,valid:f,possible:f?!0:!!(n.extended===!0&&t.possibleLengths()&&qe(l,t)),phone:l,ext:i}:f?Xn(c,l,i):{}}function Wn(e,n,t){if(e){if(e.length>Un){if(t)throw new N("TOO_LONG");return}if(n===!1)return e;var d=e.search(Gn);if(!(d<0))return e.slice(d).replace(Hn,"")}}function qn(e,n,t){var d=jn(e,{extractFormattedPhoneNumber:function(a){return Wn(a,t,n)}});if(!d)return{};if(!xt(d))return Mt(d)?{error:"TOO_SHORT"}:{};var o=zt(d);return o.ext?o:{number:d}}function Xn(e,n,t){var d={country:e,phone:n};return t&&(d.ext=t),d}function Yn(e,n,t,d){var o=Nn(ge(e),n,t,d.metadata),i=o.countryCallingCodeSource,a=o.countryCallingCode,s=o.number,c;if(a)d.selectNumberingPlan(a);else if(s&&(n||t))d.selectNumberingPlan(n,t),n&&(c=n),a=t||ee(n,d.metadata);else return{};if(!s)return{countryCallingCodeSource:i,countryCallingCode:a};var l=W(ge(s),d),m=l.nationalNumber,y=l.carrierCode,p=Tn(a,{nationalNumber:m,defaultCountry:n,metadata:d});return p&&(c=p,p==="001"||d.country(c)),{country:c,countryCallingCode:a,countryCallingCodeSource:i,nationalNumber:m,carrierCode:y}}function Fe(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 Ae(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Fe(Object(t),!0).forEach(function(d){Zn(e,d,t[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fe(Object(t)).forEach(function(d){Object.defineProperty(e,d,Object.getOwnPropertyDescriptor(t,d))})}return e}function Zn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Jn(e,n,t){return Kn(e,Ae(Ae({},n),{},{v2:!0}),t)}function Y(e){"@babel/helpers - typeof";return Y=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},Y(e)}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 Qn(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){ed(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 ed(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function td(e,n){return od(e)||rd(e,n)||dd(e,n)||nd()}function nd(){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 dd(e,n){if(e){if(typeof e=="string")return ke(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 ke(e,n)}}function ke(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 rd(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(c){i=!0,s=c}finally{try{!o&&t.return!=null&&t.return()}finally{if(i)throw s}}return d}}function od(e){if(Array.isArray(e))return e}function id(e){var n=Array.prototype.slice.call(e),t=td(n,4),d=t[0],o=t[1],i=t[2],a=t[3],s,c,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?(c=i,l=a):(c=void 0,l=i),o&&(c=Qn({defaultCountry:o},c));else if(ad(o))i?(c=o,l=i):l=o;else throw new Error("Invalid second argument: ".concat(o));return{text:s,options:c,metadata:l}}var ad=function(n){return Y(n)==="object"};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 xe(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){sd(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 sd(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ld(e,n,t){n&&n.defaultCountry&&!It(n.defaultCountry,t)&&(n=xe(xe({},n),{},{defaultCountry:void 0}));try{return Jn(e,n,t)}catch(d){if(!(d instanceof N))throw d}}function ud(){var e=id(arguments),n=e.text,t=e.options,d=e.metadata;return ld(n,t,d)}function G(){return it(ud,arguments)}const $d={class:"cols-2-1_2 gap-small pd-small bg-white"},cd=r.createElementVNode("section",{class:"w-100 desktop-only o-hidden radius-big bg-grad-main"},null,-1),Ye={__name:"Auth",setup(e){return r.ref(null),r.ref(null),r.ref(null),C.useRoute(),C.useRouter(),r.ref("email"),(n,t)=>{const d=r.resolveComponent("router-view");return r.openBlock(),r.createElementBlock("div",$d,[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}),cd])}}};function Me(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 fd={class:"t-center pd-medium"},pd={class:"mn-medium"},md={class:"mn-big t-transp"},hd={class:"w-100 mn-big flex-nowrap flex"},yd={key:1},de={__name:"EnterCode",setup(e){const n=C.useRoute(),t=C.useRouter(),{t:d}=F.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{S.setError({response:{data:{errorCode:"CODE_NOT_SENT"}}})}}const c=(p,$)=>{navigator.clipboard.readText().then(g=>{if(g&&/^\d{4}$/.test(g)){for(let h=0;h<4;h++)o.digits[$+h]=g[h];y($+3)}})},l=(p,$)=>{p.preventDefault();const f=p.clipboardData.getData("text/plain");if(/^\d{4}$/.test(f)){for(let g=0;g<4;g++)o.digits[$+g]=f[g];y($+3)}else S.setError({response:{data:{errorCode:"INPUT_ERROR"}}})},m=(p,$)=>{if(p.key==="Backspace"&&(o.digits[$]===null||o.digits[$]===void 0||o.digits[$]==="")){p.preventDefault();const f=document.querySelectorAll("input"),g=$>0?f[$-1]:null;g&&(g.focus(),g.setSelectionRange(g.value.length,g.value.length))}},y=p=>{const $=document.querySelectorAll("input"),f=$[p+1],g=p>0?$[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(""),B=u.state$1.code.code.toString();h===B?(u.state$1.code.isValid=!0,t.push({path:"/auth/enter-password",query:{type:u.state$1.code.type,method:n.query.method}})):(S.setError({response:{data:{errorCode:"WRONG_CODE"}}}),i.value.focus(),o.digits=["","","",""])}};return(p,$)=>(r.openBlock(),r.createElementBlock("section",fd,[r.createElementVNode("h3",pd,r.toDisplayString(r.unref(d)("verifyNumberTitle")),1),r.createElementVNode("p",md,r.toDisplayString(r.unref(d)("instructions")),1),r.createElementVNode("div",hd,[r.withDirectives(r.createElementVNode("input",{type:"number","onUpdate:modelValue":$[0]||($[0]=f=>o.digits[0]=f),ref_key:"firstInput",ref:i,maxlength:"1",onInput:$[1]||($[1]=f=>y(0)),onPaste:$[2]||($[2]=f=>l(f,0)),onKeydown:$[3]||($[3]=f=>m(f,0)),onFocus:$[4]||($[4]=f=>c(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":$[5]||($[5]=f=>o.digits[1]=f),maxlength:"1",onInput:$[6]||($[6]=f=>y(1)),onPaste:$[7]||($[7]=f=>l(f,1)),onKeydown:$[8]||($[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":$[9]||($[9]=f=>o.digits[2]=f),maxlength:"1",onInput:$[10]||($[10]=f=>y(2)),onPaste:$[11]||($[11]=f=>l(f,2)),onKeydown:$[12]||($[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":$[13]||($[13]=f=>o.digits[3]=f),maxlength:"1",onInput:$[14]||($[14]=f=>y(3)),onPaste:$[15]||($[15]=f=>l(f,3)),onKeydown:$[16]||($[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",yd,r.toDisplayString(a.value)+" "+r.toDisplayString(r.unref(d)("secondsResend")),1))]))}};typeof Me=="function"&&Me(de);const gd=Object.freeze(Object.defineProperty({__proto__:null,default:de},Symbol.toStringTag,{value:"Module"})),T=u.axios.create({baseURL:process.env.API_URL,withCredentials:!0});T.defaults.withCredentials=!0;const E=r.reactive({invites:[],invite:null,error:null}),Ze={async read(e){await T.get(`/api/invites/${e}`).then(n=>{E.invites=n.data,E.error=null}).catch(n=>{S.setError(n)})},async readOne(e){await T.get(`/api/invites/get/${e}`).then(n=>{E.invite=n.data,u.state.user.phone=n.data.invitedPhone,u.state.user.email=n.data.invitedEmail}).catch(n=>{S.setError(n)})},async create(e,n){await T.post(`/api/invites/${e}/create`,n).then(()=>{E.error=null}).catch(t=>{S.setError(t)})},async update(e,n){await T.put(`/api/invites/${e}/update`,n).then(()=>{E.error=null}).catch(t=>{S.setError(t)})},async delete(e){await T.delete(`/api/invites/${e}/delete`).then(()=>{E.error=null}).catch(n=>{S.setError(n)})}};r.watch(E,(e,n)=>{});const vd=Object.freeze(Object.defineProperty({__proto__:null,actions:Ze,state:E},Symbol.toStringTag,{value:"Module"}));const bd={class:"t-left pd-medium"},_d=r.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),Cd=r.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),wd={class:"mn-semi radius-small o-hidden"},Pd={key:0},Nd={key:1},Je={__name:"Invite",async setup(e){let n,t;const d=r.ref(null),o=C.useRoute(),i=C.useRouter();[n,t]=r.withAsyncContext(()=>Ze.readOne(o.query.inviteCode)),await n,t();async function a(){try{await v.validateInputs(d,v.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(c,l)=>(r.openBlock(),r.createElementBlock("section",bd,[_d,Cd,r.createElementVNode("div",wd,[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:E.invite===null,submit:a,callback:s,class:"mn-big"},{default:r.withCtx(()=>[r.unref(o).query.method==="reset-password"?(r.openBlock(),r.createElementBlock("span",Pd,"Поменять пароль")):(r.openBlock(),r.createElementBlock("span",Nd,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}},Ed=Object.freeze(Object.defineProperty({__proto__:null,default:Je},Symbol.toStringTag,{value:"Module"}));function ze(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 Od={class:"t-left pd-medium"},Sd={class:"mn-small"},Id={key:0,class:"mn-semi t-transp"},Td={key:1,class:"mn-semi t-transp"},Fd={class:"mn-semi radius-small o-hidden"},Ad={key:0},Dd={key:1},re={__name:"EnterPassword",setup(e){const n=r.ref(null),{t}=F.useI18n({inheritLocale:!0,useScope:"local"}),d=C.useRoute(),o=C.useRouter();r.ref("phone");async function i(){try{await v.validateInputs(n,v.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,c)=>(r.openBlock(),r.createElementBlock("section",Od,[r.createElementVNode("h3",Sd,r.toDisplayString(r.unref(t)("almostDone")),1),r.unref(d).query.method==="reset-password"?(r.openBlock(),r.createElementBlock("p",Id,r.toDisplayString(r.unref(t)("newPasswordPrompt")),1)):(r.openBlock(),r.createElementBlock("p",Td,r.toDisplayString(r.unref(t)("registrationPasswordPrompt")),1)),r.createElementVNode("div",Fd,[r.createVNode(u.Field,{field:u.state.user.password,"onUpdate:field":c[0]||(c[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":c[1]||(c[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",Ad,r.toDisplayString(r.unref(t)("changePasswordBtn")),1)):(r.openBlock(),r.createElementBlock("span",Dd,r.toDisplayString(r.unref(t)("registerBtn")),1))]),_:1})]))}};typeof ze=="function"&&ze(re);const kd=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"})),Rd=[["‫افغانستان‬‎","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,,"🇦🇽"]],xd=Rd.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 Md(){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 zd(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 Ld=[{name:"allCountries",type:Array,default:xd,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}],Bd=[...Ld].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},{}),Le={options:{...Bd}},Vd={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 b(e){const n=Le.options[e];return typeof n>"u"?Le.options[e]:n}const jd=r.defineComponent({name:"Vue3ReactiveTelInput",directives:{clickOutside:Vd},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:()=>b("allCountries")},autoFormat:{type:Boolean,default:()=>b("autoFormat")},validation:{type:[Boolean,Object],default:!1},customValidate:{type:[Boolean,RegExp],default:()=>b("customValidate")},defaultCountry:{type:String,default:()=>b("defaultCountry")},disabled:{type:Boolean,default:()=>b("disabled")},autoDefaultCountry:{type:Boolean,default:()=>b("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>b("dropdownOptions")},ignoredCountries:{type:Array,default:()=>b("ignoredCountries")},inputOptions:{type:Object,default:()=>b("inputOptions")},invalidMsg:{type:String,default:()=>b("invalidMsg")},mode:{type:String,default:()=>b("mode")},onlyCountries:{type:Array,default:()=>b("onlyCountries")},preferredCountries:{type:Array,default:()=>b("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>b("validCharactersOnly")},rootClass:{type:[String,Array,Object],default:()=>b("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=G(this.phone)||{}:e=G(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?Md().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=G(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(){zd(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"}}}),Ud=["tabindex"],Gd={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},Hd=["innerHTML"],Kd={key:1,class:"vti__country-code"},Wd=["onClick","onMousemove"],qd=["innerHTML"],Xd={key:1},Yd=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],Zd={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"};function Jd(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",Gd,[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:e.activeCountryFlag,class:"mn-r-thin"},null,8,Hd)):r.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(r.openBlock(),r.createElementBlock("span",Kd," +"+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,c)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["flex-nowrap flex w-max",["vti__dropdown-item",e.getItemClass(c,s.iso2)]]),key:s.iso2+(s.preferred?"-preferred":""),onClick:l=>e.choose(s),onMousemove:l=>e.selectedIndex=c},[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:s.flag,class:"mn-r-thin"},null,8,qd)):r.createCommentVNode("",!0),r.createElementVNode("strong",null,r.toDisplayString(s.name),1),e.dropdownOptions.showDialCodeInList?(r.openBlock(),r.createElementBlock("span",Xd," +"+r.toDisplayString(s.dialCode),1)):r.createCommentVNode("",!0)],42,Wd))),128))],6),[[r.vShow,e.open]])],46,Ud)),[[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,Yd),[[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",Zd," * "+r.toDisplayString(e.validation.message),1)):r.createCommentVNode("",!0)]),_:1})],64)}const oe=et._export_sfc(jd,[["render",Jd],["__scopeId","data-v-50353ca7"]]);function Be(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 Qd={class:"t-left pd-medium"},er={class:"mn-small"},tr={class:"mn-small t-transp"},nr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},dr={key:0,class:"mn-semi radius-small o-hidden"},rr={class:"mn-small t-transp"},or={key:0,class:"mn-semi radius-small o-hidden"},ir={class:"mn-small t-transp"},ie={__name:"ResetPassword",setup(e){const{t:n}=F.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);C.useRoute();const o=C.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await v.validateInputs(t,v.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await v.validateInputs(d,v.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}try{await u.actions.resetPassword(u.state.user,i.value,"reset-password")}catch(c){throw console.log(c),new Error}}function s(){o.push({name:"Enter Code",query:{type:i.value,method:"reset-password"}})}return(c,l)=>(r.openBlock(),r.createElementBlock("section",Qd,[r.createElementVNode("h3",er,r.toDisplayString(r.unref(n)("forgotPasswordTitle")),1),r.createElementVNode("p",tr,r.toDisplayString(r.unref(n)("instructions")),1),r.createElementVNode("div",nr,[r.createVNode(Z._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",dr,[r.createElementVNode("p",rr,r.toDisplayString(r.unref(n)("smsInfo")),1),r.createVNode(oe,{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",or,[r.createElementVNode("p",ir,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 Be=="function"&&Be(ie);const ar=Object.freeze(Object.defineProperty({__proto__:null,default:ie},Symbol.toStringTag,{value:"Module"}));function Ve(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 sr={class:"t-left pd-medium"},lr={class:"mn-small"},ur={class:"mn-small t-transp"},$r={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},cr={class:""},fr={class:"mn-semi radius-small"},pr={class:"mn-small t-transp"},mr={class:"mn-semi radius-small o-hidden"},hr={class:"mn-small t-transp"},yr={class:"w-100"},ae={__name:"SignUp",setup(e){const{t:n}=F.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);C.useRoute();const o=C.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await v.validateInputs(t,v.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await v.validateInputs(d,v.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(c,l)=>{const m=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",sr,[r.createElementVNode("h3",lr,r.toDisplayString(r.unref(n)("title")),1),r.createElementVNode("p",ur,r.toDisplayString(r.unref(n)("description")),1),r.createElementVNode("div",$r,[r.createVNode(Z._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",cr,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",fr,[r.createElementVNode("p",pr,r.toDisplayString(r.unref(n)("smsNotice")),1),r.createVNode(oe,{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",mr,[r.createElementVNode("p",hr,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",yr,[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 Ve=="function"&&Ve(ae);const gr=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"}));function je(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 vr={class:""},br={class:"mn-medium"},_r=r.createElementVNode("br",null,null,-1),Cr={class:"t-semi"},wr={class:"mn-big"},Pr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},Nr={class:""},Er={class:"mn-thin radius-small"},Or={class:"mn-thin radius-small o-hidden"},Sr={class:"w-100 mn-big"},Ir={class:"flex-v-center flex"},Tr={class:"mn-r-small"},se={__name:"SignIn",setup(e){const{t:n}=F.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null),o=r.ref(null);C.useRoute();const i=C.useRouter(),a=r.ref("phone"),s=r.inject("APPLE_CLIENTID"),c=r.inject("APPLE_REDIRECT_URL"),l=async()=>(window.AppleID.auth.init({clientId:s,scope:"email name",redirectURI:c,usePopup:!0}),window.AppleID.auth.signIn().then($=>(onSuccess&&onSuccess($),$)).catch($=>(onError?onError($):console.error($),null))),m=$=>new Promise((f,g)=>{const h=document.createElement("script");h.type="text/javascript",h.src=$,h.onload=f,h.onerror=g,document.head.appendChild(h)});r.onMounted(async()=>{await m("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function y(){try{a.value==="phone"&&await v.validateInputs(t,v.validatePhone,u.state.user.phone,"Некорректный телефон"),a.value==="email"&&await v.validateInputs(o,v.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}await u.actions.login(u.state.user,a.value)}function p(){i.push({name:"User Profile",params:{_id:u.state.user._id}})}return($,f)=>{const g=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",vr,[r.createElementVNode("h3",br,[r.createTextVNode(r.toDisplayString(r.unref(n)("title"))+" ",1),_r,r.createElementVNode("span",Cr,r.toDisplayString(r.unref(n)("subtitle")),1)]),r.createElementVNode("p",wr,[r.createVNode(g,{to:{name:"Sign Up"},class:"underline t-second"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signup")),1)]),_:1})]),r.createElementVNode("div",Pr,[r.createVNode(Z._sfc_main,{selected:a.value,"onUpdate:selected":f[0]||(f[0]=h=>a.value=h),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",Nr,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",Er,[r.createVNode(oe,{modelValue:u.state.user.phone,"onUpdate:modelValue":f[1]||(f[1]=h=>u.state.user.phone=h),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",Or,[r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":f[2]||(f[2]=h=>u.state.user.email=h),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":f[3]||(f[3]=h=>u.state.user.password=h),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",Sr,[r.createVNode(g,{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:y,callback:p,class:"mn-thin"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signin")),1)]),_:1}),r.createElementVNode("button",{onClick:l,class:"bg-black t-white w-100 button"},[r.createElementVNode("div",Ir,[r.createElementVNode("span",Tr,r.toDisplayString(r.unref(n)("signinMetamask")),1)])])])}}};typeof je=="function"&&je(se);const Fr=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"})),Ar=[{path:"auth",name:"Authentication",meta:{title:{en:"Sign In",ru:"Вход"}},component:Ye,children:[{path:"signin",name:"Sign In",beforeEnter:[P.requiresNoAuth,P.resetUser],meta:{title:{en:"Sign In",ru:"Вход"}},component:()=>Promise.resolve().then(()=>Fr)},{path:"reset-password",name:"Reset Password",beforeEnter:[P.requiresNoAuth,P.resetUser],meta:{title:{en:"Reset Password",ru:"Сбросить Пароль"}},component:()=>Promise.resolve().then(()=>ar)},{path:"signup",name:"Sign Up",beforeEnter:[P.requiresNoAuth,P.resetUser],meta:{title:{en:"Sign Up",ru:"Регистрация"}},component:()=>Promise.resolve().then(()=>gr)},{path:"enter-code",name:"Enter Code",beforeEnter:[P.requiresNoAuth,P.checkUser],meta:{title:{en:"Enter Code",ru:"Введите Код"}},component:()=>Promise.resolve().then(()=>gd)},{path:"enter-password",name:"Enter Password",beforeEnter:[P.requiresNoAuth,P.checkUser],meta:{title:{en:"Enter Password",ru:"Введите Пароль"}},component:()=>Promise.resolve().then(()=>kd)},{path:"invite",name:"Invite",meta:{title:{en:"Invite",ru:"Приглашение"}},component:()=>Promise.resolve().then(()=>Ed)}]}];exports.authStore=u.auth;exports.twofaStore=u.twofa;exports.Auth=Ye;exports.EnterCode=de;exports.EnterPassword=re;exports.Invite=Je;exports.ResetPassword=ie;exports.SignIn=se;exports.SignUp=ae;exports.SliderFeatures=rt;exports.authRoutes=Ar;exports.invitesStore=vd;
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 b(e){const n=Le.options[e];return typeof n>"u"?Le.options[e]:n}const jd=r.defineComponent({name:"Vue3ReactiveTelInput",directives:{clickOutside:Vd},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:()=>b("allCountries")},autoFormat:{type:Boolean,default:()=>b("autoFormat")},validation:{type:[Boolean,Object],default:!1},customValidate:{type:[Boolean,RegExp],default:()=>b("customValidate")},defaultCountry:{type:String,default:()=>b("defaultCountry")},disabled:{type:Boolean,default:()=>b("disabled")},autoDefaultCountry:{type:Boolean,default:()=>b("autoDefaultCountry")},dropdownOptions:{type:Object,default:()=>b("dropdownOptions")},ignoredCountries:{type:Array,default:()=>b("ignoredCountries")},inputOptions:{type:Object,default:()=>b("inputOptions")},invalidMsg:{type:String,default:()=>b("invalidMsg")},mode:{type:String,default:()=>b("mode")},onlyCountries:{type:Array,default:()=>b("onlyCountries")},preferredCountries:{type:Array,default:()=>b("preferredCountries")},validCharactersOnly:{type:Boolean,default:()=>b("validCharactersOnly")},rootClass:{type:[String,Array,Object],default:()=>b("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=G(this.phone)||{}:e=G(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?Md().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=G(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(){zd(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"}}}),Ud=["tabindex"],Gd={class:"flex-nowrap flex flex-v-center p-medium vti__selection"},Hd=["innerHTML"],Kd={key:1,class:"vti__country-code"},Wd=["onClick","onMousemove"],qd=["innerHTML"],Xd={key:1},Yd=["type","autocomplete","autofocus","disabled","id","maxlength","name","placeholder","readonly","required","tabindex"],Zd={key:0,class:"mn-t-thin mn-b-thin invalid-feedback"};function Jd(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",Gd,[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:e.activeCountryFlag,class:"mn-r-thin"},null,8,Hd)):r.createCommentVNode("",!0),e.dropdownOptions.showDialCodeInSelection?(r.openBlock(),r.createElementBlock("span",Kd," +"+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,c)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["flex-nowrap flex w-max",["vti__dropdown-item",e.getItemClass(c,s.iso2)]]),key:s.iso2+(s.preferred?"-preferred":""),onClick:l=>e.choose(s),onMousemove:l=>e.selectedIndex=c},[e.dropdownOptions.showFlags?(r.openBlock(),r.createElementBlock("span",{key:0,innerHTML:s.flag,class:"mn-r-thin"},null,8,qd)):r.createCommentVNode("",!0),r.createElementVNode("strong",null,r.toDisplayString(s.name),1),e.dropdownOptions.showDialCodeInList?(r.openBlock(),r.createElementBlock("span",Xd," +"+r.toDisplayString(s.dialCode),1)):r.createCommentVNode("",!0)],42,Wd))),128))],6),[[r.vShow,e.open]])],46,Ud)),[[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,Yd),[[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",Zd," * "+r.toDisplayString(e.validation.message),1)):r.createCommentVNode("",!0)]),_:1})],64)}const oe=et._export_sfc(jd,[["render",Jd],["__scopeId","data-v-50353ca7"]]);function Be(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 Qd={class:"t-left pd-medium"},er={class:"mn-small"},tr={class:"mn-small t-transp"},nr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},dr={key:0,class:"mn-semi radius-small o-hidden"},rr={class:"mn-small t-transp"},or={key:0,class:"mn-semi radius-small o-hidden"},ir={class:"mn-small t-transp"},ie={__name:"ResetPassword",setup(e){const{t:n}=F.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);C.useRoute();const o=C.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await v.validateInputs(t,v.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await v.validateInputs(d,v.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}try{await u.actions.resetPassword(u.state.user,i.value,"reset-password")}catch(c){throw console.log(c),new Error}}function s(){o.push({name:"Enter Code",query:{type:i.value,method:"reset-password"}})}return(c,l)=>(r.openBlock(),r.createElementBlock("section",Qd,[r.createElementVNode("h3",er,r.toDisplayString(r.unref(n)("forgotPasswordTitle")),1),r.createElementVNode("p",tr,r.toDisplayString(r.unref(n)("instructions")),1),r.createElementVNode("div",nr,[r.createVNode(Z._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",dr,[r.createElementVNode("p",rr,r.toDisplayString(r.unref(n)("smsInfo")),1),r.createVNode(oe,{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",or,[r.createElementVNode("p",ir,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 Be=="function"&&Be(ie);const ar=Object.freeze(Object.defineProperty({__proto__:null,default:ie},Symbol.toStringTag,{value:"Module"}));function Ve(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 sr={class:"t-left pd-medium"},lr={class:"mn-small"},ur={class:"mn-small t-transp"},$r={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},cr={class:""},fr={class:"mn-semi radius-small"},pr={class:"mn-small t-transp"},mr={class:"mn-semi radius-small o-hidden"},hr={class:"mn-small t-transp"},yr={class:"w-100"},ae={__name:"SignUp",setup(e){const{t:n}=F.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null);C.useRoute();const o=C.useRouter(),i=r.ref("phone");async function a(){try{i.value==="phone"&&await v.validateInputs(t,v.validatePhone,u.state.user.phone,"Некорректный телефон"),i.value==="email"&&await v.validateInputs(d,v.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(c,l)=>{const m=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",sr,[r.createElementVNode("h3",lr,r.toDisplayString(r.unref(n)("title")),1),r.createElementVNode("p",ur,r.toDisplayString(r.unref(n)("description")),1),r.createElementVNode("div",$r,[r.createVNode(Z._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",cr,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",fr,[r.createElementVNode("p",pr,r.toDisplayString(r.unref(n)("smsNotice")),1),r.createVNode(oe,{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",mr,[r.createElementVNode("p",hr,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",yr,[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 Ve=="function"&&Ve(ae);const gr=Object.freeze(Object.defineProperty({__proto__:null,default:ae},Symbol.toStringTag,{value:"Module"}));function je(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 vr={class:""},br={class:"mn-medium"},_r=r.createElementVNode("br",null,null,-1),Cr={class:"t-semi"},wr={class:"mn-big"},Pr={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},Nr={class:""},Er={class:"mn-thin radius-small"},Or={class:"mn-thin radius-small o-hidden"},Sr={class:"w-100 mn-big"},Ir={class:"flex-v-center flex"},Tr={class:"mn-r-small"},se={__name:"SignIn",setup(e){const{t:n}=F.useI18n({inheritLocale:!0,useScope:"local"}),t=r.ref(null),d=r.ref(null),o=r.ref(null);C.useRoute();const i=C.useRouter(),a=r.ref("phone"),s=r.inject("APPLE_CLIENTID"),c=r.inject("APPLE_REDIRECT_URL"),l=async()=>(window.AppleID.auth.init({clientId:s,scope:"email name",redirectURI:c,usePopup:!0}),window.AppleID.auth.signIn().then($=>($&&console.log($),$)).catch($=>(console.error($),null))),m=$=>new Promise((f,g)=>{const h=document.createElement("script");h.type="text/javascript",h.src=$,h.onload=f,h.onerror=g,document.head.appendChild(h)});r.onMounted(async()=>{await m("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function y(){try{a.value==="phone"&&await v.validateInputs(t,v.validatePhone,u.state.user.phone,"Некорректный телефон"),a.value==="email"&&await v.validateInputs(o,v.validateEmail,u.state.user.email,"Некорректный email")}catch{throw new Error}await u.actions.login(u.state.user,a.value)}function p(){i.push({name:"User Profile",params:{_id:u.state.user._id}})}return($,f)=>{const g=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("section",vr,[r.createElementVNode("h3",br,[r.createTextVNode(r.toDisplayString(r.unref(n)("title"))+" ",1),_r,r.createElementVNode("span",Cr,r.toDisplayString(r.unref(n)("subtitle")),1)]),r.createElementVNode("p",wr,[r.createVNode(g,{to:{name:"Sign Up"},class:"underline t-second"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signup")),1)]),_:1})]),r.createElementVNode("div",Pr,[r.createVNode(Z._sfc_main,{selected:a.value,"onUpdate:selected":f[0]||(f[0]=h=>a.value=h),tabs:[{name:r.unref(n)("phone"),value:"phone"},{name:r.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),r.createElementVNode("div",Nr,[r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",Er,[r.createVNode(oe,{modelValue:u.state.user.phone,"onUpdate:modelValue":f[1]||(f[1]=h=>u.state.user.phone=h),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",Or,[r.createVNode(u.Field,{field:u.state.user.email,"onUpdate:field":f[2]||(f[2]=h=>u.state.user.email=h),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":f[3]||(f[3]=h=>u.state.user.password=h),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",Sr,[r.createVNode(g,{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:y,callback:p,class:"mn-thin"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(n)("signin")),1)]),_:1}),r.createElementVNode("button",{onClick:l,class:"bg-black t-white w-100 button"},[r.createElementVNode("div",Ir,[r.createElementVNode("span",Tr,r.toDisplayString(r.unref(n)("signinMetamask")),1)])])])}}};typeof je=="function"&&je(se);const Fr=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"})),Ar=[{path:"auth",name:"Authentication",meta:{title:{en:"Sign In",ru:"Вход"}},component:Ye,children:[{path:"signin",name:"Sign In",beforeEnter:[P.requiresNoAuth,P.resetUser],meta:{title:{en:"Sign In",ru:"Вход"}},component:()=>Promise.resolve().then(()=>Fr)},{path:"reset-password",name:"Reset Password",beforeEnter:[P.requiresNoAuth,P.resetUser],meta:{title:{en:"Reset Password",ru:"Сбросить Пароль"}},component:()=>Promise.resolve().then(()=>ar)},{path:"signup",name:"Sign Up",beforeEnter:[P.requiresNoAuth,P.resetUser],meta:{title:{en:"Sign Up",ru:"Регистрация"}},component:()=>Promise.resolve().then(()=>gr)},{path:"enter-code",name:"Enter Code",beforeEnter:[P.requiresNoAuth,P.checkUser],meta:{title:{en:"Enter Code",ru:"Введите Код"}},component:()=>Promise.resolve().then(()=>gd)},{path:"enter-password",name:"Enter Password",beforeEnter:[P.requiresNoAuth,P.checkUser],meta:{title:{en:"Enter Password",ru:"Введите Пароль"}},component:()=>Promise.resolve().then(()=>kd)},{path:"invite",name:"Invite",meta:{title:{en:"Invite",ru:"Приглашение"}},component:()=>Promise.resolve().then(()=>Ed)}]}];exports.authStore=u.auth;exports.twofaStore=u.twofa;exports.Auth=Ye;exports.EnterCode=de;exports.EnterPassword=re;exports.Invite=Je;exports.ResetPassword=ie;exports.SignIn=se;exports.SignUp=ae;exports.SliderFeatures=rt;exports.authRoutes=Ar;exports.invitesStore=vd;
@@ -3620,7 +3620,7 @@ const oi = { class: "" }, ai = { class: "mn-medium" }, si = /* @__PURE__ */ c("b
3620
3620
  scope: "email name",
3621
3621
  redirectURI: $,
3622
3622
  usePopup: !0
3623
- }), window.AppleID.auth.signIn().then((l) => (onSuccess && onSuccess(l), l)).catch((l) => (onError ? onError(l) : console.error(l), null))), y = (l) => new Promise((u, w) => {
3623
+ }), window.AppleID.auth.signIn().then((l) => (l && console.log(l), l)).catch((l) => (console.error(l), null))), y = (l) => new Promise((u, w) => {
3624
3624
  const _ = document.createElement("script");
3625
3625
  _.type = "text/javascript", _.src = l, _.onload = u, _.onerror = w, document.head.appendChild(_);
3626
3626
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
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",
@@ -163,20 +163,15 @@ const appleSignIn = async () => {
163
163
  .signIn()
164
164
  .then((response) => {
165
165
  /** This is only called in case usePopup is true */
166
- if (onSuccess) {
167
- onSuccess(response);
166
+ if (response) {
167
+ console.log(response)
168
168
  }
169
169
  /** resolve with the reponse */
170
170
  return response;
171
171
  })
172
172
  .catch((err) => {
173
- if (onError) {
174
- /** Call onError catching the error */
175
- onError(err);
176
- } else {
177
- /** Log the error to help debug */
178
- console.error(err);
179
- }
173
+ /** Log the error to help debug */
174
+ console.error(err);
180
175
  return null;
181
176
  });
182
177
  };