@ozdao/martyrs 0.2.584 → 0.2.586
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.server.js +161 -96
- package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
- package/dist/builder.js +2 -0
- package/dist/chats.server.js +2 -2
- package/dist/community.server.js +1 -1
- package/dist/core.server.js +191 -2
- package/dist/{core.websocket-C2FxNmZ1.js → core.websocket-Cl76z2wT.js} +41 -5
- package/dist/{crud-q1ye5IhV.js → crud-DpOXTZep.js} +1 -1
- package/dist/events.server.js +2 -2
- package/dist/files.server.js +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/index-kvBwwb0w.js +427 -0
- package/dist/inventory.server.js +2 -2
- package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
- package/dist/{main-fmp55tJF.js → main-BIf-WirR.js} +864 -865
- package/dist/marketplace.server.js +1 -1
- package/dist/martyrs/dist/{main-fmp55tJF.js → main-BIf-WirR.js} +193 -38
- package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
- package/dist/martyrs/dist/{web-BDuQSQKS.js → web-O7lXcjg0.js} +2 -2
- package/dist/martyrs/dist/{web-BDuQSQKS.js.map → web-O7lXcjg0.js.map} +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +8 -7
- package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
- package/dist/martyrs/src/components/EditImages/{EditImages.vue2.js → EditImages.vue.js} +2 -2
- package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js +1 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
- package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
- package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
- package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js +17 -22
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -1
- package/dist/martyrs/src/modules/auth/auth.client.js +18 -24
- package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +178 -0
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +104 -77
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +198 -14
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +71 -30
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +87 -31
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js +100 -0
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js +2 -31
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -14
- package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -56
- package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js +5 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js.map +1 -1
- package/dist/martyrs/src/modules/backoffice/backoffice.client.js +3 -15
- package/dist/martyrs/src/modules/backoffice/backoffice.client.js.map +1 -1
- package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js +99 -0
- package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js.map +1 -0
- package/dist/martyrs/src/modules/backoffice/{backoffice.router.js → router/backoffice.router.js} +9 -7
- package/dist/martyrs/src/modules/backoffice/router/backoffice.router.js.map +1 -0
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +7 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/core/core.client.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/classes/core.app.js +5 -1
- package/dist/martyrs/src/modules/core/views/classes/core.app.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +0 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +74 -0
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +77 -67
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js +76 -7
- package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/store/core.store.js +1 -0
- package/dist/martyrs/src/modules/core/views/store/core.store.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js +2 -1
- package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +0 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -3
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/pages.router.js +7 -5
- package/dist/martyrs/src/modules/pages/pages.router.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +0 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +0 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -2
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +4 -4
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +2 -2
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +2 -2
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.js +1 -1
- package/dist/notifications.server.js +1 -1
- package/dist/orders.server.js +7 -6
- package/dist/organizations.server.js +2 -2
- package/dist/products.server.js +2 -2
- package/dist/profile.schema-C31Lynn3.js +21 -0
- package/dist/rents.server.js +1 -1
- package/dist/sessions.service-COcwjd0f.js +86 -0
- package/dist/style.css +183 -108
- package/dist/{tickets.controller-B7r0mK-5.js → tickets.controller-DdF85W-i.js} +1 -1
- package/dist/visitors.service-B1dhhuSo.js +83 -0
- package/dist/wallet.server.js +2 -2
- package/dist/{web-BDuQSQKS.js → web-O7lXcjg0.js} +1 -1
- package/package.json +5 -1
- package/src/builder/modes/ssr.rspack.dev.js +2 -0
- package/src/cli/commands/create.js +106 -0
- package/src/cli/index.js +25 -0
- package/src/cli/templates/app/.env.development.mustache +14 -0
- package/src/cli/templates/app/.env.production.mustache +14 -0
- package/src/cli/templates/app/Dockerfile +36 -0
- package/src/cli/templates/app/babel.config.js +14 -0
- package/src/cli/templates/app/env.js +3 -0
- package/src/cli/templates/app/index.js +46 -0
- package/src/cli/templates/app/mongodb.config.js +18 -0
- package/src/cli/templates/app/package.json.mustache +65 -0
- package/src/cli/templates/app/src/client.js +22 -0
- package/src/cli/templates/app/src/components/pages/Index.vue +11 -0
- package/src/cli/templates/app/src/configs/global.config.js.mustache +40 -0
- package/src/cli/templates/app/src/localization/extensions.js +2 -0
- package/src/cli/templates/app/src/localization/index.js +44 -0
- package/src/cli/templates/app/src/localization/overrides.js +2 -0
- package/src/cli/templates/app/src/localization/translations.js +10 -0
- package/src/cli/templates/app/src/models/index.js +9 -0
- package/src/cli/templates/app/src/router/index.js +48 -0
- package/src/cli/templates/app/src/scss/theme.scss +18 -0
- package/src/cli/templates/app/src/server.js +68 -0
- package/src/cli/templates/app/src/store/index.js +9 -0
- package/src/cli/templates/docker-compose.yaml.mustache +47 -0
- package/src/cli/templates/nginx/Dockerfile +5 -0
- package/src/cli/templates/nginx/default.conf.mustache +55 -0
- package/src/cli/templates/public/favicon/.gitkeep +0 -0
- package/src/cli/templates/start-dev.sh.mustache +131 -0
- package/src/cli/templates/start-prod.sh.mustache +12 -0
- package/src/components/Button/Button.vue +61 -15
- package/src/components/Loader/Loader.vue +1 -1
- package/src/components/Tooltip/Tooltip.vue +31 -23
- package/src/modules/TASKS.MD +30 -1
- package/src/modules/auth/CLAUDE.md +381 -0
- package/src/modules/auth/FIXES.md +0 -38
- package/src/modules/auth/auth.client.js +4 -6
- package/src/modules/auth/auth.server.js +4 -15
- package/src/modules/auth/controllers/middlewares/authJwt.js +59 -17
- package/src/modules/auth/controllers/middlewares/index.js +4 -1
- package/src/modules/auth/controllers/middlewares/otp.middleware.js +166 -0
- package/src/modules/auth/controllers/middlewares/verifySignUp.js +0 -1
- package/src/modules/auth/controllers/middlewares/verifyUser.js +58 -11
- package/src/modules/auth/controllers/routes/auth.routes.js +48 -6
- package/src/modules/auth/controllers/routes/users.routes.js +29 -8
- package/src/modules/auth/controllers/services/auth.service.js +62 -12
- package/src/modules/auth/controllers/services/otp.service.js +109 -0
- package/src/modules/auth/controllers/services/users.service.js +46 -6
- package/src/modules/auth/models/otp.model.js +20 -0
- package/src/modules/auth/views/components/blocks/OtpDialog.vue +168 -0
- package/src/modules/auth/views/components/pages/Profile.vue +51 -18
- package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +199 -45
- package/src/modules/auth/views/components/pages/ResetPassword.vue +170 -132
- package/src/modules/auth/views/components/pages/SignIn.vue +2 -1
- package/src/modules/auth/views/components/pages/SignUp.vue +203 -147
- package/src/modules/auth/views/plugins/otp.plugin.js +104 -0
- package/src/modules/auth/views/router/auth.router.js +1 -24
- package/src/modules/auth/views/router/users.router.js +1 -12
- package/src/modules/auth/views/store/auth.js +0 -68
- package/src/modules/auth/views/store/users.js +6 -2
- package/src/modules/backoffice/backoffice.client.js +1 -25
- package/src/modules/backoffice/configs/navigation.backoffice.config.js +99 -0
- package/src/modules/backoffice/router/backoffice.router.js +8 -7
- package/src/modules/community/components/pages/BlogPost.vue +9 -1
- package/src/modules/core/controllers/classes/core.websocket.js +57 -6
- package/src/modules/core/controllers/middlewares/visitor.logger.js +49 -0
- package/src/modules/core/controllers/services/requests.service.js +53 -0
- package/src/modules/core/controllers/services/sessions.service.js +98 -0
- package/src/modules/core/controllers/services/visitors.service.js +102 -0
- package/src/modules/core/controllers/utils/mailing.js +16 -3
- package/src/modules/core/core.client.js +1 -0
- package/src/modules/core/core.server.js +45 -3
- package/src/modules/core/models/request.model.js +30 -0
- package/src/modules/core/models/session.model.js +43 -0
- package/src/modules/core/models/visitor.model.js +28 -0
- package/src/modules/core/views/classes/core.app.js +8 -3
- package/src/modules/core/views/components/elements/OnlineIndicator.vue +115 -0
- package/src/modules/core/views/components/layouts/App.vue +2 -2
- package/src/modules/core/views/components/layouts/Client.vue +444 -479
- package/src/modules/core/views/components/pages/404.vue +55 -3
- package/src/modules/core/views/store/core.store.js +1 -0
- package/src/modules/core/views/utils/vue-app-renderer.js +9 -1
- package/src/modules/orders/controllers/orders.controller.js +3 -3
- package/src/modules/pages/pages.router.js +4 -2
- package/src/modules/pages/views/router/pages.backoffice.router.js +4 -3
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/dist/_virtual/alignment-pattern.js +0 -5
- package/dist/_virtual/alignment-pattern.js.map +0 -1
- package/dist/_virtual/browser.js +0 -8
- package/dist/_virtual/browser.js.map +0 -1
- package/dist/_virtual/browser2.js +0 -5
- package/dist/_virtual/browser2.js.map +0 -1
- package/dist/_virtual/canvas.js +0 -5
- package/dist/_virtual/canvas.js.map +0 -1
- package/dist/_virtual/dijkstra.js +0 -5
- package/dist/_virtual/dijkstra.js.map +0 -1
- package/dist/_virtual/error-correction-code.js +0 -5
- package/dist/_virtual/error-correction-code.js.map +0 -1
- package/dist/_virtual/error-correction-level.js +0 -5
- package/dist/_virtual/error-correction-level.js.map +0 -1
- package/dist/_virtual/finder-pattern.js +0 -5
- package/dist/_virtual/finder-pattern.js.map +0 -1
- package/dist/_virtual/format-info.js +0 -5
- package/dist/_virtual/format-info.js.map +0 -1
- package/dist/_virtual/galois-field.js +0 -5
- package/dist/_virtual/galois-field.js.map +0 -1
- package/dist/_virtual/mask-pattern.js +0 -5
- package/dist/_virtual/mask-pattern.js.map +0 -1
- package/dist/_virtual/mode.js +0 -5
- package/dist/_virtual/mode.js.map +0 -1
- package/dist/_virtual/polynomial.js +0 -5
- package/dist/_virtual/polynomial.js.map +0 -1
- package/dist/_virtual/qrcode.js +0 -5
- package/dist/_virtual/qrcode.js.map +0 -1
- package/dist/_virtual/regex.js +0 -5
- package/dist/_virtual/regex.js.map +0 -1
- package/dist/_virtual/segments.js +0 -5
- package/dist/_virtual/segments.js.map +0 -1
- package/dist/_virtual/svg-tag.js +0 -5
- package/dist/_virtual/svg-tag.js.map +0 -1
- package/dist/_virtual/utils.js +0 -5
- package/dist/_virtual/utils.js.map +0 -1
- package/dist/_virtual/utils2.js +0 -5
- package/dist/_virtual/utils2.js.map +0 -1
- package/dist/_virtual/version-check.js +0 -5
- package/dist/_virtual/version-check.js.map +0 -1
- package/dist/_virtual/version.js +0 -5
- package/dist/_virtual/version.js.map +0 -1
- package/dist/index-_Edcmck_.js +0 -170
- package/dist/martyrs/dist/main-fmp55tJF.js.map +0 -1
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -1336
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js.map +0 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +0 -166
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +0 -118
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +0 -360
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/store/twofa.js +0 -40
- package/dist/martyrs/src/modules/auth/views/store/twofa.js.map +0 -1
- package/dist/martyrs/src/modules/backoffice/backoffice.router.js.map +0 -1
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +0 -150
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js.map +0 -1
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +0 -43
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +0 -47
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +0 -29
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +0 -89
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +0 -136
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +0 -238
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js +0 -9
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js +0 -134
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js.map +0 -1
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +0 -106
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +0 -79
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +0 -43
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -85
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +0 -40
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +0 -34
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +0 -36
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +0 -367
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +0 -52
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +0 -25
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +0 -24
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +0 -46
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +0 -149
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +0 -90
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +0 -41
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +0 -44
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +0 -279
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +0 -33
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +0 -201
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +0 -84
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +0 -107
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +0 -61
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +0 -64
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +0 -87
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js.map +0 -1
- package/dist/profile.schema-CjLOfG7b.js +0 -92
- package/src/modules/auth/controllers/middlewares/visitor.logger.js +0 -75
- package/src/modules/auth/controllers/routes/twofa.routes.js +0 -8
- package/src/modules/auth/controllers/services/twofa.service.js +0 -30
- package/src/modules/auth/models/request.model.js +0 -14
- package/src/modules/auth/models/visitor.model.js +0 -11
- package/src/modules/auth/views/components/pages/EnterCode.vue +0 -204
- package/src/modules/auth/views/components/pages/EnterPassword.vue +0 -123
- package/src/modules/auth/views/components/sections/ProfileEditCredentials.vue +0 -329
- package/src/modules/auth/views/store/twofa.js +0 -70
- package/src/modules/auth//320/220/320/240/320/245/320/230/320/242/320/225/320/232/320/242/320/243/320/240/320/220.md +0 -445
- package/src/modules/backoffice/backoffice.router.js +0 -69
- package/src/modules/backoffice/components/partials/Sidebar.vue +0 -165
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { onMounted, ref, createElementBlock, openBlock, createElementVNode, createCommentVNode, createVNode, toDisplayString, unref, withCtx, createTextVNode, Fragment, renderList, createBlock } from "vue";
|
|
2
|
-
import { useI18n } from "vue-i18n";
|
|
3
|
-
import Web3 from "web3";
|
|
4
|
-
import { state, actions } from "../../store/wallet.store.js";
|
|
5
|
-
import text from "../../localization/wallet.json.js";
|
|
6
|
-
import _sfc_main$3 from "../../../../../components/Popup/Popup.vue.js";
|
|
7
|
-
import _sfc_main$1 from "../../../../../components/Button/Button.vue2.js";
|
|
8
|
-
import "vue-router";
|
|
9
|
-
/* empty css */
|
|
10
|
-
/* empty css */
|
|
11
|
-
/* empty css */
|
|
12
|
-
import _sfc_main$2 from "../elements/ConnectMetamask.vue.js";
|
|
13
|
-
import _sfc_main$4 from "../blocks/CashDeposit.vue.js";
|
|
14
|
-
import _sfc_main$5 from "../blocks/CardDeposit.vue.js";
|
|
15
|
-
import _sfc_main$7 from "../blocks/CryptoDeposit.vue.js";
|
|
16
|
-
import _sfc_main$6 from "../blocks/CardBalanceReplenished.vue.js";
|
|
17
|
-
import CryptoDepositProcessing from "../blocks/CryptoDepositProcessing.vue.js";
|
|
18
|
-
const _hoisted_1 = { class: "pd-thin" };
|
|
19
|
-
const _hoisted_2 = { class: "bg-black t-white mn-b-thin radius-big pd-big" };
|
|
20
|
-
const _hoisted_3 = { class: "mn-b-medium" };
|
|
21
|
-
const _hoisted_4 = { class: "mn-b-semi t-transp p-medium" };
|
|
22
|
-
const _hoisted_5 = {
|
|
23
|
-
key: 0,
|
|
24
|
-
class: "gap-thin mn-b-thin flex-nowrap bg-black radius-extra t-white br-white-transp-10 br-1px flex-v-center flex pd-medium"
|
|
25
|
-
};
|
|
26
|
-
const _hoisted_6 = { class: "flex-v-center flex-nowrap flex mn-r-auto" };
|
|
27
|
-
const _hoisted_7 = {
|
|
28
|
-
key: 1,
|
|
29
|
-
class: "w-100 mn-b-semi flex-column flex pd-big radius-big bg-main t-black"
|
|
30
|
-
};
|
|
31
|
-
const _hoisted_8 = { class: "h1 mn-b-small" };
|
|
32
|
-
const _hoisted_9 = { class: "flex-v-center mn-b-small flex-nowrap flex pd-small bg-black-transp-5 radius-extra" };
|
|
33
|
-
const _hoisted_10 = {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "t-transp fw-medium"
|
|
36
|
-
};
|
|
37
|
-
const _hoisted_11 = {
|
|
38
|
-
key: 0,
|
|
39
|
-
class: "mn-b-semi cols-2 mobile:cols-1 gap-thin"
|
|
40
|
-
};
|
|
41
|
-
const _hoisted_12 = { class: "w-100 pd-medium flex-center flex flex-column radius-medium t-center bg-light" };
|
|
42
|
-
const _hoisted_13 = {
|
|
43
|
-
key: 0,
|
|
44
|
-
class: "mn-b-small"
|
|
45
|
-
};
|
|
46
|
-
const _hoisted_14 = {
|
|
47
|
-
key: 1,
|
|
48
|
-
class: "mn-b-small"
|
|
49
|
-
};
|
|
50
|
-
const _hoisted_15 = { class: "cols-3 mobile:cols-1 gap-thin" };
|
|
51
|
-
const _hoisted_16 = { class: "radius-medium bg-light" };
|
|
52
|
-
const _hoisted_17 = { class: "flex-nowrap br-b-1px br-black-transp-10 flex pd-medium" };
|
|
53
|
-
const _hoisted_18 = { class: "fw-semi mn-r-auto" };
|
|
54
|
-
const _hoisted_19 = { class: "pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main flex flex-center radius-extra fw-semi p-small" };
|
|
55
|
-
const _hoisted_20 = { class: "pd-medium" };
|
|
56
|
-
const _hoisted_21 = { class: "fw-regular mn-b-thin" };
|
|
57
|
-
const _hoisted_22 = {
|
|
58
|
-
key: 2,
|
|
59
|
-
class: "mn-b-small"
|
|
60
|
-
};
|
|
61
|
-
const _hoisted_23 = { class: "cols-3 mobile:cols-1 gap-thin" };
|
|
62
|
-
const _hoisted_24 = { class: "radius-medium bg-grey" };
|
|
63
|
-
const _hoisted_25 = { class: "flex-nowrap br-b-1px br-black-transp-10 flex pd-medium" };
|
|
64
|
-
const _hoisted_26 = { class: "fw-semi mn-r-auto" };
|
|
65
|
-
const _hoisted_27 = { class: "pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main flex flex-center radius-extra fw-semi p-small" };
|
|
66
|
-
const _hoisted_28 = { class: "pd-medium" };
|
|
67
|
-
const _hoisted_29 = { class: "fw-regular mn-b-thin" };
|
|
68
|
-
const _hoisted_30 = { key: 0 };
|
|
69
|
-
const _sfc_main = {
|
|
70
|
-
__name: "Wallet",
|
|
71
|
-
setup(__props) {
|
|
72
|
-
const { t } = useI18n({
|
|
73
|
-
useScope: "global",
|
|
74
|
-
...text
|
|
75
|
-
});
|
|
76
|
-
onMounted(() => {
|
|
77
|
-
window.ethereum.on("accountsChanged", (accounts) => {
|
|
78
|
-
if (accounts.length < 1) {
|
|
79
|
-
state.account = null;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
state.web3 = new Web3(window.ethereum || "http://localhost:8080");
|
|
83
|
-
actions.listRewards();
|
|
84
|
-
actions.tryReconnectWallet();
|
|
85
|
-
});
|
|
86
|
-
const isGetMorePopup = ref(false);
|
|
87
|
-
const currentMenuPopup = ref(0);
|
|
88
|
-
function switchGetMoreMenu(value) {
|
|
89
|
-
currentMenuPopup.value = value;
|
|
90
|
-
}
|
|
91
|
-
function openGetMorePopup() {
|
|
92
|
-
isGetMorePopup.value = true;
|
|
93
|
-
}
|
|
94
|
-
function closeGetMorePopup() {
|
|
95
|
-
isGetMorePopup.value = false;
|
|
96
|
-
currentMenuPopup.value = 0;
|
|
97
|
-
actions.stopTimer();
|
|
98
|
-
actions.disconnectWebSocket();
|
|
99
|
-
}
|
|
100
|
-
return (_ctx, _cache) => {
|
|
101
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
102
|
-
createElementVNode("section", _hoisted_2, [
|
|
103
|
-
createElementVNode("h1", _hoisted_3, toDisplayString(unref(t)("wallet.title")), 1),
|
|
104
|
-
createElementVNode("p", _hoisted_4, toDisplayString(unref(t)("wallet.subtitle")), 1),
|
|
105
|
-
unref(state).account ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
106
|
-
createElementVNode("div", _hoisted_6, [
|
|
107
|
-
createElementVNode("h2", null, toDisplayString(unref(state).tokenBalance) + " " + toDisplayString(unref(t)("wallet.token")), 1)
|
|
108
|
-
]),
|
|
109
|
-
createElementVNode("button", {
|
|
110
|
-
onClick: openGetMorePopup,
|
|
111
|
-
class: "ws-nowrap w-max bg-main fw-medium button"
|
|
112
|
-
}, "Get More"),
|
|
113
|
-
createVNode(_sfc_main$1, {
|
|
114
|
-
submit: unref(actions).collectRewards,
|
|
115
|
-
class: "w-max bg-white t-black fw-medium button"
|
|
116
|
-
}, {
|
|
117
|
-
default: withCtx(() => _cache[9] || (_cache[9] = [
|
|
118
|
-
createTextVNode(" Withdraw ")
|
|
119
|
-
])),
|
|
120
|
-
_: 1
|
|
121
|
-
}, 8, ["submit"])
|
|
122
|
-
])) : createCommentVNode("", true),
|
|
123
|
-
createVNode(_sfc_main$2, { class: "mn-b-thin radius-extra br-white-transp-10 br-1px w-100" }),
|
|
124
|
-
unref(state).account ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
125
|
-
_cache[12] || (_cache[12] = createElementVNode("p", { class: "t-transp fw-medium mn-b-thin" }, "You own:", -1)),
|
|
126
|
-
createElementVNode("p", _hoisted_8, toDisplayString(unref(state).share) + "%", 1),
|
|
127
|
-
_cache[13] || (_cache[13] = createElementVNode("p", { class: "t-white p-medium fw-medium mn-b-semi" }, "of all shares", -1)),
|
|
128
|
-
createElementVNode("div", _hoisted_9, [
|
|
129
|
-
unref(state).account ? (openBlock(), createElementBlock("p", _hoisted_10, [
|
|
130
|
-
_cache[10] || (_cache[10] = createElementVNode("span", { class: "uppercase p-small fw-medium t-transp" }, "Connected Metamask", -1)),
|
|
131
|
-
_cache[11] || (_cache[11] = createElementVNode("br", null, null, -1)),
|
|
132
|
-
createElementVNode("span", null, toDisplayString(unref(state).account), 1)
|
|
133
|
-
])) : createCommentVNode("", true),
|
|
134
|
-
unref(state).account ? (openBlock(), createElementBlock("button", {
|
|
135
|
-
key: 1,
|
|
136
|
-
onClick: _cache[0] || (_cache[0] = (...args) => unref(actions).disconnectWallet && unref(actions).disconnectWallet(...args)),
|
|
137
|
-
class: "mn-l-auto bg-red button"
|
|
138
|
-
}, " Disconnect Wallet ")) : createCommentVNode("", true)
|
|
139
|
-
])
|
|
140
|
-
])) : createCommentVNode("", true)
|
|
141
|
-
]),
|
|
142
|
-
!unref(state).account ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
143
|
-
_cache[14] || (_cache[14] = createElementVNode("div", { class: "w-100 pd-medium radius-medium t-center bg-light" }, [
|
|
144
|
-
createElementVNode("h3", { class: "mn-b-small" }, "Make first order and start earning Weeder Token"),
|
|
145
|
-
createElementVNode("button", { class: "mn-l-auto mn-r-auto bg-main button" }, "Explore marketplace")
|
|
146
|
-
], -1)),
|
|
147
|
-
createElementVNode("div", _hoisted_12, [
|
|
148
|
-
!unref(state).account ? (openBlock(), createElementBlock("h3", _hoisted_13, " Connect Metamask to withdrawal your earnings. ")) : createCommentVNode("", true),
|
|
149
|
-
!unref(state).account ? (openBlock(), createElementBlock("button", {
|
|
150
|
-
key: 1,
|
|
151
|
-
onClick: _cache[1] || (_cache[1] = (...args) => unref(actions).connectWallet && unref(actions).connectWallet(...args)),
|
|
152
|
-
class: "br-2px br-black-transp-10 t-black button"
|
|
153
|
-
}, " Connect Wallet ")) : createCommentVNode("", true)
|
|
154
|
-
])
|
|
155
|
-
])) : createCommentVNode("", true),
|
|
156
|
-
unref(state).rewards.length > 0 ? (openBlock(), createElementBlock("h2", _hoisted_14, "Latest Rewards ")) : createCommentVNode("", true),
|
|
157
|
-
createElementVNode("section", _hoisted_15, [
|
|
158
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(state).rewards, (income) => {
|
|
159
|
-
return openBlock(), createElementBlock("div", _hoisted_16, [
|
|
160
|
-
createElementVNode("div", _hoisted_17, [
|
|
161
|
-
createElementVNode("p", _hoisted_18, toDisplayString(income.amount) + " WDT", 1),
|
|
162
|
-
createElementVNode("span", _hoisted_19, toDisplayString(income.type === "blogpost" ? "Community Reward" : income.type), 1)
|
|
163
|
-
]),
|
|
164
|
-
createElementVNode("div", _hoisted_20, [
|
|
165
|
-
createElementVNode("h4", _hoisted_21, toDisplayString(income.name), 1)
|
|
166
|
-
])
|
|
167
|
-
]);
|
|
168
|
-
}), 256))
|
|
169
|
-
]),
|
|
170
|
-
unref(state).rewards.length > 0 ? (openBlock(), createElementBlock("h2", _hoisted_22, "Activity")) : createCommentVNode("", true),
|
|
171
|
-
createElementVNode("section", _hoisted_23, [
|
|
172
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(state).rewards, (income) => {
|
|
173
|
-
return openBlock(), createElementBlock("div", _hoisted_24, [
|
|
174
|
-
createElementVNode("div", _hoisted_25, [
|
|
175
|
-
createElementVNode("p", _hoisted_26, toDisplayString(income.amount) + " WDT", 1),
|
|
176
|
-
createElementVNode("span", _hoisted_27, toDisplayString(income.type === "blogpost" ? "Community Reward" : income.type), 1)
|
|
177
|
-
]),
|
|
178
|
-
createElementVNode("div", _hoisted_28, [
|
|
179
|
-
createElementVNode("h4", _hoisted_29, toDisplayString(income.name), 1)
|
|
180
|
-
])
|
|
181
|
-
]);
|
|
182
|
-
}), 256))
|
|
183
|
-
]),
|
|
184
|
-
createVNode(_sfc_main$3, {
|
|
185
|
-
onClosePopup: closeGetMorePopup,
|
|
186
|
-
isPopupOpen: isGetMorePopup.value,
|
|
187
|
-
class: "w-m-50r t-left pd-big bg-white radius-big"
|
|
188
|
-
}, {
|
|
189
|
-
default: withCtx(() => [
|
|
190
|
-
currentMenuPopup.value === 0 ? (openBlock(), createElementBlock("div", _hoisted_30, [
|
|
191
|
-
_cache[15] || (_cache[15] = createElementVNode("h2", { class: "mn-b-small t-center fw-bold" }, "Choose the way of deposit", -1)),
|
|
192
|
-
createElementVNode("button", {
|
|
193
|
-
class: "w-100 bg-white t-black pd-thin radius-medium h3 t-center br-2px br-black-transp-10 mn-t-small",
|
|
194
|
-
onClick: _cache[2] || (_cache[2] = ($event) => switchGetMoreMenu(1))
|
|
195
|
-
}, " CASH "),
|
|
196
|
-
createElementVNode("button", {
|
|
197
|
-
class: "w-100 bg-white t-black pd-thin radius-medium h3 t-center br-2px br-black-transp-10 mn-t-small",
|
|
198
|
-
onClick: _cache[3] || (_cache[3] = ($event) => switchGetMoreMenu(2))
|
|
199
|
-
}, " CARD "),
|
|
200
|
-
createElementVNode("button", {
|
|
201
|
-
class: "w-100 bg-white t-black pd-thin radius-medium h3 t-center br-2px br-black-transp-10 mn-t-small",
|
|
202
|
-
onClick: _cache[4] || (_cache[4] = ($event) => switchGetMoreMenu(4))
|
|
203
|
-
}, " CRYPTO ")
|
|
204
|
-
])) : createCommentVNode("", true),
|
|
205
|
-
currentMenuPopup.value === 1 ? (openBlock(), createBlock(_sfc_main$4, {
|
|
206
|
-
key: 1,
|
|
207
|
-
onBackSelection: _cache[5] || (_cache[5] = ($event) => switchGetMoreMenu(0))
|
|
208
|
-
})) : createCommentVNode("", true),
|
|
209
|
-
currentMenuPopup.value === 2 ? (openBlock(), createBlock(_sfc_main$5, {
|
|
210
|
-
key: 2,
|
|
211
|
-
onBackSelection: _cache[6] || (_cache[6] = ($event) => switchGetMoreMenu(0)),
|
|
212
|
-
onSwitchMenu: switchGetMoreMenu
|
|
213
|
-
})) : createCommentVNode("", true),
|
|
214
|
-
currentMenuPopup.value === 3 ? (openBlock(), createBlock(_sfc_main$6, {
|
|
215
|
-
key: 3,
|
|
216
|
-
onClose: closeGetMorePopup
|
|
217
|
-
})) : createCommentVNode("", true),
|
|
218
|
-
currentMenuPopup.value === 4 ? (openBlock(), createBlock(_sfc_main$7, {
|
|
219
|
-
key: 4,
|
|
220
|
-
onBackSelection: _cache[7] || (_cache[7] = ($event) => switchGetMoreMenu(0)),
|
|
221
|
-
onSwitchMenu: switchGetMoreMenu
|
|
222
|
-
})) : createCommentVNode("", true),
|
|
223
|
-
currentMenuPopup.value === 5 ? (openBlock(), createBlock(CryptoDepositProcessing, {
|
|
224
|
-
key: 5,
|
|
225
|
-
onBackSelection: _cache[8] || (_cache[8] = ($event) => switchGetMoreMenu(0)),
|
|
226
|
-
onSwitchMenu: switchGetMoreMenu
|
|
227
|
-
})) : createCommentVNode("", true)
|
|
228
|
-
]),
|
|
229
|
-
_: 1
|
|
230
|
-
}, 8, ["isPopupOpen"])
|
|
231
|
-
]);
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
export {
|
|
236
|
-
_sfc_main as default
|
|
237
|
-
};
|
|
238
|
-
//# sourceMappingURL=Wallet.vue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Wallet.vue.js","sources":["../../../../../../../../src/modules/wallet/views/components/pages/Wallet.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin\">\n <section class=\"bg-black t-white mn-b-thin radius-big pd-big\">\n <h1 class=\"mn-b-medium\">{{ t('wallet.title') }}</h1>\n\n <p class=\"mn-b-semi t-transp p-medium\">\n {{ t('wallet.subtitle') }}\n </p>\n\n <div \n v-if=\"state.account\"\n class=\"gap-thin mn-b-thin flex-nowrap bg-black radius-extra t-white br-white-transp-10 br-1px flex-v-center flex pd-medium\"\n >\n <div class=\"flex-v-center flex-nowrap flex mn-r-auto\">\n <!-- <img loading=\"lazy\" src=\"/logo/wdt.svg\" class=\"mn-r-thin i-big\"> -->\n <h2>{{state.tokenBalance}} {{ t('wallet.token') }}</h2>\n </div>\n\n <button @click=\"openGetMorePopup\" class=\"ws-nowrap w-max bg-main fw-medium button\">Get More</button>\n\n\n <Button \n :submit=\"actions.collectRewards\" \n class=\"w-max bg-white t-black fw-medium button\"\n >\n Withdraw\n </Button>\n </div>\n\n <ConnectMetamask class=\"mn-b-thin radius-extra br-white-transp-10 br-1px w-100\" />\n\n <div\n v-if=\"state.account\"\n class=\"w-100 mn-b-semi flex-column flex pd-big radius-big bg-main t-black\"\n >\n <p class=\"t-transp fw-medium mn-b-thin\">You own:</p>\n <p class=\"h1 mn-b-small\">{{state.share}}%</p>\n <p class=\"t-white p-medium fw-medium mn-b-semi\">of all shares</p>\n\n <div\n class=\"flex-v-center mn-b-small flex-nowrap flex pd-small bg-black-transp-5 radius-extra\"\n >\n <!-- <img loading=\"lazy\" src=\"@/assets/icons/metamask.svg\" class=\"mn-r-small i-big\" > -->\n \n <p v-if=\"state.account\" class=\"t-transp fw-medium \">\n <span class=\"uppercase p-small fw-medium t-transp\">Connected Metamask</span><br>\n <span>{{state.account}}</span>\n </p>\n\n <button\n v-if=\"state.account\"\n @click=\"actions.disconnectWallet\"\n class=\"mn-l-auto bg-red button\"\n >\n Disconnect Wallet\n </button>\n </div>\n </div>\n\n </section>\n\n <div v-if=\"!state.account\" class=\"mn-b-semi cols-2 mobile:cols-1 gap-thin\">\n <div\n class=\"w-100 pd-medium radius-medium t-center bg-light\"\n >\n <h3 class=\"mn-b-small\">Make first order and start earning Weeder Token</h3>\n <button class=\"mn-l-auto mn-r-auto bg-main button\">Explore marketplace</button>\n </div>\n\n <div\n class=\"w-100 pd-medium flex-center flex flex-column radius-medium t-center bg-light\"\n >\n <h3 \n v-if=\"!state.account\"\n class=\"mn-b-small\"\n >\n Connect Metamask to withdrawal your earnings.\n </h3>\n\n <button\n v-if=\"!state.account\"\n @click=\"actions.connectWallet\"\n class=\"br-2px br-black-transp-10 t-black button\"\n >\n Connect Wallet\n </button>\n </div>\n </div>\n\n <h2 class=\"mn-b-small\" v-if=\"state.rewards.length > 0\">Latest Rewards </h2>\n\n <section class=\"cols-3 mobile:cols-1 gap-thin\">\n <div \n class=\"radius-medium bg-light\"\n v-for=\"income in state.rewards\"\n > \n <div class=\"flex-nowrap br-b-1px br-black-transp-10 flex pd-medium\">\n <!-- <img loading=\"lazy\" src=\"/logo/wdt-plus.svg\" class=\"mn-r-thin i-medium\"> -->\n <p class=\"fw-semi mn-r-auto\">{{income.amount}} WDT</p>\n \n <span class=\"pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main flex flex-center radius-extra fw-semi p-small\">{{income.type === 'blogpost' ? 'Community Reward' : income.type}}</span>\n </div>\n\n <div class=\"pd-medium\">\n <h4 class=\"fw-regular mn-b-thin\">{{income.name}}</h4>\n <!-- <p class=\"p-small\">{{income.content[0].content}}</p> -->\n </div>\n\n </div>\n\n\n </section>\n\n <h2 class=\"mn-b-small\" v-if=\"state.rewards.length > 0\">Activity</h2>\n\n <section class=\"cols-3 mobile:cols-1 gap-thin\">\n <div \n class=\"radius-medium bg-grey\"\n v-for=\"income in state.rewards\"\n > \n <div class=\"flex-nowrap br-b-1px br-black-transp-10 flex pd-medium\">\n <!-- <img loading=\"lazy\" src=\"/logo/wdt-plus.svg\" class=\"mn-r-thin i-medium\"> -->\n <p class=\"fw-semi mn-r-auto\">{{income.amount}} WDT</p>\n \n <span class=\"pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main flex flex-center radius-extra fw-semi p-small\">{{income.type === 'blogpost' ? 'Community Reward' : income.type}}</span>\n </div>\n\n <div class=\"pd-medium\">\n <h4 class=\"fw-regular mn-b-thin\">{{income.name}}</h4>\n <!-- <p class=\"p-small\">{{income.content[0].content}}</p> -->\n </div>\n </div>\n </section>\n\n <Popup \n @close-popup=\"closeGetMorePopup\" \n :isPopupOpen=\"isGetMorePopup\"\n class=\"w-m-50r t-left pd-big bg-white radius-big\"\n >\n <div\n v-if=\"currentMenuPopup === 0\"\n >\n <h2 class=\"mn-b-small t-center fw-bold\">Choose the way of deposit</h2>\n\n <button\n class=\"w-100 bg-white t-black pd-thin radius-medium h3 t-center br-2px br-black-transp-10 mn-t-small\"\n @click=\"switchGetMoreMenu(1)\"\n >\n CASH\n </button>\n\n <button\n class=\"w-100 bg-white t-black pd-thin radius-medium h3 t-center br-2px br-black-transp-10 mn-t-small\"\n @click=\"switchGetMoreMenu(2)\"\n >\n CARD\n </button>\n\n <button\n class=\"w-100 bg-white t-black pd-thin radius-medium h3 t-center br-2px br-black-transp-10 mn-t-small\"\n @click=\"switchGetMoreMenu(4)\"\n >\n CRYPTO\n </button>\n </div>\n\n <CashDepositMenu\n v-if=\"currentMenuPopup === 1\"\n @back-selection=\"switchGetMoreMenu(0)\"\n />\n\n <CardDepositMenu\n v-if=\"currentMenuPopup === 2\"\n @back-selection=\"switchGetMoreMenu(0)\"\n @switch-menu=\"switchGetMoreMenu\"\n />\n\n <CardBalanceReplenished\n v-if=\"currentMenuPopup === 3\"\n @close=\"closeGetMorePopup\"\n />\n\n <CryptoDepositMenu\n v-if=\"currentMenuPopup === 4\"\n @back-selection=\"switchGetMoreMenu(0)\"\n @switch-menu=\"switchGetMoreMenu\"\n />\n\n <CryptoDepositProcessing\n v-if=\"currentMenuPopup === 5\"\n @back-selection=\"switchGetMoreMenu(0)\"\n @switch-menu=\"switchGetMoreMenu\"\n />\n </Popup>\n </div>\n</template>\n\n<script setup>\n import { onMounted, ref } from 'vue';\n import { useI18n } from 'vue-i18n'\n import Web3 from 'web3';\n\n import { state, actions } from '@martyrs/src/modules/wallet/views/store/wallet.store';\n\n import text from '@martyrs/src/modules/wallet/views/localization/wallet.json'\n\n const { t } = useI18n({\n useScope: 'global',\n ...text\n })\n\n import Popup from '@martyrs/src/components/Popup/Popup.vue';\n import Button from '@martyrs/src/components/Button/Button.vue';\n\n import CardBlogpost from '@martyrs/src/modules/community/components/blocks/CardBlogpost.vue';\n\n import ConnectMetamask from '@martyrs/src/modules/wallet/views/components/elements/ConnectMetamask.vue';\n\n import CashDepositMenu from '@martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue';\n import CardDepositMenu from '@martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue';\n import CryptoDepositMenu from '@martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue';\n import CardBalanceReplenished from '@martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue';\n import CryptoDepositProcessing from '@martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue';\n\n\n\n onMounted(() => {\n // User has disconnected metamask from extension\n window.ethereum.on('accountsChanged', (accounts) => {\n if (accounts.length < 1) {\n state.account = null;\n }\n });\n\n state.web3 = new Web3(window.ethereum || 'http://localhost:8080');\n\n actions.listRewards();\n actions.tryReconnectWallet();\n });\n\n // /////////////////////////////////////////\n // GetMore Popup\n // /////////////////////////////////////////\n const isGetMorePopup = ref(false)\n const currentMenuPopup = ref(0)\n\n function switchGetMoreMenu(value) {\n currentMenuPopup.value = value;\n }\n\n function openGetMorePopup() {\n isGetMorePopup.value = true;\n }\n function closeGetMorePopup() {\n isGetMorePopup.value = false;\n currentMenuPopup.value = 0;\n actions.stopTimer();\n actions.disconnectWebSocket();\n }\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8ME,UAAM,EAAE,EAAC,IAAK,QAAQ;AAAA,MACpB,UAAU;AAAA,MACV,GAAG;AAAA,IACP,CAAG;AAiBD,cAAU,MAAM;AAEd,aAAO,SAAS,GAAG,mBAAmB,CAAC,aAAa;AAClD,YAAI,SAAS,SAAS,GAAG;AACvB,gBAAM,UAAU;AAAA,QAClB;AAAA,MACF,CAAC;AAED,YAAM,OAAO,IAAI,KAAK,OAAO,YAAY,uBAAuB;AAEhE,cAAQ,YAAW;AACnB,cAAQ,mBAAkB;AAAA,IAC5B,CAAC;AAKD,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,mBAAmB,IAAI,CAAC;AAE9B,aAAS,kBAAkB,OAAO;AAChC,uBAAiB,QAAQ;AAAA,IAC3B;AAEA,aAAS,mBAAmB;AAC1B,qBAAe,QAAQ;AAAA,IACzB;AACA,aAAS,oBAAoB;AAC3B,qBAAe,QAAQ;AACvB,uBAAiB,QAAQ;AACzB,cAAQ,UAAS;AACjB,cAAQ,oBAAmB;AAAA,IAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const messages = { "en": { "wallet": { "title": "Your Wallet", "subtitle": "Earn WDT by purchasing our weed or contributing to the community.", "token": "WDT", "pay": "pay", "youReceived": "you received", "enterAmount": "enter amount to top up", "backToWallet": "back to wallet", "backToSelection": "back to selection", "balanceReplenished": "balance replenished", "depositWithCrypto": "deposit with crypto" } }, "ru": { "wallet": { "title": "Ваш Кошелек", "subtitle": "Зарабатывайте WDT, покупая товары или внося вклад в сообщество.", "pay": "купить", "youReceived": "вы пополнили на сумму", "enterAmount": "введите сумму для пополнения", "backToWallet": "назад к кошельку", "backToSelection": "назад к списку", "balanceReplenished": "баланс пополнен", "depositWithCrypto": "пополнение криптовалютой" } } };
|
|
2
|
-
const text = {
|
|
3
|
-
messages
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
text as default,
|
|
7
|
-
messages
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=wallet.json.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { BigNumber } from "../../../../../node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js";
|
|
3
|
-
import { reactive } from "vue";
|
|
4
|
-
const API_CRYPTO_PATH = "/api/crypto";
|
|
5
|
-
const WDT_SUPPLY = 2e7;
|
|
6
|
-
const $axios = axios.create({ baseURL: process.env.API_URL, withCredentials: true });
|
|
7
|
-
const state = reactive({
|
|
8
|
-
rewards: [],
|
|
9
|
-
tokenBalance: "0",
|
|
10
|
-
share: "0",
|
|
11
|
-
account: null,
|
|
12
|
-
web3: null,
|
|
13
|
-
depositInfo: null,
|
|
14
|
-
depositRequestIsActive: false,
|
|
15
|
-
websocket: null,
|
|
16
|
-
config: null,
|
|
17
|
-
chosenNetwork: null
|
|
18
|
-
});
|
|
19
|
-
const timer = reactive({ remaining: 0, interval: null });
|
|
20
|
-
const actions = {
|
|
21
|
-
loadConfig: async () => {
|
|
22
|
-
await $axios.get(`${API_CRYPTO_PATH}/deposit/config`).then((r) => {
|
|
23
|
-
state.config = r.data;
|
|
24
|
-
state.chosenNetwork = {
|
|
25
|
-
name: `polygon-WDT`,
|
|
26
|
-
value: {
|
|
27
|
-
token: state.config.polygon.tokens.WDT,
|
|
28
|
-
network: "polygon"
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}).catch((e) => console.error(e));
|
|
32
|
-
},
|
|
33
|
-
connectWebSocket: () => {
|
|
34
|
-
state.websocket = new WebSocket(process.env.WSS_URL);
|
|
35
|
-
state.websocket.onmessage = (event) => {
|
|
36
|
-
const message = JSON.parse(event.data);
|
|
37
|
-
if (message.id === state.depositInfo.id) {
|
|
38
|
-
const confirmations = state.depositInfo.confirmations;
|
|
39
|
-
state.depositInfo = message;
|
|
40
|
-
state.depositInfo.confirmations = confirmations;
|
|
41
|
-
}
|
|
42
|
-
if (message.hash === state.depositInfo.tx.hash) {
|
|
43
|
-
state.depositInfo.confirmations = message.confirmations;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
state.websocket.onerror = (err) => console.error(err);
|
|
47
|
-
},
|
|
48
|
-
disconnectWebSocket: () => {
|
|
49
|
-
if (state.websocket) {
|
|
50
|
-
state.websocket.close();
|
|
51
|
-
state.websocket = null;
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
listRewards: async () => {
|
|
55
|
-
try {
|
|
56
|
-
const r = await $axios.get(`${API_CRYPTO_PATH}/rewards`);
|
|
57
|
-
state.rewards = r.data;
|
|
58
|
-
state.tokenBalance = r.data.reduce((acc, v) => acc.plus(v.amount), new BigNumber("0")).toString();
|
|
59
|
-
state.share = new BigNumber(state.tokenBalance).div(WDT_SUPPLY).multipliedBy(100).toFormat(6);
|
|
60
|
-
} catch (e) {
|
|
61
|
-
console.error(e);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
collectRewards: async () => {
|
|
65
|
-
try {
|
|
66
|
-
await $axios.post(`${API_CRYPTO_PATH}/collect`, { recipient: state.account });
|
|
67
|
-
await actions.listRewards();
|
|
68
|
-
} catch (e) {
|
|
69
|
-
console.error(e);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
disconnectWallet: async () => {
|
|
73
|
-
try {
|
|
74
|
-
await window.ethereum.request({
|
|
75
|
-
method: "wallet_revokePermissions",
|
|
76
|
-
params: [{ eth_accounts: {} }]
|
|
77
|
-
});
|
|
78
|
-
state.account = null;
|
|
79
|
-
} catch (e) {
|
|
80
|
-
console.error(e);
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
connectWallet: async () => {
|
|
84
|
-
try {
|
|
85
|
-
const accounts = await state.web3.eth.requestAccounts();
|
|
86
|
-
state.account = accounts[0];
|
|
87
|
-
} catch (e) {
|
|
88
|
-
console.error(e);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
tryReconnectWallet: async () => {
|
|
92
|
-
try {
|
|
93
|
-
const a = await state.web3.eth.getAccounts();
|
|
94
|
-
if (a.length > 0) {
|
|
95
|
-
await actions.connectWallet();
|
|
96
|
-
}
|
|
97
|
-
} catch (e) {
|
|
98
|
-
console.error(e);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
requestCryptoDeposit: async (amount) => {
|
|
102
|
-
state.depositRequestIsActive = true;
|
|
103
|
-
await $axios.post(`${API_CRYPTO_PATH}/deposit`, {
|
|
104
|
-
network: state.chosenNetwork.value.network,
|
|
105
|
-
amount: new BigNumber(amount).shiftedBy(8).toString(),
|
|
106
|
-
token: state.chosenNetwork.value.token
|
|
107
|
-
}).then((r) => {
|
|
108
|
-
state.depositInfo = r.data;
|
|
109
|
-
const createTimestamp = new Date(r.data.createdAt).getTime();
|
|
110
|
-
const dead = createTimestamp + state.config[state.chosenNetwork.value.network].waitingTime;
|
|
111
|
-
timer.remaining = Math.floor((dead - Date.now()) / 1e3);
|
|
112
|
-
timer.interval = setInterval(() => {
|
|
113
|
-
timer.remaining -= 1;
|
|
114
|
-
if (timer.remaining === 0) {
|
|
115
|
-
clearInterval(timer.interval);
|
|
116
|
-
}
|
|
117
|
-
}, 1e3);
|
|
118
|
-
}).catch((e) => console.error(e));
|
|
119
|
-
state.depositRequestIsActive = false;
|
|
120
|
-
actions.connectWebSocket();
|
|
121
|
-
},
|
|
122
|
-
stopTimer: () => {
|
|
123
|
-
clearInterval(timer.interval);
|
|
124
|
-
},
|
|
125
|
-
cancelDeposit: async () => {
|
|
126
|
-
await $axios.post(`${API_CRYPTO_PATH}/deposit/cancel`, { id: state.depositInfo.id }).then(() => actions.stopTimer()).then(() => actions.disconnectWebSocket()).catch((e) => console.error(e));
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
export {
|
|
130
|
-
actions,
|
|
131
|
-
state,
|
|
132
|
-
timer
|
|
133
|
-
};
|
|
134
|
-
//# sourceMappingURL=wallet.store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.store.js","sources":["../../../../../../../src/modules/wallet/views/store/wallet.store.js"],"sourcesContent":["import axios from 'axios';\nimport { BigNumber } from 'bignumber.js';\nimport { reactive } from 'vue';\n\nconst API_CRYPTO_PATH = '/api/crypto';\nconst WDT_SUPPLY = 20_000_000;\n\nconst $axios = axios.create({ baseURL: process.env.API_URL, withCredentials: true });\n\nconst state = reactive({\n rewards: [],\n tokenBalance: '0',\n share: '0',\n account: null,\n web3: null,\n depositInfo: null,\n depositRequestIsActive: false,\n websocket: null,\n config: null,\n chosenNetwork: null,\n});\n\nconst timer = reactive({ remaining: 0, interval: null });\n\nconst actions = {\n loadConfig: async () => {\n await $axios\n .get(`${API_CRYPTO_PATH}/deposit/config`)\n .then(r => {\n state.config = r.data;\n state.chosenNetwork = {\n name: `polygon-WDT`,\n value: {\n token: state.config.polygon.tokens.WDT,\n network: 'polygon',\n },\n };\n })\n .catch(e => console.error(e));\n },\n\n connectWebSocket: () => {\n state.websocket = new WebSocket(process.env.WSS_URL);\n\n state.websocket.onmessage = event => {\n const message = JSON.parse(event.data);\n\n if (message.id === state.depositInfo.id) {\n const confirmations = state.depositInfo.confirmations;\n\n state.depositInfo = message;\n state.depositInfo.confirmations = confirmations;\n }\n\n if (message.hash === state.depositInfo.tx.hash) {\n state.depositInfo.confirmations = message.confirmations;\n }\n };\n\n state.websocket.onerror = err => console.error(err);\n },\n\n disconnectWebSocket: () => {\n if (state.websocket) {\n state.websocket.close();\n state.websocket = null;\n }\n },\n\n listRewards: async () => {\n try {\n const r = await $axios.get(`${API_CRYPTO_PATH}/rewards`);\n\n state.rewards = r.data;\n state.tokenBalance = r.data.reduce((acc, v) => acc.plus(v.amount), new BigNumber('0')).toString();\n\n state.share = new BigNumber(state.tokenBalance).div(WDT_SUPPLY).multipliedBy(100).toFormat(6);\n } catch (e) {\n console.error(e);\n }\n },\n\n collectRewards: async () => {\n try {\n await $axios.post(`${API_CRYPTO_PATH}/collect`, { recipient: state.account });\n await actions.listRewards();\n } catch (e) {\n console.error(e);\n }\n },\n\n disconnectWallet: async () => {\n try {\n await window.ethereum.request({\n method: 'wallet_revokePermissions',\n params: [{ eth_accounts: {} }],\n });\n state.account = null;\n } catch (e) {\n console.error(e);\n }\n },\n\n connectWallet: async () => {\n try {\n const accounts = await state.web3.eth.requestAccounts();\n state.account = accounts[0];\n } catch (e) {\n console.error(e);\n }\n },\n\n tryReconnectWallet: async () => {\n try {\n const a = await state.web3.eth.getAccounts();\n if (a.length > 0) {\n await actions.connectWallet();\n }\n } catch (e) {\n console.error(e);\n }\n },\n\n requestCryptoDeposit: async amount => {\n state.depositRequestIsActive = true;\n\n await $axios\n .post(`${API_CRYPTO_PATH}/deposit`, {\n network: state.chosenNetwork.value.network,\n amount: new BigNumber(amount).shiftedBy(8).toString(),\n token: state.chosenNetwork.value.token,\n })\n .then(r => {\n state.depositInfo = r.data;\n\n const createTimestamp = new Date(r.data.createdAt).getTime();\n const dead = createTimestamp + state.config[state.chosenNetwork.value.network].waitingTime;\n timer.remaining = Math.floor((dead - Date.now()) / 1000);\n\n timer.interval = setInterval(() => {\n timer.remaining -= 1;\n\n if (timer.remaining === 0) {\n clearInterval(timer.interval);\n }\n }, 1000);\n })\n .catch(e => console.error(e));\n\n state.depositRequestIsActive = false;\n\n actions.connectWebSocket();\n },\n\n stopTimer: () => {\n clearInterval(timer.interval);\n },\n\n cancelDeposit: async () => {\n await $axios\n .post(`${API_CRYPTO_PATH}/deposit/cancel`, { id: state.depositInfo.id })\n .then(() => actions.stopTimer())\n .then(() => actions.disconnectWebSocket())\n .catch(e => console.error(e));\n },\n};\n\nexport { actions, state, timer };\n"],"names":[],"mappings":";;;AAIA,MAAM,kBAAkB;AACxB,MAAM,aAAa;AAEnB,MAAM,SAAS,MAAM,OAAO,EAAE,SAAS,QAAQ,IAAI,SAAS,iBAAiB,MAAM;AAE9E,MAAC,QAAQ,SAAS;AAAA,EACrB,SAAS,CAAA;AAAA,EACT,cAAc;AAAA,EACd,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AAAA,EACb,wBAAwB;AAAA,EACxB,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,eAAe;AACjB,CAAC;AAEI,MAAC,QAAQ,SAAS,EAAE,WAAW,GAAG,UAAU,KAAI,CAAE;AAElD,MAAC,UAAU;AAAA,EACd,YAAY,YAAY;AACtB,UAAM,OACH,IAAI,GAAG,eAAe,iBAAiB,EACvC,KAAK,OAAK;AACT,YAAM,SAAS,EAAE;AACjB,YAAM,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN,OAAO;AAAA,UACL,OAAO,MAAM,OAAO,QAAQ,OAAO;AAAA,UACnC,SAAS;AAAA,QACrB;AAAA,MACA;AAAA,IACM,CAAC,EACA,MAAM,OAAK,QAAQ,MAAM,CAAC,CAAC;AAAA,EAChC;AAAA,EAEA,kBAAkB,MAAM;AACtB,UAAM,YAAY,IAAI,UAAU,QAAQ,IAAI,OAAO;AAEnD,UAAM,UAAU,YAAY,WAAS;AACnC,YAAM,UAAU,KAAK,MAAM,MAAM,IAAI;AAErC,UAAI,QAAQ,OAAO,MAAM,YAAY,IAAI;AACvC,cAAM,gBAAgB,MAAM,YAAY;AAExC,cAAM,cAAc;AACpB,cAAM,YAAY,gBAAgB;AAAA,MACpC;AAEA,UAAI,QAAQ,SAAS,MAAM,YAAY,GAAG,MAAM;AAC9C,cAAM,YAAY,gBAAgB,QAAQ;AAAA,MAC5C;AAAA,IACF;AAEA,UAAM,UAAU,UAAU,SAAO,QAAQ,MAAM,GAAG;AAAA,EACpD;AAAA,EAEA,qBAAqB,MAAM;AACzB,QAAI,MAAM,WAAW;AACnB,YAAM,UAAU,MAAK;AACrB,YAAM,YAAY;AAAA,IACpB;AAAA,EACF;AAAA,EAEA,aAAa,YAAY;AACvB,QAAI;AACF,YAAM,IAAI,MAAM,OAAO,IAAI,GAAG,eAAe,UAAU;AAEvD,YAAM,UAAU,EAAE;AAClB,YAAM,eAAe,EAAE,KAAK,OAAO,CAAC,KAAK,MAAM,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,UAAU,GAAG,CAAC,EAAE,SAAQ;AAE/F,YAAM,QAAQ,IAAI,UAAU,MAAM,YAAY,EAAE,IAAI,UAAU,EAAE,aAAa,GAAG,EAAE,SAAS,CAAC;AAAA,IAC9F,SAAS,GAAG;AACV,cAAQ,MAAM,CAAC;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,gBAAgB,YAAY;AAC1B,QAAI;AACF,YAAM,OAAO,KAAK,GAAG,eAAe,YAAY,EAAE,WAAW,MAAM,SAAS;AAC5E,YAAM,QAAQ,YAAW;AAAA,IAC3B,SAAS,GAAG;AACV,cAAQ,MAAM,CAAC;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,kBAAkB,YAAY;AAC5B,QAAI;AACF,YAAM,OAAO,SAAS,QAAQ;AAAA,QAC5B,QAAQ;AAAA,QACR,QAAQ,CAAC,EAAE,cAAc,CAAA,GAAI;AAAA,MACrC,CAAO;AACD,YAAM,UAAU;AAAA,IAClB,SAAS,GAAG;AACV,cAAQ,MAAM,CAAC;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,eAAe,YAAY;AACzB,QAAI;AACF,YAAM,WAAW,MAAM,MAAM,KAAK,IAAI,gBAAe;AACrD,YAAM,UAAU,SAAS,CAAC;AAAA,IAC5B,SAAS,GAAG;AACV,cAAQ,MAAM,CAAC;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,oBAAoB,YAAY;AAC9B,QAAI;AACF,YAAM,IAAI,MAAM,MAAM,KAAK,IAAI,YAAW;AAC1C,UAAI,EAAE,SAAS,GAAG;AAChB,cAAM,QAAQ,cAAa;AAAA,MAC7B;AAAA,IACF,SAAS,GAAG;AACV,cAAQ,MAAM,CAAC;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,sBAAsB,OAAM,WAAU;AACpC,UAAM,yBAAyB;AAE/B,UAAM,OACH,KAAK,GAAG,eAAe,YAAY;AAAA,MAClC,SAAS,MAAM,cAAc,MAAM;AAAA,MACnC,QAAQ,IAAI,UAAU,MAAM,EAAE,UAAU,CAAC,EAAE,SAAQ;AAAA,MACnD,OAAO,MAAM,cAAc,MAAM;AAAA,IACzC,CAAO,EACA,KAAK,OAAK;AACT,YAAM,cAAc,EAAE;AAEtB,YAAM,kBAAkB,IAAI,KAAK,EAAE,KAAK,SAAS,EAAE,QAAO;AAC1D,YAAM,OAAO,kBAAkB,MAAM,OAAO,MAAM,cAAc,MAAM,OAAO,EAAE;AAC/E,YAAM,YAAY,KAAK,OAAO,OAAO,KAAK,IAAG,KAAM,GAAI;AAEvD,YAAM,WAAW,YAAY,MAAM;AACjC,cAAM,aAAa;AAEnB,YAAI,MAAM,cAAc,GAAG;AACzB,wBAAc,MAAM,QAAQ;AAAA,QAC9B;AAAA,MACF,GAAG,GAAI;AAAA,IACT,CAAC,EACA,MAAM,OAAK,QAAQ,MAAM,CAAC,CAAC;AAE9B,UAAM,yBAAyB;AAE/B,YAAQ,iBAAgB;AAAA,EAC1B;AAAA,EAEA,WAAW,MAAM;AACf,kBAAc,MAAM,QAAQ;AAAA,EAC9B;AAAA,EAEA,eAAe,YAAY;AACzB,UAAM,OACH,KAAK,GAAG,eAAe,mBAAmB,EAAE,IAAI,MAAM,YAAY,GAAE,CAAE,EACtE,KAAK,MAAM,QAAQ,UAAS,CAAE,EAC9B,KAAK,MAAM,QAAQ,oBAAmB,CAAE,EACxC,MAAM,OAAK,QAAQ,MAAM,CAAC,CAAC;AAAA,EAChC;AACF;"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { __module as dijkstra } from "../../../../../_virtual/dijkstra.js";
|
|
2
|
-
var hasRequiredDijkstra;
|
|
3
|
-
function requireDijkstra() {
|
|
4
|
-
if (hasRequiredDijkstra) return dijkstra.exports;
|
|
5
|
-
hasRequiredDijkstra = 1;
|
|
6
|
-
(function(module) {
|
|
7
|
-
var dijkstra2 = {
|
|
8
|
-
single_source_shortest_paths: function(graph, s, d) {
|
|
9
|
-
var predecessors = {};
|
|
10
|
-
var costs = {};
|
|
11
|
-
costs[s] = 0;
|
|
12
|
-
var open = dijkstra2.PriorityQueue.make();
|
|
13
|
-
open.push(s, 0);
|
|
14
|
-
var closest, u, v, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit;
|
|
15
|
-
while (!open.empty()) {
|
|
16
|
-
closest = open.pop();
|
|
17
|
-
u = closest.value;
|
|
18
|
-
cost_of_s_to_u = closest.cost;
|
|
19
|
-
adjacent_nodes = graph[u] || {};
|
|
20
|
-
for (v in adjacent_nodes) {
|
|
21
|
-
if (adjacent_nodes.hasOwnProperty(v)) {
|
|
22
|
-
cost_of_e = adjacent_nodes[v];
|
|
23
|
-
cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
|
|
24
|
-
cost_of_s_to_v = costs[v];
|
|
25
|
-
first_visit = typeof costs[v] === "undefined";
|
|
26
|
-
if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
|
|
27
|
-
costs[v] = cost_of_s_to_u_plus_cost_of_e;
|
|
28
|
-
open.push(v, cost_of_s_to_u_plus_cost_of_e);
|
|
29
|
-
predecessors[v] = u;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (typeof d !== "undefined" && typeof costs[d] === "undefined") {
|
|
35
|
-
var msg = ["Could not find a path from ", s, " to ", d, "."].join("");
|
|
36
|
-
throw new Error(msg);
|
|
37
|
-
}
|
|
38
|
-
return predecessors;
|
|
39
|
-
},
|
|
40
|
-
extract_shortest_path_from_predecessor_list: function(predecessors, d) {
|
|
41
|
-
var nodes = [];
|
|
42
|
-
var u = d;
|
|
43
|
-
while (u) {
|
|
44
|
-
nodes.push(u);
|
|
45
|
-
predecessors[u];
|
|
46
|
-
u = predecessors[u];
|
|
47
|
-
}
|
|
48
|
-
nodes.reverse();
|
|
49
|
-
return nodes;
|
|
50
|
-
},
|
|
51
|
-
find_path: function(graph, s, d) {
|
|
52
|
-
var predecessors = dijkstra2.single_source_shortest_paths(graph, s, d);
|
|
53
|
-
return dijkstra2.extract_shortest_path_from_predecessor_list(
|
|
54
|
-
predecessors,
|
|
55
|
-
d
|
|
56
|
-
);
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* A very naive priority queue implementation.
|
|
60
|
-
*/
|
|
61
|
-
PriorityQueue: {
|
|
62
|
-
make: function(opts) {
|
|
63
|
-
var T = dijkstra2.PriorityQueue, t = {}, key;
|
|
64
|
-
opts = opts || {};
|
|
65
|
-
for (key in T) {
|
|
66
|
-
if (T.hasOwnProperty(key)) {
|
|
67
|
-
t[key] = T[key];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
t.queue = [];
|
|
71
|
-
t.sorter = opts.sorter || T.default_sorter;
|
|
72
|
-
return t;
|
|
73
|
-
},
|
|
74
|
-
default_sorter: function(a, b) {
|
|
75
|
-
return a.cost - b.cost;
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Add a new item to the queue and ensure the highest priority element
|
|
79
|
-
* is at the front of the queue.
|
|
80
|
-
*/
|
|
81
|
-
push: function(value, cost) {
|
|
82
|
-
var item = { value, cost };
|
|
83
|
-
this.queue.push(item);
|
|
84
|
-
this.queue.sort(this.sorter);
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* Return the highest priority element in the queue.
|
|
88
|
-
*/
|
|
89
|
-
pop: function() {
|
|
90
|
-
return this.queue.shift();
|
|
91
|
-
},
|
|
92
|
-
empty: function() {
|
|
93
|
-
return this.queue.length === 0;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
{
|
|
98
|
-
module.exports = dijkstra2;
|
|
99
|
-
}
|
|
100
|
-
})(dijkstra);
|
|
101
|
-
return dijkstra.exports;
|
|
102
|
-
}
|
|
103
|
-
export {
|
|
104
|
-
requireDijkstra as __require
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=dijkstra.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dijkstra.js","sources":["../../../../../../../node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js"],"sourcesContent":["'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin <self@wyattbaldwin.com>\n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n single_source_shortest_paths: function(graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n\n var closest,\n u, v,\n cost_of_s_to_u,\n adjacent_nodes,\n cost_of_e,\n cost_of_s_to_u_plus_cost_of_e,\n cost_of_s_to_v,\n first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = (typeof costs[v] === 'undefined');\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n\n return predecessors;\n },\n\n extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n\n find_path: function(graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(\n predecessors, d);\n },\n\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {value: value, cost: cost};\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n\n empty: function () {\n return this.queue.length === 0;\n }\n }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n module.exports = dijkstra;\n}\n"],"names":["dijkstra"],"mappings":";;;;;;AAuBA,QAAIA,YAAW;AAAA,MACb,8BAA8B,SAAS,OAAO,GAAG,GAAG;AAGlD,YAAI,eAAe,CAAA;AAInB,YAAI,QAAQ,CAAA;AACZ,cAAM,CAAC,IAAI;AAMX,YAAI,OAAOA,UAAS,cAAc,KAAI;AACtC,aAAK,KAAK,GAAG,CAAC;AAEd,YAAI,SACA,GAAG,GACH,gBACA,gBACA,WACA,+BACA,gBACA;AACJ,eAAO,CAAC,KAAK,SAAS;AAGpB,oBAAU,KAAK,IAAG;AAClB,cAAI,QAAQ;AACZ,2BAAiB,QAAQ;AAGzB,2BAAiB,MAAM,CAAC,KAAK,CAAA;AAK7B,eAAK,KAAK,gBAAgB;AACxB,gBAAI,eAAe,eAAe,CAAC,GAAG;AAEpC,0BAAY,eAAe,CAAC;AAK5B,8CAAgC,iBAAiB;AAMjD,+BAAiB,MAAM,CAAC;AACxB,4BAAe,OAAO,MAAM,CAAC,MAAM;AACnC,kBAAI,eAAe,iBAAiB,+BAA+B;AACjE,sBAAM,CAAC,IAAI;AACX,qBAAK,KAAK,GAAG,6BAA6B;AAC1C,6BAAa,CAAC,IAAI;AAAA,cAC9B;AAAA,YACA;AAAA,UACA;AAAA,QACA;AAEI,YAAI,OAAO,MAAM,eAAe,OAAO,MAAM,CAAC,MAAM,aAAa;AAC/D,cAAI,MAAM,CAAC,+BAA+B,GAAG,QAAQ,GAAG,GAAG,EAAE,KAAK,EAAE;AACpE,gBAAM,IAAI,MAAM,GAAG;AAAA,QACzB;AAEI,eAAO;AAAA,MACX;AAAA,MAEE,6CAA6C,SAAS,cAAc,GAAG;AACrE,YAAI,QAAQ,CAAA;AACZ,YAAI,IAAI;AAER,eAAO,GAAG;AACR,gBAAM,KAAK,CAAC;AACE,uBAAa,CAAC;AAC5B,cAAI,aAAa,CAAC;AAAA,QACxB;AACI,cAAM,QAAO;AACb,eAAO;AAAA,MACX;AAAA,MAEE,WAAW,SAAS,OAAO,GAAG,GAAG;AAC/B,YAAI,eAAeA,UAAS,6BAA6B,OAAO,GAAG,CAAC;AACpE,eAAOA,UAAS;AAAA,UACd;AAAA,UAAc;AAAA,QAAC;AAAA,MACrB;AAAA;AAAA;AAAA;AAAA,MAKE,eAAe;AAAA,QACb,MAAM,SAAU,MAAM;AACpB,cAAI,IAAIA,UAAS,eACb,IAAI,CAAA,GACJ;AACJ,iBAAO,QAAQ,CAAA;AACf,eAAK,OAAO,GAAG;AACb,gBAAI,EAAE,eAAe,GAAG,GAAG;AACzB,gBAAE,GAAG,IAAI,EAAE,GAAG;AAAA,YACxB;AAAA,UACA;AACM,YAAE,QAAQ,CAAA;AACV,YAAE,SAAS,KAAK,UAAU,EAAE;AAC5B,iBAAO;AAAA,QACb;AAAA,QAEI,gBAAgB,SAAU,GAAG,GAAG;AAC9B,iBAAO,EAAE,OAAO,EAAE;AAAA,QACxB;AAAA;AAAA;AAAA;AAAA;AAAA,QAMI,MAAM,SAAU,OAAO,MAAM;AAC3B,cAAI,OAAO,EAAC,OAAc,KAAU;AACpC,eAAK,MAAM,KAAK,IAAI;AACpB,eAAK,MAAM,KAAK,KAAK,MAAM;AAAA,QACjC;AAAA;AAAA;AAAA;AAAA,QAKI,KAAK,WAAY;AACf,iBAAO,KAAK,MAAM,MAAK;AAAA,QAC7B;AAAA,QAEI,OAAO,WAAY;AACjB,iBAAO,KAAK,MAAM,WAAW;AAAA,QACnC;AAAA,MACA;AAAA;AAKmC;AACjC,uBAAiBA;AAAA,IACnB;AAAA;;;","x_google_ignoreList":[0]}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { __exports as browser } from "../../../../../../_virtual/browser2.js";
|
|
2
|
-
import { __require as requireCanPromise } from "./can-promise.js";
|
|
3
|
-
import { __require as requireQrcode } from "./core/qrcode.js";
|
|
4
|
-
import { __require as requireCanvas } from "./renderer/canvas.js";
|
|
5
|
-
import { __require as requireSvgTag } from "./renderer/svg-tag.js";
|
|
6
|
-
var hasRequiredBrowser;
|
|
7
|
-
function requireBrowser() {
|
|
8
|
-
if (hasRequiredBrowser) return browser;
|
|
9
|
-
hasRequiredBrowser = 1;
|
|
10
|
-
const canPromise = requireCanPromise();
|
|
11
|
-
const QRCode = requireQrcode();
|
|
12
|
-
const CanvasRenderer = requireCanvas();
|
|
13
|
-
const SvgRenderer = requireSvgTag();
|
|
14
|
-
function renderCanvas(renderFunc, canvas, text, opts, cb) {
|
|
15
|
-
const args = [].slice.call(arguments, 1);
|
|
16
|
-
const argsNum = args.length;
|
|
17
|
-
const isLastArgCb = typeof args[argsNum - 1] === "function";
|
|
18
|
-
if (!isLastArgCb && !canPromise()) {
|
|
19
|
-
throw new Error("Callback required as last argument");
|
|
20
|
-
}
|
|
21
|
-
if (isLastArgCb) {
|
|
22
|
-
if (argsNum < 2) {
|
|
23
|
-
throw new Error("Too few arguments provided");
|
|
24
|
-
}
|
|
25
|
-
if (argsNum === 2) {
|
|
26
|
-
cb = text;
|
|
27
|
-
text = canvas;
|
|
28
|
-
canvas = opts = void 0;
|
|
29
|
-
} else if (argsNum === 3) {
|
|
30
|
-
if (canvas.getContext && typeof cb === "undefined") {
|
|
31
|
-
cb = opts;
|
|
32
|
-
opts = void 0;
|
|
33
|
-
} else {
|
|
34
|
-
cb = opts;
|
|
35
|
-
opts = text;
|
|
36
|
-
text = canvas;
|
|
37
|
-
canvas = void 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
if (argsNum < 1) {
|
|
42
|
-
throw new Error("Too few arguments provided");
|
|
43
|
-
}
|
|
44
|
-
if (argsNum === 1) {
|
|
45
|
-
text = canvas;
|
|
46
|
-
canvas = opts = void 0;
|
|
47
|
-
} else if (argsNum === 2 && !canvas.getContext) {
|
|
48
|
-
opts = text;
|
|
49
|
-
text = canvas;
|
|
50
|
-
canvas = void 0;
|
|
51
|
-
}
|
|
52
|
-
return new Promise(function(resolve, reject) {
|
|
53
|
-
try {
|
|
54
|
-
const data = QRCode.create(text, opts);
|
|
55
|
-
resolve(renderFunc(data, canvas, opts));
|
|
56
|
-
} catch (e) {
|
|
57
|
-
reject(e);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
const data = QRCode.create(text, opts);
|
|
63
|
-
cb(null, renderFunc(data, canvas, opts));
|
|
64
|
-
} catch (e) {
|
|
65
|
-
cb(e);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
browser.create = QRCode.create;
|
|
69
|
-
browser.toCanvas = renderCanvas.bind(null, CanvasRenderer.render);
|
|
70
|
-
browser.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL);
|
|
71
|
-
browser.toString = renderCanvas.bind(null, function(data, _, opts) {
|
|
72
|
-
return SvgRenderer.render(data, opts);
|
|
73
|
-
});
|
|
74
|
-
return browser;
|
|
75
|
-
}
|
|
76
|
-
export {
|
|
77
|
-
requireBrowser as __require
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=browser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sources":["../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js"],"sourcesContent":["\nconst canPromise = require('./can-promise')\n\nconst QRCode = require('./core/qrcode')\nconst CanvasRenderer = require('./renderer/canvas')\nconst SvgRenderer = require('./renderer/svg-tag.js')\n\nfunction renderCanvas (renderFunc, canvas, text, opts, cb) {\n const args = [].slice.call(arguments, 1)\n const argsNum = args.length\n const isLastArgCb = typeof args[argsNum - 1] === 'function'\n\n if (!isLastArgCb && !canPromise()) {\n throw new Error('Callback required as last argument')\n }\n\n if (isLastArgCb) {\n if (argsNum < 2) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 2) {\n cb = text\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 3) {\n if (canvas.getContext && typeof cb === 'undefined') {\n cb = opts\n opts = undefined\n } else {\n cb = opts\n opts = text\n text = canvas\n canvas = undefined\n }\n }\n } else {\n if (argsNum < 1) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 1) {\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 2 && !canvas.getContext) {\n opts = text\n text = canvas\n canvas = undefined\n }\n\n return new Promise(function (resolve, reject) {\n try {\n const data = QRCode.create(text, opts)\n resolve(renderFunc(data, canvas, opts))\n } catch (e) {\n reject(e)\n }\n })\n }\n\n try {\n const data = QRCode.create(text, opts)\n cb(null, renderFunc(data, canvas, opts))\n } catch (e) {\n cb(e)\n }\n}\n\nexports.create = QRCode.create\nexports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)\nexports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)\n\n// only svg for now.\nexports.toString = renderCanvas.bind(null, function (data, _, opts) {\n return SvgRenderer.render(data, opts)\n})\n"],"names":["require$$0","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;AACA,QAAM,aAAaA,kBAAA;AAEnB,QAAM,SAASC,cAAA;AACf,QAAM,iBAAiBC,cAAA;AACvB,QAAM,cAAcC,cAAA;AAEpB,WAAS,aAAc,YAAY,QAAQ,MAAM,MAAM,IAAI;AACzD,UAAM,OAAO,CAAA,EAAG,MAAM,KAAK,WAAW,CAAC;AACvC,UAAM,UAAU,KAAK;AACrB,UAAM,cAAc,OAAO,KAAK,UAAU,CAAC,MAAM;AAEjD,QAAI,CAAC,eAAe,CAAC,cAAc;AACjC,YAAM,IAAI,MAAM,oCAAoC;AAAA,IACxD;AAEE,QAAI,aAAa;AACf,UAAI,UAAU,GAAG;AACf,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAClD;AAEI,UAAI,YAAY,GAAG;AACjB,aAAK;AACL,eAAO;AACP,iBAAS,OAAO;AAAA,MACtB,WAAe,YAAY,GAAG;AACxB,YAAI,OAAO,cAAc,OAAO,OAAO,aAAa;AAClD,eAAK;AACL,iBAAO;AAAA,QACf,OAAa;AACL,eAAK;AACL,iBAAO;AACP,iBAAO;AACP,mBAAS;AAAA,QACjB;AAAA,MACA;AAAA,IACA,OAAS;AACL,UAAI,UAAU,GAAG;AACf,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAClD;AAEI,UAAI,YAAY,GAAG;AACjB,eAAO;AACP,iBAAS,OAAO;AAAA,MACtB,WAAe,YAAY,KAAK,CAAC,OAAO,YAAY;AAC9C,eAAO;AACP,eAAO;AACP,iBAAS;AAAA,MACf;AAEI,aAAO,IAAI,QAAQ,SAAU,SAAS,QAAQ;AAC5C,YAAI;AACF,gBAAM,OAAO,OAAO,OAAO,MAAM,IAAI;AACrC,kBAAQ,WAAW,MAAM,QAAQ,IAAI,CAAC;AAAA,QAC9C,SAAe,GAAG;AACV,iBAAO,CAAC;AAAA,QAChB;AAAA,MACA,CAAK;AAAA,IACL;AAEE,QAAI;AACF,YAAM,OAAO,OAAO,OAAO,MAAM,IAAI;AACrC,SAAG,MAAM,WAAW,MAAM,QAAQ,IAAI,CAAC;AAAA,IAC3C,SAAW,GAAG;AACV,SAAG,CAAC;AAAA,IACR;AAAA,EACA;AAEA,UAAA,SAAiB,OAAO;AACxB,UAAA,WAAmB,aAAa,KAAK,MAAM,eAAe,MAAM;AAChE,UAAA,YAAoB,aAAa,KAAK,MAAM,eAAe,eAAe;AAG1E,UAAA,WAAmB,aAAa,KAAK,MAAM,SAAU,MAAM,GAAG,MAAM;AAClE,WAAO,YAAY,OAAO,MAAM,IAAI;AAAA,EACtC,CAAC;;;","x_google_ignoreList":[0]}
|