@ozdao/prometheus-framework 0.1.82 → 0.1.84

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. package/dist/node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs +4 -4
  2. package/dist/node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js +3 -3
  3. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
  4. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +22 -22
  5. package/dist/prometheus-framework/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs +1 -1
  6. package/dist/prometheus-framework/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +2981 -2804
  7. package/dist/prometheus-framework/node_modules/date-fns/esm/getQuarter/index.cjs +1 -0
  8. package/dist/prometheus-framework/node_modules/date-fns/esm/getQuarter/index.js +10 -0
  9. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/getNumberType.cjs +2 -2
  10. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +26 -26
  11. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/isObject.cjs +1 -0
  12. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/helpers/isObject.js +7 -0
  13. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/metadata.cjs +1 -1
  14. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/metadata.js +28 -29
  15. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/normalizeArguments.cjs +2 -2
  16. package/dist/prometheus-framework/node_modules/libphonenumber-js/es6/normalizeArguments.js +55 -65
  17. package/dist/prometheus-framework/node_modules/libphonenumber-js/metadata.min.json.cjs +1 -1
  18. package/dist/prometheus-framework/node_modules/libphonenumber-js/metadata.min.json.js +1 -1
  19. package/dist/prometheus-framework/src/components/Address/Address.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Address/Address.vue.js +23 -23
  21. package/dist/prometheus-framework/src/components/Breadcrumbs/Breadcrumbs.vue2.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/Breadcrumbs/Breadcrumbs.vue2.js +31 -31
  23. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -224
  25. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  26. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +224 -2
  27. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +22 -22
  29. package/dist/prometheus-framework/src/components/DatePicker/DatePicker.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/components/DatePicker/DatePicker.vue.js +18 -18
  31. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +24 -24
  33. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
  35. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  36. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +76 -2
  37. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +31 -30
  39. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +1 -1
  40. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +20 -20
  42. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +33 -33
  44. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +21 -21
  46. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/Select/Select.vue.js +2 -78
  48. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +78 -2
  50. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
  52. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
  54. package/dist/prometheus-framework/src/components/Text/Text.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/Text/Text.vue.js +11 -11
  56. package/dist/prometheus-framework/src/components/Upload/Upload.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +27 -27
  58. package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.js +18 -18
  60. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +17 -17
  62. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  64. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
  70. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +44 -43
  74. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/auth/store/auth.js +65 -96
  78. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +24 -24
  80. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  84. package/dist/prometheus-framework/src/modules/constructor/components/elements/Audio.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/constructor/components/elements/Audio.vue.js +19 -19
  86. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.cjs +2 -2
  87. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.js +16 -16
  88. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.js +13 -13
  90. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +16 -16
  92. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.cjs +3 -3
  93. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.js +30 -30
  94. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.js +22 -22
  96. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -4
  97. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +2 -62
  98. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +4 -1
  99. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +62 -2
  100. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +56 -56
  102. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +44 -43
  104. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +15 -15
  106. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +13 -13
  110. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +51 -53
  114. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +59 -61
  116. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  120. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Contacts.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Contacts.vue.js +22 -22
  122. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +25 -25
  124. package/dist/prometheus-framework/src/modules/organizations/components/blocks/EditArray.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/organizations/components/blocks/EditArray.vue.js +9 -9
  126. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Socials.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/components/blocks/Socials.vue.js +23 -23
  128. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +11 -11
  130. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
  132. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +4 -4
  134. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -4
  136. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  138. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  140. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.js +19 -19
  142. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  144. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.js +30 -30
  146. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +4 -4
  148. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +24 -24
  150. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  152. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.js +21 -21
  154. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  156. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  158. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  160. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  162. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.js +1 -1
  164. package/dist/prometheus-framework.cjs.js +27 -27
  165. package/dist/prometheus-framework.es.js +1949 -1937
  166. package/dist/style.css +1 -1
  167. package/package.json +2 -4
  168. package/src/modules/auth/components/pages/ResetPassword.vue +1 -1
  169. package/src/modules/auth/components/pages/SignIn.vue +1 -0
  170. package/src/modules/auth/store/auth.js +42 -51
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");const l=require("../../../../components/Field/Field.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),d=require("vue-router"),h=require("vue-i18n"),t=require("../../store/auth.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs"),w=require("../../localization/EnterPassword.json.cjs");require("./EnterPassword.vue2.cjs");const y={class:"t-left pd-medium"},_={class:"mn-small"},g={key:0,class:"mn-semi t-transp"},k={key:1,class:"mn-semi t-transp"},q={class:"mn-semi radius-small o-hidden"},B={key:2,class:"p-medium t-semi mn-semi"},E=e.createElementVNode("a",{class:"t-second",href:"https://thecommunephuket.com/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),P={key:0},v={key:1},b={__name:"EnterPassword",setup(V){const n=e.ref(null),{t:s}=h.useI18n(w.default),r=d.useRoute(),u=d.useRouter();e.ref("phone");async function c(){try{await i.validateInputs(n,i.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}r.query.method==="reset-password"&&await t.actions.updatePassword(t.state.user,r.query.type),r.query.method!=="reset-password"&&await t.actions.signup(t.state.user,r.query.type)}function p(){u.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(m,o)=>(e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",_,e.toDisplayString(e.unref(s)("almostDone")),1),e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(e.unref(s)("newPasswordPrompt")),1)):(e.openBlock(),e.createElementBlock("p",k,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",q,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":o[0]||(o[0]=a=>t.state.user.password=a),type:"password",validation:n.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","validation","placeholder"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":o[1]||(o[1]=a=>t.state.user.passwordRepeat=a),type:"password",placeholder:e.unref(s)("repeatPasswordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",B,[e.createTextVNode(" By registering, you agree to our "),E])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:c,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",v,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),h=require("vue-i18n"),t=require("../../store/auth.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs"),w=require("../../localization/EnterPassword.json.cjs");require("./EnterPassword.vue2.cjs");const y={class:"t-left pd-medium"},_={class:"mn-small"},g={key:0,class:"mn-semi t-transp"},k={key:1,class:"mn-semi t-transp"},q={class:"mn-semi radius-small o-hidden"},B={key:2,class:"p-medium t-semi mn-semi"},E=e.createElementVNode("a",{class:"t-second",href:"https://thecommunephuket.com/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),P={key:0},v={key:1},b={__name:"EnterPassword",setup(V){const n=e.ref(null),{t:s}=h.useI18n(w.default),r=d.useRoute(),u=d.useRouter();e.ref("phone");async function c(){try{await i.validateInputs(n,i.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}r.query.method==="reset-password"&&await t.actions.updatePassword(t.state.user,r.query.type),r.query.method!=="reset-password"&&await t.actions.signup(t.state.user,r.query.type)}function p(){u.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(m,o)=>(e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",_,e.toDisplayString(e.unref(s)("almostDone")),1),e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(e.unref(s)("newPasswordPrompt")),1)):(e.openBlock(),e.createElementBlock("p",k,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",q,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":o[0]||(o[0]=a=>t.state.user.password=a),type:"password",validation:n.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","validation","placeholder"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":o[1]||(o[1]=a=>t.state.user.passwordRepeat=a),type:"password",placeholder:e.unref(s)("repeatPasswordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",B,[e.createTextVNode(" By registering, you agree to our "),E])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:c,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",v,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};exports.default=b;
@@ -1,7 +1,7 @@
1
1
  import { ref as u, openBlock as o, createElementBlock as a, createElementVNode as m, toDisplayString as d, unref as e, createVNode as l, createTextVNode as g, createCommentVNode as P, withCtx as k } from "vue";
2
- import "../../../../components/Tab/Tab.vue2.js";
3
- import c from "../../../../components/Field/Field.vue.js";
4
- import q from "../../../../components/Button/Button.vue.js";
2
+ import "../../../../components/Tab/Tab.vue.js";
3
+ import c from "../../../../components/Field/Field.vue2.js";
4
+ import q from "../../../../components/Button/Button.vue2.js";
5
5
  import { useRoute as b, useRouter as v } from "vue-router";
6
6
  import { useI18n as E } from "vue-i18n";
7
7
  import { state as s, actions as h } from "../../store/auth.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");const l=require("../../../../components/Field/Field.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),d=require("vue-router"),t=require("../../store/auth.cjs"),u=require("../../store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");require("./Invite.vue2.cjs");const h={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),y=e.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),b={class:"mn-semi radius-small o-hidden"},q={key:0},k={key:1},B={__name:"Invite",async setup(E){let r,n;const i=e.ref(null),s=d.useRoute(),p=d.useRouter();[r,n]=e.withAsyncContext(()=>u.actions.readOne(s.query.inviteCode)),await r,n();async function m(){try{await c.validateInputs(i,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}await t.actions.signup(t.state.user,s.query.type,s.query.inviteCode)}function _(){p.push({name:"Dashboard"})}return(w,a)=>(e.openBlock(),e.createElementBlock("section",h,[v,y,e.createElementVNode("div",b,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":a[0]||(a[0]=o=>t.state.user.password=o),type:"password",validation:i.value,label:"Пароль",placeholder:"******",class:"bg-white radius-small mn-small"},null,8,["field","validation"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":a[1]||(a[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Повторите пароль",placeholder:"******",class:"bg-white radius-small mn-semi"},null,8,["field"])]),e.createVNode(f.default,{disabled:u.state.invite===null,submit:m,callback:_,class:"mn-big"},{default:e.withCtx(()=>[e.unref(s).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",q,"Поменять пароль")):(e.openBlock(),e.createElementBlock("span",k,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}};exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),t=require("../../store/auth.cjs"),u=require("../../store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");require("./Invite.vue2.cjs");const h={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),y=e.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),b={class:"mn-semi radius-small o-hidden"},q={key:0},k={key:1},B={__name:"Invite",async setup(E){let r,n;const i=e.ref(null),s=d.useRoute(),p=d.useRouter();[r,n]=e.withAsyncContext(()=>u.actions.readOne(s.query.inviteCode)),await r,n();async function m(){try{await c.validateInputs(i,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}await t.actions.signup(t.state.user,s.query.type,s.query.inviteCode)}function _(){p.push({name:"Dashboard"})}return(w,a)=>(e.openBlock(),e.createElementBlock("section",h,[v,y,e.createElementVNode("div",b,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":a[0]||(a[0]=o=>t.state.user.password=o),type:"password",validation:i.value,label:"Пароль",placeholder:"******",class:"bg-white radius-small mn-small"},null,8,["field","validation"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":a[1]||(a[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Повторите пароль",placeholder:"******",class:"bg-white radius-small mn-semi"},null,8,["field"])]),e.createVNode(f.default,{disabled:u.state.invite===null,submit:m,callback:_,class:"mn-big"},{default:e.withCtx(()=>[e.unref(s).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",q,"Поменять пароль")):(e.openBlock(),e.createElementBlock("span",k,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}};exports.default=B;
@@ -1,7 +1,7 @@
1
1
  import { ref as w, withAsyncContext as h, openBlock as o, createElementBlock as r, createElementVNode as n, createVNode as i, withCtx as y, unref as b } from "vue";
2
- import "../../../../components/Tab/Tab.vue2.js";
3
- import p from "../../../../components/Field/Field.vue.js";
4
- import v from "../../../../components/Button/Button.vue.js";
2
+ import "../../../../components/Tab/Tab.vue.js";
3
+ import p from "../../../../components/Field/Field.vue2.js";
4
+ import v from "../../../../components/Button/Button.vue2.js";
5
5
  import { useRoute as k, useRouter as g } from "vue-router";
6
6
  import { state as e, actions as q } from "../../store/auth.js";
7
7
  import { actions as x, state as C } from "../../store/invites.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Tab/Tab.vue.cjs"),f=require("../../../../components/Field/Field.vue.cjs"),v=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),_=require("../../../../components/Button/Button.vue.cjs"),u=require("vue-router"),w=require("vue-i18n"),V=require("../../localization/ResetPassword.json.cjs"),s=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");require("./ResetPassword.vue2.cjs");const g={class:"t-left pd-medium"},y={class:"mn-small"},N={class:"mn-small t-transp"},b={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},E={key:0,class:"mn-semi radius-small o-hidden"},k={class:"mn-small t-transp"},C={key:0,class:"mn-semi radius-small o-hidden"},P={class:"mn-small t-transp"},S={__name:"ResetPassword",setup(I){const{t}=w.useI18n(V.default),i=e.ref(null),d=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await n.validateInputs(i,n.validatePhone,s.state.user.phone,"Некорректный телефон"),a.value==="email"&&await n.validateInputs(d,n.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}try{await s.actions.resetPassword(s.state.user,a.value,"reset-password")}catch(r){throw console.log(r),new Error}}function p(){c.push({name:"Enter Code",query:{type:a.value,method:"reset-password"}})}return(r,o)=>(e.openBlock(),e.createElementBlock("section",g,[e.createElementVNode("h3",y,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",N,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",b,[e.createVNode(h.default,{selected:a.value,"onUpdate:selected":o[0]||(o[0]=l=>a.value=l),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(v.default,{modelValue:s.state.user.phone,"onUpdate:modelValue":o[1]||(o[1]=l=>s.state.user.phone=l),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("p",P,e.toDisplayString(e.unref(t)("emailInfo")),1),e.createVNode(f.default,{field:s.state.user.email,"onUpdate:field":o[2]||(o[2]=l=>s.state.user.email=l),placeholder:e.unref(t)("emailPlaceholder"),validation:d.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(_.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),v=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),u=require("vue-router"),w=require("vue-i18n"),V=require("../../localization/ResetPassword.json.cjs"),s=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");require("./ResetPassword.vue2.cjs");const g={class:"t-left pd-medium"},y={class:"mn-small"},N={class:"mn-small t-transp"},b={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},E={key:0,class:"mn-semi radius-small o-hidden"},k={class:"mn-small t-transp"},C={key:0,class:"mn-semi radius-small o-hidden"},P={class:"mn-small t-transp"},S={__name:"ResetPassword",setup(I){const{t}=w.useI18n(V.default),i=e.ref(null),d=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await n.validateInputs(i,n.validatePhone,s.state.user.phone,"Некорректный телефон"),a.value==="email"&&await n.validateInputs(d,n.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}try{await s.actions.resetPassword(s.state.user,a.value,"reset-password")}catch(r){throw console.log(r),new Error}}function p(){c.push({name:"Enter Code",query:{type:a.value,method:"reset-password"}})}return(r,o)=>(e.openBlock(),e.createElementBlock("section",g,[e.createElementVNode("h3",y,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",N,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",b,[e.createVNode(h.default,{selected:a.value,"onUpdate:selected":o[0]||(o[0]=l=>a.value=l),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(v.default,{modelValue:s.state.user.phone,"onUpdate:modelValue":o[1]||(o[1]=l=>s.state.user.phone=l),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("p",P,e.toDisplayString(e.unref(t)("emailInfo")),1),e.createVNode(f.default,{field:s.state.user.email,"onUpdate:field":o[2]||(o[2]=l=>s.state.user.email=l),placeholder:e.unref(t)("emailPlaceholder"),validation:d.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(_.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};exports.default=S;
@@ -1,8 +1,8 @@
1
1
  import { ref as m, openBlock as u, createElementBlock as p, createElementVNode as l, toDisplayString as r, unref as t, createVNode as i, Transition as _, withCtx as c, createCommentVNode as v, createTextVNode as V } from "vue";
2
- import P from "../../../../components/Tab/Tab.vue.js";
3
- import C from "../../../../components/Field/Field.vue.js";
2
+ import P from "../../../../components/Tab/Tab.vue2.js";
3
+ import C from "../../../../components/Field/Field.vue2.js";
4
4
  import E from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import I from "../../../../components/Button/Button.vue.js";
5
+ import I from "../../../../components/Button/Button.vue2.js";
6
6
  import { useRoute as k, useRouter as x } from "vue-router";
7
7
  import { useI18n as N } from "vue-i18n";
8
8
  import T from "../../localization/ResetPassword.json.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Tab/Tab.vue.cjs"),c=require("../../../../components/Field/Field.vue.cjs"),V=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),w=require("../../../../components/Button/Button.vue.cjs"),p=require("vue-router"),N=require("vue-i18n"),b=require("../../localization/SignIn.json.cjs"),a=require("../../store/auth.cjs"),r=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const y={class:""},S=["src"],E={class:"mn-medium"},q=e.createElementVNode("br",null,null,-1),x={class:"t-semi"},C={class:"mn-big"},D={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},P={class:"pos-relative"},T={class:"mn-thin radius-small"},I={class:"mn-thin radius-small o-hidden"},U={class:"w-100 mn-big"},k={__name:"SignIn",setup(j){const d=e.ref(null),m=e.ref(null),u=e.ref(null);p.useRoute();const h=p.useRouter(),{t:l}=N.useI18n(b.default),n=e.ref("phone"),f=o=>new Promise((s,i)=>{const t=document.createElement("script");t.type="text/javascript",t.src=o,t.onload=s,t.onerror=i,document.head.appendChild(t)});e.onMounted(async()=>{await f("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function v(){try{n.value==="phone"&&await r.validateInputs(d,r.validatePhone,a.state.user.phone,"Некорректный телефон"),n.value==="email"&&await r.validateInputs(u,r.validateEmail,a.state.user.email,"Некорректный email")}catch{throw new Error}const o={...a.state.user};o.phone=a.state.user.phone.number,await a.actions.login(o,n.value)}function _(){h.push({name:"User Profile",params:{_id:a.state.user._id},query:{afterAuth:"true"}})}return(o,s)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("img",{src:"/logo/logo_square.svg",class:"i-extra radius-small mn-small"},null,8,S),e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(l)("title"))+" ",1),q,e.createElementVNode("span",x,e.toDisplayString(e.unref(l)("subtitle")),1)]),e.createElementVNode("p",C,[e.createVNode(i,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signup")),1)]),_:1})]),e.createElementVNode("div",D,[e.createVNode(g.default,{selected:n.value,"onUpdate:selected":s[0]||(s[0]=t=>n.value=t),tabs:[{name:e.unref(l)("phone"),value:"phone"},{name:e.unref(l)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",P,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createVNode(V.default,{modelValue:a.state.user.phone,"onUpdate:modelValue":s[1]||(s[1]=t=>a.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(l)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,n.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(c.default,{field:a.state.user.email,"onUpdate:field":s[2]||(s[2]=t=>a.state.user.email=t),placeholder:e.unref(l)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,n.value==="email"]])]),_:1})]),e.createVNode(c.default,{field:a.state.user.password,"onUpdate:field":s[3]||(s[3]=t=>a.state.user.password=t),type:"password",validation:m.value,placeholder:e.unref(l)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",U,[e.createVNode(i,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("forgotPassword")),1)]),_:1})]),e.createVNode(w.default,{submit:v,callback:_,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signin")),1)]),_:1})])}}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Tab/Tab.vue2.cjs"),c=require("../../../../components/Field/Field.vue2.cjs"),V=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),w=require("../../../../components/Button/Button.vue2.cjs"),p=require("vue-router"),N=require("vue-i18n"),b=require("../../localization/SignIn.json.cjs"),a=require("../../store/auth.cjs"),r=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const y={class:""},S=["src"],E={class:"mn-medium"},q=e.createElementVNode("br",null,null,-1),x={class:"t-semi"},C={class:"mn-big"},D={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},T={class:"pos-relative"},P={class:"mn-thin radius-small"},I={class:"mn-thin radius-small o-hidden"},k={class:"w-100 mn-big"},U={__name:"SignIn",setup(j){const d=e.ref(null),m=e.ref(null),u=e.ref(null);p.useRoute();const h=p.useRouter(),{t:o}=N.useI18n(b.default),l=e.ref("phone"),f=n=>new Promise((s,i)=>{const t=document.createElement("script");t.type="text/javascript",t.src=n,t.onload=s,t.onerror=i,document.head.appendChild(t)});e.onMounted(async()=>{await f("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function v(){try{l.value==="phone"&&await r.validateInputs(d,r.validatePhone,a.state.user.phone,"Некорректный телефон"),l.value==="email"&&await r.validateInputs(u,r.validateEmail,a.state.user.email,"Некорректный email")}catch{throw new Error}const n={...a.state.user};n.phone=a.state.user.phone.number,await a.actions.login(n,l.value)}function _(){h.push({name:"User Profile",params:{_id:a.state.user._id},query:{afterAuth:"true"}})}return(n,s)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createTextVNode(e.toDisplayString(n.document.cookie)+" ",1),e.createElementVNode("img",{src:"/logo/logo_square.svg",class:"i-extra radius-small mn-small"},null,8,S),e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(o)("title"))+" ",1),q,e.createElementVNode("span",x,e.toDisplayString(e.unref(o)("subtitle")),1)]),e.createElementVNode("p",C,[e.createVNode(i,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("signup")),1)]),_:1})]),e.createElementVNode("div",D,[e.createVNode(g.default,{selected:l.value,"onUpdate:selected":s[0]||(s[0]=t=>l.value=t),tabs:[{name:e.unref(o)("phone"),value:"phone"},{name:e.unref(o)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",T,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",P,[e.createVNode(V.default,{modelValue:a.state.user.phone,"onUpdate:modelValue":s[1]||(s[1]=t=>a.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(o)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,l.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(c.default,{field:a.state.user.email,"onUpdate:field":s[2]||(s[2]=t=>a.state.user.email=t),placeholder:e.unref(o)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,l.value==="email"]])]),_:1})]),e.createVNode(c.default,{field:a.state.user.password,"onUpdate:field":s[3]||(s[3]=t=>a.state.user.password=t),type:"password",validation:m.value,placeholder:e.unref(o)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",k,[e.createVNode(i,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("forgotPassword")),1)]),_:1})]),e.createVNode(w.default,{submit:v,callback:_,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("signin")),1)]),_:1})])}}};exports.default=U;
@@ -1,73 +1,74 @@
1
- import { ref as p, onMounted as U, resolveComponent as k, openBlock as C, createElementBlock as E, createElementVNode as l, createTextVNode as c, toDisplayString as d, unref as o, createVNode as i, withCtx as u, Transition as f, withDirectives as v, vShow as g } from "vue";
2
- import I from "../../../../components/Tab/Tab.vue.js";
3
- import w from "../../../../components/Field/Field.vue.js";
1
+ import { ref as c, onMounted as x, resolveComponent as U, openBlock as C, createElementBlock as E, createTextVNode as u, toDisplayString as d, createElementVNode as l, unref as a, createVNode as i, withCtx as m, Transition as f, withDirectives as v, vShow as g } from "vue";
2
+ import I from "../../../../components/Tab/Tab.vue2.js";
3
+ import w from "../../../../components/Field/Field.vue2.js";
4
4
  import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import j from "../../../../components/Button/Button.vue.js";
5
+ import j from "../../../../components/Button/Button.vue2.js";
6
6
  import { useRoute as F, useRouter as N } from "vue-router";
7
7
  import { useI18n as O } from "vue-i18n";
8
8
  import T from "../../localization/SignIn.json.js";
9
- import { state as s, actions as q } from "../../store/auth.js";
9
+ import { state as o, actions as q } from "../../store/auth.js";
10
10
  import { validateInputs as b, validatePhone as A, validateEmail as B } from "../../../middlewares/client/inputs.validation.js";
11
11
  import "./SignIn.vue2.js";
12
12
  const R = { class: "" }, $ = ["src"], L = { class: "mn-medium" }, M = /* @__PURE__ */ l("br", null, null, -1), z = { class: "t-semi" }, G = { class: "mn-big" }, H = { class: "mn-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, J = { class: "pos-relative" }, K = { class: "mn-thin radius-small" }, Q = { class: "mn-thin radius-small o-hidden" }, W = { class: "w-100 mn-big" }, de = {
13
13
  __name: "SignIn",
14
14
  setup(X) {
15
- const h = p(null), y = p(null), _ = p(null);
15
+ const h = c(null), y = c(null), _ = c(null);
16
16
  F();
17
- const V = N(), { t: a } = O(T), n = p("phone"), x = (r) => new Promise((t, m) => {
17
+ const V = N(), { t: s } = O(T), n = c("phone"), P = (r) => new Promise((t, p) => {
18
18
  const e = document.createElement("script");
19
- e.type = "text/javascript", e.src = r, e.onload = t, e.onerror = m, document.head.appendChild(e);
19
+ e.type = "text/javascript", e.src = r, e.onload = t, e.onerror = p, document.head.appendChild(e);
20
20
  });
21
- U(async () => {
22
- await x("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
21
+ x(async () => {
22
+ await P("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
23
23
  });
24
- async function P() {
24
+ async function S() {
25
25
  try {
26
26
  n.value === "phone" && await b(
27
27
  h,
28
28
  A,
29
- s.user.phone,
29
+ o.user.phone,
30
30
  "Некорректный телефон"
31
31
  ), n.value === "email" && await b(
32
32
  _,
33
33
  B,
34
- s.user.email,
34
+ o.user.email,
35
35
  "Некорректный email"
36
36
  );
37
37
  } catch {
38
38
  throw new Error();
39
39
  }
40
- const r = { ...s.user };
41
- r.phone = s.user.phone.number, await q.login(r, n.value);
40
+ const r = { ...o.user };
41
+ r.phone = o.user.phone.number, await q.login(r, n.value);
42
42
  }
43
- function S() {
43
+ function k() {
44
44
  V.push({
45
45
  name: "User Profile",
46
46
  params: {
47
- _id: s.user._id
47
+ _id: o.user._id
48
48
  },
49
49
  query: { afterAuth: "true" }
50
50
  });
51
51
  }
52
52
  return (r, t) => {
53
- const m = k("router-link");
53
+ const p = U("router-link");
54
54
  return C(), E("section", R, [
55
+ u(d(r.document.cookie) + " ", 1),
55
56
  l("img", {
56
57
  src: "/logo/logo_square.svg",
57
58
  class: "i-extra radius-small mn-small"
58
59
  }, null, 8, $),
59
60
  l("h3", L, [
60
- c(d(o(a)("title")) + " ", 1),
61
+ u(d(a(s)("title")) + " ", 1),
61
62
  M,
62
- l("span", z, d(o(a)("subtitle")), 1)
63
+ l("span", z, d(a(s)("subtitle")), 1)
63
64
  ]),
64
65
  l("p", G, [
65
- i(m, {
66
+ i(p, {
66
67
  to: { name: "Sign Up" },
67
68
  class: "underline t-second"
68
69
  }, {
69
- default: u(() => [
70
- c(d(o(a)("signup")), 1)
70
+ default: m(() => [
71
+ u(d(a(s)("signup")), 1)
71
72
  ]),
72
73
  _: 1
73
74
  })
@@ -77,18 +78,18 @@ const R = { class: "" }, $ = ["src"], L = { class: "mn-medium" }, M = /* @__PURE
77
78
  selected: n.value,
78
79
  "onUpdate:selected": t[0] || (t[0] = (e) => n.value = e),
79
80
  tabs: [
80
- { name: o(a)("phone"), value: "phone" },
81
- { name: o(a)("email"), value: "email" }
81
+ { name: a(s)("phone"), value: "phone" },
82
+ { name: a(s)("email"), value: "email" }
82
83
  ]
83
84
  }, null, 8, ["selected", "tabs"])
84
85
  ]),
85
86
  l("div", J, [
86
87
  i(f, { name: "slide-fade" }, {
87
- default: u(() => [
88
+ default: m(() => [
88
89
  v(l("div", K, [
89
90
  i(D, {
90
- modelValue: s.user.phone,
91
- "onUpdate:modelValue": t[1] || (t[1] = (e) => s.user.phone = e),
91
+ modelValue: o.user.phone,
92
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => o.user.phone = e),
92
93
  dropdownOptions: {
93
94
  showDialCodeInSelection: !0,
94
95
  showFlags: !0,
@@ -96,7 +97,7 @@ const R = { class: "" }, $ = ["src"], L = { class: "mn-medium" }, M = /* @__PURE
96
97
  },
97
98
  validation: h.value,
98
99
  mode: "national",
99
- inputOptions: { placeholder: o(a)("phonePlaceholder") },
100
+ inputOptions: { placeholder: a(s)("phonePlaceholder") },
100
101
  class: "bg-grey pd-small radius-small mn-thin"
101
102
  }, null, 8, ["modelValue", "validation", "inputOptions"])
102
103
  ], 512), [
@@ -106,12 +107,12 @@ const R = { class: "" }, $ = ["src"], L = { class: "mn-medium" }, M = /* @__PURE
106
107
  _: 1
107
108
  }),
108
109
  i(f, { name: "slide-fade" }, {
109
- default: u(() => [
110
+ default: m(() => [
110
111
  v(l("div", Q, [
111
112
  i(w, {
112
- field: s.user.email,
113
- "onUpdate:field": t[2] || (t[2] = (e) => s.user.email = e),
114
- placeholder: o(a)("emailPlaceholder"),
113
+ field: o.user.email,
114
+ "onUpdate:field": t[2] || (t[2] = (e) => o.user.email = e),
115
+ placeholder: a(s)("emailPlaceholder"),
115
116
  validation: _.value,
116
117
  class: "bg-grey pd-medium radius-small"
117
118
  }, null, 8, ["field", "placeholder", "validation"])
@@ -123,31 +124,31 @@ const R = { class: "" }, $ = ["src"], L = { class: "mn-medium" }, M = /* @__PURE
123
124
  })
124
125
  ]),
125
126
  i(w, {
126
- field: s.user.password,
127
- "onUpdate:field": t[3] || (t[3] = (e) => s.user.password = e),
127
+ field: o.user.password,
128
+ "onUpdate:field": t[3] || (t[3] = (e) => o.user.password = e),
128
129
  type: "password",
129
130
  validation: y.value,
130
- placeholder: o(a)("passwordPlaceholder"),
131
+ placeholder: a(s)("passwordPlaceholder"),
131
132
  class: "bg-grey pd-medium radius-small mn-semi"
132
133
  }, null, 8, ["field", "validation", "placeholder"]),
133
134
  l("div", W, [
134
- i(m, {
135
+ i(p, {
135
136
  to: "/auth/reset-password",
136
137
  class: "underline d-block t-blue"
137
138
  }, {
138
- default: u(() => [
139
- c(d(o(a)("forgotPassword")), 1)
139
+ default: m(() => [
140
+ u(d(a(s)("forgotPassword")), 1)
140
141
  ]),
141
142
  _: 1
142
143
  })
143
144
  ]),
144
145
  i(j, {
145
- submit: P,
146
- callback: S,
146
+ submit: S,
147
+ callback: k,
147
148
  class: "mn-thin"
148
149
  }, {
149
- default: u(() => [
150
- c(d(o(a)("signin")), 1)
150
+ default: m(() => [
151
+ u(d(a(s)("signin")), 1)
151
152
  ]),
152
153
  _: 1
153
154
  })
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue.cjs"),f=require("../../../../components/Field/Field.vue.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue.cjs"),u=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),n=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const b={class:"t-left pd-medium"},E={class:"mn-small"},S={class:"mn-small t-transp"},y={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-semi radius-small"},D={class:"mn-small t-transp"},x={class:"mn-semi radius-small o-hidden"},T={class:"mn-small t-transp"},k={class:"w-100"},I={__name:"SignUp",setup(P){const{t}=g.useI18n(w.default),i=e.ref(null),r=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,n.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,n.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(n.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(d,l)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",b,[e.createElementVNode("h3",E,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("p",S,e.toDisplayString(e.unref(t)("description")),1),e.createElementVNode("div",y,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":l[0]||(l[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",C,[e.createElementVNode("p",D,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{modelValue:n.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=o=>n.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",x,[e.createElementVNode("p",T,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:n.state.user.email,"onUpdate:field":l[2]||(l[2]=o=>n.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(V.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",k,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue2.cjs"),u=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),n=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const b={class:"t-left pd-medium"},E={class:"mn-small"},S={class:"mn-small t-transp"},y={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-semi radius-small"},D={class:"mn-small t-transp"},x={class:"mn-semi radius-small o-hidden"},T={class:"mn-small t-transp"},k={class:"w-100"},I={__name:"SignUp",setup(P){const{t}=g.useI18n(w.default),i=e.ref(null),r=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,n.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,n.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(n.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(d,l)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",b,[e.createElementVNode("h3",E,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("p",S,e.toDisplayString(e.unref(t)("description")),1),e.createElementVNode("div",y,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":l[0]||(l[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",C,[e.createElementVNode("p",D,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{modelValue:n.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=o=>n.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",x,[e.createElementVNode("p",T,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:n.state.user.email,"onUpdate:field":l[2]||(l[2]=o=>n.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(V.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",k,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=I;
@@ -1,8 +1,8 @@
1
1
  import { ref as d, resolveComponent as C, openBlock as k, createElementBlock as E, createElementVNode as o, toDisplayString as n, unref as t, createVNode as a, Transition as h, withCtx as m, withDirectives as _, vShow as f, createTextVNode as v } from "vue";
2
- import x from "../../../../components/Tab/Tab.vue.js";
3
- import N from "../../../../components/Field/Field.vue.js";
2
+ import x from "../../../../components/Tab/Tab.vue2.js";
3
+ import N from "../../../../components/Field/Field.vue2.js";
4
4
  import S from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import D from "../../../../components/Button/Button.vue.js";
5
+ import D from "../../../../components/Button/Button.vue2.js";
6
6
  import { useRoute as I, useRouter as P } from "vue-router";
7
7
  import { useI18n as U } from "vue-i18n";
8
8
  import F from "../../localization/SignUp.json.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../node_modules/axios/lib/axios.cjs"),d=require("../../../../../node_modules/js-cookie/src/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/core/dist/index.cjs"),w=require("vue"),c=require("../../globals/store/globals.cjs"),k=require("./twofa.cjs"),i=f.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function O(){const s=await m("user");if(s){const{_id:t,email:e,phone:n,roles:o,accessToken:r}=s;Object.assign(a.user,{_id:t,email:e,phone:n}),Object.assign(a.access,{token:r,roles:o,status:!!r}),i.interceptors.request.use(u=>(r&&(u.headers["x-access-token"]=r),u),u=>Promise.reject(u))}}O();const g={async login(s,t){try{const e=await i.post("/api/auth/signin",{...s,type:t});return p("user",e.data),Object.assign(a.user,{...e.data}),Object.assign(a.access,{token:e.data.accessToken,status:!0,roles:e.data.roles}),e.data}catch(e){return Object.assign(a.access,{token:null,status:!1,roles:null}),c.setError(e),Promise.reject(e)}},async signup(s,t,e){const{password:n,passwordRepeat:o}=a.user;if(n!==o){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(r),new Error(r.response.status)}try{s.phone=s.phone.number;const r=await i.post("/api/auth/signup",{...s,type:t,inviteCode:e});return r.data.accessToken&&p("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw c.setError(r),console.log("Sign up falied"),r}},logout(){b("user"),Object.assign(a.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(a.access,{token:null,status:!1})},async resetPassword(s,t){try{const e=await i.post("/api/auth/reset-password",{email:s.email,phone:s.phone.number,type:t});return Object.assign(k.state.code,{...e.data,isSended:!0}),e.data}catch(e){return c.setError(e),Promise.reject(e)}},async updatePassword(s,t){const{password:e,passwordRepeat:n}=a.user;if(e!==n){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(o),new Error(o.response.status)}try{const o=await i.post("/api/auth/update-password",{email:s.email,phone:s.phone.number,password:s.password,passwordRepeat:s.passwordRepeat,type:t});return o.data.accessToken&&p("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return c.setError(o),Promise.reject(o)}}},h={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function m(s){if(process.env.MOBILE_APP)Object.fromEntries(document.cookie.split("/; *").map(t=>{const[e,...n]=t.split("=");return[{key:e,value:n.join("=")}]}));else{const t=d.default.get(s);return t?JSON.parse(t):null}}function p(s,t,e=process.env.NODE_ENV){process.env.MOBILE_APP?l.CapacitorCookies.setCookie({url:process.env.API_URL,key:s,value:JSON.stringify(t)}):d.default.set(s,JSON.stringify(t),h[e])}function b(s,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.CapacitorCookies.deleteCookie({url:process.env.API_URL,key:s});else{const e=t==="production"?{domain:process.env.API_URL}:{};d.default.remove(s,e)}}w.watch(a,(s,t)=>{});exports.actions=g;exports.state=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../node_modules/axios/lib/axios.cjs"),p=require("../../../../../node_modules/js-cookie/src/js.cookie.cjs");require("../../../../node_modules/@capacitor/core/dist/index.cjs");const l=require("vue"),n=require("../../globals/store/globals.cjs"),g=require("./twofa.cjs"),i=w.default.create({baseURL:process.env.API_URL,withCredentials:!0}),o=l.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}}),d=f("user");if(d){const{_id:s,email:r,phone:e,roles:c,accessToken:t}=d;Object.assign(o.user,{_id:s,email:r,phone:e}),Object.assign(o.access,{token:t,roles:c,status:!!t}),i.interceptors.request.use(a=>(t&&(a.headers["x-access-token"]=t),a),a=>Promise.reject(a))}const h={async login(s,r){try{const e=await i.post("/api/auth/signin",{...s,type:r});return u("user",e.data),Object.assign(o.user,{...e.data}),Object.assign(o.access,{token:e.data.accessToken,status:!0,roles:e.data.roles}),e.data}catch(e){return Object.assign(o.access,{token:null,status:!1,roles:null}),n.setError(e),Promise.reject(e)}},async signup(s,r,e){const{password:c,passwordRepeat:t}=o.user;if(c!==t){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(a),new Error(a.response.status)}try{s.phone=s.phone.number;const a=await i.post("/api/auth/signup",{...s,type:r,inviteCode:e});return a.data.accessToken&&u("user",a.data),Object.assign(o.user,{...a.data}),Object.assign(o.access,{token:a.data.accessToken,status:!0,roles:a.data.roles}),a.data}catch(a){throw n.setError(a),console.log("Sign up falied"),a}},logout(){m("user"),Object.assign(o.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(o.access,{token:null,status:!1})},async resetPassword(s,r){try{const e=await i.post("/api/auth/reset-password",{email:s.email,phone:s.phone.number,type:r});return Object.assign(g.state.code,{...e.data,isSended:!0}),e.data}catch(e){return n.setError(e),Promise.reject(e)}},async updatePassword(s,r){const{password:e,passwordRepeat:c}=o.user;if(e!==c){const t={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(t),new Error(t.response.status)}try{const t=await i.post("/api/auth/update-password",{email:s.email,phone:s.phone.number,password:s.password,passwordRepeat:s.passwordRepeat,type:r});return t.data.accessToken&&u("user",t.data),Object.assign(o.user,{...t.data}),Object.assign(o.access,{token:t.data.accessToken,status:!0}),t.data}catch(t){return n.setError(t),Promise.reject(t)}}},O={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function f(s){const r=p.default.get(s);return r?JSON.parse(r):null}function u(s,r,e=process.env.NODE_ENV){p.default.set(s,JSON.stringify(r),O[e])}function m(s,r=process.env.NODE_ENV){const e=r==="production"?{domain:process.env.API_URL}:{};p.default.remove(s,e)}l.watch(o,(s,r)=>{});exports.actions=h;exports.state=o;
@@ -1,10 +1,10 @@
1
- import m from "../../../../node_modules/axios/lib/axios.js";
2
- import d from "../../../../../node_modules/js-cookie/src/js.cookie.js";
3
- import { CapacitorCookies as l } from "../../../../node_modules/@capacitor/core/dist/index.js";
4
- import { reactive as w, watch as f } from "vue";
5
- import { setError as c } from "../../globals/store/globals.js";
6
- import { state as k } from "./twofa.js";
7
- const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w({
1
+ import l from "../../../../node_modules/axios/lib/axios.js";
2
+ import u from "../../../../../node_modules/js-cookie/src/js.cookie.js";
3
+ import "../../../../node_modules/@capacitor/core/dist/index.js";
4
+ import { reactive as m, watch as w } from "vue";
5
+ import { setError as n } from "../../globals/store/globals.js";
6
+ import { state as h } from "./twofa.js";
7
+ const i = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), o = m({
8
8
  user: {
9
9
  _id: void 0,
10
10
  username: "",
@@ -18,164 +18,133 @@ const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w
18
18
  token: null,
19
19
  status: !1
20
20
  }
21
- });
22
- async function O() {
23
- const s = await g("user");
24
- if (s) {
25
- const { _id: t, email: e, phone: n, roles: r, accessToken: o } = s;
26
- Object.assign(a.user, { _id: t, email: e, phone: n }), Object.assign(a.access, { token: o, roles: r, status: !!o }), i.interceptors.request.use((p) => (o && (p.headers["x-access-token"] = o), p), (p) => Promise.reject(p));
27
- }
21
+ }), d = f("user");
22
+ if (d) {
23
+ const { _id: s, email: a, phone: e, roles: c, accessToken: t } = d;
24
+ Object.assign(o.user, { _id: s, email: a, phone: e }), Object.assign(o.access, { token: t, roles: c, status: !!t }), i.interceptors.request.use((r) => (t && (r.headers["x-access-token"] = t), r), (r) => Promise.reject(r));
28
25
  }
29
- O();
30
- const R = {
31
- async login(s, t) {
26
+ const C = {
27
+ async login(s, a) {
32
28
  try {
33
29
  const e = await i.post("/api/auth/signin", {
34
30
  ...s,
35
- type: t
31
+ type: a
36
32
  });
37
- return u("user", e.data), Object.assign(a.user, {
33
+ return p("user", e.data), Object.assign(o.user, {
38
34
  ...e.data
39
- }), Object.assign(a.access, {
35
+ }), Object.assign(o.access, {
40
36
  token: e.data.accessToken,
41
37
  status: !0,
42
38
  roles: e.data.roles
43
39
  }), e.data;
44
40
  } catch (e) {
45
- return Object.assign(a.access, {
41
+ return Object.assign(o.access, {
46
42
  token: null,
47
43
  status: !1,
48
44
  roles: null
49
- }), c(e), Promise.reject(e);
45
+ }), n(e), Promise.reject(e);
50
46
  }
51
47
  },
52
- async signup(s, t, e) {
53
- const { password: n, passwordRepeat: r } = a.user;
54
- if (n !== r) {
55
- const o = {
48
+ async signup(s, a, e) {
49
+ const { password: c, passwordRepeat: t } = o.user;
50
+ if (c !== t) {
51
+ const r = {
56
52
  response: {
57
53
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
58
54
  }
59
55
  };
60
- throw c(o), new Error(o.response.status);
56
+ throw n(r), new Error(r.response.status);
61
57
  }
62
58
  try {
63
59
  s.phone = s.phone.number;
64
- const o = await i.post("/api/auth/signup", {
60
+ const r = await i.post("/api/auth/signup", {
65
61
  ...s,
66
- type: t,
62
+ type: a,
67
63
  inviteCode: e
68
64
  });
69
- return o.data.accessToken && u("user", o.data), Object.assign(a.user, {
70
- ...o.data
71
- }), Object.assign(a.access, {
72
- token: o.data.accessToken,
65
+ return r.data.accessToken && p("user", r.data), Object.assign(o.user, {
66
+ ...r.data
67
+ }), Object.assign(o.access, {
68
+ token: r.data.accessToken,
73
69
  status: !0,
74
- roles: o.data.roles
75
- }), o.data;
76
- } catch (o) {
77
- throw c(o), console.log("Sign up falied"), o;
70
+ roles: r.data.roles
71
+ }), r.data;
72
+ } catch (r) {
73
+ throw n(r), console.log("Sign up falied"), r;
78
74
  }
79
75
  },
80
76
  logout() {
81
- P("user"), Object.assign(a.user, {
77
+ g("user"), Object.assign(o.user, {
82
78
  email: "",
83
79
  phone: "",
84
80
  password: "",
85
81
  passwordRepeat: ""
86
- }), Object.assign(a.access, {
82
+ }), Object.assign(o.access, {
87
83
  token: null,
88
84
  status: !1
89
85
  });
90
86
  },
91
- async resetPassword(s, t) {
87
+ async resetPassword(s, a) {
92
88
  try {
93
89
  const e = await i.post("/api/auth/reset-password", {
94
90
  email: s.email,
95
91
  phone: s.phone.number,
96
- type: t
92
+ type: a
97
93
  });
98
- return Object.assign(k.code, {
94
+ return Object.assign(h.code, {
99
95
  ...e.data,
100
96
  isSended: !0
101
97
  }), e.data;
102
98
  } catch (e) {
103
- return c(e), Promise.reject(e);
99
+ return n(e), Promise.reject(e);
104
100
  }
105
101
  },
106
- async updatePassword(s, t) {
107
- const { password: e, passwordRepeat: n } = a.user;
108
- if (e !== n) {
109
- const r = {
102
+ async updatePassword(s, a) {
103
+ const { password: e, passwordRepeat: c } = o.user;
104
+ if (e !== c) {
105
+ const t = {
110
106
  response: {
111
107
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
112
108
  }
113
109
  };
114
- throw c(r), new Error(r.response.status);
110
+ throw n(t), new Error(t.response.status);
115
111
  }
116
112
  try {
117
- const r = await i.post("/api/auth/update-password", {
113
+ const t = await i.post("/api/auth/update-password", {
118
114
  email: s.email,
119
115
  phone: s.phone.number,
120
116
  password: s.password,
121
117
  passwordRepeat: s.passwordRepeat,
122
- type: t
118
+ type: a
123
119
  });
124
- return r.data.accessToken && u("user", r.data), Object.assign(a.user, {
125
- ...r.data
126
- }), Object.assign(a.access, {
127
- token: r.data.accessToken,
120
+ return t.data.accessToken && p("user", t.data), Object.assign(o.user, {
121
+ ...t.data
122
+ }), Object.assign(o.access, {
123
+ token: t.data.accessToken,
128
124
  status: !0
129
- }), r.data;
130
- } catch (r) {
131
- return c(r), Promise.reject(r);
125
+ }), t.data;
126
+ } catch (t) {
127
+ return n(t), Promise.reject(t);
132
128
  }
133
129
  }
134
- }, h = {
130
+ }, O = {
135
131
  development: { secure: !1, expires: 1 },
136
132
  production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
137
133
  };
138
- function g(s) {
139
- if (process.env.MOBILE_APP)
140
- Object.fromEntries(
141
- document.cookie.split("/; *").map((t) => {
142
- const [e, ...n] = t.split("=");
143
- return [
144
- {
145
- key: e,
146
- value: n.join("=")
147
- }
148
- ];
149
- })
150
- );
151
- else {
152
- const t = d.get(s);
153
- return t ? JSON.parse(t) : null;
154
- }
134
+ function f(s) {
135
+ const a = u.get(s);
136
+ return a ? JSON.parse(a) : null;
155
137
  }
156
- function u(s, t, e = process.env.NODE_ENV) {
157
- process.env.MOBILE_APP ? l.setCookie({
158
- url: process.env.API_URL,
159
- // используйте ваш API_URL
160
- key: s,
161
- value: JSON.stringify(t)
162
- }) : d.set(s, JSON.stringify(t), h[e]);
138
+ function p(s, a, e = process.env.NODE_ENV) {
139
+ u.set(s, JSON.stringify(a), O[e]);
163
140
  }
164
- function P(s, t = process.env.NODE_ENV) {
165
- if (process.env.MOBILE_APP)
166
- l.deleteCookie({
167
- url: process.env.API_URL,
168
- // используйте ваш API_URL
169
- key: s
170
- });
171
- else {
172
- const e = t === "production" ? { domain: process.env.API_URL } : {};
173
- d.remove(s, e);
174
- }
141
+ function g(s, a = process.env.NODE_ENV) {
142
+ const e = a === "production" ? { domain: process.env.API_URL } : {};
143
+ u.remove(s, e);
175
144
  }
176
- f(a, (s, t) => {
145
+ w(o, (s, a) => {
177
146
  });
178
147
  export {
179
- R as actions,
180
- a as state
148
+ C as actions,
149
+ o as state
181
150
  };