@ozdao/prometheus-framework 0.1.35 → 0.1.37
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BackofficeGallery-568b55bb.js +1 -0
- package/dist/BackofficeGallery-b4105137.mjs +306 -0
- package/dist/BlockTags-8cddaef7.js +1 -0
- package/dist/BlockTags-ee310572.mjs +853 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Button-7643c9aa.js +1 -0
- package/dist/Button-9e1a9284.mjs +226 -0
- package/dist/ButtonToggleMembership-15f149cb.js +1 -0
- package/dist/ButtonToggleMembership-3bb9139e.mjs +90 -0
- package/dist/CardBlogpost-38016b80.mjs +246 -0
- package/dist/CardBlogpost-cc208f93.js +1 -0
- package/dist/CardOrganization-d93c9bdb.js +1 -0
- package/dist/CardOrganization-e920be73.mjs +234 -0
- package/dist/CardProduct-92affca1.js +1 -0
- package/dist/CardProduct-fca53299.mjs +193 -0
- package/dist/Checkbox-5dbe7b23.mjs +62 -0
- package/dist/Checkbox-76f09248.js +1 -0
- package/dist/Chips-9d81b215.mjs +214 -0
- package/dist/Chips-d47704e6.js +1 -0
- package/dist/Community-87522a04.mjs +132 -0
- package/dist/Community-aef23aee.js +1 -0
- package/dist/Dashboard-91d73bc5.js +1 -0
- package/dist/Dashboard-ea9035bc.mjs +152 -0
- package/dist/Dropdown-31115457.js +1 -0
- package/dist/Dropdown-cab3605b.mjs +146 -0
- package/dist/EULA-aba6a807.js +1 -0
- package/dist/EditOrder-94bbebff.mjs +221 -0
- package/dist/EditOrder-c070d474.js +1 -0
- package/dist/EmptyState-d65bab5b.js +1 -0
- package/dist/EmptyState-e404b05d.mjs +36 -0
- package/dist/Events-cdfbca78.js +1 -0
- package/dist/Events-e9dd58f7.mjs +123 -0
- package/dist/Feed-22464fcd.js +1 -0
- package/dist/Feed-6e96d3dd.mjs +124 -0
- package/dist/Feed-793b3eef.mjs +146 -0
- package/dist/Feed-7b80704d.mjs +361 -0
- package/dist/Feed-98b47c6f.js +1 -0
- package/dist/Feed-b30ef609.js +1 -0
- package/dist/Feed-c5d4390a.js +1 -0
- package/dist/Feed-d114330c.mjs +112 -0
- package/dist/Field-e2a43424.js +1 -0
- package/dist/Field-e5ad88d3.mjs +75 -0
- package/dist/Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-0ea8fbf8.js +1 -0
- package/dist/Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-4ed993c7.mjs +1 -0
- package/dist/IconChevronRight-a55f838e.js +1 -0
- package/dist/IconChevronRight-fae9d012.mjs +28 -0
- package/dist/IconCommunity-468dc457.mjs +65 -0
- package/dist/IconCommunity-b339e806.js +1 -0
- package/dist/IconCross-5bf93179.js +1 -0
- package/dist/IconCross-84cb1292.mjs +28 -0
- package/dist/IconEdit-9edfd74d.mjs +21 -0
- package/dist/IconEdit-c0469b45.js +1 -0
- package/dist/Image-245c003d.mjs +480 -0
- package/dist/Image-35d31936.js +9 -0
- package/dist/LabelGooglePlay-24feb437.mjs +31 -0
- package/dist/LabelGooglePlay-f80e5ff0.js +1 -0
- package/dist/LeftoverAdd-08d9fb54.mjs +228 -0
- package/dist/LeftoverAdd-fc673884.js +1 -0
- package/dist/Leftovers-296c0042.js +1 -0
- package/dist/Leftovers-685d9f19.mjs +136 -0
- package/dist/Loader-21f016da.js +1 -0
- package/dist/Loader-cd422786.mjs +41 -0
- package/dist/Loader.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Loader.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Members-2cb2ff58.mjs +114 -0
- package/dist/Members-85534d1f.js +1 -0
- package/dist/Menu-b5d6a0c7.js +1 -0
- package/dist/Menu-dd7645c1.mjs +13 -0
- package/dist/MenuItem-56ae7f94.js +1 -0
- package/dist/MenuItem-6296d02f.mjs +63 -0
- package/dist/Orders-b64e8cb9.js +1 -0
- package/dist/Orders-ff30db05.mjs +75 -0
- package/dist/Organizations-0cb37d68.js +1 -0
- package/dist/Organizations-d6ef2113.mjs +73 -0
- package/dist/Payments-53e5fecf.js +1 -0
- package/dist/Payments-82e545e1.mjs +87 -0
- package/dist/PlaceholderUserpic-47f6f319.js +1 -0
- package/dist/Popup-0915427c.mjs +74 -0
- package/dist/Popup-795f5c88.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/Product-5994a8c9.mjs +653 -0
- package/dist/Product-68fa1e9e.js +7 -0
- package/dist/ProductEdit-64207814.mjs +296 -0
- package/dist/ProductEdit-a434240f.js +1 -0
- package/dist/ProductsBackoffice-0c93f9b6.js +1 -0
- package/dist/ProductsBackoffice-3d987c60.mjs +86 -0
- package/dist/ProfileBlogposts-0b81d964.js +1 -0
- package/dist/ProfileBlogposts-b59992cf.mjs +79 -0
- package/dist/ProfileEvents-3f7ca2c1.js +1 -0
- package/dist/ProfileEvents-bbdd62e7.mjs +70 -0
- package/dist/ProfileOrganizations-4734c02e.mjs +73 -0
- package/dist/ProfileOrganizations-d55ee487.js +1 -0
- package/dist/Publics-0762210a.js +1 -0
- package/dist/Publics-660e851c.mjs +45 -0
- package/dist/SelectMulti-58704d69.mjs +1038 -0
- package/dist/SelectMulti-c25765cf.js +1 -0
- package/dist/SkeletonBlogpost-95db0fa9.js +1 -0
- package/dist/SkeletonBlogpost-e0621af7.mjs +16 -0
- package/dist/SkeletonEvent-8690422d.mjs +16 -0
- package/dist/SkeletonEvent-eb284de8.js +1 -0
- package/dist/SkeletonEventShort-6c9e3940.js +1 -0
- package/dist/SkeletonEventShort-f030e56f.mjs +16 -0
- package/dist/SkeletonOrganization-5c09cfc5.js +1 -0
- package/dist/SkeletonOrganization-8690422d.mjs +16 -0
- package/dist/Socials-31c06635.mjs +74 -0
- package/dist/Socials-cceaeaf2.js +1 -0
- package/dist/Tab-054b61f7.mjs +46 -0
- package/dist/Tab-2c1e4224.js +1 -0
- package/dist/Tab.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
- package/dist/Tab.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
- package/dist/addMembersQuantity-7147aa4a.js +89 -0
- package/dist/addMembersQuantity-eac999f0.mjs +90 -0
- package/dist/auth-06d35b82.js +7 -0
- package/dist/auth-ec618cb3.mjs +627 -0
- package/dist/auth.client.cjs +7 -7
- package/dist/auth.client.js +22 -19
- package/dist/auth.server.js +7 -7
- package/dist/auth.server.mjs +7 -7
- package/dist/auth.validation-0ce9e326.js +1 -0
- package/dist/auth.validation-ba3606bf.mjs +24 -0
- package/dist/backoffice.client.cjs +1 -1
- package/dist/backoffice.client.js +235 -59
- package/dist/categories-82b28618.js +1 -0
- package/dist/categories-df3240a7.mjs +122 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +233 -227
- package/dist/community.server.js +223 -195
- package/dist/community.server.mjs +223 -195
- package/dist/components/Field/Field.vue.d.ts +58 -2
- package/dist/components/Field/Field.vue.d.ts.map +1 -1
- package/dist/components/UploadImage/UploadImage.vue.d.ts +1 -1
- package/dist/dribbble-8e8e169b.js +1 -0
- package/dist/dribbble-ae37c2ac.mjs +127 -0
- package/dist/events.client.cjs +2 -2
- package/dist/events.client.js +1793 -1888
- package/dist/events.server.js +106 -216
- package/dist/events.server.mjs +106 -216
- package/dist/globals.server.js +1 -1
- package/dist/globals.server.mjs +1 -1
- package/dist/icons.client.cjs +1 -0
- package/dist/icons.client.js +84 -0
- package/dist/inputs.validation-d7cef32b.js +1 -0
- package/dist/inputs.validation-db65277a.mjs +83 -0
- package/dist/landing.client.cjs +1 -1
- package/dist/landing.client.js +40 -64
- package/dist/leftovers-66951de6.js +1 -0
- package/dist/leftovers-be37c7a5.mjs +67 -0
- package/dist/legal.client.cjs +1 -1
- package/dist/legal.client.js +7 -4
- package/dist/mailing-76895d59.mjs +50 -0
- package/dist/mailing-9659b3c4.js +49 -0
- package/dist/main.css +1 -1
- package/dist/memberships-12210953.mjs +68 -0
- package/dist/memberships-393765d8.js +1 -0
- package/dist/metadata.schema-147f9902.mjs +212 -0
- package/dist/metadata.schema-93397f9f.js +211 -0
- package/dist/metadata.schema-a539dd65.mjs +210 -0
- package/dist/metadata.schema-e4fe5c57.js +209 -0
- package/dist/modules/community/components/blocks/FooterBlogpost.vue.d.ts +1 -1
- package/dist/modules/community/components/sections/Feed.vue.d.ts +4 -3
- package/dist/modules/events/components/sections/Feed.vue.d.ts +4 -4
- package/dist/modules/events/components/sections/List.vue.d.ts +3 -3
- package/dist/modules/globals/components/blocks/CardFooter.vue.d.ts +8 -0
- package/dist/modules/globals/components/blocks/CardHeader.vue.d.ts +15 -0
- package/dist/modules/globals/components/sections/Feed.vue.d.ts +69 -0
- package/dist/modules/orders/components/pages/EditOrder.vue.d.ts +6 -0
- package/dist/modules/orders/components/pages/Favorites.vue.d.ts +6 -0
- package/dist/modules/orders/components/pages/History.vue.d.ts +6 -0
- package/dist/modules/orders/components/pages/Orders.vue.d.ts +2 -0
- package/dist/modules/orders/components/pages/ViewOrder.vue.d.ts +6 -0
- package/dist/modules/orders/components/sections/Form.vue.d.ts +1 -0
- package/dist/modules/organizations/components/blocks/CardDepartment.vue.d.ts +7 -0
- package/dist/modules/organizations/components/blocks/User.vue.d.ts +1 -1
- package/dist/modules/organizations/components/elements/ButtonToggleMembership.vue.d.ts +1 -1
- package/dist/modules/organizations/components/pages/Members.vue.d.ts +2 -0
- package/dist/modules/organizations/components/sections/Department2.vue.d.ts +7 -0
- package/dist/modules/organizations/components/sections/Feed.vue.d.ts +4 -4
- package/dist/modules/organizations/components/sections/FeedDepartments.vue.d.ts +8 -0
- package/dist/modules/payments/components/pages/Payments.vue.d.ts +2 -0
- package/dist/modules/products/components/blocks/CardLeftover.vue.d.ts +6 -0
- package/dist/modules/products/components/blocks/CardPosition.vue.d.ts +11 -0
- package/dist/modules/products/components/blocks/CardProduct.vue.d.ts +6 -0
- package/dist/modules/products/components/blocks/LeftoverPositions.vue.d.ts +0 -1
- package/dist/modules/products/components/pages/ProductsBackoffice.vue.d.ts +2 -0
- package/dist/modules/products/components/sections/FilterProducts.vue.d.ts +9 -0
- package/dist/modules/products/components/sections/SortProducts.vue.d.ts +10 -0
- package/dist/modules/reports/components/sections/FormReport.vue.d.ts +3 -3
- package/dist/modules/spots/components/blocks/CardSpot.vue.d.ts +7 -0
- package/dist/modules/spots/components/blocks/SpotMemberModify.vue.d.ts +11 -0
- package/dist/modules/spots/components/blocks/SpotSub.vue.d.ts +6 -0
- package/dist/modules/spots/components/pages/Spot.vue.d.ts +7 -0
- package/dist/modules/spots/components/pages/SpotEdit.vue.d.ts +2 -0
- package/dist/modules/spots/components/sections/Feed.vue.d.ts +8 -0
- package/dist/modules/spots/components/sections/PlaceModify.vue.d.ts +9 -0
- package/dist/modules/spots/components/sections/Places.vue.d.ts +9 -0
- package/dist/modules/wallet/components/pages/Wallet.vue.d.ts +2 -0
- package/dist/orders-13c10d49.mjs +85 -0
- package/dist/orders-37f041aa.js +1 -0
- package/dist/organizations-4d18a2e2.js +1 -0
- package/dist/organizations-6ed907e3.mjs +122 -0
- package/dist/organizations.client-01593e4d.js +3 -0
- package/dist/organizations.client-1b9fa66e.mjs +2997 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +75 -51
- package/dist/organizations.server.js +9 -20
- package/dist/organizations.server.mjs +9 -20
- package/dist/products-7960bbd4.js +1 -0
- package/dist/products-bf5783aa.mjs +108 -0
- package/dist/prometheus-framework.cjs.js +17 -17
- package/dist/prometheus-framework.es.js +771 -758
- package/dist/states.validation-03f7cd49.js +1 -0
- package/dist/states.validation-50e3a5a0.mjs +13 -0
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +214 -258
- package/dist/users.server.js +1 -1
- package/dist/users.server.mjs +1 -1
- package/package.json +2 -119
- package/src/components/Field/Field.vue +34 -9
- package/src/components/SelectMulti/SelectMulti.vue +18 -22
- package/src/modules/auth/routes/auth.routes.js +9 -6
- package/src/modules/auth/store/auth.js +34 -15
- package/src/modules/backoffice/components/pages/Dashboard.vue +91 -0
- package/src/modules/backoffice/router/admin.js +0 -28
- package/src/modules/backoffice/router/backoffice.js +131 -4
- package/src/modules/community/components/blocks/CardBlogpost.vue +1 -1
- package/src/modules/community/components/pages/Blog.vue +1 -0
- package/src/modules/community/components/sections/Comments.vue +1 -1
- package/src/modules/community/components/sections/Feed.vue +6 -0
- package/src/modules/community/controllers/blog.controller.js +129 -285
- package/src/modules/community/controllers/reactions.controller.js +2 -0
- package/src/modules/community/controllers/utils/queryProcessor.js +56 -0
- package/src/modules/community/controllers/utils/queryProcessorReactions.js +63 -0
- package/src/modules/community/routes/blog.routes.js +10 -6
- package/src/modules/community/store/blogposts.js +5 -5
- package/src/modules/events/components/blocks/CardEvent.vue +2 -3
- package/src/modules/events/components/pages/Events.vue +4 -4
- package/src/modules/events/components/sections/Feed.vue +4 -4
- package/src/modules/events/components/sections/List.vue +2 -2
- package/src/modules/events/controllers/events.controller.js +8 -6
- package/src/modules/events/controllers/utils/queryProcessor.js +111 -1
- package/src/modules/events/models/event.model.js +0 -4
- package/src/modules/events/routes/events.routes.js +9 -6
- package/src/modules/events/store/events.js +5 -7
- package/src/{components/CardHeader → modules/globals/components/blocks}/CardHeader.vue +31 -4
- package/src/modules/globals/components/sections/Feed.vue +136 -0
- package/src/modules/globals/controllers/utils/queryProcessor.js +19 -117
- package/src/modules/globals/models/engagement.schema.js +29 -25
- package/src/modules/globals/utils/mailing.js +1 -1
- package/src/modules/icons/icons.client.js +51 -0
- package/src/modules/marketplace/components/layouts/Marketplace.vue +1 -1
- package/src/modules/marketplace/components/pages/Catalog.vue +3 -4
- package/src/modules/marketplace/router/marketplace.js +0 -11
- package/src/modules/middlewares/client/auth.validation.js +1 -1
- package/src/modules/orders/components/blocks/CardOrderItem.vue +1 -2
- package/src/modules/orders/components/pages/EditOrder.vue +238 -0
- package/src/modules/{backoffice → orders}/components/pages/Favorites.vue +2 -2
- package/src/modules/orders/components/pages/Order.vue +28 -34
- package/src/modules/orders/components/pages/Orders.vue +90 -0
- package/src/modules/{backoffice/components/pages/History.vue → orders/components/pages/ViewOrder.vue} +0 -8
- package/src/modules/orders/components/sections/Form.vue +52 -34
- package/src/modules/orders/controllers/orders.controller.js +102 -72
- package/src/modules/orders/models/order.model.js +30 -22
- package/src/modules/orders/router/orders.router.js +30 -0
- package/src/modules/orders/routes/orders.routes.js +23 -13
- package/src/modules/orders/store/orders.js +67 -40
- package/src/modules/organizations/components/{sections/Department.vue → blocks/CardDepartment.vue} +1 -10
- package/src/modules/organizations/components/blocks/CardOrganization.vue +13 -9
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +3 -3
- package/src/modules/organizations/components/{sections/MembersTab.vue → pages/Members.vue} +23 -8
- package/src/modules/organizations/components/pages/Organization.vue +80 -46
- package/src/modules/organizations/components/pages/Organizations.vue +45 -90
- package/src/modules/organizations/components/sections/{StructureTab.vue → FeedDepartments.vue} +5 -5
- package/src/modules/organizations/components/sections/Organizations.vue +1 -2
- package/src/modules/organizations/components/sections/Publics.vue +3 -2
- package/src/modules/organizations/controllers/organizations.controller.js +8 -21
- package/src/modules/organizations/controllers/organizations.new.controller.js +372 -0
- package/src/modules/organizations/controllers/utils/addUserStatusFields.js +53 -48
- package/src/modules/organizations/controllers/utils/queryProcessor.js +87 -0
- package/src/modules/organizations/controllers/utils/queryProcessorOrganizations.js +25 -0
- package/src/modules/organizations/organizations.client.js +42 -46
- package/src/modules/organizations/router/departments.router.js +29 -0
- package/src/modules/organizations/router/members.router.js +19 -0
- package/src/modules/organizations/router/organizations.js +12 -88
- package/src/modules/organizations/router/organizations.router.js +38 -0
- package/src/modules/organizations/router/products.router.js +24 -0
- package/src/modules/organizations/store/departments.js +108 -0
- package/src/modules/{backoffice/components/admin/Orders.vue → payments/components/pages/Payments.vue} +0 -15
- package/src/modules/products/components/blocks/{Leftover.vue → CardLeftover.vue} +21 -12
- package/src/modules/products/components/blocks/CardPosition.vue +84 -0
- package/src/modules/products/components/blocks/LeftoverPositions.vue +65 -136
- package/src/modules/products/components/pages/LeftoverAdd.vue +133 -88
- package/src/modules/products/components/pages/Leftovers.vue +91 -64
- package/src/modules/products/components/pages/Product.vue +3 -3
- package/src/modules/products/components/pages/Products.vue +42 -263
- package/src/modules/products/components/pages/ProductsBackoffice.vue +92 -0
- package/src/modules/products/components/sections/FilterProducts.vue +180 -0
- package/src/modules/products/components/sections/PopularProducts.vue +2 -2
- package/src/modules/products/components/sections/SectionProduct.vue +18 -3
- package/src/modules/products/components/sections/SortProducts.vue +76 -0
- package/src/modules/products/controllers/leftovers.controller.js +51 -45
- package/src/modules/products/controllers/modifications.controller.js +66 -0
- package/src/modules/products/controllers/products.controller.js +67 -111
- package/src/modules/products/models/leftover.model.js +12 -9
- package/src/modules/products/models/product.model.js +1 -0
- package/src/modules/products/router/products.router.js +46 -0
- package/src/modules/products/routes/products.routes.js +4 -9
- package/src/modules/products/store/leftovers.js +56 -59
- package/src/modules/products/store/products.js +21 -22
- package/src/modules/spots/components/blocks/CardSpot.vue +104 -0
- package/src/modules/spots/components/blocks/SpotMemberModify.vue +92 -0
- package/src/modules/spots/components/blocks/SpotSub.vue +24 -0
- package/src/modules/spots/components/pages/Map.vue +2 -2
- package/src/modules/spots/components/pages/Spot.vue +107 -0
- package/src/modules/spots/components/pages/SpotEdit.vue +319 -0
- package/src/modules/spots/components/sections/Feed.vue +64 -0
- package/src/modules/spots/controllers/spots.controller.js +83 -0
- package/src/modules/spots/models/spot.model.js +72 -0
- package/src/modules/spots/router/spots.js +34 -1
- package/src/modules/spots/routes/spots.routes.js +31 -0
- package/src/modules/spots/store/spots.js +15 -15
- package/src/modules/users/components/pages/Profile.vue +2 -3
- package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
- package/src/styles/components/block.scss +2 -4
- package/src/modules/backoffice/components/admin/LeftoverAdd.vue +0 -157
- package/src/modules/backoffice/components/admin/Leftovers.vue +0 -119
- package/src/modules/backoffice/components/admin/Order.vue +0 -199
- package/src/modules/backoffice/components/admin/Product.vue +0 -28
- package/src/modules/backoffice/components/admin/Products.vue +0 -82
- package/src/modules/backoffice/components/pages/Organizations.vue +0 -104
- package/src/modules/community/controllers/blog.new.controller.js +0 -290
- package/src/modules/organizations/components/blocks/DepartmentSubDepartmentModify.vue +0 -92
- package/src/modules/organizations/components/elements/ButtonFollow.vue +0 -84
- package/src/modules/organizations/components/pages/OrganizationsAccount.vue +0 -110
- package/src/modules/organizations/controllers/utils/excludeBlockedMembers.js +0 -18
- /package/src/{components/CardFooter → modules/globals/components/blocks}/CardFooter.vue +0 -0
- /package/src/modules/{orders/controllers → payments/controller}/payments.controller.js +0 -0
- /package/src/modules/{orders → payments}/routes/payments.routes.js +0 -0
- /package/src/modules/{orders → payments}/store/payments.js +0 -0
- /package/src/modules/products/components/blocks/{ProductCard.vue → CardProduct.vue} +0 -0
- /package/src/modules/{organizations → spots}/components/sections/PlaceModify.vue +0 -0
- /package/src/modules/{organizations → spots}/components/sections/Places.vue +0 -0
- /package/src/modules/{backoffice → wallet}/components/pages/Wallet.vue +0 -0
@@ -0,0 +1,627 @@
|
|
1
|
+
import { g as le, a as V } from "./index-a661083c.mjs";
|
2
|
+
import { reactive as Z, watch as Q } from "vue";
|
3
|
+
import { s as E } from "./globals-96ba60e4.mjs";
|
4
|
+
var X = { exports: {} };
|
5
|
+
/*!
|
6
|
+
* JavaScript Cookie v2.2.1
|
7
|
+
* https://github.com/js-cookie/js-cookie
|
8
|
+
*
|
9
|
+
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
10
|
+
* Released under the MIT license
|
11
|
+
*/
|
12
|
+
(function(t, e) {
|
13
|
+
(function(r) {
|
14
|
+
var o;
|
15
|
+
if (t.exports = r(), o = !0, !o) {
|
16
|
+
var n = window.Cookies, s = window.Cookies = r();
|
17
|
+
s.noConflict = function() {
|
18
|
+
return window.Cookies = n, s;
|
19
|
+
};
|
20
|
+
}
|
21
|
+
})(function() {
|
22
|
+
function r() {
|
23
|
+
for (var s = 0, i = {}; s < arguments.length; s++) {
|
24
|
+
var a = arguments[s];
|
25
|
+
for (var d in a)
|
26
|
+
i[d] = a[d];
|
27
|
+
}
|
28
|
+
return i;
|
29
|
+
}
|
30
|
+
function o(s) {
|
31
|
+
return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
|
32
|
+
}
|
33
|
+
function n(s) {
|
34
|
+
function i() {
|
35
|
+
}
|
36
|
+
function a(c, p, l) {
|
37
|
+
if (!(typeof document > "u")) {
|
38
|
+
l = r({
|
39
|
+
path: "/"
|
40
|
+
}, i.defaults, l), typeof l.expires == "number" && (l.expires = new Date(/* @__PURE__ */ new Date() * 1 + l.expires * 864e5)), l.expires = l.expires ? l.expires.toUTCString() : "";
|
41
|
+
try {
|
42
|
+
var b = JSON.stringify(p);
|
43
|
+
/^[\{\[]/.test(b) && (p = b);
|
44
|
+
} catch {
|
45
|
+
}
|
46
|
+
p = s.write ? s.write(p, c) : encodeURIComponent(String(p)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), c = encodeURIComponent(String(c)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
|
47
|
+
var y = "";
|
48
|
+
for (var C in l)
|
49
|
+
l[C] && (y += "; " + C, l[C] !== !0 && (y += "=" + l[C].split(";")[0]));
|
50
|
+
return document.cookie = c + "=" + p + y;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
function d(c, p) {
|
54
|
+
if (!(typeof document > "u")) {
|
55
|
+
for (var l = {}, b = document.cookie ? document.cookie.split("; ") : [], y = 0; y < b.length; y++) {
|
56
|
+
var C = b[y].split("="), h = C.slice(1).join("=");
|
57
|
+
!p && h.charAt(0) === '"' && (h = h.slice(1, -1));
|
58
|
+
try {
|
59
|
+
var U = o(C[0]);
|
60
|
+
if (h = (s.read || s)(h, U) || o(h), p)
|
61
|
+
try {
|
62
|
+
h = JSON.parse(h);
|
63
|
+
} catch {
|
64
|
+
}
|
65
|
+
if (l[U] = h, c === U)
|
66
|
+
break;
|
67
|
+
} catch {
|
68
|
+
}
|
69
|
+
}
|
70
|
+
return c ? l[c] : l;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
return i.set = a, i.get = function(c) {
|
74
|
+
return d(
|
75
|
+
c,
|
76
|
+
!1
|
77
|
+
/* read as raw */
|
78
|
+
);
|
79
|
+
}, i.getJSON = function(c) {
|
80
|
+
return d(
|
81
|
+
c,
|
82
|
+
!0
|
83
|
+
/* read as json */
|
84
|
+
);
|
85
|
+
}, i.remove = function(c, p) {
|
86
|
+
a(c, "", r(p, {
|
87
|
+
expires: -1
|
88
|
+
}));
|
89
|
+
}, i.defaults = {}, i.withConverter = n, i;
|
90
|
+
}
|
91
|
+
return n(function() {
|
92
|
+
});
|
93
|
+
});
|
94
|
+
})(X);
|
95
|
+
var de = X.exports;
|
96
|
+
const F = /* @__PURE__ */ le(de);
|
97
|
+
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
98
|
+
const ue = (t) => {
|
99
|
+
const e = /* @__PURE__ */ new Map();
|
100
|
+
e.set("web", { name: "web" });
|
101
|
+
const r = t.CapacitorPlatforms || {
|
102
|
+
currentPlatform: { name: "web" },
|
103
|
+
platforms: e
|
104
|
+
}, o = (s, i) => {
|
105
|
+
r.platforms.set(s, i);
|
106
|
+
}, n = (s) => {
|
107
|
+
r.platforms.has(s) && (r.currentPlatform = r.platforms.get(s));
|
108
|
+
};
|
109
|
+
return r.addPlatform = o, r.setPlatform = n, r;
|
110
|
+
}, fe = (t) => t.CapacitorPlatforms = ue(t), Y = /* @__PURE__ */ fe(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
111
|
+
Y.addPlatform;
|
112
|
+
Y.setPlatform;
|
113
|
+
var S;
|
114
|
+
(function(t) {
|
115
|
+
t.Unimplemented = "UNIMPLEMENTED", t.Unavailable = "UNAVAILABLE";
|
116
|
+
})(S || (S = {}));
|
117
|
+
class W extends Error {
|
118
|
+
constructor(e, r, o) {
|
119
|
+
super(e), this.message = e, this.code = r, this.data = o;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
const pe = (t) => {
|
123
|
+
var e, r;
|
124
|
+
return t != null && t.androidBridge ? "android" : !((r = (e = t == null ? void 0 : t.webkit) === null || e === void 0 ? void 0 : e.messageHandlers) === null || r === void 0) && r.bridge ? "ios" : "web";
|
125
|
+
}, ge = (t) => {
|
126
|
+
var e, r, o, n, s;
|
127
|
+
const i = t.CapacitorCustomPlatform || null, a = t.Capacitor || {}, d = a.Plugins = a.Plugins || {}, c = t.CapacitorPlatforms, p = () => i !== null ? i.name : pe(t), l = ((e = c == null ? void 0 : c.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || p, b = () => l() !== "web", y = ((r = c == null ? void 0 : c.currentPlatform) === null || r === void 0 ? void 0 : r.isNativePlatform) || b, C = (u) => {
|
128
|
+
const f = M.get(u);
|
129
|
+
return !!(f != null && f.platforms.has(l()) || R(u));
|
130
|
+
}, h = ((o = c == null ? void 0 : c.currentPlatform) === null || o === void 0 ? void 0 : o.isPluginAvailable) || C, U = (u) => {
|
131
|
+
var f;
|
132
|
+
return (f = a.PluginHeaders) === null || f === void 0 ? void 0 : f.find((x) => x.name === u);
|
133
|
+
}, R = ((n = c == null ? void 0 : c.currentPlatform) === null || n === void 0 ? void 0 : n.getPluginHeader) || U, re = (u) => t.console.error(u), se = (u, f, x) => Promise.reject(`${x} does not have an implementation of "${f}".`), M = /* @__PURE__ */ new Map(), ne = (u, f = {}) => {
|
134
|
+
const x = M.get(u);
|
135
|
+
if (x)
|
136
|
+
return console.warn(`Capacitor plugin "${u}" already registered. Cannot register plugins twice.`), x.proxy;
|
137
|
+
const j = l(), _ = R(u);
|
138
|
+
let O;
|
139
|
+
const ae = async () => (!O && j in f ? O = typeof f[j] == "function" ? O = await f[j]() : O = f[j] : i !== null && !O && "web" in f && (O = typeof f.web == "function" ? O = await f.web() : O = f.web), O), ie = (g, w) => {
|
140
|
+
var P, L;
|
141
|
+
if (_) {
|
142
|
+
const k = _ == null ? void 0 : _.methods.find((v) => w === v.name);
|
143
|
+
if (k)
|
144
|
+
return k.rtype === "promise" ? (v) => a.nativePromise(u, w.toString(), v) : (v, T) => a.nativeCallback(u, w.toString(), v, T);
|
145
|
+
if (g)
|
146
|
+
return (P = g[w]) === null || P === void 0 ? void 0 : P.bind(g);
|
147
|
+
} else {
|
148
|
+
if (g)
|
149
|
+
return (L = g[w]) === null || L === void 0 ? void 0 : L.bind(g);
|
150
|
+
throw new W(`"${u}" plugin is not implemented on ${j}`, S.Unimplemented);
|
151
|
+
}
|
152
|
+
}, H = (g) => {
|
153
|
+
let w;
|
154
|
+
const P = (...L) => {
|
155
|
+
const k = ae().then((v) => {
|
156
|
+
const T = ie(v, g);
|
157
|
+
if (T) {
|
158
|
+
const I = T(...L);
|
159
|
+
return w = I == null ? void 0 : I.remove, I;
|
160
|
+
} else
|
161
|
+
throw new W(`"${u}.${g}()" is not implemented on ${j}`, S.Unimplemented);
|
162
|
+
});
|
163
|
+
return g === "addListener" && (k.remove = async () => w()), k;
|
164
|
+
};
|
165
|
+
return P.toString = () => `${g.toString()}() { [capacitor code] }`, Object.defineProperty(P, "name", {
|
166
|
+
value: g,
|
167
|
+
writable: !1,
|
168
|
+
configurable: !1
|
169
|
+
}), P;
|
170
|
+
}, G = H("addListener"), z = H("removeListener"), ce = (g, w) => {
|
171
|
+
const P = G({ eventName: g }, w), L = async () => {
|
172
|
+
const v = await P;
|
173
|
+
z({
|
174
|
+
eventName: g,
|
175
|
+
callbackId: v
|
176
|
+
}, w);
|
177
|
+
}, k = new Promise((v) => P.then(() => v({ remove: L })));
|
178
|
+
return k.remove = async () => {
|
179
|
+
console.warn("Using addListener() without 'await' is deprecated."), await L();
|
180
|
+
}, k;
|
181
|
+
}, B = new Proxy({}, {
|
182
|
+
get(g, w) {
|
183
|
+
switch (w) {
|
184
|
+
case "$$typeof":
|
185
|
+
return;
|
186
|
+
case "toJSON":
|
187
|
+
return () => ({});
|
188
|
+
case "addListener":
|
189
|
+
return _ ? ce : G;
|
190
|
+
case "removeListener":
|
191
|
+
return z;
|
192
|
+
default:
|
193
|
+
return H(w);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
});
|
197
|
+
return d[u] = B, M.set(u, {
|
198
|
+
name: u,
|
199
|
+
proxy: B,
|
200
|
+
platforms: /* @__PURE__ */ new Set([
|
201
|
+
...Object.keys(f),
|
202
|
+
..._ ? [j] : []
|
203
|
+
])
|
204
|
+
}), B;
|
205
|
+
}, oe = ((s = c == null ? void 0 : c.currentPlatform) === null || s === void 0 ? void 0 : s.registerPlugin) || ne;
|
206
|
+
return a.convertFileSrc || (a.convertFileSrc = (u) => u), a.getPlatform = l, a.handleError = re, a.isNativePlatform = y, a.isPluginAvailable = h, a.pluginMethodNoop = se, a.registerPlugin = oe, a.Exception = W, a.DEBUG = !!a.DEBUG, a.isLoggingEnabled = !!a.isLoggingEnabled, a.platform = a.getPlatform(), a.isNative = a.isNativePlatform(), a;
|
207
|
+
}, me = (t) => t.Capacitor = ge(t), D = /* @__PURE__ */ me(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), ee = D.registerPlugin;
|
208
|
+
D.Plugins;
|
209
|
+
class te {
|
210
|
+
constructor(e) {
|
211
|
+
this.listeners = {}, this.windowListeners = {}, e && (console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`), this.config = e);
|
212
|
+
}
|
213
|
+
addListener(e, r) {
|
214
|
+
this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(r);
|
215
|
+
const n = this.windowListeners[e];
|
216
|
+
n && !n.registered && this.addWindowListener(n);
|
217
|
+
const s = async () => this.removeListener(e, r), i = Promise.resolve({ remove: s });
|
218
|
+
return Object.defineProperty(i, "remove", {
|
219
|
+
value: async () => {
|
220
|
+
console.warn("Using addListener() without 'await' is deprecated."), await s();
|
221
|
+
}
|
222
|
+
}), i;
|
223
|
+
}
|
224
|
+
async removeAllListeners() {
|
225
|
+
this.listeners = {};
|
226
|
+
for (const e in this.windowListeners)
|
227
|
+
this.removeWindowListener(this.windowListeners[e]);
|
228
|
+
this.windowListeners = {};
|
229
|
+
}
|
230
|
+
notifyListeners(e, r) {
|
231
|
+
const o = this.listeners[e];
|
232
|
+
o && o.forEach((n) => n(r));
|
233
|
+
}
|
234
|
+
hasListeners(e) {
|
235
|
+
return !!this.listeners[e].length;
|
236
|
+
}
|
237
|
+
registerWindowListener(e, r) {
|
238
|
+
this.windowListeners[r] = {
|
239
|
+
registered: !1,
|
240
|
+
windowEventName: e,
|
241
|
+
pluginEventName: r,
|
242
|
+
handler: (o) => {
|
243
|
+
this.notifyListeners(r, o);
|
244
|
+
}
|
245
|
+
};
|
246
|
+
}
|
247
|
+
unimplemented(e = "not implemented") {
|
248
|
+
return new D.Exception(e, S.Unimplemented);
|
249
|
+
}
|
250
|
+
unavailable(e = "not available") {
|
251
|
+
return new D.Exception(e, S.Unavailable);
|
252
|
+
}
|
253
|
+
async removeListener(e, r) {
|
254
|
+
const o = this.listeners[e];
|
255
|
+
if (!o)
|
256
|
+
return;
|
257
|
+
const n = o.indexOf(r);
|
258
|
+
this.listeners[e].splice(n, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
259
|
+
}
|
260
|
+
addWindowListener(e) {
|
261
|
+
window.addEventListener(e.windowEventName, e.handler), e.registered = !0;
|
262
|
+
}
|
263
|
+
removeWindowListener(e) {
|
264
|
+
e && (window.removeEventListener(e.windowEventName, e.handler), e.registered = !1);
|
265
|
+
}
|
266
|
+
}
|
267
|
+
const K = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), N = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
268
|
+
class we extends te {
|
269
|
+
async getCookies() {
|
270
|
+
const e = document.cookie, r = {};
|
271
|
+
return e.split(";").forEach((o) => {
|
272
|
+
if (o.length <= 0)
|
273
|
+
return;
|
274
|
+
let [n, s] = o.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
|
275
|
+
n = N(n).trim(), s = N(s).trim(), r[n] = s;
|
276
|
+
}), r;
|
277
|
+
}
|
278
|
+
async setCookie(e) {
|
279
|
+
try {
|
280
|
+
const r = K(e.key), o = K(e.value), n = `; expires=${(e.expires || "").replace("expires=", "")}`, s = (e.path || "/").replace("path=", ""), i = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
|
281
|
+
document.cookie = `${r}=${o || ""}${n}; path=${s}; ${i};`;
|
282
|
+
} catch (r) {
|
283
|
+
return Promise.reject(r);
|
284
|
+
}
|
285
|
+
}
|
286
|
+
async deleteCookie(e) {
|
287
|
+
try {
|
288
|
+
document.cookie = `${e.key}=; Max-Age=0`;
|
289
|
+
} catch (r) {
|
290
|
+
return Promise.reject(r);
|
291
|
+
}
|
292
|
+
}
|
293
|
+
async clearCookies() {
|
294
|
+
try {
|
295
|
+
const e = document.cookie.split(";") || [];
|
296
|
+
for (const r of e)
|
297
|
+
document.cookie = r.replace(/^ +/, "").replace(/=.*/, `=;expires=${(/* @__PURE__ */ new Date()).toUTCString()};path=/`);
|
298
|
+
} catch (e) {
|
299
|
+
return Promise.reject(e);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
async clearAllCookies() {
|
303
|
+
try {
|
304
|
+
await this.clearCookies();
|
305
|
+
} catch (e) {
|
306
|
+
return Promise.reject(e);
|
307
|
+
}
|
308
|
+
}
|
309
|
+
}
|
310
|
+
const J = ee("CapacitorCookies", {
|
311
|
+
web: () => new we()
|
312
|
+
}), he = async (t) => new Promise((e, r) => {
|
313
|
+
const o = new FileReader();
|
314
|
+
o.onload = () => {
|
315
|
+
const n = o.result;
|
316
|
+
e(n.indexOf(",") >= 0 ? n.split(",")[1] : n);
|
317
|
+
}, o.onerror = (n) => r(n), o.readAsDataURL(t);
|
318
|
+
}), ve = (t = {}) => {
|
319
|
+
const e = Object.keys(t);
|
320
|
+
return Object.keys(t).map((n) => n.toLocaleLowerCase()).reduce((n, s, i) => (n[s] = t[e[i]], n), {});
|
321
|
+
}, Pe = (t, e = !0) => t ? Object.entries(t).reduce((o, n) => {
|
322
|
+
const [s, i] = n;
|
323
|
+
let a, d;
|
324
|
+
return Array.isArray(i) ? (d = "", i.forEach((c) => {
|
325
|
+
a = e ? encodeURIComponent(c) : c, d += `${s}=${a}&`;
|
326
|
+
}), d.slice(0, -1)) : (a = e ? encodeURIComponent(i) : i, d = `${s}=${a}`), `${o}&${d}`;
|
327
|
+
}, "").substr(1) : null, be = (t, e = {}) => {
|
328
|
+
const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = ve(t.headers)["content-type"] || "";
|
329
|
+
if (typeof t.data == "string")
|
330
|
+
r.body = t.data;
|
331
|
+
else if (n.includes("application/x-www-form-urlencoded")) {
|
332
|
+
const s = new URLSearchParams();
|
333
|
+
for (const [i, a] of Object.entries(t.data || {}))
|
334
|
+
s.set(i, a);
|
335
|
+
r.body = s.toString();
|
336
|
+
} else if (n.includes("multipart/form-data")) {
|
337
|
+
const s = new FormData();
|
338
|
+
if (t.data instanceof FormData)
|
339
|
+
t.data.forEach((a, d) => {
|
340
|
+
s.append(d, a);
|
341
|
+
});
|
342
|
+
else
|
343
|
+
for (const a of Object.keys(t.data))
|
344
|
+
s.append(a, t.data[a]);
|
345
|
+
r.body = s;
|
346
|
+
const i = new Headers(r.headers);
|
347
|
+
i.delete("content-type"), r.headers = i;
|
348
|
+
} else
|
349
|
+
(n.includes("application/json") || typeof t.data == "object") && (r.body = JSON.stringify(t.data));
|
350
|
+
return r;
|
351
|
+
};
|
352
|
+
class ye extends te {
|
353
|
+
/**
|
354
|
+
* Perform an Http request given a set of options
|
355
|
+
* @param options Options to build the HTTP request
|
356
|
+
*/
|
357
|
+
async request(e) {
|
358
|
+
const r = be(e, e.webFetchExtra), o = Pe(e.params, e.shouldEncodeUrlParams), n = o ? `${e.url}?${o}` : e.url, s = await fetch(n, r), i = s.headers.get("content-type") || "";
|
359
|
+
let { responseType: a = "text" } = s.ok ? e : {};
|
360
|
+
i.includes("application/json") && (a = "json");
|
361
|
+
let d, c;
|
362
|
+
switch (a) {
|
363
|
+
case "arraybuffer":
|
364
|
+
case "blob":
|
365
|
+
c = await s.blob(), d = await he(c);
|
366
|
+
break;
|
367
|
+
case "json":
|
368
|
+
d = await s.json();
|
369
|
+
break;
|
370
|
+
case "document":
|
371
|
+
case "text":
|
372
|
+
default:
|
373
|
+
d = await s.text();
|
374
|
+
}
|
375
|
+
const p = {};
|
376
|
+
return s.headers.forEach((l, b) => {
|
377
|
+
p[b] = l;
|
378
|
+
}), {
|
379
|
+
data: d,
|
380
|
+
headers: p,
|
381
|
+
status: s.status,
|
382
|
+
url: s.url
|
383
|
+
};
|
384
|
+
}
|
385
|
+
/**
|
386
|
+
* Perform an Http GET request given a set of options
|
387
|
+
* @param options Options to build the HTTP request
|
388
|
+
*/
|
389
|
+
async get(e) {
|
390
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "GET" }));
|
391
|
+
}
|
392
|
+
/**
|
393
|
+
* Perform an Http POST request given a set of options
|
394
|
+
* @param options Options to build the HTTP request
|
395
|
+
*/
|
396
|
+
async post(e) {
|
397
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "POST" }));
|
398
|
+
}
|
399
|
+
/**
|
400
|
+
* Perform an Http PUT request given a set of options
|
401
|
+
* @param options Options to build the HTTP request
|
402
|
+
*/
|
403
|
+
async put(e) {
|
404
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "PUT" }));
|
405
|
+
}
|
406
|
+
/**
|
407
|
+
* Perform an Http PATCH request given a set of options
|
408
|
+
* @param options Options to build the HTTP request
|
409
|
+
*/
|
410
|
+
async patch(e) {
|
411
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "PATCH" }));
|
412
|
+
}
|
413
|
+
/**
|
414
|
+
* Perform an Http DELETE request given a set of options
|
415
|
+
* @param options Options to build the HTTP request
|
416
|
+
*/
|
417
|
+
async delete(e) {
|
418
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "DELETE" }));
|
419
|
+
}
|
420
|
+
}
|
421
|
+
ee("CapacitorHttp", {
|
422
|
+
web: () => new ye()
|
423
|
+
});
|
424
|
+
const Ce = V.create({ baseURL: process.env.API_URL, withCredentials: !0 }), $ = Z({
|
425
|
+
code: {
|
426
|
+
value: "",
|
427
|
+
type: "",
|
428
|
+
method: "",
|
429
|
+
isSended: !1,
|
430
|
+
isValid: !1
|
431
|
+
}
|
432
|
+
});
|
433
|
+
async function Oe(t, e, r) {
|
434
|
+
return await Ce.post("/api/twofa/sendcode", {
|
435
|
+
phone: t.phone.number,
|
436
|
+
email: t.email,
|
437
|
+
method: e,
|
438
|
+
type: r
|
439
|
+
}).then(
|
440
|
+
(o) => ($.code = o.data, $.code.isSended = !0, Promise.resolve(o.data)),
|
441
|
+
(o) => (console.log(o), E(o), Promise.reject(o))
|
442
|
+
);
|
443
|
+
}
|
444
|
+
Q($, (t, e) => {
|
445
|
+
});
|
446
|
+
const Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
447
|
+
__proto__: null,
|
448
|
+
sendCode: Oe,
|
449
|
+
state: $
|
450
|
+
}, Symbol.toStringTag, { value: "Module" })), A = V.create({ baseURL: process.env.API_URL, withCredentials: !0 }), m = Z({
|
451
|
+
user: {
|
452
|
+
_id: void 0,
|
453
|
+
username: "",
|
454
|
+
email: "",
|
455
|
+
phone: "",
|
456
|
+
password: "",
|
457
|
+
passwordRepeat: ""
|
458
|
+
},
|
459
|
+
access: {
|
460
|
+
roles: null,
|
461
|
+
token: null,
|
462
|
+
status: !1
|
463
|
+
}
|
464
|
+
});
|
465
|
+
async function Le() {
|
466
|
+
const t = await Ee("user");
|
467
|
+
if (t) {
|
468
|
+
const { _id: e, email: r, phone: o, roles: n, accessToken: s } = t;
|
469
|
+
Object.assign(m.user, { _id: e, email: r, phone: o }), Object.assign(m.access, { token: s, roles: n, status: !!s }), A.interceptors.request.use((i) => (s && (i.headers["x-access-token"] = s), i), (i) => Promise.reject(i));
|
470
|
+
}
|
471
|
+
}
|
472
|
+
Le();
|
473
|
+
const ke = {
|
474
|
+
async login(t, e) {
|
475
|
+
try {
|
476
|
+
const r = await A.post("/api/auth/signin", {
|
477
|
+
...t,
|
478
|
+
type: e
|
479
|
+
});
|
480
|
+
return q("user", r.data), Object.assign(m.user, {
|
481
|
+
...r.data
|
482
|
+
}), Object.assign(m.access, {
|
483
|
+
token: r.data.accessToken,
|
484
|
+
status: !0,
|
485
|
+
roles: r.data.roles
|
486
|
+
}), r.data;
|
487
|
+
} catch (r) {
|
488
|
+
return Object.assign(m.access, {
|
489
|
+
token: null,
|
490
|
+
status: !1,
|
491
|
+
roles: null
|
492
|
+
}), E(r), Promise.reject(r);
|
493
|
+
}
|
494
|
+
},
|
495
|
+
async signup(t, e, r) {
|
496
|
+
const { password: o, passwordRepeat: n } = m.user;
|
497
|
+
if (o !== n) {
|
498
|
+
const s = {
|
499
|
+
response: {
|
500
|
+
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
501
|
+
}
|
502
|
+
};
|
503
|
+
throw E(s), new Error(s.response.status);
|
504
|
+
}
|
505
|
+
try {
|
506
|
+
t.phone = t.phone.number;
|
507
|
+
const s = await A.post("/api/auth/signup", {
|
508
|
+
...t,
|
509
|
+
type: e,
|
510
|
+
inviteCode: r
|
511
|
+
});
|
512
|
+
return s.data.accessToken && q("user", s.data), Object.assign(m.user, {
|
513
|
+
...s.data
|
514
|
+
}), Object.assign(m.access, {
|
515
|
+
token: s.data.accessToken,
|
516
|
+
status: !0,
|
517
|
+
roles: s.data.roles
|
518
|
+
}), s.data;
|
519
|
+
} catch (s) {
|
520
|
+
throw E(s), console.log("Sign up falied"), s;
|
521
|
+
}
|
522
|
+
},
|
523
|
+
logout() {
|
524
|
+
xe("user"), Object.assign(m.user, {
|
525
|
+
email: "",
|
526
|
+
phone: "",
|
527
|
+
password: "",
|
528
|
+
passwordRepeat: ""
|
529
|
+
}), Object.assign(m.access, {
|
530
|
+
token: null,
|
531
|
+
status: !1
|
532
|
+
});
|
533
|
+
},
|
534
|
+
async resetPassword(t, e) {
|
535
|
+
try {
|
536
|
+
const r = await A.post("/api/auth/reset-password", {
|
537
|
+
email: t.email,
|
538
|
+
phone: t.phone.number,
|
539
|
+
type: e
|
540
|
+
});
|
541
|
+
return Object.assign($.code, {
|
542
|
+
...r.data,
|
543
|
+
isSended: !0
|
544
|
+
}), r.data;
|
545
|
+
} catch (r) {
|
546
|
+
return E(r), Promise.reject(r);
|
547
|
+
}
|
548
|
+
},
|
549
|
+
async updatePassword(t, e) {
|
550
|
+
const { password: r, passwordRepeat: o } = m.user;
|
551
|
+
if (r !== o) {
|
552
|
+
const n = {
|
553
|
+
response: {
|
554
|
+
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
555
|
+
}
|
556
|
+
};
|
557
|
+
throw E(n), new Error(n.response.status);
|
558
|
+
}
|
559
|
+
try {
|
560
|
+
const n = await A.post("/api/auth/update-password", {
|
561
|
+
email: t.email,
|
562
|
+
phone: t.phone.number,
|
563
|
+
password: t.password,
|
564
|
+
passwordRepeat: t.passwordRepeat,
|
565
|
+
type: e
|
566
|
+
});
|
567
|
+
return n.data.accessToken && q("user", n.data), Object.assign(m.user, {
|
568
|
+
...n.data
|
569
|
+
}), Object.assign(m.access, {
|
570
|
+
token: n.data.accessToken,
|
571
|
+
status: !0
|
572
|
+
}), n.data;
|
573
|
+
} catch (n) {
|
574
|
+
return E(n), Promise.reject(n);
|
575
|
+
}
|
576
|
+
}
|
577
|
+
}, je = {
|
578
|
+
development: { secure: !1, expires: 1 },
|
579
|
+
production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
|
580
|
+
};
|
581
|
+
function Ee(t) {
|
582
|
+
if (process.env.MOBILE_APP)
|
583
|
+
return J.getCookie({
|
584
|
+
url: process.env.API_URL,
|
585
|
+
key: t
|
586
|
+
}).then((e) => JSON.parse(e.value));
|
587
|
+
{
|
588
|
+
const e = F.get(t);
|
589
|
+
return e ? JSON.parse(e) : null;
|
590
|
+
}
|
591
|
+
}
|
592
|
+
function q(t, e, r = process.env.NODE_ENV) {
|
593
|
+
process.env.MOBILE_APP ? J.setCookie({
|
594
|
+
url: process.env.API_URL,
|
595
|
+
// используйте ваш API_URL
|
596
|
+
key: t,
|
597
|
+
value: JSON.stringify(e)
|
598
|
+
}) : F.set(t, JSON.stringify(e), je[r]);
|
599
|
+
}
|
600
|
+
function xe(t, e = process.env.NODE_ENV) {
|
601
|
+
if (process.env.MOBILE_APP)
|
602
|
+
J.deleteCookie({
|
603
|
+
url: process.env.API_URL,
|
604
|
+
// используйте ваш API_URL
|
605
|
+
key: t
|
606
|
+
});
|
607
|
+
else {
|
608
|
+
const r = e === "production" ? { domain: process.env.API_URL } : {};
|
609
|
+
F.remove(t, r);
|
610
|
+
}
|
611
|
+
}
|
612
|
+
Q(m, (t, e) => {
|
613
|
+
});
|
614
|
+
const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
615
|
+
__proto__: null,
|
616
|
+
actions: ke,
|
617
|
+
state: m
|
618
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
619
|
+
export {
|
620
|
+
F as C,
|
621
|
+
ke as a,
|
622
|
+
$ as b,
|
623
|
+
Oe as c,
|
624
|
+
$e as d,
|
625
|
+
m as s,
|
626
|
+
Ae as t
|
627
|
+
};
|